diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 53e985abb..33c8cb0a1 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -6,6 +6,67 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog `__.
+3.94.1 - 2026-09-29
+-------------------
+Added
+~~~~~
+
+* Dual-stack support for cli based session creation with browser
+
+ * ``oci session authenticate --enable-dual-stack``
+
+* Support for new optional parameters ``--memory-per-oracle-compute-unit-in-gbs`` and ``--sga-percentage`` for change of memory to CPU ratio at VM cluster level in the Database Service
+
+ * ``oci db autonomous-vm-cluster update --memory-per-oracle-compute-unit-in-gbs --sga-percentage``
+ * ``oci db cloud-autonomous-vm-cluster update --memory-per-oracle-compute-unit-in-gbs --sga-percentage``
+
+* Data Safe
+
+ * Support for registration policy lifecycle and configuration operations
+
+ * ``oci data-safe registration-policy``
+ * ``oci data-safe registration-policy-summary list-registration-policies``
+
+ * Support to update the Data Safe target database Privileges.
+
+ * ``oci data-safe target-database manage-privileges``
+
+ * Support for Data Subsetting APIs
+
+ * ``oci data-safe subsetted-object-summary list-subsetted-objects``
+ * ``oci data-safe subsetting-error-summary list-subsetting-errors``
+ * ``oci data-safe subsetting-policy``
+ * ``oci data-safe subsetting-policy-health-report``
+ * ``oci data-safe subsetting-report``
+ * ``oci data-safe subsetting-rule``
+ * ``oci data-safe subsetting-rule-processing-chain-object-summary``
+ * ``oci data-safe subsetting-schema-collection list-subsetting-schemas``
+ * ``oci data-safe subsetting-schema-object-summary list-subsetting-schema-objects``
+ * ``oci data-safe subsetting-schema-relation``
+ * ``oci data-safe subsetting-schema-relation-summary``
+ * ``oci data-safe table-estimate-summary list-table-estimates``
+
+ * Support for new optional parameter ``--enablement-resource-ocid`` to return target databases filtered by enablement resource OCID
+
+ * ``oci data-safe target-database list --enablement-resource-ocid``
+
+* Networking Service
+
+ * Support for NAT on DRG
+
+ * ``oci network drg-attachment remove-drg-nat-policy``
+ * ``oci network drg-nat-policy``
+ * ``oci network drg-nat-rule``
+
+ * Support for new optional parameters ``--drg-nat-policy-id`` and ``--does-preserve-original-routes-with-nat``
+
+ * ``oci network drg-attachment create --drg-nat-policy-id --does-preserve-original-routes-with-nat``
+ * ``oci network drg-attachment update --drg-nat-policy-id --does-preserve-original-routes-with-nat``
+
+* Support for OCI CLI authentication using PKCS#11 compatible hardware devices like the YubiKey
+
+ * ``oci --auth pkcs11``
+
3.94.0 - 2026-09-22
-------------------
Added
diff --git a/README.rst b/README.rst
index a201dd3f3..af4c08778 100644
--- a/README.rst
+++ b/README.rst
@@ -8,7 +8,7 @@ This is the command line interface for Oracle Cloud Infrastructure.
The project is open source and maintained by Oracle Corp. The home page for the project is `here`__.
__ https://docs.cloud.oracle.com/Content/API/Concepts/cliconcepts.htm
-
+
Announcements
=============
diff --git a/requirements.txt b/requirements.txt
index faa15b093..d1b0d6dd1 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -20,7 +20,7 @@ jmespath>=0.10.0,<=1.0.1
importlib-metadata; python_version < '3.8'
ndg-httpsclient==0.4.2
mock==2.0.0
-oci==2.187.0
+oci==2.187.1
packaging==20.2; python_version < '3.7'
packaging>=21.0,<25.0; python_version >= '3.7' and python_version < '3.9'
packaging>=22.0,<25.0; python_version >= '3.9'
diff --git a/services/core/src/oci_cli_virtual_network/generated/virtualnetwork_cli.py b/services/core/src/oci_cli_virtual_network/generated/virtualnetwork_cli.py
index b68801a8c..b52c393ce 100644
--- a/services/core/src/oci_cli_virtual_network/generated/virtualnetwork_cli.py
+++ b/services/core/src/oci_cli_virtual_network/generated/virtualnetwork_cli.py
@@ -280,6 +280,12 @@ def security_list_group():
pass
+@click.command(cli_util.override('virtual_network.drg_nat_policy_group.command_name', 'drg-nat-policy'), cls=CommandGroupWithAlias, help="""Collection of DRG NAT rules that is associated to a DRG Attachment to allow Network Address Translation of one or more conflicting IPs or CIDR ranges.""")
+@cli_util.help_option_group
+def drg_nat_policy_group():
+ pass
+
+
@click.command(cli_util.override('virtual_network.byoip_allocated_range_summary_group.command_name', 'byoip-allocated-range-summary'), cls=CommandGroupWithAlias, help="""A summary of CIDR block subranges that are currently allocated to an IP pool.""")
@cli_util.help_option_group
def byoip_allocated_range_summary_group():
@@ -340,6 +346,12 @@ def cross_connect_location_group():
pass
+@click.command(cli_util.override('virtual_network.drg_nat_rule_group.command_name', 'drg-nat-rule'), cls=CommandGroupWithAlias, help="""A DRG NAT rule specifies the mapping between an original source/destination IP and a translated source/destination IP. The source needs to be described in the context of packet entering the DRG.""")
+@cli_util.help_option_group
+def drg_nat_rule_group():
+ pass
+
+
@click.command(cli_util.override('virtual_network.private_ip_group.command_name', 'private-ip'), cls=CommandGroupWithAlias, help="""A *private IP* is a conceptual term that refers to an IPv4 private IP address and related properties. The `privateIp` object is the API representation of a private IP.
**Note:** For information about IPv6 addresses, see [Ipv6].
@@ -604,6 +616,7 @@ def internal_public_ip_group():
virtual_network_root_group.add_command(network_security_group_group)
virtual_network_root_group.add_command(tunnel_route_group)
virtual_network_root_group.add_command(security_list_group)
+virtual_network_root_group.add_command(drg_nat_policy_group)
virtual_network_root_group.add_command(byoip_allocated_range_summary_group)
virtual_network_root_group.add_command(remote_peering_connection_group)
virtual_network_root_group.add_command(nat_gateway_group)
@@ -613,6 +626,7 @@ def internal_public_ip_group():
virtual_network_root_group.add_command(allowed_ike_ip_sec_parameters_group)
virtual_network_root_group.add_command(vcn_dns_resolver_association_group)
virtual_network_root_group.add_command(cross_connect_location_group)
+virtual_network_root_group.add_command(drg_nat_rule_group)
virtual_network_root_group.add_command(private_ip_group)
virtual_network_root_group.add_command(virtual_circuit_group)
virtual_network_root_group.add_command(local_peering_gateway_group)
@@ -642,6 +656,37 @@ def internal_public_ip_group():
virtual_network_root_group.add_command(internal_public_ip_group)
+@drg_nat_rule_group.command(name=cli_util.override('virtual_network.add_drg_nat_rules.command_name', 'add'), help=u"""Adds DRG NAT rules to the specified DRG NAT policy. \n[Command Reference](addDrgNatRules)""")
+@cli_util.option('--drg-nat-policy-id', required=True, help=u"""The [OCID] of the DRG NAT policy.""")
+@cli_util.option('--rules', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The collection of DRG NAT rules to insert into the DRG NAT policy.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@json_skeleton_utils.get_cli_json_input_option({'rules': {'module': 'core', 'class': 'list[AddDrgNatRuleDetails]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'rules': {'module': 'core', 'class': 'list[AddDrgNatRuleDetails]'}}, output_type={'module': 'core', 'class': 'list[DrgNatRule]'})
+@cli_util.wrap_exceptions
+def add_drg_nat_rules(ctx, from_json, drg_nat_policy_id, rules, if_match):
+
+ if isinstance(drg_nat_policy_id, six.string_types) and len(drg_nat_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --drg-nat-policy-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['rules'] = cli_util.parse_json_parameter("rules", rules)
+
+ client = cli_util.build_client('core', 'virtual_network', ctx)
+ result = client.add_drg_nat_rules(
+ drg_nat_policy_id=drg_nat_policy_id,
+ add_drg_nat_rules_details=_details,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
@drg_route_distribution_statement_group.command(name=cli_util.override('virtual_network.add_drg_route_distribution_statements.command_name', 'add'), help=u"""Adds one or more route distribution statements to the specified route distribution. \n[Command Reference](addDrgRouteDistributionStatements)""")
@cli_util.option('--drg-route-distribution-id', required=True, help=u"""The [OCID] of the route distribution.""")
@cli_util.option('--statements', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The collection of route distribution statements to insert into the route distribution.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@@ -2071,6 +2116,37 @@ def change_drg_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wai
cli_util.render_response(result, ctx)
+@drg_nat_policy_group.command(name=cli_util.override('virtual_network.change_drg_nat_policy_compartment.command_name', 'change-compartment'), help=u"""Moves a DrgNatPolicy into a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment]. \n[Command Reference](changeDrgNatPolicyCompartment)""")
+@cli_util.option('--drg-nat-policy-id', required=True, help=u"""The [OCID] of the DRG NAT policy.""")
+@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment to move the DrgNatPolicy to.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@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_drg_nat_policy_compartment(ctx, from_json, drg_nat_policy_id, compartment_id, if_match):
+
+ if isinstance(drg_nat_policy_id, six.string_types) and len(drg_nat_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --drg-nat-policy-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('core', 'virtual_network', ctx)
+ result = client.change_drg_nat_policy_compartment(
+ drg_nat_policy_id=drg_nat_policy_id,
+ change_drg_nat_policy_compartment_details=_details,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
@internet_gateway_group.command(name=cli_util.override('virtual_network.change_internet_gateway_compartment.command_name', 'change-compartment'), help=u"""Moves an internet gateway into a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment]. \n[Command Reference](changeInternetGatewayCompartment)""")
@cli_util.option('--ig-id', required=True, help=u"""The [OCID] of the internet gateway.""")
@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment to move the internet gateway to.""")
@@ -3399,7 +3475,9 @@ def create_drg(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_s
* [Transit Routing: Access to Multiple VCNs in Same Region] * [Transit Routing: Private Access to Oracle Services] This field is deprecated. Instead, use the networkDetails field to specify the VCN route table for this attachment.""")
@cli_util.option('--vcn-id', help=u"""The [OCID] of the VCN. This field is deprecated. Instead, use the `networkDetails` field to specify the [OCID] of the attached resource.""")
-@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ATTACHING", "ATTACHED", "DETACHING", "DETACHED"]), 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 ATTACHING --wait-for-state DETACHED 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('--drg-nat-policy-id', help=u"""The [OCID] of the DRG attachment's DRG NAT policy.""")
+@cli_util.option('--does-preserve-original-routes-with-nat', type=click.BOOL, help=u"""By default, only translated DrgNatRule CIDRs are imported into the DrgRouteTable to prevent routing complications. Enable this option to also preserve original CIDRs. The original source CIDRs is not advertised if this value is set to false, else it is advertised. default: `false`""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ATTACHING", "ATTACHED", "DETACHING", "DETACHED"]), 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 SUCCEEDED --wait-for-state FAILED 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({'network-details': {'module': 'core', 'class': 'DrgAttachmentNetworkCreateDetails'}, 'defined-tags': {'module': 'core', 'class': 'dict(str, dict(str, object))'}, 'freeform-tags': {'module': 'core', 'class': 'dict(str, string)'}})
@@ -3407,7 +3485,7 @@ def create_drg(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_s
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'network-details': {'module': 'core', 'class': 'DrgAttachmentNetworkCreateDetails'}, 'defined-tags': {'module': 'core', 'class': 'dict(str, dict(str, object))'}, 'freeform-tags': {'module': 'core', 'class': 'dict(str, string)'}}, output_type={'module': 'core', 'class': 'DrgAttachment'})
@cli_util.wrap_exceptions
-def create_drg_attachment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, drg_id, display_name, drg_route_table_id, network_details, defined_tags, freeform_tags, route_table_id, vcn_id):
+def create_drg_attachment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, drg_id, display_name, drg_route_table_id, network_details, defined_tags, freeform_tags, route_table_id, vcn_id, drg_nat_policy_id, does_preserve_original_routes_with_nat):
kwargs = {}
@@ -3435,6 +3513,12 @@ def create_drg_attachment(ctx, from_json, wait_for_state, max_wait_seconds, wait
if vcn_id is not None:
_details['vcnId'] = vcn_id
+ if drg_nat_policy_id is not None:
+ _details['drgNatPolicyId'] = drg_nat_policy_id
+
+ if does_preserve_original_routes_with_nat is not None:
+ _details['doesPreserveOriginalRoutesWithNat'] = does_preserve_original_routes_with_nat
+
client = cli_util.build_client('core', 'virtual_network', ctx)
result = client.create_drg_attachment(
create_drg_attachment_details=_details,
@@ -3488,6 +3572,8 @@ def create_drg_attachment(ctx, from_json, wait_for_state, max_wait_seconds, wait
* [Transit Routing: Access to Multiple VCNs in Same Region] * [Transit Routing: Private Access to Oracle Services] This field is deprecated. Instead, use the networkDetails field to specify the VCN route table for this attachment.""")
@cli_util.option('--vcn-id', help=u"""The [OCID] of the VCN. This field is deprecated. Instead, use the `networkDetails` field to specify the [OCID] of the attached resource.""")
+@cli_util.option('--drg-nat-policy-id', help=u"""The [OCID] of the DRG attachment's DRG NAT policy.""")
+@cli_util.option('--does-preserve-original-routes-with-nat', type=click.BOOL, help=u"""By default, only translated DrgNatRule CIDRs are imported into the DrgRouteTable to prevent routing complications. Enable this option to also preserve original CIDRs. The original source CIDRs is not advertised if this value is set to false, else it is advertised. default: `false`""")
@cli_util.option('--network-details-id', help=u"""The [OCID] of the network attached to the DRG.""")
@cli_util.option('--network-details-route-table-id', help=u"""This is the [OCID] of the route table that is used to route the traffic as it enters a VCN through this attachment.
@@ -3503,7 +3589,7 @@ def create_drg_attachment(ctx, from_json, wait_for_state, max_wait_seconds, wait
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'defined-tags': {'module': 'core', 'class': 'dict(str, dict(str, object))'}, 'freeform-tags': {'module': 'core', 'class': 'dict(str, string)'}}, output_type={'module': 'core', 'class': 'DrgAttachment'})
@cli_util.wrap_exceptions
-def create_drg_attachment_vcn_drg_attachment_network_create_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, drg_id, display_name, drg_route_table_id, defined_tags, freeform_tags, route_table_id, vcn_id, network_details_id, network_details_route_table_id, network_details_vcn_route_type):
+def create_drg_attachment_vcn_drg_attachment_network_create_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, drg_id, display_name, drg_route_table_id, defined_tags, freeform_tags, route_table_id, vcn_id, drg_nat_policy_id, does_preserve_original_routes_with_nat, network_details_id, network_details_route_table_id, network_details_vcn_route_type):
kwargs = {}
@@ -3529,6 +3615,12 @@ def create_drg_attachment_vcn_drg_attachment_network_create_details(ctx, from_js
if vcn_id is not None:
_details['vcnId'] = vcn_id
+ if drg_nat_policy_id is not None:
+ _details['drgNatPolicyId'] = drg_nat_policy_id
+
+ if does_preserve_original_routes_with_nat is not None:
+ _details['doesPreserveOriginalRoutesWithNat'] = does_preserve_original_routes_with_nat
+
if network_details_id is not None:
_details['networkDetails']['id'] = network_details_id
@@ -3571,6 +3663,71 @@ def create_drg_attachment_vcn_drg_attachment_network_create_details(ctx, from_js
cli_util.render_response(result, ctx)
+@drg_nat_policy_group.command(name=cli_util.override('virtual_network.create_drg_nat_policy.command_name', 'create'), help=u"""Creates a new DRG NAT policy. Assign the DRG NAT policy to a DRG attachment using the `UpdateDrgAttachment` or `CreateDrgAttachment` operations. \n[Command Reference](createDrgNatPolicy)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment containing the DRG NAT policy.""")
+@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('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), 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 SUCCEEDED --wait-for-state FAILED 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({'defined-tags': {'module': 'core', 'class': 'dict(str, dict(str, object))'}, 'freeform-tags': {'module': 'core', 'class': 'dict(str, string)'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'defined-tags': {'module': 'core', 'class': 'dict(str, dict(str, object))'}, 'freeform-tags': {'module': 'core', 'class': 'dict(str, string)'}}, output_type={'module': 'core', 'class': 'DrgNatPolicy'})
+@cli_util.wrap_exceptions
+def create_drg_nat_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, defined_tags, display_name, freeform_tags):
+
+ kwargs = {}
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+ _details['compartmentId'] = compartment_id
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ client = cli_util.build_client('core', 'virtual_network', ctx)
+ result = client.create_drg_nat_policy(
+ create_drg_nat_policy_details=_details,
+ **kwargs
+ )
+ if wait_for_state:
+
+ if hasattr(client, 'get_drg_nat_policy') and callable(getattr(client, 'get_drg_nat_policy')):
+ 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_drg_nat_policy(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)
+
+
@drg_route_distribution_group.command(name=cli_util.override('virtual_network.create_drg_route_distribution.command_name', 'create'), help=u"""Creates a new route distribution for the specified DRG. Assign the route distribution as an import distribution to a DRG route table using the `UpdateDrgRouteTable` or `CreateDrgRouteTable` operations. Assign the route distribution as an export distribution to a DRG attachment using the `UpdateDrgAttachment` or `CreateDrgAttachment` operations. \n[Command Reference](createDrgRouteDistribution)""")
@cli_util.option('--drg-id', required=True, help=u"""The [OCID] of the DRG the DRG route table belongs to.""")
@cli_util.option('--distribution-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["IMPORT"]), help=u"""States that this distribution defines how routes get imported into route tables.""")
@@ -5944,6 +6101,63 @@ def delete_drg_attachment(ctx, from_json, wait_for_state, max_wait_seconds, wait
cli_util.render_response(result, ctx)
+@drg_nat_policy_group.command(name=cli_util.override('virtual_network.delete_drg_nat_policy.command_name', 'delete'), help=u"""Deletes the specified DRG NAT policy. \n[Command Reference](deleteDrgNatPolicy)""")
+@cli_util.option('--drg-nat-policy-id', required=True, help=u"""The [OCID] of the DRG NAT policy.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
+@cli_util.wrap_exceptions
+def delete_drg_nat_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, drg_nat_policy_id, if_match):
+
+ if isinstance(drg_nat_policy_id, six.string_types) and len(drg_nat_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --drg-nat-policy-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('core', 'virtual_network', ctx)
+ result = client.delete_drg_nat_policy(
+ drg_nat_policy_id=drg_nat_policy_id,
+ **kwargs
+ )
+ work_request_client = cli_util.build_client('work_requests', 'work_request', ctx)
+ if wait_for_state:
+
+ if hasattr(work_request_client, 'get_work_request') and callable(getattr(work_request_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(work_request_client, work_request_client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
+ # If we fail, we should show an error, but we should still provide the information to the customer
+ click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ sys.exit(2)
+ except Exception:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ raise
+ else:
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+
+
@drg_route_distribution_statement_group.command(name=cli_util.override('virtual_network.delete_drg_route_distribution.command_name', 'delete-drg-route-distribution'), help=u"""Deletes the specified route distribution. You can't delete a route distribution currently in use by a DRG attachment or DRG route table.
Remove the DRG route distribution from a DRG attachment or DRG route table by using the \"RemoveExportDrgRouteDistribution\" or \"RemoveImportDrgRouteDistribution' operations. \n[Command Reference](deleteDrgRouteDistribution)""")
@@ -7616,6 +7830,28 @@ def get_drg_attachment(ctx, from_json, drg_attachment_id):
cli_util.render_response(result, ctx)
+@drg_nat_policy_group.command(name=cli_util.override('virtual_network.get_drg_nat_policy.command_name', 'get'), help=u"""Gets the specified DRG NAT policy's information. \n[Command Reference](getDrgNatPolicy)""")
+@cli_util.option('--drg-nat-policy-id', required=True, help=u"""The [OCID] of the DRG NAT policy.""")
+@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': 'core', 'class': 'DrgNatPolicy'})
+@cli_util.wrap_exceptions
+def get_drg_nat_policy(ctx, from_json, drg_nat_policy_id):
+
+ if isinstance(drg_nat_policy_id, six.string_types) and len(drg_nat_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --drg-nat-policy-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('core', 'virtual_network', ctx)
+ result = client.get_drg_nat_policy(
+ drg_nat_policy_id=drg_nat_policy_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
@drg_redundancy_status_group.command(name=cli_util.override('virtual_network.get_drg_redundancy_status.command_name', 'get'), help=u"""Gets the redundancy status for the specified DRG. For more information, see [Redundancy Remedies]. \n[Command Reference](getDrgRedundancyStatus)""")
@cli_util.option('--drg-id', required=True, help=u"""The [OCID] of the DRG.""")
@json_skeleton_utils.get_cli_json_input_option({})
@@ -9449,6 +9685,7 @@ def list_dhcp_options(ctx, from_json, all_pages, page_size, compartment_id, vcn_
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. For important details about how pagination works, see [List Pagination].""")
+@cli_util.option('--drg-nat-policy-id', help=u"""The [OCID] of the DrgNatPolicy.""")
@cli_util.option('--network-id', help=u"""The [OCID] of the resource (virtual circuit, VCN, IPSec tunnel, or remote peering connection) attached to the DRG.""")
@cli_util.option('--attachment-type', type=custom_types.CliCaseInsensitiveChoice(["VCN", "VIRTUAL_CIRCUIT", "REMOTE_PEERING_CONNECTION", "IPSEC_TUNNEL", "ALL"]), help=u"""The type for the network resource attached to the DRG.""")
@cli_util.option('--drg-route-table-id', help=u"""The [OCID] of the DRG route table assigned to the DRG attachment.""")
@@ -9465,7 +9702,7 @@ def list_dhcp_options(ctx, from_json, all_pages, page_size, compartment_id, vcn_
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'core', 'class': 'list[DrgAttachment]'})
@cli_util.wrap_exceptions
-def list_drg_attachments(ctx, from_json, all_pages, page_size, compartment_id, vcn_id, drg_id, limit, page, network_id, attachment_type, drg_route_table_id, display_name, sort_by, sort_order, lifecycle_state):
+def list_drg_attachments(ctx, from_json, all_pages, page_size, compartment_id, vcn_id, drg_id, limit, page, drg_nat_policy_id, network_id, attachment_type, drg_route_table_id, display_name, sort_by, sort_order, lifecycle_state):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
@@ -9479,6 +9716,8 @@ def list_drg_attachments(ctx, from_json, all_pages, page_size, compartment_id, v
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if drg_nat_policy_id is not None:
+ kwargs['drg_nat_policy_id'] = drg_nat_policy_id
if network_id is not None:
kwargs['network_id'] = network_id
if attachment_type is not None:
@@ -9519,6 +9758,123 @@ def list_drg_attachments(ctx, from_json, all_pages, page_size, compartment_id, v
cli_util.render_response(result, ctx)
+@drg_nat_policy_group.command(name=cli_util.override('virtual_network.list_drg_nat_policies.command_name', 'list'), help=u"""The list of DRG NAT policies in the compartment. \n[Command Reference](listDrgNatPolicies)""")
+@cli_util.option('--compartment-id', required=True, help=u"""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. For important details about how pagination works, 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. For important details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.
+
+**Note:** In general, some \"List\" operations (for example, `ListInstances`) let you optionally filter by availability domain if the scope of the resource type is within a single availability domain. If you call one of these \"List\" operations without specifying an availability domain, the resources are grouped by availability domain, then sorted.""")
+@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('--display-name', help=u"""A filter to return only resources that match the given display name 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({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'core', 'class': 'list[DrgNatPolicy]'})
+@cli_util.wrap_exceptions
+def list_drg_nat_policies(ctx, from_json, all_pages, page_size, compartment_id, limit, page, sort_by, sort_order, display_name):
+
+ 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
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('core', 'virtual_network', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_drg_nat_policies,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_drg_nat_policies,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_drg_nat_policies(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@drg_nat_rule_group.command(name=cli_util.override('virtual_network.list_drg_nat_rules.command_name', 'list'), help=u"""Lists the rules for the specified DRG NAT policy. \n[Command Reference](listDrgNatRules)""")
+@cli_util.option('--drg-nat-policy-id', required=True, help=u"""The [OCID] of the DRG NAT policy.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].
+
+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. For important details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["PRIORITY"]), help=u"""The field to sort by.""")
+@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': 'core', 'class': 'list[DrgNatRule]'})
+@cli_util.wrap_exceptions
+def list_drg_nat_rules(ctx, from_json, all_pages, page_size, drg_nat_policy_id, limit, page, sort_by):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(drg_nat_policy_id, six.string_types) and len(drg_nat_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --drg-nat-policy-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ 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('core', 'virtual_network', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_drg_nat_rules,
+ drg_nat_policy_id=drg_nat_policy_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_drg_nat_rules,
+ limit,
+ page_size,
+ drg_nat_policy_id=drg_nat_policy_id,
+ **kwargs
+ )
+ else:
+ result = client.list_drg_nat_rules(
+ drg_nat_policy_id=drg_nat_policy_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
@drg_route_distribution_statement_group.command(name=cli_util.override('virtual_network.list_drg_route_distribution_statements.command_name', 'list'), help=u"""Lists the statements for the specified route distribution. \n[Command Reference](listDrgRouteDistributionStatements)""")
@cli_util.option('--drg-route-distribution-id', required=True, help=u"""The [OCID] of the route distribution.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].
@@ -11986,6 +12342,125 @@ def private_ip_vnic_detach(ctx, from_json, private_ip_id, if_match):
cli_util.render_response(result, ctx)
+@drg_attachment_group.command(name=cli_util.override('virtual_network.remove_drg_nat_policy.command_name', 'remove'), help=u"""Dissociates the DRG NAT policy from the DRG attachment so no DRG NAT rules are advertised to it. \n[Command Reference](removeDrgNatPolicy)""")
+@cli_util.option('--drg-attachment-id', required=True, help=u"""The [OCID] of the DRG attachment.""")
+@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(["ATTACHING", "ATTACHED", "DETACHING", "DETACHED"]), 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 SUCCEEDED --wait-for-state FAILED 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({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'core', 'class': 'DrgAttachment'})
+@cli_util.wrap_exceptions
+def remove_drg_nat_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, drg_attachment_id, if_match):
+
+ if isinstance(drg_attachment_id, six.string_types) and len(drg_attachment_id.strip()) == 0:
+ raise click.UsageError('Parameter --drg-attachment-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ client = cli_util.build_client('core', 'virtual_network', ctx)
+ result = client.remove_drg_nat_policy(
+ drg_attachment_id=drg_attachment_id,
+ **kwargs
+ )
+ if wait_for_state:
+
+ if hasattr(client, 'get_drg_attachment') and callable(getattr(client, 'get_drg_attachment')):
+ 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_drg_attachment(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)
+
+
+@drg_nat_rule_group.command(name=cli_util.override('virtual_network.remove_drg_nat_rules.command_name', 'remove'), help=u"""Request with DRG NAT rules to remove from the DRG NAT policy. \n[Command Reference](removeDrgNatRules)""")
+@cli_util.option('--drg-nat-policy-id', required=True, help=u"""The [OCID] of the DRG NAT policy.""")
+@cli_util.option('--rule-ids', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The Oracle-assigned ID of each DRG NAT rule to remove.""" + 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"]), 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 SUCCEEDED --wait-for-state FAILED 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({'rule-ids': {'module': 'core', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'rule-ids': {'module': 'core', 'class': 'list[string]'}})
+@cli_util.wrap_exceptions
+def remove_drg_nat_rules(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, drg_nat_policy_id, rule_ids, if_match):
+
+ if isinstance(drg_nat_policy_id, six.string_types) and len(drg_nat_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --drg-nat-policy-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['ruleIds'] = cli_util.parse_json_parameter("rule_ids", rule_ids)
+
+ client = cli_util.build_client('core', 'virtual_network', ctx)
+ result = client.remove_drg_nat_rules(
+ drg_nat_policy_id=drg_nat_policy_id,
+ remove_drg_nat_rules_details=_details,
+ **kwargs
+ )
+ work_request_client = cli_util.build_client('work_requests', 'work_request', ctx)
+ if wait_for_state:
+
+ if hasattr(work_request_client, 'get_work_request') and callable(getattr(work_request_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(work_request_client, work_request_client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
+ if hasattr(result, "data") and hasattr(result.data, "resources") and len(result.data.resources) == 1:
+ entity_type = result.data.resources[0].entity_type
+ identifier = result.data.resources[0].identifier
+ get_operation = 'get_' + entity_type
+ if hasattr(client, get_operation) and callable(getattr(client, get_operation)):
+ result = getattr(client, get_operation)(identifier)
+
+ 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)
+
+
@drg_route_distribution_statement_group.command(name=cli_util.override('virtual_network.remove_drg_route_distribution_statements.command_name', 'remove'), help=u"""Removes one or more route distribution statements from the specified route distribution's map. \n[Command Reference](removeDrgRouteDistributionStatements)""")
@cli_util.option('--drg-route-distribution-id', required=True, help=u"""The [OCID] of the route distribution.""")
@cli_util.option('--statement-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The Oracle-assigned ID of each route distribution to remove.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@@ -13314,6 +13789,8 @@ def update_drg(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_int
@drg_attachment_group.command(name=cli_util.override('virtual_network.update_drg_attachment.command_name', 'update'), help=u"""Updates the display name and routing information for the specified `DrgAttachment`. Avoid entering confidential information. \n[Command Reference](updateDrgAttachment)""")
@cli_util.option('--drg-attachment-id', required=True, help=u"""The [OCID] of the DRG attachment.""")
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
+@cli_util.option('--drg-nat-policy-id', help=u"""The [OCID] of the DRG attachment's DRG NAT policy.""")
+@cli_util.option('--does-preserve-original-routes-with-nat', type=click.BOOL, help=u"""By default, only translated DrgNatRule CIDRs are imported into the DrgRouteTable to prevent routing complications. Enable this option to also preserve original CIDRs. The original source CIDRs is not advertised if this value is set to false, else it is advertised. default: `false`""")
@cli_util.option('--drg-route-table-id', help=u"""The [OCID] of the DRG route table that is assigned to this attachment.
The DRG route table manages traffic inside the DRG.
@@ -13342,7 +13819,7 @@ def update_drg(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_int
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'network-details': {'module': 'core', 'class': 'DrgAttachmentNetworkUpdateDetails'}, 'defined-tags': {'module': 'core', 'class': 'dict(str, dict(str, object))'}, 'freeform-tags': {'module': 'core', 'class': 'dict(str, string)'}}, output_type={'module': 'core', 'class': 'DrgAttachment'})
@cli_util.wrap_exceptions
-def update_drg_attachment(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, drg_attachment_id, display_name, drg_route_table_id, network_details, defined_tags, freeform_tags, export_drg_route_distribution_id, route_table_id, if_match):
+def update_drg_attachment(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, drg_attachment_id, display_name, drg_nat_policy_id, does_preserve_original_routes_with_nat, drg_route_table_id, network_details, defined_tags, freeform_tags, export_drg_route_distribution_id, route_table_id, if_match):
if isinstance(drg_attachment_id, six.string_types) and len(drg_attachment_id.strip()) == 0:
raise click.UsageError('Parameter --drg-attachment-id cannot be whitespace or empty string')
@@ -13360,6 +13837,12 @@ def update_drg_attachment(ctx, from_json, force, wait_for_state, max_wait_second
if display_name is not None:
_details['displayName'] = display_name
+ if drg_nat_policy_id is not None:
+ _details['drgNatPolicyId'] = drg_nat_policy_id
+
+ if does_preserve_original_routes_with_nat is not None:
+ _details['doesPreserveOriginalRoutesWithNat'] = does_preserve_original_routes_with_nat
+
if drg_route_table_id is not None:
_details['drgRouteTableId'] = drg_route_table_id
@@ -13413,6 +13896,8 @@ def update_drg_attachment(ctx, from_json, force, wait_for_state, max_wait_second
@drg_attachment_group.command(name=cli_util.override('virtual_network.update_drg_attachment_vcn_drg_attachment_network_update_details.command_name', 'update-drg-attachment-vcn-drg-attachment-network-update-details'), help=u"""Updates the display name and routing information for the specified `DrgAttachment`. Avoid entering confidential information. \n[Command Reference](updateDrgAttachment)""")
@cli_util.option('--drg-attachment-id', required=True, help=u"""The [OCID] of the DRG attachment.""")
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
+@cli_util.option('--drg-nat-policy-id', help=u"""The [OCID] of the DRG attachment's DRG NAT policy.""")
+@cli_util.option('--does-preserve-original-routes-with-nat', type=click.BOOL, help=u"""By default, only translated DrgNatRule CIDRs are imported into the DrgRouteTable to prevent routing complications. Enable this option to also preserve original CIDRs. The original source CIDRs is not advertised if this value is set to false, else it is advertised. default: `false`""")
@cli_util.option('--drg-route-table-id', help=u"""The [OCID] of the DRG route table that is assigned to this attachment.
The DRG route table manages traffic inside the DRG.
@@ -13446,7 +13931,7 @@ def update_drg_attachment(ctx, from_json, force, wait_for_state, max_wait_second
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'defined-tags': {'module': 'core', 'class': 'dict(str, dict(str, object))'}, 'freeform-tags': {'module': 'core', 'class': 'dict(str, string)'}}, output_type={'module': 'core', 'class': 'DrgAttachment'})
@cli_util.wrap_exceptions
-def update_drg_attachment_vcn_drg_attachment_network_update_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, drg_attachment_id, display_name, drg_route_table_id, defined_tags, freeform_tags, export_drg_route_distribution_id, route_table_id, if_match, network_details_route_table_id, network_details_vcn_route_type):
+def update_drg_attachment_vcn_drg_attachment_network_update_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, drg_attachment_id, display_name, drg_nat_policy_id, does_preserve_original_routes_with_nat, drg_route_table_id, defined_tags, freeform_tags, export_drg_route_distribution_id, route_table_id, if_match, network_details_route_table_id, network_details_vcn_route_type):
if isinstance(drg_attachment_id, six.string_types) and len(drg_attachment_id.strip()) == 0:
raise click.UsageError('Parameter --drg-attachment-id cannot be whitespace or empty string')
@@ -13465,6 +13950,12 @@ def update_drg_attachment_vcn_drg_attachment_network_update_details(ctx, from_js
if display_name is not None:
_details['displayName'] = display_name
+ if drg_nat_policy_id is not None:
+ _details['drgNatPolicyId'] = drg_nat_policy_id
+
+ if does_preserve_original_routes_with_nat is not None:
+ _details['doesPreserveOriginalRoutesWithNat'] = does_preserve_original_routes_with_nat
+
if drg_route_table_id is not None:
_details['drgRouteTableId'] = drg_route_table_id
@@ -13520,6 +14011,113 @@ def update_drg_attachment_vcn_drg_attachment_network_update_details(ctx, from_js
cli_util.render_response(result, ctx)
+@drg_nat_policy_group.command(name=cli_util.override('virtual_network.update_drg_nat_policy.command_name', 'update'), help=u"""Updates the specified DRG NAT policy \n[Command Reference](updateDrgNatPolicy)""")
+@cli_util.option('--drg-nat-policy-id', required=True, help=u"""The [OCID] of the DRG NAT policy.""")
+@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('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--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(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), 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 SUCCEEDED --wait-for-state FAILED 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({'defined-tags': {'module': 'core', 'class': 'dict(str, dict(str, object))'}, 'freeform-tags': {'module': 'core', 'class': 'dict(str, string)'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'defined-tags': {'module': 'core', 'class': 'dict(str, dict(str, object))'}, 'freeform-tags': {'module': 'core', 'class': 'dict(str, string)'}}, output_type={'module': 'core', 'class': 'DrgNatPolicy'})
+@cli_util.wrap_exceptions
+def update_drg_nat_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, drg_nat_policy_id, defined_tags, display_name, freeform_tags, if_match):
+
+ if isinstance(drg_nat_policy_id, six.string_types) and len(drg_nat_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --drg-nat-policy-id cannot be whitespace or empty string')
+ if not force:
+ if defined_tags or freeform_tags:
+ if not click.confirm("WARNING: Updates to defined-tags and freeform-tags will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ client = cli_util.build_client('core', 'virtual_network', ctx)
+ result = client.update_drg_nat_policy(
+ drg_nat_policy_id=drg_nat_policy_id,
+ update_drg_nat_policy_details=_details,
+ **kwargs
+ )
+ if wait_for_state:
+
+ if hasattr(client, 'get_drg_nat_policy') and callable(getattr(client, 'get_drg_nat_policy')):
+ 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_drg_nat_policy(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)
+
+
+@drg_nat_rule_group.command(name=cli_util.override('virtual_network.update_drg_nat_rules.command_name', 'update'), help=u"""Updates DRG NAT rules in the specified DRG NAT policy. \n[Command Reference](updateDrgNatRules)""")
+@cli_util.option('--drg-nat-policy-id', required=True, help=u"""The [OCID] of the DRG NAT policy.""")
+@cli_util.option('--rules', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The DRG NAT rules to update, and the details to be updated.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@json_skeleton_utils.get_cli_json_input_option({'rules': {'module': 'core', 'class': 'list[UpdateDrgNatRuleDetails]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'rules': {'module': 'core', 'class': 'list[UpdateDrgNatRuleDetails]'}}, output_type={'module': 'core', 'class': 'list[DrgNatRule]'})
+@cli_util.wrap_exceptions
+def update_drg_nat_rules(ctx, from_json, drg_nat_policy_id, rules, if_match):
+
+ if isinstance(drg_nat_policy_id, six.string_types) and len(drg_nat_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --drg-nat-policy-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['rules'] = cli_util.parse_json_parameter("rules", rules)
+
+ client = cli_util.build_client('core', 'virtual_network', ctx)
+ result = client.update_drg_nat_rules(
+ drg_nat_policy_id=drg_nat_policy_id,
+ update_drg_nat_rules_details=_details,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
@drg_route_distribution_group.command(name=cli_util.override('virtual_network.update_drg_route_distribution.command_name', 'update'), help=u"""Updates the specified route distribution \n[Command Reference](updateDrgRouteDistribution)""")
@cli_util.option('--drg-route-distribution-id', required=True, help=u"""The [OCID] of the route distribution.""")
@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].
diff --git a/services/core/src/oci_cli_virtual_network/virtualnetwork_cli_extended.py b/services/core/src/oci_cli_virtual_network/virtualnetwork_cli_extended.py
index d8d6ae5c4..cceb7cd0c 100644
--- a/services/core/src/oci_cli_virtual_network/virtualnetwork_cli_extended.py
+++ b/services/core/src/oci_cli_virtual_network/virtualnetwork_cli_extended.py
@@ -667,6 +667,8 @@ def create_virtual_circuit_extended(ctx, **kwargs):
cli_util.rename_command(virtualnetwork_cli, virtualnetwork_cli.drg_route_table_group, virtualnetwork_cli.delete_drg_route_table, "delete")
cli_util.rename_command(virtualnetwork_cli, virtualnetwork_cli.drg_route_table_group, virtualnetwork_cli.remove_import_drg_route_distribution, "remove-import-route-distribution")
+cli_util.rename_command(virtualnetwork_cli, virtualnetwork_cli.drg_attachment_group, virtualnetwork_cli.remove_drg_nat_policy, "remove-drg-nat-policy")
+
@cli_util.copy_params_from_generated_command(virtualnetwork_cli.get_drg_route_distribution, params_to_exclude=['drg_route_distribution_id'])
@virtualnetwork_cli.drg_route_distribution_group.command(name=virtualnetwork_cli.get_drg_route_distribution.name, help=virtualnetwork_cli.get_drg_route_distribution.help)
diff --git a/services/core/tests/util/generated/command_to_api.py b/services/core/tests/util/generated/command_to_api.py
index 9a0b19a63..f51cf79a0 100644
--- a/services/core/tests/util/generated/command_to_api.py
+++ b/services/core/tests/util/generated/command_to_api.py
@@ -2,6 +2,7 @@
# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved.
SDK_client_map = {
+ "virtual_network.add_drg_nat_rules": "oci.core.VirtualNetworkClient.add_drg_nat_rules",
"virtual_network.add_drg_route_distribution_statements": "oci.core.VirtualNetworkClient.add_drg_route_distribution_statements",
"virtual_network.add_drg_route_rules": "oci.core.VirtualNetworkClient.add_drg_route_rules",
"virtual_network.add_ipv4_subnet_cidr": "oci.core.VirtualNetworkClient.add_ipv4_subnet_cidr",
@@ -30,6 +31,7 @@
"virtual_network.change_cross_connect_group_compartment": "oci.core.VirtualNetworkClient.change_cross_connect_group_compartment",
"virtual_network.change_dhcp_options_compartment": "oci.core.VirtualNetworkClient.change_dhcp_options_compartment",
"virtual_network.change_drg_compartment": "oci.core.VirtualNetworkClient.change_drg_compartment",
+ "virtual_network.change_drg_nat_policy_compartment": "oci.core.VirtualNetworkClient.change_drg_nat_policy_compartment",
"virtual_network.change_internet_gateway_compartment": "oci.core.VirtualNetworkClient.change_internet_gateway_compartment",
"virtual_network.change_ip_sec_connection_compartment": "oci.core.VirtualNetworkClient.change_ip_sec_connection_compartment",
"virtual_network.change_local_peering_gateway_compartment": "oci.core.VirtualNetworkClient.change_local_peering_gateway_compartment",
@@ -57,6 +59,7 @@
"virtual_network.create_dhcp_options": "oci.core.VirtualNetworkClient.create_dhcp_options",
"virtual_network.create_drg": "oci.core.VirtualNetworkClient.create_drg",
"virtual_network.create_drg_attachment": "oci.core.VirtualNetworkClient.create_drg_attachment",
+ "virtual_network.create_drg_nat_policy": "oci.core.VirtualNetworkClient.create_drg_nat_policy",
"virtual_network.create_drg_route_distribution": "oci.core.VirtualNetworkClient.create_drg_route_distribution",
"virtual_network.create_drg_route_table": "oci.core.VirtualNetworkClient.create_drg_route_table",
"virtual_network.create_internet_gateway": "oci.core.VirtualNetworkClient.create_internet_gateway",
@@ -86,6 +89,7 @@
"virtual_network.delete_dhcp_options": "oci.core.VirtualNetworkClient.delete_dhcp_options",
"virtual_network.delete_drg": "oci.core.VirtualNetworkClient.delete_drg",
"virtual_network.delete_drg_attachment": "oci.core.VirtualNetworkClient.delete_drg_attachment",
+ "virtual_network.delete_drg_nat_policy": "oci.core.VirtualNetworkClient.delete_drg_nat_policy",
"virtual_network.delete_drg_route_distribution": "oci.core.VirtualNetworkClient.delete_drg_route_distribution",
"virtual_network.delete_drg_route_table": "oci.core.VirtualNetworkClient.delete_drg_route_table",
"virtual_network.delete_internet_gateway": "oci.core.VirtualNetworkClient.delete_internet_gateway",
@@ -122,6 +126,7 @@
"virtual_network.get_dhcp_options": "oci.core.VirtualNetworkClient.get_dhcp_options",
"virtual_network.get_drg": "oci.core.VirtualNetworkClient.get_drg",
"virtual_network.get_drg_attachment": "oci.core.VirtualNetworkClient.get_drg_attachment",
+ "virtual_network.get_drg_nat_policy": "oci.core.VirtualNetworkClient.get_drg_nat_policy",
"virtual_network.get_drg_redundancy_status": "oci.core.VirtualNetworkClient.get_drg_redundancy_status",
"virtual_network.get_drg_route_distribution": "oci.core.VirtualNetworkClient.get_drg_route_distribution",
"virtual_network.get_drg_route_table": "oci.core.VirtualNetworkClient.get_drg_route_table",
@@ -181,6 +186,8 @@
"virtual_network.list_crossconnect_port_speed_shapes": "oci.core.VirtualNetworkClient.list_crossconnect_port_speed_shapes",
"virtual_network.list_dhcp_options": "oci.core.VirtualNetworkClient.list_dhcp_options",
"virtual_network.list_drg_attachments": "oci.core.VirtualNetworkClient.list_drg_attachments",
+ "virtual_network.list_drg_nat_policies": "oci.core.VirtualNetworkClient.list_drg_nat_policies",
+ "virtual_network.list_drg_nat_rules": "oci.core.VirtualNetworkClient.list_drg_nat_rules",
"virtual_network.list_drg_route_distribution_statements": "oci.core.VirtualNetworkClient.list_drg_route_distribution_statements",
"virtual_network.list_drg_route_distributions": "oci.core.VirtualNetworkClient.list_drg_route_distributions",
"virtual_network.list_drg_route_rules": "oci.core.VirtualNetworkClient.list_drg_route_rules",
@@ -222,6 +229,8 @@
"virtual_network.patch_subnet": "oci.core.VirtualNetworkClient.patch_subnet",
"virtual_network.patch_vcn": "oci.core.VirtualNetworkClient.patch_vcn",
"virtual_network.private_ip_vnic_detach": "oci.core.VirtualNetworkClient.private_ip_vnic_detach",
+ "virtual_network.remove_drg_nat_policy": "oci.core.VirtualNetworkClient.remove_drg_nat_policy",
+ "virtual_network.remove_drg_nat_rules": "oci.core.VirtualNetworkClient.remove_drg_nat_rules",
"virtual_network.remove_drg_route_distribution_statements": "oci.core.VirtualNetworkClient.remove_drg_route_distribution_statements",
"virtual_network.remove_drg_route_rules": "oci.core.VirtualNetworkClient.remove_drg_route_rules",
"virtual_network.remove_export_drg_route_distribution": "oci.core.VirtualNetworkClient.remove_export_drg_route_distribution",
@@ -244,6 +253,8 @@
"virtual_network.update_dhcp_options": "oci.core.VirtualNetworkClient.update_dhcp_options",
"virtual_network.update_drg": "oci.core.VirtualNetworkClient.update_drg",
"virtual_network.update_drg_attachment": "oci.core.VirtualNetworkClient.update_drg_attachment",
+ "virtual_network.update_drg_nat_policy": "oci.core.VirtualNetworkClient.update_drg_nat_policy",
+ "virtual_network.update_drg_nat_rules": "oci.core.VirtualNetworkClient.update_drg_nat_rules",
"virtual_network.update_drg_route_distribution": "oci.core.VirtualNetworkClient.update_drg_route_distribution",
"virtual_network.update_drg_route_distribution_statements": "oci.core.VirtualNetworkClient.update_drg_route_distribution_statements",
"virtual_network.update_drg_route_rules": "oci.core.VirtualNetworkClient.update_drg_route_rules",
diff --git a/services/data_safe/src/oci_cli_data_safe/datasafe_cli_extended.py b/services/data_safe/src/oci_cli_data_safe/datasafe_cli_extended.py
index 55f3019f3..3b71557d7 100644
--- a/services/data_safe/src/oci_cli_data_safe/datasafe_cli_extended.py
+++ b/services/data_safe/src/oci_cli_data_safe/datasafe_cli_extended.py
@@ -7,6 +7,7 @@
from oci_cli import cli_util
from oci_cli import json_skeleton_utils
from services.data_safe.src.oci_cli_data_safe.generated import datasafe_cli
+from oci_cli import custom_types
# 1 :
# From: oci data-safe data-safe-configuration get --compartment-id | -c, -? | -h | --help
@@ -306,3 +307,33 @@ def update_data_safe_private_endpoint_extended(ctx, **kwargs):
# Remove update-peer-target-database-installed-database-details from oci data-safe peer-target-database
datasafe_cli.peer_target_database_group.commands.pop(datasafe_cli.update_peer_target_database_installed_database_details.name)
+
+
+@cli_util.copy_params_from_generated_command(datasafe_cli.create_registration_policy, params_to_exclude=['features'])
+@datasafe_cli.registration_policy_group.command(name='create', help=datasafe_cli.create_registration_policy.help)
+@cli_util.option('--features', required=True, multiple=True, type=custom_types.CliCaseInsensitiveChoice(["ASSESSMENT", "AUDIT_COLLECTION", "AUDIT_SETTING", "DATA_DISCOVERY", "MASKING", "SQL_FIREWALL", "ALL"]), help=u"""The Data Safe features granted to the databases registering under the registration policy.""")
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'connection-option': {'module': 'data_safe', 'class': 'PolicyConnectionOption'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'RegistrationPolicy'})
+@cli_util.wrap_exceptions
+def create_registration_policy_extended(ctx, **kwargs):
+ ctx.invoke(datasafe_cli.create_registration_policy, **kwargs)
+
+
+@cli_util.copy_params_from_generated_command(datasafe_cli.manage_privileges, params_to_exclude=['features'])
+@datasafe_cli.target_database_group.command(name='manage-privileges', help=datasafe_cli.manage_privileges.help)
+@cli_util.option('--features', required=True, multiple=True, type=custom_types.CliCaseInsensitiveChoice(["ASSESSMENT", "AUDIT_COLLECTION", "AUDIT_SETTING", "DATA_DISCOVERY", "MASKING", "SQL_FIREWALL", "ALL"]), help=u"""The Data Safe features granted to the databases registering under the registration policy.""")
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
+@cli_util.wrap_exceptions
+def manage_privileges_extended(ctx, **kwargs):
+ ctx.invoke(datasafe_cli.manage_privileges, **kwargs)
+
+
+@cli_util.copy_params_from_generated_command(datasafe_cli.update_registration_policy, params_to_exclude=['features'])
+@datasafe_cli.registration_policy_group.command(name='update', help=datasafe_cli.update_registration_policy.help)
+@cli_util.option('--features', multiple=True, type=custom_types.CliCaseInsensitiveChoice(["ASSESSMENT", "AUDIT_COLLECTION", "AUDIT_SETTING", "DATA_DISCOVERY", "MASKING", "SQL_FIREWALL", "ALL"]), help=u"""The Data Safe features granted to the databases registering under the registration policy.""")
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'connection-option': {'module': 'data_safe', 'class': 'PolicyConnectionOption'}}, output_type={'module': 'data_safe', 'class': 'RegistrationPolicy'})
+@cli_util.wrap_exceptions
+def update_registration_policy_extended(ctx, **kwargs):
+ ctx.invoke(datasafe_cli.update_registration_policy, **kwargs)
diff --git a/services/data_safe/src/oci_cli_data_safe/generated/datasafe_cli.py b/services/data_safe/src/oci_cli_data_safe/generated/datasafe_cli.py
index 0e22c769b..9ed534afd 100644
--- a/services/data_safe/src/oci_cli_data_safe/generated/datasafe_cli.py
+++ b/services/data_safe/src/oci_cli_data_safe/generated/datasafe_cli.py
@@ -40,39 +40,15 @@ def sensitive_type_group_summary_group():
pass
-@click.command(cli_util.override('data_safe.security_policy_collection_group.command_name', 'security-policy-collection'), cls=CommandGroupWithAlias, help="""Collection of security policy summary.""")
-@cli_util.help_option_group
-def security_policy_collection_group():
- pass
-
-
@click.command(cli_util.override('data_safe.security_policy_config_collection_group.command_name', 'security-policy-config-collection'), cls=CommandGroupWithAlias, help="""Collection of security policy configuration summaries.""")
@cli_util.help_option_group
def security_policy_config_collection_group():
pass
-@click.command(cli_util.override('data_safe.data_safe_configuration_group.command_name', 'data-safe-configuration'), cls=CommandGroupWithAlias, help="""A Data Safe configuration for a tenancy and region.""")
-@cli_util.help_option_group
-def data_safe_configuration_group():
- pass
-
-
-@click.command(cli_util.override('data_safe.database_view_access_entry_group.command_name', 'database-view-access-entry'), cls=CommandGroupWithAlias, help="""A DatabaseViewAccessEntry object is a resource corresponding to a row in view authorization report. It's a subresource of Security Policy Report resource and is always associated with a SecurityPolicyReport.""")
-@cli_util.help_option_group
-def database_view_access_entry_group():
- pass
-
-
-@click.command(cli_util.override('data_safe.sensitive_type_group.command_name', 'sensitive-type'), cls=CommandGroupWithAlias, help="""A sensitive type defines a particular type or class of sensitive data. It can be a basic sensitive type with regular expressions or a sensitive category. While sensitive types are used for data discovery, sensitive categories are used for logically grouping the related or similar sensitive types. [Learn more].""")
-@cli_util.help_option_group
-def sensitive_type_group():
- pass
-
-
-@click.command(cli_util.override('data_safe.security_assessment_group.command_name', 'security-assessment'), cls=CommandGroupWithAlias, help="""A security assessment that provides an overall insight into your database security posture. The security assessment results are based on the analysis of your database configurations, user accounts, and security controls. For more information, see [Security Assessment Overview].""")
+@click.command(cli_util.override('data_safe.subsetting_report_group.command_name', 'subsetting-report'), cls=CommandGroupWithAlias, help="""Summary information for a report generated from a data subsetting operation""")
@cli_util.help_option_group
-def security_assessment_group():
+def subsetting_report_group():
pass
@@ -82,30 +58,12 @@ def sensitive_data_model_sensitive_type_collection_group():
pass
-@click.command(cli_util.override('data_safe.on_prem_connector_group.command_name', 'on-prem-connector'), cls=CommandGroupWithAlias, help="""A Data Safe on-premises connector that enables Data Safe to connect to on-premises databases.""")
-@cli_util.help_option_group
-def on_prem_connector_group():
- pass
-
-
@click.command(cli_util.override('data_safe.referential_relation_group.command_name', 'referential-relation'), cls=CommandGroupWithAlias, help="""A referential relation is a resource corresponding to database columns. It's a subresource of sensitive data model resource and is always associated with a sensitive data model.""")
@cli_util.help_option_group
def referential_relation_group():
pass
-@click.command(cli_util.override('data_safe.sql_firewall_policy_group.command_name', 'sql-firewall-policy'), cls=CommandGroupWithAlias, help="""The SQL Firewall policy resource contains the firewall policy metadata for a single user.""")
-@cli_util.help_option_group
-def sql_firewall_policy_group():
- pass
-
-
-@click.command(cli_util.override('data_safe.work_request_group.command_name', 'work-request'), cls=CommandGroupWithAlias, help="""An asynchronous work request.""")
-@cli_util.help_option_group
-def work_request_group():
- pass
-
-
@click.command(cli_util.override('data_safe.difference_column_group.command_name', 'difference-column'), cls=CommandGroupWithAlias, help="""A SDM masking policy difference column. It can be one of the following three types: NEW: A new column in the sensitive data model that is not in the masking policy. DELETED: A column that is present in the masking policy but has been deleted from the sensitive data model. MODIFIED: A column that is present in the masking policy as well as the sensitive data model but some of its attributes have been modified.""")
@cli_util.help_option_group
def difference_column_group():
@@ -136,12 +94,6 @@ def security_policy_config_group():
pass
-@click.command(cli_util.override('data_safe.sql_collection_collection_group.command_name', 'sql-collection-collection'), cls=CommandGroupWithAlias, help="""Collection of SQL collection summary.""")
-@cli_util.help_option_group
-def sql_collection_collection_group():
- pass
-
-
@click.command(cli_util.override('data_safe.work_request_error_group.command_name', 'work-request-error'), cls=CommandGroupWithAlias, help="""An error related to a work request.""")
@cli_util.help_option_group
def work_request_error_group():
@@ -154,520 +106,666 @@ def target_database_group_group():
pass
-@click.command(cli_util.override('data_safe.attribute_set_group.command_name', 'attribute-set'), cls=CommandGroupWithAlias, help="""Represents an attribute set. An attribute set is a collection of data attributes defined by the user. i.e an attribute set of ip addresses, os user names or database privileged users.""")
+@click.command(cli_util.override('data_safe.alert_policy_rule_group.command_name', 'alert-policy-rule'), cls=CommandGroupWithAlias, help="""A rule associated with a alert policy.""")
@cli_util.help_option_group
-def attribute_set_group():
+def alert_policy_rule_group():
pass
-@click.command(cli_util.override('data_safe.library_masking_format_summary_group.command_name', 'library-masking-format-summary'), cls=CommandGroupWithAlias, help="""Summary of a library masking format.""")
+@click.command(cli_util.override('data_safe.database_view_access_entry_collection_group.command_name', 'database-view-access-entry-collection'), cls=CommandGroupWithAlias, help="""A collection of database view access summary objects.""")
@cli_util.help_option_group
-def library_masking_format_summary_group():
+def database_view_access_entry_collection_group():
pass
-@click.command(cli_util.override('data_safe.alert_policy_rule_group.command_name', 'alert-policy-rule'), cls=CommandGroupWithAlias, help="""A rule associated with a alert policy.""")
+@click.command(cli_util.override('data_safe.security_policy_group.command_name', 'security-policy'), cls=CommandGroupWithAlias, help="""The resource represents as a container for all the security policies in Data Safe.""")
@cli_util.help_option_group
-def alert_policy_rule_group():
+def security_policy_group():
pass
-@click.command(cli_util.override('data_safe.alert_summary_group.command_name', 'alert-summary'), cls=CommandGroupWithAlias, help="""Summary of a Data Safe Alert.""")
+@click.command(cli_util.override('data_safe.registration_policy_group.command_name', 'registration-policy'), cls=CommandGroupWithAlias, help="""A registration policy. This object contains detailed information about a registration policy, including its ID, compartment ID, display name, and features.""")
@cli_util.help_option_group
-def alert_summary_group():
+def registration_policy_group():
pass
-@click.command(cli_util.override('data_safe.database_view_access_entry_collection_group.command_name', 'database-view-access-entry-collection'), cls=CommandGroupWithAlias, help="""A collection of database view access summary objects.""")
+@click.command(cli_util.override('data_safe.profile_group.command_name', 'profile'), cls=CommandGroupWithAlias, help="""The comprehensive information about the user profiles available on a given target. It includes details such as profile name, failed login attempts, password reuse time, password verification function, password verification function implementation code snippet, sessions per user, connect time inactive account time, password lock time, cpu usage per session, target id, and compartment id.""")
@cli_util.help_option_group
-def database_view_access_entry_collection_group():
+def profile_group():
pass
-@click.command(cli_util.override('data_safe.sensitive_types_export_group.command_name', 'sensitive-types-export'), cls=CommandGroupWithAlias, help="""The resource represents sensitive types to be exported in Data Safe.""")
+@click.command(cli_util.override('data_safe.subsetting_schema_object_summary_group.command_name', 'subsetting-schema-object-summary'), cls=CommandGroupWithAlias, help="""Summary of a table included in the schema for a subsetting policy""")
@cli_util.help_option_group
-def sensitive_types_export_group():
+def subsetting_schema_object_summary_group():
pass
-@click.command(cli_util.override('data_safe.data_safe_private_endpoint_group.command_name', 'data-safe-private-endpoint'), cls=CommandGroupWithAlias, help="""A Data Safe private endpoint that allows Data Safe to connect to databases in a customer's virtual cloud network (VCN).""")
+@click.command(cli_util.override('data_safe.subsetting_policy_group.command_name', 'subsetting-policy'), cls=CommandGroupWithAlias, help="""A subsetting policy defines the approach to subset data in a target database. It's basically a collection of rules applied on tables or schemas, to reduce rows in them. A subsetting policy can be used to subset multiple databases provided that they have the same schema design.""")
@cli_util.help_option_group
-def data_safe_private_endpoint_group():
+def subsetting_policy_group():
pass
-@click.command(cli_util.override('data_safe.security_policy_group.command_name', 'security-policy'), cls=CommandGroupWithAlias, help="""The resource represents as a container for all the security policies in Data Safe.""")
+@click.command(cli_util.override('data_safe.audit_profile_group.command_name', 'audit-profile'), cls=CommandGroupWithAlias, help="""The resource represents audit profile settings and audit configurations for the database target, and helps evaluate the initial audit data volume for configuring collection in Data Safe. The resource is also responsible for auto-discovery of audit trails in the database target during target's registration.""")
@cli_util.help_option_group
-def security_policy_group():
+def audit_profile_group():
pass
-@click.command(cli_util.override('data_safe.sql_firewall_allowed_sql_collection_group.command_name', 'sql-firewall-allowed-sql-collection'), cls=CommandGroupWithAlias, help="""Collection of SQL Firewall allowed SQL statements.""")
+@click.command(cli_util.override('data_safe.subsetting_rule_group.command_name', 'subsetting-rule'), cls=CommandGroupWithAlias, help="""Defines a rule for subsetting data in specific tables or schemas, including scope and processing strategies""")
@cli_util.help_option_group
-def sql_firewall_allowed_sql_collection_group():
+def subsetting_rule_group():
pass
-@click.command(cli_util.override('data_safe.discovery_job_result_group.command_name', 'discovery-job-result'), cls=CommandGroupWithAlias, help="""A discovery job result representing a sensitive column. It can be one of the following three types: NEW: A new sensitive column in the target database that is not in the sensitive data model. DELETED: A column that is present in the sensitive data model but has been deleted from the target database. MODIFIED: A column that is present in the target database as well as the sensitive data model but some of its attributes have been modified.""")
+@click.command(cli_util.override('data_safe.sensitive_data_model_group.command_name', 'sensitive-data-model'), cls=CommandGroupWithAlias, help="""A sensitive data model is a collection of sensitive columns and their referential relationships. It helps understand the sensitive data landscape, track changes, and efficiently enable security controls such as data masking. It can be managed either manually or by performing sensitive data discovery on a reference target database. [Learn more].""")
@cli_util.help_option_group
-def discovery_job_result_group():
+def sensitive_data_model_group():
pass
-@click.command(cli_util.override('data_safe.sql_firewall_policy_analytics_collection_group.command_name', 'sql-firewall-policy-analytics-collection'), cls=CommandGroupWithAlias, help="""SQL Firewall policy analytics collection.""")
+@click.command(cli_util.override('data_safe.unified_audit_policy_definition_collection_group.command_name', 'unified-audit-policy-definition-collection'), cls=CommandGroupWithAlias, help="""Collection of audit policy summary.""")
@cli_util.help_option_group
-def sql_firewall_policy_analytics_collection_group():
+def unified_audit_policy_definition_collection_group():
pass
-@click.command(cli_util.override('data_safe.sql_firewall_policy_collection_group.command_name', 'sql-firewall-policy-collection'), cls=CommandGroupWithAlias, help="""Collection of SQL Firewall policy summary.""")
+@click.command(cli_util.override('data_safe.sql_collection_analytics_collection_group.command_name', 'sql-collection-analytics-collection'), cls=CommandGroupWithAlias, help="""SQL collection analytics collection.""")
@cli_util.help_option_group
-def sql_firewall_policy_collection_group():
+def sql_collection_analytics_collection_group():
pass
-@click.command(cli_util.override('data_safe.masking_schema_collection_group.command_name', 'masking-schema-collection'), cls=CommandGroupWithAlias, help="""A collection of masking schema summary objects.""")
+@click.command(cli_util.override('data_safe.audit_policy_analytic_collection_group.command_name', 'audit-policy-analytic-collection'), cls=CommandGroupWithAlias, help="""Details of audit policy aggregation.""")
@cli_util.help_option_group
-def masking_schema_collection_group():
+def audit_policy_analytic_collection_group():
pass
-@click.command(cli_util.override('data_safe.report_definition_group.command_name', 'report-definition'), cls=CommandGroupWithAlias, help="""Description of report definition.""")
+@click.command(cli_util.override('data_safe.library_masking_format_group.command_name', 'library-masking-format'), cls=CommandGroupWithAlias, help="""A library masking format is a masking format stored in an Oracle Cloud Infrastructure compartment and can be used in multiple masking policies. If you want to use the same masking logic for multiple masking columns or even in multiple masking policies, you can create a library masking format and assign it to masking columns as needed. It helps you avoid defining the same masking logic again and again.
+
+Oracle Data Safe provides a set of predefined library masking formats to mask common sensitive and personal data, such as names, national identifiers, credit card numbers, and phone numbers. To meet your specific requirements, you can easily create new library masking formats and use them in your masking policies.""")
@cli_util.help_option_group
-def report_definition_group():
+def library_masking_format_group():
pass
-@click.command(cli_util.override('data_safe.profile_group.command_name', 'profile'), cls=CommandGroupWithAlias, help="""The comprehensive information about the user profiles available on a given target. It includes details such as profile name, failed login attempts, password reuse time, password verification function, password verification function implementation code snippet, sessions per user, connect time inactive account time, password lock time, cpu usage per session, target id, and compartment id.""")
+@click.command(cli_util.override('data_safe.masking_report_group.command_name', 'masking-report'), cls=CommandGroupWithAlias, help="""A masking report contains information about a completed masking request. It includes details such as the target database masked, masking policy used, masking start and finish time, total number of schemas, tables, columns and values masked, masked columns, and the masking formats used.""")
@cli_util.help_option_group
-def profile_group():
+def masking_report_group():
pass
-@click.command(cli_util.override('data_safe.security_policy_report_collection_group.command_name', 'security-policy-report-collection'), cls=CommandGroupWithAlias, help="""Collection of security policy report summary.""")
+@click.command(cli_util.override('data_safe.alert_policy_group.command_name', 'alert-policy'), cls=CommandGroupWithAlias, help="""An Alert Policy is a set of alerting rules evaluated against a target. The alert policy is said to be satisfied when all rules in the policy evaulate to true. If there are three rules: rule1,rule2 and rule3, the policy is satisfied if rule1 AND rule2 AND rule3 is True.""")
@cli_util.help_option_group
-def security_policy_report_collection_group():
+def alert_policy_group():
pass
-@click.command(cli_util.override('data_safe.finding_group.command_name', 'finding'), cls=CommandGroupWithAlias, help="""The particular finding reported by the security assessment.""")
+@click.command(cli_util.override('data_safe.user_assessment_group.command_name', 'user-assessment'), cls=CommandGroupWithAlias, help="""The details of the user assessment, which includes statistics related to target database users.""")
@cli_util.help_option_group
-def finding_group():
+def user_assessment_group():
pass
-@click.command(cli_util.override('data_safe.audit_profile_group.command_name', 'audit-profile'), cls=CommandGroupWithAlias, help="""The resource represents audit profile settings and audit configurations for the database target, and helps evaluate the initial audit data volume for configuring collection in Data Safe. The resource is also responsible for auto-discovery of audit trails in the database target during target's registration.""")
+@click.command(cli_util.override('data_safe.sensitive_schema_collection_group.command_name', 'sensitive-schema-collection'), cls=CommandGroupWithAlias, help="""A collection of sensitive schema summary objects.""")
@cli_util.help_option_group
-def audit_profile_group():
+def sensitive_schema_collection_group():
pass
-@click.command(cli_util.override('data_safe.target_database_group.command_name', 'target-database'), cls=CommandGroupWithAlias, help="""The details of the Data Safe target database.""")
+@click.command(cli_util.override('data_safe.audit_policy_collection_group.command_name', 'audit-policy-collection'), cls=CommandGroupWithAlias, help="""Collection of audit policy summary.""")
@cli_util.help_option_group
-def target_database_group():
+def audit_policy_collection_group():
pass
-@click.command(cli_util.override('data_safe.target_database_group_summary_group.command_name', 'target-database-group-summary'), cls=CommandGroupWithAlias, help="""Summary of the target database group used in list operations. Contains essential information without matching criteria.""")
+@click.command(cli_util.override('data_safe.table_estimate_summary_group.command_name', 'table-estimate-summary'), cls=CommandGroupWithAlias, help="""Estimated row count and size details for a table in a subsetting policy.""")
@cli_util.help_option_group
-def target_database_group_summary_group():
+def table_estimate_summary_group():
pass
-@click.command(cli_util.override('data_safe.sensitive_data_model_group.command_name', 'sensitive-data-model'), cls=CommandGroupWithAlias, help="""A sensitive data model is a collection of sensitive columns and their referential relationships. It helps understand the sensitive data landscape, track changes, and efficiently enable security controls such as data masking. It can be managed either manually or by performing sensitive data discovery on a reference target database. [Learn more].""")
+@click.command(cli_util.override('data_safe.sensitive_object_collection_group.command_name', 'sensitive-object-collection'), cls=CommandGroupWithAlias, help="""A collection of sensitive object summary objects.""")
@cli_util.help_option_group
-def sensitive_data_model_group():
+def sensitive_object_collection_group():
pass
-@click.command(cli_util.override('data_safe.security_policy_deployment_collection_group.command_name', 'security-policy-deployment-collection'), cls=CommandGroupWithAlias, help="""Collection of security policy deployment summary.""")
+@click.command(cli_util.override('data_safe.sql_firewall_allowed_sql_analytics_collection_group.command_name', 'sql-firewall-allowed-sql-analytics-collection'), cls=CommandGroupWithAlias, help="""SQL Firewall allowed SQL analytics collection.""")
@cli_util.help_option_group
-def security_policy_deployment_collection_group():
+def sql_firewall_allowed_sql_analytics_collection_group():
pass
-@click.command(cli_util.override('data_safe.sensitive_types_export_collection_group.command_name', 'sensitive-types-export-collection'), cls=CommandGroupWithAlias, help="""A collection of sensitive types export summary objects.""")
+@click.command(cli_util.override('data_safe.database_table_access_entry_group.command_name', 'database-table-access-entry'), cls=CommandGroupWithAlias, help="""A DatabaseTableAccess is a resource corresponding to a row in database table access report. It contains information about user's privilege grants that enable table access for the user. It's a subresource of Security Policy Report resource and is always associated with a SecurityPolicyReport.""")
@cli_util.help_option_group
-def sensitive_types_export_collection_group():
+def database_table_access_entry_group():
pass
-@click.command(cli_util.override('data_safe.unified_audit_policy_definition_collection_group.command_name', 'unified-audit-policy-definition-collection'), cls=CommandGroupWithAlias, help="""Collection of audit policy summary.""")
+@click.command(cli_util.override('data_safe.sql_collection_log_insights_collection_group.command_name', 'sql-collection-log-insights-collection'), cls=CommandGroupWithAlias, help="""SQL collection log analytics collection.""")
@cli_util.help_option_group
-def unified_audit_policy_definition_collection_group():
+def sql_collection_log_insights_collection_group():
pass
-@click.command(cli_util.override('data_safe.audit_profile_analytic_collection_group.command_name', 'audit-profile-analytic-collection'), cls=CommandGroupWithAlias, help="""Details of audit profile analytic summary.""")
+@click.command(cli_util.override('data_safe.audit_policy_group.command_name', 'audit-policy'), cls=CommandGroupWithAlias, help="""The resource represents all available audit policies relevant for the target database with their corresponding audit conditions. The audit policies could be in any one of the following 3 states in the target database 1) Created and enabled 2) Created but not enabled 3) Not created For more details on available audit policies, refer to [documentation].""")
@cli_util.help_option_group
-def audit_profile_analytic_collection_group():
+def audit_policy_group():
pass
-@click.command(cli_util.override('data_safe.sql_collection_analytics_collection_group.command_name', 'sql-collection-analytics-collection'), cls=CommandGroupWithAlias, help="""SQL collection analytics collection.""")
+@click.command(cli_util.override('data_safe.audit_trail_analytic_collection_group.command_name', 'audit-trail-analytic-collection'), cls=CommandGroupWithAlias, help="""Details of audit trail analytic summary.""")
@cli_util.help_option_group
-def sql_collection_analytics_collection_group():
+def audit_trail_analytic_collection_group():
pass
-@click.command(cli_util.override('data_safe.peer_target_database_group.command_name', 'peer-target-database'), cls=CommandGroupWithAlias, help="""The details of the peer target database in Data Safe.""")
+@click.command(cli_util.override('data_safe.masking_policy_group.command_name', 'masking-policy'), cls=CommandGroupWithAlias, help="""A masking policy defines the approach to mask data in a target database. It's basically a collection of columns to be masked, called masking columns, and the associated masking formats to be used to mask these columns. A masking policy can be used to mask multiple databases provided that they have the same schema design. For more information, see Masking Policies in the Oracle Data Safe documentation.""")
@cli_util.help_option_group
-def peer_target_database_group():
+def masking_policy_group():
pass
-@click.command(cli_util.override('data_safe.security_policy_deployment_group.command_name', 'security-policy-deployment'), cls=CommandGroupWithAlias, help="""The resource represents the state of the deployment of a security policy on a target.""")
+@click.command(cli_util.override('data_safe.audit_archive_retrieval_group.command_name', 'audit-archive-retrieval'), cls=CommandGroupWithAlias, help="""Represents the archive retrieve request for the audit data. You can retrieve audit data for a target database from the archive and store it online. For more information, see [Retrieve Audit Data for a Target Database from the Archive].""")
@cli_util.help_option_group
-def security_policy_deployment_group():
+def audit_archive_retrieval_group():
pass
-@click.command(cli_util.override('data_safe.audit_policy_analytic_collection_group.command_name', 'audit-policy-analytic-collection'), cls=CommandGroupWithAlias, help="""Details of audit policy aggregation.""")
+@click.command(cli_util.override('data_safe.discovery_job_group.command_name', 'discovery-job'), cls=CommandGroupWithAlias, help="""A data discovery job. It helps track job's metadata as well as result statistics.""")
@cli_util.help_option_group
-def audit_policy_analytic_collection_group():
+def discovery_job_group():
pass
-@click.command(cli_util.override('data_safe.audit_event_summary_group.command_name', 'audit-event-summary'), cls=CommandGroupWithAlias, help="""The resource represents the audit events collected from the target database by Oracle Data Safe.""")
+@click.command(cli_util.override('data_safe.masking_object_collection_group.command_name', 'masking-object-collection'), cls=CommandGroupWithAlias, help="""A collection of masking object summary objects.""")
@cli_util.help_option_group
-def audit_event_summary_group():
+def masking_object_collection_group():
pass
-@click.command(cli_util.override('data_safe.library_masking_format_group.command_name', 'library-masking-format'), cls=CommandGroupWithAlias, help="""A library masking format is a masking format stored in an Oracle Cloud Infrastructure compartment and can be used in multiple masking policies. If you want to use the same masking logic for multiple masking columns or even in multiple masking policies, you can create a library masking format and assign it to masking columns as needed. It helps you avoid defining the same masking logic again and again.
-
-Oracle Data Safe provides a set of predefined library masking formats to mask common sensitive and personal data, such as names, national identifiers, credit card numbers, and phone numbers. To meet your specific requirements, you can easily create new library masking formats and use them in your masking policies.""")
+@click.command(cli_util.override('data_safe.unified_audit_policy_group.command_name', 'unified-audit-policy'), cls=CommandGroupWithAlias, help="""Resource represents a single unified audit policy on the target database.""")
@cli_util.help_option_group
-def library_masking_format_group():
+def unified_audit_policy_group():
pass
-@click.command(cli_util.override('data_safe.masking_report_group.command_name', 'masking-report'), cls=CommandGroupWithAlias, help="""A masking report contains information about a completed masking request. It includes details such as the target database masked, masking policy used, masking start and finish time, total number of schemas, tables, columns and values masked, masked columns, and the masking formats used.""")
+@click.command(cli_util.override('data_safe.database_security_config_group.command_name', 'database-security-config'), cls=CommandGroupWithAlias, help="""Database Security Configurations resource represents the target database configurations. Included in the Database Security Configurations are the SQL Firewall configurations such as the status of the firewall, the time that the firewall status was last updated, violation log auto purge settings, etc.""")
@cli_util.help_option_group
-def masking_report_group():
+def database_security_config_group():
pass
-@click.command(cli_util.override('data_safe.sql_firewall_allowed_sql_group.command_name', 'sql-firewall-allowed-sql'), cls=CommandGroupWithAlias, help="""The resource represents a SQL Firewall allowed SQL in Data Safe.""")
+@click.command(cli_util.override('data_safe.masking_column_group.command_name', 'masking-column'), cls=CommandGroupWithAlias, help="""A masking column is a resource corresponding to a database column that you want to mask. It's a subresource of masking policy resource and is always associated with a masking policy. Note that only parent columns are managed as masking columns. The child columns are automatically managed using the childColumns attribute.""")
@cli_util.help_option_group
-def sql_firewall_allowed_sql_group():
+def masking_column_group():
pass
-@click.command(cli_util.override('data_safe.alert_policy_group.command_name', 'alert-policy'), cls=CommandGroupWithAlias, help="""An Alert Policy is a set of alerting rules evaluated against a target. The alert policy is said to be satisfied when all rules in the policy evaulate to true. If there are three rules: rule1,rule2 and rule3, the policy is satisfied if rule1 AND rule2 AND rule3 is True.""")
+@click.command(cli_util.override('data_safe.report_group.command_name', 'report'), cls=CommandGroupWithAlias, help="""The description of the report.""")
@cli_util.help_option_group
-def alert_policy_group():
+def report_group():
pass
-@click.command(cli_util.override('data_safe.user_assessment_group.command_name', 'user-assessment'), cls=CommandGroupWithAlias, help="""The details of the user assessment, which includes statistics related to target database users.""")
+@click.command(cli_util.override('data_safe.security_policy_entry_state_collection_group.command_name', 'security-policy-entry-state-collection'), cls=CommandGroupWithAlias, help="""Collection of security policy entry state summary.""")
@cli_util.help_option_group
-def user_assessment_group():
+def security_policy_entry_state_collection_group():
pass
-@click.command(cli_util.override('data_safe.sql_collection_group.command_name', 'sql-collection'), cls=CommandGroupWithAlias, help="""The resource represents SQL collection for a specific database user in a target. SqlCollection encapsulates the SQL commands issued in the user\u2019s database sessions, and its execution context.""")
+@click.command(cli_util.override('data_safe.report_summary_group.command_name', 'report-summary'), cls=CommandGroupWithAlias, help="""Description of report.""")
@cli_util.help_option_group
-def sql_collection_group():
+def report_summary_group():
pass
-@click.command(cli_util.override('data_safe.alert_group.command_name', 'alert'), cls=CommandGroupWithAlias, help="""The details of a Data Safe Alert, that shows alerts generated by a Data Safe feature.""")
+@click.command(cli_util.override('data_safe.target_alert_policy_association_summary_group.command_name', 'target-alert-policy-association-summary'), cls=CommandGroupWithAlias, help="""A summary of target to alert policy association.""")
@cli_util.help_option_group
-def alert_group():
+def target_alert_policy_association_summary_group():
pass
-@click.command(cli_util.override('data_safe.sensitive_schema_collection_group.command_name', 'sensitive-schema-collection'), cls=CommandGroupWithAlias, help="""A collection of sensitive schema summary objects.""")
+@click.command(cli_util.override('data_safe.security_policy_collection_group.command_name', 'security-policy-collection'), cls=CommandGroupWithAlias, help="""Collection of security policy summary.""")
@cli_util.help_option_group
-def sensitive_schema_collection_group():
+def security_policy_collection_group():
pass
-@click.command(cli_util.override('data_safe.audit_policy_collection_group.command_name', 'audit-policy-collection'), cls=CommandGroupWithAlias, help="""Collection of audit policy summary.""")
+@click.command(cli_util.override('data_safe.data_safe_configuration_group.command_name', 'data-safe-configuration'), cls=CommandGroupWithAlias, help="""A Data Safe configuration for a tenancy and region.""")
@cli_util.help_option_group
-def audit_policy_collection_group():
+def data_safe_configuration_group():
pass
-@click.command(cli_util.override('data_safe.masking_error_summary_group.command_name', 'masking-error-summary'), cls=CommandGroupWithAlias, help="""Summary of a masking error. A Masking error is an error seen during the masking run.""")
+@click.command(cli_util.override('data_safe.subsetting_rule_processing_chain_object_summary_group.command_name', 'subsetting-rule-processing-chain-object-summary'), cls=CommandGroupWithAlias, help="""Summary of a subsetting schema relation processed while extracting rows for processing a subsetting rule.""")
@cli_util.help_option_group
-def masking_error_summary_group():
+def subsetting_rule_processing_chain_object_summary_group():
pass
-@click.command(cli_util.override('data_safe.masking_policy_health_report_group.command_name', 'masking-policy-health-report'), cls=CommandGroupWithAlias, help="""The masking policy health report.""")
+@click.command(cli_util.override('data_safe.database_view_access_entry_group.command_name', 'database-view-access-entry'), cls=CommandGroupWithAlias, help="""A DatabaseViewAccessEntry object is a resource corresponding to a row in view authorization report. It's a subresource of Security Policy Report resource and is always associated with a SecurityPolicyReport.""")
@cli_util.help_option_group
-def masking_policy_health_report_group():
+def database_view_access_entry_group():
pass
-@click.command(cli_util.override('data_safe.role_grant_path_collection_group.command_name', 'role-grant-path-collection'), cls=CommandGroupWithAlias, help="""A collection of role grant path summary objects.""")
+@click.command(cli_util.override('data_safe.sensitive_type_group.command_name', 'sensitive-type'), cls=CommandGroupWithAlias, help="""A sensitive type defines a particular type or class of sensitive data. It can be a basic sensitive type with regular expressions or a sensitive category. While sensitive types are used for data discovery, sensitive categories are used for logically grouping the related or similar sensitive types. [Learn more].""")
@cli_util.help_option_group
-def role_grant_path_collection_group():
+def sensitive_type_group():
pass
-@click.command(cli_util.override('data_safe.sensitive_object_collection_group.command_name', 'sensitive-object-collection'), cls=CommandGroupWithAlias, help="""A collection of sensitive object summary objects.""")
+@click.command(cli_util.override('data_safe.security_assessment_group.command_name', 'security-assessment'), cls=CommandGroupWithAlias, help="""A security assessment that provides an overall insight into your database security posture. The security assessment results are based on the analysis of your database configurations, user accounts, and security controls. For more information, see [Security Assessment Overview].""")
@cli_util.help_option_group
-def sensitive_object_collection_group():
+def security_assessment_group():
pass
-@click.command(cli_util.override('data_safe.masking_policy_referential_relation_summary_group.command_name', 'masking-policy-referential-relation-summary'), cls=CommandGroupWithAlias, help="""A referential relation is a resource corresponding to database columns. It is always associated with a masking policy.""")
+@click.command(cli_util.override('data_safe.on_prem_connector_group.command_name', 'on-prem-connector'), cls=CommandGroupWithAlias, help="""A Data Safe on-premises connector that enables Data Safe to connect to on-premises databases.""")
@cli_util.help_option_group
-def masking_policy_referential_relation_summary_group():
+def on_prem_connector_group():
pass
-@click.command(cli_util.override('data_safe.sql_firewall_allowed_sql_analytics_collection_group.command_name', 'sql-firewall-allowed-sql-analytics-collection'), cls=CommandGroupWithAlias, help="""SQL Firewall allowed SQL analytics collection.""")
+@click.command(cli_util.override('data_safe.sql_firewall_policy_group.command_name', 'sql-firewall-policy'), cls=CommandGroupWithAlias, help="""The SQL Firewall policy resource contains the firewall policy metadata for a single user.""")
@cli_util.help_option_group
-def sql_firewall_allowed_sql_analytics_collection_group():
+def sql_firewall_policy_group():
pass
-@click.command(cli_util.override('data_safe.database_table_access_entry_group.command_name', 'database-table-access-entry'), cls=CommandGroupWithAlias, help="""A DatabaseTableAccess is a resource corresponding to a row in database table access report. It contains information about user's privilege grants that enable table access for the user. It's a subresource of Security Policy Report resource and is always associated with a SecurityPolicyReport.""")
+@click.command(cli_util.override('data_safe.subsetting_schema_collection_group.command_name', 'subsetting-schema-collection'), cls=CommandGroupWithAlias, help="""A collection of subsetting schema summary objects.""")
@cli_util.help_option_group
-def database_table_access_entry_group():
+def subsetting_schema_collection_group():
pass
-@click.command(cli_util.override('data_safe.sql_collection_log_insights_collection_group.command_name', 'sql-collection-log-insights-collection'), cls=CommandGroupWithAlias, help="""SQL collection log analytics collection.""")
+@click.command(cli_util.override('data_safe.work_request_group.command_name', 'work-request'), cls=CommandGroupWithAlias, help="""An asynchronous work request.""")
@cli_util.help_option_group
-def sql_collection_log_insights_collection_group():
+def work_request_group():
pass
-@click.command(cli_util.override('data_safe.security_policy_entry_state_group.command_name', 'security-policy-entry-state'), cls=CommandGroupWithAlias, help="""The resource represents the state of a specific entry type deployment on a target.""")
+@click.command(cli_util.override('data_safe.subsetting_schema_relation_group.command_name', 'subsetting-schema-relation'), cls=CommandGroupWithAlias, help="""Summary of a relationship between tables in the subsetting for a subsetting policy.""")
@cli_util.help_option_group
-def security_policy_entry_state_group():
+def subsetting_schema_relation_group():
pass
-@click.command(cli_util.override('data_safe.database_table_access_entry_collection_group.command_name', 'database-table-access-entry-collection'), cls=CommandGroupWithAlias, help="""A collection of database table access summary objects.""")
+@click.command(cli_util.override('data_safe.sql_collection_collection_group.command_name', 'sql-collection-collection'), cls=CommandGroupWithAlias, help="""Collection of SQL collection summary.""")
@cli_util.help_option_group
-def database_table_access_entry_collection_group():
+def sql_collection_collection_group():
pass
-@click.command(cli_util.override('data_safe.work_request_log_entry_group.command_name', 'work-request-log-entry'), cls=CommandGroupWithAlias, help="""A log entry related to a work request.""")
+@click.command(cli_util.override('data_safe.attribute_set_group.command_name', 'attribute-set'), cls=CommandGroupWithAlias, help="""Represents an attribute set. An attribute set is a collection of data attributes defined by the user. i.e an attribute set of ip addresses, os user names or database privileged users.""")
@cli_util.help_option_group
-def work_request_log_entry_group():
+def attribute_set_group():
pass
-@click.command(cli_util.override('data_safe.audit_policy_group.command_name', 'audit-policy'), cls=CommandGroupWithAlias, help="""The resource represents all available audit policies relevant for the target database with their corresponding audit conditions. The audit policies could be in any one of the following 3 states in the target database 1) Created and enabled 2) Created but not enabled 3) Not created For more details on available audit policies, refer to [documentation].""")
+@click.command(cli_util.override('data_safe.library_masking_format_summary_group.command_name', 'library-masking-format-summary'), cls=CommandGroupWithAlias, help="""Summary of a library masking format.""")
@cli_util.help_option_group
-def audit_policy_group():
+def library_masking_format_summary_group():
pass
-@click.command(cli_util.override('data_safe.audit_trail_analytic_collection_group.command_name', 'audit-trail-analytic-collection'), cls=CommandGroupWithAlias, help="""Details of audit trail analytic summary.""")
+@click.command(cli_util.override('data_safe.subsetting_schema_relation_summary_group.command_name', 'subsetting-schema-relation-summary'), cls=CommandGroupWithAlias, help="""Summary of a relationship between tables in the subsetting for a subsetting policy.""")
@cli_util.help_option_group
-def audit_trail_analytic_collection_group():
+def subsetting_schema_relation_summary_group():
pass
-@click.command(cli_util.override('data_safe.masking_policy_group.command_name', 'masking-policy'), cls=CommandGroupWithAlias, help="""A masking policy defines the approach to mask data in a target database. It's basically a collection of columns to be masked, called masking columns, and the associated masking formats to be used to mask these columns. A masking policy can be used to mask multiple databases provided that they have the same schema design. For more information, see Masking Policies in the Oracle Data Safe documentation.""")
+@click.command(cli_util.override('data_safe.alert_summary_group.command_name', 'alert-summary'), cls=CommandGroupWithAlias, help="""Summary of a Data Safe Alert.""")
@cli_util.help_option_group
-def masking_policy_group():
+def alert_summary_group():
pass
-@click.command(cli_util.override('data_safe.target_alert_policy_association_group.command_name', 'target-alert-policy-association'), cls=CommandGroupWithAlias, help="""The association of the target database to an alert policy.""")
+@click.command(cli_util.override('data_safe.sensitive_types_export_group.command_name', 'sensitive-types-export'), cls=CommandGroupWithAlias, help="""The resource represents sensitive types to be exported in Data Safe.""")
@cli_util.help_option_group
-def target_alert_policy_association_group():
+def sensitive_types_export_group():
pass
-@click.command(cli_util.override('data_safe.sensitive_column_group.command_name', 'sensitive-column'), cls=CommandGroupWithAlias, help="""A sensitive column is a resource corresponding to a database column that is considered sensitive. It's a subresource of sensitive data model resource and is always associated with a sensitive data model. Note that referential relationships are also managed as part of sensitive columns.""")
+@click.command(cli_util.override('data_safe.data_safe_private_endpoint_group.command_name', 'data-safe-private-endpoint'), cls=CommandGroupWithAlias, help="""A Data Safe private endpoint that allows Data Safe to connect to databases in a customer's virtual cloud network (VCN).""")
@cli_util.help_option_group
-def sensitive_column_group():
+def data_safe_private_endpoint_group():
pass
-@click.command(cli_util.override('data_safe.sensitive_type_group_group.command_name', 'sensitive-type-group'), cls=CommandGroupWithAlias, help="""The details of the sensitive type group.""")
+@click.command(cli_util.override('data_safe.sql_firewall_allowed_sql_collection_group.command_name', 'sql-firewall-allowed-sql-collection'), cls=CommandGroupWithAlias, help="""Collection of SQL Firewall allowed SQL statements.""")
@cli_util.help_option_group
-def sensitive_type_group_group():
+def sql_firewall_allowed_sql_collection_group():
pass
-@click.command(cli_util.override('data_safe.audit_trail_group.command_name', 'audit-trail'), cls=CommandGroupWithAlias, help="""An audit trail represents the source of audit records that provides documentary evidence of the sequence of activities in the target database. Configuring audit trails in Data Safe, and enabling audit data collection on the audit trails copies the audit records from the target database's audit trail into the Data Safe repository.""")
+@click.command(cli_util.override('data_safe.discovery_job_result_group.command_name', 'discovery-job-result'), cls=CommandGroupWithAlias, help="""A discovery job result representing a sensitive column. It can be one of the following three types: NEW: A new sensitive column in the target database that is not in the sensitive data model. DELETED: A column that is present in the sensitive data model but has been deleted from the target database. MODIFIED: A column that is present in the target database as well as the sensitive data model but some of its attributes have been modified.""")
@cli_util.help_option_group
-def audit_trail_group():
+def discovery_job_result_group():
pass
-@click.command(cli_util.override('data_safe.audit_archive_retrieval_group.command_name', 'audit-archive-retrieval'), cls=CommandGroupWithAlias, help="""Represents the archive retrieve request for the audit data. You can retrieve audit data for a target database from the archive and store it online. For more information, see [Retrieve Audit Data for a Target Database from the Archive].""")
+@click.command(cli_util.override('data_safe.sql_firewall_policy_analytics_collection_group.command_name', 'sql-firewall-policy-analytics-collection'), cls=CommandGroupWithAlias, help="""SQL Firewall policy analytics collection.""")
@cli_util.help_option_group
-def audit_archive_retrieval_group():
+def sql_firewall_policy_analytics_collection_group():
pass
-@click.command(cli_util.override('data_safe.discovery_job_group.command_name', 'discovery-job'), cls=CommandGroupWithAlias, help="""A data discovery job. It helps track job's metadata as well as result statistics.""")
+@click.command(cli_util.override('data_safe.sql_firewall_policy_collection_group.command_name', 'sql-firewall-policy-collection'), cls=CommandGroupWithAlias, help="""Collection of SQL Firewall policy summary.""")
@cli_util.help_option_group
-def discovery_job_group():
+def sql_firewall_policy_collection_group():
pass
-@click.command(cli_util.override('data_safe.masking_object_collection_group.command_name', 'masking-object-collection'), cls=CommandGroupWithAlias, help="""A collection of masking object summary objects.""")
+@click.command(cli_util.override('data_safe.masking_schema_collection_group.command_name', 'masking-schema-collection'), cls=CommandGroupWithAlias, help="""A collection of masking schema summary objects.""")
@cli_util.help_option_group
-def masking_object_collection_group():
+def masking_schema_collection_group():
pass
-@click.command(cli_util.override('data_safe.unified_audit_policy_group.command_name', 'unified-audit-policy'), cls=CommandGroupWithAlias, help="""Resource represents a single unified audit policy on the target database.""")
+@click.command(cli_util.override('data_safe.report_definition_group.command_name', 'report-definition'), cls=CommandGroupWithAlias, help="""Description of report definition.""")
@cli_util.help_option_group
-def unified_audit_policy_group():
+def report_definition_group():
pass
-@click.command(cli_util.override('data_safe.database_security_config_group.command_name', 'database-security-config'), cls=CommandGroupWithAlias, help="""Database Security Configurations resource represents the target database configurations. Included in the Database Security Configurations are the SQL Firewall configurations such as the status of the firewall, the time that the firewall status was last updated, violation log auto purge settings, etc.""")
+@click.command(cli_util.override('data_safe.subsetting_error_summary_group.command_name', 'subsetting-error-summary'), cls=CommandGroupWithAlias, help="""Summary of a subsetting error. A Subsetting error is an error seen during the subsetting run.""")
@cli_util.help_option_group
-def database_security_config_group():
+def subsetting_error_summary_group():
pass
-@click.command(cli_util.override('data_safe.masking_column_group.command_name', 'masking-column'), cls=CommandGroupWithAlias, help="""A masking column is a resource corresponding to a database column that you want to mask. It's a subresource of masking policy resource and is always associated with a masking policy. Note that only parent columns are managed as masking columns. The child columns are automatically managed using the childColumns attribute.""")
+@click.command(cli_util.override('data_safe.security_policy_report_collection_group.command_name', 'security-policy-report-collection'), cls=CommandGroupWithAlias, help="""Collection of security policy report summary.""")
@cli_util.help_option_group
-def masking_column_group():
+def security_policy_report_collection_group():
pass
-@click.command(cli_util.override('data_safe.report_group.command_name', 'report'), cls=CommandGroupWithAlias, help="""The description of the report.""")
+@click.command(cli_util.override('data_safe.subsetting_policy_health_report_group.command_name', 'subsetting-policy-health-report'), cls=CommandGroupWithAlias, help="""The subsetting policy health report.""")
@cli_util.help_option_group
-def report_group():
+def subsetting_policy_health_report_group():
pass
-@click.command(cli_util.override('data_safe.security_policy_entry_state_collection_group.command_name', 'security-policy-entry-state-collection'), cls=CommandGroupWithAlias, help="""Collection of security policy entry state summary.""")
+@click.command(cli_util.override('data_safe.finding_group.command_name', 'finding'), cls=CommandGroupWithAlias, help="""The particular finding reported by the security assessment.""")
@cli_util.help_option_group
-def security_policy_entry_state_collection_group():
+def finding_group():
pass
-@click.command(cli_util.override('data_safe.unified_audit_policy_definition_group.command_name', 'unified-audit-policy-definition'), cls=CommandGroupWithAlias, help="""Resource represents a single unified audit policy definition.""")
+@click.command(cli_util.override('data_safe.target_database_group.command_name', 'target-database'), cls=CommandGroupWithAlias, help="""The details of the Data Safe target database.""")
@cli_util.help_option_group
-def unified_audit_policy_definition_group():
+def target_database_group():
pass
-@click.command(cli_util.override('data_safe.unified_audit_policy_collection_group.command_name', 'unified-audit-policy-collection'), cls=CommandGroupWithAlias, help="""Collection of audit policy summaries.""")
+@click.command(cli_util.override('data_safe.target_database_group_summary_group.command_name', 'target-database-group-summary'), cls=CommandGroupWithAlias, help="""Summary of the target database group used in list operations. Contains essential information without matching criteria.""")
@cli_util.help_option_group
-def unified_audit_policy_collection_group():
+def target_database_group_summary_group():
pass
-@click.command(cli_util.override('data_safe.crypto_assessment_group.command_name', 'crypto-assessment'), cls=CommandGroupWithAlias, help="""A crypto assessment that provides insight into database cryptographic posture. The assessment evaluates data and network encryption, certificates, key management, backups, and quantum-readiness settings for a target database.""")
+@click.command(cli_util.override('data_safe.security_policy_deployment_collection_group.command_name', 'security-policy-deployment-collection'), cls=CommandGroupWithAlias, help="""Collection of security policy deployment summary.""")
@cli_util.help_option_group
-def crypto_assessment_group():
+def security_policy_deployment_collection_group():
pass
-@click.command(cli_util.override('data_safe.report_summary_group.command_name', 'report-summary'), cls=CommandGroupWithAlias, help="""Description of report.""")
+@click.command(cli_util.override('data_safe.sensitive_types_export_collection_group.command_name', 'sensitive-types-export-collection'), cls=CommandGroupWithAlias, help="""A collection of sensitive types export summary objects.""")
@cli_util.help_option_group
-def report_summary_group():
+def sensitive_types_export_collection_group():
pass
-@click.command(cli_util.override('data_safe.target_alert_policy_association_summary_group.command_name', 'target-alert-policy-association-summary'), cls=CommandGroupWithAlias, help="""A summary of target to alert policy association.""")
+@click.command(cli_util.override('data_safe.audit_profile_analytic_collection_group.command_name', 'audit-profile-analytic-collection'), cls=CommandGroupWithAlias, help="""Details of audit profile analytic summary.""")
@cli_util.help_option_group
-def target_alert_policy_association_summary_group():
+def audit_profile_analytic_collection_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.peer_target_database_group.command_name', 'peer-target-database'), cls=CommandGroupWithAlias, help="""The details of the peer target database in Data Safe.""")
+@cli_util.help_option_group
+def peer_target_database_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.security_policy_deployment_group.command_name', 'security-policy-deployment'), cls=CommandGroupWithAlias, help="""The resource represents the state of the deployment of a security policy on a target.""")
+@cli_util.help_option_group
+def security_policy_deployment_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.subsetted_object_summary_group.command_name', 'subsetted-object-summary'), cls=CommandGroupWithAlias, help="""Summary of a subsetted object. A subsetted object is a database table subsetted by a data subsetting request""")
+@cli_util.help_option_group
+def subsetted_object_summary_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.audit_event_summary_group.command_name', 'audit-event-summary'), cls=CommandGroupWithAlias, help="""The resource represents the audit events collected from the target database by Oracle Data Safe.""")
+@cli_util.help_option_group
+def audit_event_summary_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.sql_firewall_allowed_sql_group.command_name', 'sql-firewall-allowed-sql'), cls=CommandGroupWithAlias, help="""The resource represents a SQL Firewall allowed SQL in Data Safe.""")
+@cli_util.help_option_group
+def sql_firewall_allowed_sql_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.sql_collection_group.command_name', 'sql-collection'), cls=CommandGroupWithAlias, help="""The resource represents SQL collection for a specific database user in a target. SqlCollection encapsulates the SQL commands issued in the user\u2019s database sessions, and its execution context.""")
+@cli_util.help_option_group
+def sql_collection_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.alert_group.command_name', 'alert'), cls=CommandGroupWithAlias, help="""The details of a Data Safe Alert, that shows alerts generated by a Data Safe feature.""")
+@cli_util.help_option_group
+def alert_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.masking_error_summary_group.command_name', 'masking-error-summary'), cls=CommandGroupWithAlias, help="""Summary of a masking error. A Masking error is an error seen during the masking run.""")
+@cli_util.help_option_group
+def masking_error_summary_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.masking_policy_health_report_group.command_name', 'masking-policy-health-report'), cls=CommandGroupWithAlias, help="""The masking policy health report.""")
+@cli_util.help_option_group
+def masking_policy_health_report_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.role_grant_path_collection_group.command_name', 'role-grant-path-collection'), cls=CommandGroupWithAlias, help="""A collection of role grant path summary objects.""")
+@cli_util.help_option_group
+def role_grant_path_collection_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.masking_policy_referential_relation_summary_group.command_name', 'masking-policy-referential-relation-summary'), cls=CommandGroupWithAlias, help="""A referential relation is a resource corresponding to database columns. It is always associated with a masking policy.""")
+@cli_util.help_option_group
+def masking_policy_referential_relation_summary_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.security_policy_entry_state_group.command_name', 'security-policy-entry-state'), cls=CommandGroupWithAlias, help="""The resource represents the state of a specific entry type deployment on a target.""")
+@cli_util.help_option_group
+def security_policy_entry_state_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.database_table_access_entry_collection_group.command_name', 'database-table-access-entry-collection'), cls=CommandGroupWithAlias, help="""A collection of database table access summary objects.""")
+@cli_util.help_option_group
+def database_table_access_entry_collection_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.work_request_log_entry_group.command_name', 'work-request-log-entry'), cls=CommandGroupWithAlias, help="""A log entry related to a work request.""")
+@cli_util.help_option_group
+def work_request_log_entry_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.registration_policy_summary_group.command_name', 'registration-policy-summary'), cls=CommandGroupWithAlias, help="""A summary of a registration policy. This object contains key information about a registration policy, including its ID, compartment ID, display name, and lifecycle state.""")
+@cli_util.help_option_group
+def registration_policy_summary_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.target_alert_policy_association_group.command_name', 'target-alert-policy-association'), cls=CommandGroupWithAlias, help="""The association of the target database to an alert policy.""")
+@cli_util.help_option_group
+def target_alert_policy_association_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.sensitive_column_group.command_name', 'sensitive-column'), cls=CommandGroupWithAlias, help="""A sensitive column is a resource corresponding to a database column that is considered sensitive. It's a subresource of sensitive data model resource and is always associated with a sensitive data model. Note that referential relationships are also managed as part of sensitive columns.""")
+@cli_util.help_option_group
+def sensitive_column_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.sensitive_type_group_group.command_name', 'sensitive-type-group'), cls=CommandGroupWithAlias, help="""The details of the sensitive type group.""")
+@cli_util.help_option_group
+def sensitive_type_group_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.audit_trail_group.command_name', 'audit-trail'), cls=CommandGroupWithAlias, help="""An audit trail represents the source of audit records that provides documentary evidence of the sequence of activities in the target database. Configuring audit trails in Data Safe, and enabling audit data collection on the audit trails copies the audit records from the target database's audit trail into the Data Safe repository.""")
+@cli_util.help_option_group
+def audit_trail_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.unified_audit_policy_definition_group.command_name', 'unified-audit-policy-definition'), cls=CommandGroupWithAlias, help="""Resource represents a single unified audit policy definition.""")
+@cli_util.help_option_group
+def unified_audit_policy_definition_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.unified_audit_policy_collection_group.command_name', 'unified-audit-policy-collection'), cls=CommandGroupWithAlias, help="""Collection of audit policy summaries.""")
+@cli_util.help_option_group
+def unified_audit_policy_collection_group():
+ pass
+
+
+@click.command(cli_util.override('data_safe.crypto_assessment_group.command_name', 'crypto-assessment'), cls=CommandGroupWithAlias, help="""A crypto assessment that provides insight into database cryptographic posture. The assessment evaluates data and network encryption, certificates, key management, backups, and quantum-readiness settings for a target database.""")
+@cli_util.help_option_group
+def crypto_assessment_group():
pass
data_safe_root_group.add_command(masked_column_summary_group)
data_safe_root_group.add_command(sdm_masking_policy_difference_group)
data_safe_root_group.add_command(sensitive_type_group_summary_group)
-data_safe_root_group.add_command(security_policy_collection_group)
data_safe_root_group.add_command(security_policy_config_collection_group)
-data_safe_root_group.add_command(data_safe_configuration_group)
-data_safe_root_group.add_command(database_view_access_entry_group)
-data_safe_root_group.add_command(sensitive_type_group)
-data_safe_root_group.add_command(security_assessment_group)
+data_safe_root_group.add_command(subsetting_report_group)
data_safe_root_group.add_command(sensitive_data_model_sensitive_type_collection_group)
-data_safe_root_group.add_command(on_prem_connector_group)
data_safe_root_group.add_command(referential_relation_group)
-data_safe_root_group.add_command(sql_firewall_policy_group)
-data_safe_root_group.add_command(work_request_group)
data_safe_root_group.add_command(difference_column_group)
data_safe_root_group.add_command(security_policy_report_group)
data_safe_root_group.add_command(sql_firewall_violation_summary_group)
data_safe_root_group.add_command(database_security_config_collection_group)
data_safe_root_group.add_command(security_policy_config_group)
-data_safe_root_group.add_command(sql_collection_collection_group)
data_safe_root_group.add_command(work_request_error_group)
data_safe_root_group.add_command(target_database_group_group)
+data_safe_root_group.add_command(alert_policy_rule_group)
+data_safe_root_group.add_command(database_view_access_entry_collection_group)
+data_safe_root_group.add_command(security_policy_group)
+data_safe_root_group.add_command(registration_policy_group)
+data_safe_root_group.add_command(profile_group)
+data_safe_root_group.add_command(subsetting_schema_object_summary_group)
+data_safe_root_group.add_command(subsetting_policy_group)
+data_safe_root_group.add_command(audit_profile_group)
+data_safe_root_group.add_command(subsetting_rule_group)
+data_safe_root_group.add_command(sensitive_data_model_group)
+data_safe_root_group.add_command(unified_audit_policy_definition_collection_group)
+data_safe_root_group.add_command(sql_collection_analytics_collection_group)
+data_safe_root_group.add_command(audit_policy_analytic_collection_group)
+data_safe_root_group.add_command(library_masking_format_group)
+data_safe_root_group.add_command(masking_report_group)
+data_safe_root_group.add_command(alert_policy_group)
+data_safe_root_group.add_command(user_assessment_group)
+data_safe_root_group.add_command(sensitive_schema_collection_group)
+data_safe_root_group.add_command(audit_policy_collection_group)
+data_safe_root_group.add_command(table_estimate_summary_group)
+data_safe_root_group.add_command(sensitive_object_collection_group)
+data_safe_root_group.add_command(sql_firewall_allowed_sql_analytics_collection_group)
+data_safe_root_group.add_command(database_table_access_entry_group)
+data_safe_root_group.add_command(sql_collection_log_insights_collection_group)
+data_safe_root_group.add_command(audit_policy_group)
+data_safe_root_group.add_command(audit_trail_analytic_collection_group)
+data_safe_root_group.add_command(masking_policy_group)
+data_safe_root_group.add_command(audit_archive_retrieval_group)
+data_safe_root_group.add_command(discovery_job_group)
+data_safe_root_group.add_command(masking_object_collection_group)
+data_safe_root_group.add_command(unified_audit_policy_group)
+data_safe_root_group.add_command(database_security_config_group)
+data_safe_root_group.add_command(masking_column_group)
+data_safe_root_group.add_command(report_group)
+data_safe_root_group.add_command(security_policy_entry_state_collection_group)
+data_safe_root_group.add_command(report_summary_group)
+data_safe_root_group.add_command(target_alert_policy_association_summary_group)
+data_safe_root_group.add_command(security_policy_collection_group)
+data_safe_root_group.add_command(data_safe_configuration_group)
+data_safe_root_group.add_command(subsetting_rule_processing_chain_object_summary_group)
+data_safe_root_group.add_command(database_view_access_entry_group)
+data_safe_root_group.add_command(sensitive_type_group)
+data_safe_root_group.add_command(security_assessment_group)
+data_safe_root_group.add_command(on_prem_connector_group)
+data_safe_root_group.add_command(sql_firewall_policy_group)
+data_safe_root_group.add_command(subsetting_schema_collection_group)
+data_safe_root_group.add_command(work_request_group)
+data_safe_root_group.add_command(subsetting_schema_relation_group)
+data_safe_root_group.add_command(sql_collection_collection_group)
data_safe_root_group.add_command(attribute_set_group)
data_safe_root_group.add_command(library_masking_format_summary_group)
-data_safe_root_group.add_command(alert_policy_rule_group)
+data_safe_root_group.add_command(subsetting_schema_relation_summary_group)
data_safe_root_group.add_command(alert_summary_group)
-data_safe_root_group.add_command(database_view_access_entry_collection_group)
data_safe_root_group.add_command(sensitive_types_export_group)
data_safe_root_group.add_command(data_safe_private_endpoint_group)
-data_safe_root_group.add_command(security_policy_group)
data_safe_root_group.add_command(sql_firewall_allowed_sql_collection_group)
data_safe_root_group.add_command(discovery_job_result_group)
data_safe_root_group.add_command(sql_firewall_policy_analytics_collection_group)
data_safe_root_group.add_command(sql_firewall_policy_collection_group)
data_safe_root_group.add_command(masking_schema_collection_group)
data_safe_root_group.add_command(report_definition_group)
-data_safe_root_group.add_command(profile_group)
+data_safe_root_group.add_command(subsetting_error_summary_group)
data_safe_root_group.add_command(security_policy_report_collection_group)
+data_safe_root_group.add_command(subsetting_policy_health_report_group)
data_safe_root_group.add_command(finding_group)
-data_safe_root_group.add_command(audit_profile_group)
data_safe_root_group.add_command(target_database_group)
data_safe_root_group.add_command(target_database_group_summary_group)
-data_safe_root_group.add_command(sensitive_data_model_group)
data_safe_root_group.add_command(security_policy_deployment_collection_group)
data_safe_root_group.add_command(sensitive_types_export_collection_group)
-data_safe_root_group.add_command(unified_audit_policy_definition_collection_group)
data_safe_root_group.add_command(audit_profile_analytic_collection_group)
-data_safe_root_group.add_command(sql_collection_analytics_collection_group)
data_safe_root_group.add_command(peer_target_database_group)
data_safe_root_group.add_command(security_policy_deployment_group)
-data_safe_root_group.add_command(audit_policy_analytic_collection_group)
+data_safe_root_group.add_command(subsetted_object_summary_group)
data_safe_root_group.add_command(audit_event_summary_group)
-data_safe_root_group.add_command(library_masking_format_group)
-data_safe_root_group.add_command(masking_report_group)
data_safe_root_group.add_command(sql_firewall_allowed_sql_group)
-data_safe_root_group.add_command(alert_policy_group)
-data_safe_root_group.add_command(user_assessment_group)
data_safe_root_group.add_command(sql_collection_group)
data_safe_root_group.add_command(alert_group)
-data_safe_root_group.add_command(sensitive_schema_collection_group)
-data_safe_root_group.add_command(audit_policy_collection_group)
data_safe_root_group.add_command(masking_error_summary_group)
data_safe_root_group.add_command(masking_policy_health_report_group)
data_safe_root_group.add_command(role_grant_path_collection_group)
-data_safe_root_group.add_command(sensitive_object_collection_group)
data_safe_root_group.add_command(masking_policy_referential_relation_summary_group)
-data_safe_root_group.add_command(sql_firewall_allowed_sql_analytics_collection_group)
-data_safe_root_group.add_command(database_table_access_entry_group)
-data_safe_root_group.add_command(sql_collection_log_insights_collection_group)
data_safe_root_group.add_command(security_policy_entry_state_group)
data_safe_root_group.add_command(database_table_access_entry_collection_group)
data_safe_root_group.add_command(work_request_log_entry_group)
-data_safe_root_group.add_command(audit_policy_group)
-data_safe_root_group.add_command(audit_trail_analytic_collection_group)
-data_safe_root_group.add_command(masking_policy_group)
+data_safe_root_group.add_command(registration_policy_summary_group)
data_safe_root_group.add_command(target_alert_policy_association_group)
data_safe_root_group.add_command(sensitive_column_group)
data_safe_root_group.add_command(sensitive_type_group_group)
data_safe_root_group.add_command(audit_trail_group)
-data_safe_root_group.add_command(audit_archive_retrieval_group)
-data_safe_root_group.add_command(discovery_job_group)
-data_safe_root_group.add_command(masking_object_collection_group)
-data_safe_root_group.add_command(unified_audit_policy_group)
-data_safe_root_group.add_command(database_security_config_group)
-data_safe_root_group.add_command(masking_column_group)
-data_safe_root_group.add_command(report_group)
-data_safe_root_group.add_command(security_policy_entry_state_collection_group)
data_safe_root_group.add_command(unified_audit_policy_definition_group)
data_safe_root_group.add_command(unified_audit_policy_collection_group)
data_safe_root_group.add_command(crypto_assessment_group)
-data_safe_root_group.add_command(report_summary_group)
-data_safe_root_group.add_command(target_alert_policy_association_summary_group)
@target_database_group.command(name=cli_util.override('data_safe.activate_target_database.command_name', 'activate'), help=u"""Reactivates a previously deactivated Data Safe target database. \n[Command Reference](activateTargetDatabase)""")
@@ -2355,6 +2453,67 @@ def change_on_prem_connector_compartment(ctx, from_json, on_prem_connector_id, c
cli_util.render_response(result, ctx)
+@registration_policy_group.command(name=cli_util.override('data_safe.change_registration_policy_compartment.command_name', 'change-compartment'), help=u"""Moves the registration policy to the specified compartment. \n[Command Reference](changeRegistrationPolicyCompartment)""")
+@cli_util.option('--registration-policy-id', required=True, help=u"""The OCID of the registration policy to be used for identification""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment to which the registration policy 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 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={}, output_type={'module': 'data_safe', 'class': 'RegistrationPolicy'})
+@cli_util.wrap_exceptions
+def change_registration_policy_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, registration_policy_id, compartment_id, if_match):
+
+ if isinstance(registration_policy_id, six.string_types) and len(registration_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --registration-policy-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_safe', 'data_safe', ctx)
+ result = client.change_registration_policy_compartment(
+ registration_policy_id=registration_policy_id,
+ change_registration_policy_compartment_details=_details,
+ **kwargs
+ )
+ if wait_for_state:
+
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
+ try:
+ wait_period_kwargs = {}
+ if max_wait_seconds is not None:
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
+ if wait_interval_seconds is not None:
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
+ if 'opc-work-request-id' not in result.headers:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
+ cli_util.render_response(result, ctx)
+ return
+
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
+ # If we fail, we should show an error, but we should still provide the information to the customer
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ sys.exit(2)
+ except Exception:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ raise
+ else:
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+
+
@report_group.command(name=cli_util.override('data_safe.change_report_compartment.command_name', 'change-compartment'), help=u"""Moves a resource into a different compartment. When provided, If-Match is checked against ETag values of the resource. \n[Command Reference](changeReportCompartment)""")
@cli_util.option('--report-id', required=True, help=u"""Unique report identifier""")
@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment into which the resource should be moved.""")
@@ -3043,6 +3202,68 @@ def change_sql_firewall_policy_compartment(ctx, from_json, wait_for_state, max_w
cli_util.render_response(result, ctx)
+@subsetting_policy_group.command(name=cli_util.override('data_safe.change_subsetting_policy_compartment.command_name', 'change-compartment'), help=u"""Moves the specified subsetting policy and its dependent resources into a different compartment. \n[Command Reference](changeSubsettingPolicyCompartment)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment where the subsetting policy 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 will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
+@cli_util.wrap_exceptions
+def change_subsetting_policy_compartment(ctx, from_json, subsetting_policy_id, compartment_id, if_match):
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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_safe', 'data_safe', ctx)
+ result = client.change_subsetting_policy_compartment(
+ subsetting_policy_id=subsetting_policy_id,
+ change_subsetting_policy_compartment_details=_details,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_policy_health_report_group.command(name=cli_util.override('data_safe.change_subsetting_policy_health_report_compartment.command_name', 'change-compartment'), help=u"""Moves the specified subsetting policy health report and its dependent resources into a different compartment. \n[Command Reference](changeSubsettingPolicyHealthReportCompartment)""")
+@cli_util.option('--subsetting-policy-health-report-id', required=True, help=u"""The OCID of the subsetting health report.""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment where the subsetting policy 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 will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
+@cli_util.wrap_exceptions
+def change_subsetting_policy_health_report_compartment(ctx, from_json, subsetting_policy_health_report_id, compartment_id, if_match):
+
+ if isinstance(subsetting_policy_health_report_id, six.string_types) and len(subsetting_policy_health_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-health-report-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_safe', 'data_safe', ctx)
+ result = client.change_subsetting_policy_health_report_compartment(
+ subsetting_policy_health_report_id=subsetting_policy_health_report_id,
+ change_subsetting_policy_health_report_compartment_details=_details,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
@target_alert_policy_association_group.command(name=cli_util.override('data_safe.change_target_alert_policy_association_compartment.command_name', 'change-compartment'), help=u"""Moves the specified target-alert policy Association into a different compartment. \n[Command Reference](changeTargetAlertPolicyAssociationCompartment)""")
@cli_util.option('--target-alert-policy-association-id', required=True, help=u"""The OCID of the target-alert policy association.""")
@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment to move the target-alert policy association to.""")
@@ -5062,6 +5283,95 @@ def create_referential_relation(ctx, from_json, wait_for_state, max_wait_seconds
cli_util.render_response(result, ctx)
+@registration_policy_group.command(name=cli_util.override('data_safe.create_registration_policy.command_name', 'create'), help=u"""Creates a new OptIn/Registration Policy \n[Command Reference](createRegistrationPolicy)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment where the registration policy will be created.""")
+@cli_util.option('--resource-id', required=True, help=u"""The OCID of the resource used in the registration policy.""")
+@cli_util.option('--features', required=True, type=custom_types.CliCaseInsensitiveChoice(["ASSESSMENT", "AUDIT_COLLECTION", "AUDIT_SETTING", "DATA_DISCOVERY", "MASKING", "SQL_FIREWALL", "ALL"]), help=u"""The Data Safe features granted to the databases registering under the registration policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the registration policy.""")
+@cli_util.option('--description', help=u"""A description of the registration policy.""")
+@cli_util.option('--can-override-features', type=click.BOOL, help=u"""Indicates whether features will be overridden for all targets.""")
+@cli_util.option('--connection-option', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--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 modify the configuration item details and is used only to perform validation on the submitted data.""")
+@cli_util.option('--x-cluster-id', help=u"""Identifier of the cluster of the CDB associated to the registration policy being created.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'connection-option': {'module': 'data_safe', 'class': 'PolicyConnectionOption'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'connection-option': {'module': 'data_safe', 'class': 'PolicyConnectionOption'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'RegistrationPolicy'})
+@cli_util.wrap_exceptions
+def create_registration_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, resource_id, features, display_name, description, can_override_features, connection_option, freeform_tags, defined_tags, opc_dry_run, x_cluster_id):
+
+ kwargs = {}
+ if opc_dry_run is not None:
+ kwargs['opc_dry_run'] = opc_dry_run
+ if x_cluster_id is not None:
+ kwargs['x_cluster_id'] = x_cluster_id
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+ _details['compartmentId'] = compartment_id
+ _details['resourceId'] = resource_id
+ _details['features'] = cli_util.parse_json_parameter("features", features)
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if can_override_features is not None:
+ _details['canOverrideFeatures'] = can_override_features
+
+ if connection_option is not None:
+ _details['connectionOption'] = cli_util.parse_json_parameter("connection_option", connection_option)
+
+ 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_safe', 'data_safe', ctx)
+ result = client.create_registration_policy(
+ create_registration_policy_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)
+
+
@report_definition_group.command(name=cli_util.override('data_safe.create_report_definition.command_name', 'create'), help=u"""Creates a new report definition with parameters specified in the body. The report definition is stored in the specified compartment. \n[Command Reference](createReportDefinition)""")
@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment containing the report definition.""")
@cli_util.option('--display-name', required=True, help=u"""Specifies the name of the report definition.""")
@@ -6249,14 +6559,25 @@ def create_sql_collection(ctx, from_json, wait_for_state, max_wait_seconds, wait
cli_util.render_response(result, ctx)
-@target_alert_policy_association_group.command(name=cli_util.override('data_safe.create_target_alert_policy_association.command_name', 'create'), help=u"""Creates a new target-alert policy association to track a alert policy applied on target. \n[Command Reference](createTargetAlertPolicyAssociation)""")
-@cli_util.option('--policy-id', required=True, help=u"""The OCID of the alert policy.""")
-@cli_util.option('--target-id', required=True, help=u"""The OCID of the target or target database group.""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment where the target-alert policy association is created.""")
-@cli_util.option('--is-enabled', required=True, type=click.BOOL, help=u"""Indicates if the target-alert policy association is enabled or disabled by user.""")
-@cli_util.option('--display-name', help=u"""The display name of the target-alert policy association.""")
-@cli_util.option('--description', help=u"""Describes the target-alert policy association.""")
-@cli_util.option('--target-type', help=u"""The resource type that is represented by the alert policy association. Default is considered as TARGET_DATABASE.""")
+@subsetting_policy_group.command(name=cli_util.override('data_safe.create_subsetting_policy.command_name', 'create'), help=u"""Creates a new subsetting policy and associates it with a sensitive data model or a target database.
+
+To use a sensitive data model as the source of subsetting schemas, set the schemaSource attribute to SENSITIVE_DATA_MODEL and provide the sensitiveDataModelId attribute. In this case, the target database associated with the sensitive data model is used for subsetting rules validations.
+
+You can also create a subsetting policy without using a sensitive data model. In this case, you need to associate your subsetting policy with a target database by setting the schemaSource attribute to TARGET and providing the targetId attribute. The specified target database is used for subsetting rules validations.
+
+After creating a subsetting policy, you can use the CreateSubsettingRule operation to manually add subsetting rules to the policy. \n[Command Reference](createSubsettingPolicy)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment where the subsetting policy should be created""")
+@cli_util.option('--schema-source', 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"""The display name of the subsetting policy. The name does not have to be unique, and it's changeable""")
+@cli_util.option('--description', help=u"""The description of the subsetting policy""")
+@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a subsetting operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, subsetting disables redo logging and flashback logging to purge any original data from logs. However, in certain circumstances when you only want to test subsetting, rollback changes, and retry subsetting, you could enable logging and use a flashback database to retrieve the original data after it has been subsetted""")
+@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The subsetting process gathers statistics on subsetted database tables after subsetting completes""")
+@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data subsetting. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve subsetting performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism""")
+@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data subsetting. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after subsetting completes""")
+@cli_util.option('--unrelated-tables-action', help=u"""Strategy to be applied for tables which are not impacted by any of the subsetting rules""")
+@cli_util.option('--pre-subsetting-script', help=u"""A pre-subsetting script, which can contain SQL and PL/SQL statements. It's executed before the subsetting process. It's usually used to perform any preparation or prerequisite work before subsetting data.""")
+@cli_util.option('--post-subsetting-script', help=u"""A post-subsetting script, which can contain SQL and PL/SQL statements. It's executed after the subsetting process. It's usually used to perform additional transformation or cleanup work after subsetting data.""")
+@cli_util.option('--masking-policy-id', help=u"""The OCID of the masking policy to associate with this subsetting policy""")
@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)
@@ -6264,21 +6585,19 @@ def create_sql_collection(ctx, from_json, wait_for_state, max_wait_seconds, wait
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'schema-source': {'module': 'data_safe', 'class': 'CreateSchemaSourceDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetAlertPolicyAssociation'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-source': {'module': 'data_safe', 'class': 'CreateSchemaSourceDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'SubsettingPolicy'})
@cli_util.wrap_exceptions
-def create_target_alert_policy_association(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, policy_id, target_id, compartment_id, is_enabled, display_name, description, target_type, freeform_tags, defined_tags):
+def create_subsetting_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, schema_source, display_name, description, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, unrelated_tables_action, pre_subsetting_script, post_subsetting_script, masking_policy_id, freeform_tags, defined_tags):
kwargs = {}
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['policyId'] = policy_id
- _details['targetId'] = target_id
_details['compartmentId'] = compartment_id
- _details['isEnabled'] = is_enabled
+ _details['schemaSource'] = cli_util.parse_json_parameter("schema_source", schema_source)
if display_name is not None:
_details['displayName'] = display_name
@@ -6286,8 +6605,29 @@ def create_target_alert_policy_association(ctx, from_json, wait_for_state, max_w
if description is not None:
_details['description'] = description
- if target_type is not None:
- _details['targetType'] = target_type
+ if is_redo_logging_enabled is not None:
+ _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
+
+ if is_refresh_stats_enabled is not None:
+ _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
+
+ if parallel_degree is not None:
+ _details['parallelDegree'] = parallel_degree
+
+ if recompile is not None:
+ _details['recompile'] = recompile
+
+ if unrelated_tables_action is not None:
+ _details['unrelatedTablesAction'] = unrelated_tables_action
+
+ if pre_subsetting_script is not None:
+ _details['preSubsettingScript'] = pre_subsetting_script
+
+ if post_subsetting_script is not None:
+ _details['postSubsettingScript'] = post_subsetting_script
+
+ if masking_policy_id is not None:
+ _details['maskingPolicyId'] = masking_policy_id
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -6296,8 +6636,8 @@ def create_target_alert_policy_association(ctx, from_json, wait_for_state, max_w
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.create_target_alert_policy_association(
- create_target_alert_policy_association_details=_details,
+ result = client.create_subsetting_policy(
+ create_subsetting_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -6330,17 +6670,25 @@ def create_target_alert_policy_association(ctx, from_json, wait_for_state, max_w
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.create_target_database.command_name', 'create'), help=u"""Registers the specified database with Data Safe and creates a Data Safe target database in the Data Safe Console. \n[Command Reference](createTargetDatabase)""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the Data Safe target database.""")
-@cli_util.option('--database-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"""The display name of the target database in Data Safe. The name is modifiable and does not need to be unique.""")
-@cli_util.option('--description', help=u"""The description of the target database in Data Safe.""")
-@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--connection-option', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--peer-target-database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The details of the database to be registered as a peer target database.
+@subsetting_policy_group.command(name=cli_util.override('data_safe.create_subsetting_policy_create_schema_source_from_sdm_details.command_name', 'create-subsetting-policy-create-schema-source-from-sdm-details'), help=u"""Creates a new subsetting policy and associates it with a sensitive data model or a target database.
-This option is a JSON list with items of type CreatePeerTargetDatabaseDetails. For documentation on CreatePeerTargetDatabaseDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/CreatePeerTargetDatabaseDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+To use a sensitive data model as the source of subsetting schemas, set the schemaSource attribute to SENSITIVE_DATA_MODEL and provide the sensitiveDataModelId attribute. In this case, the target database associated with the sensitive data model is used for subsetting rules validations.
+
+You can also create a subsetting policy without using a sensitive data model. In this case, you need to associate your subsetting policy with a target database by setting the schemaSource attribute to TARGET and providing the targetId attribute. The specified target database is used for subsetting rules validations.
+
+After creating a subsetting policy, you can use the CreateSubsettingRule operation to manually add subsetting rules to the policy. \n[Command Reference](createSubsettingPolicy)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment where the subsetting policy should be created""")
+@cli_util.option('--schema-source-sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model that's used as the source of subsetting schemas""")
+@cli_util.option('--display-name', help=u"""The display name of the subsetting policy. The name does not have to be unique, and it's changeable""")
+@cli_util.option('--description', help=u"""The description of the subsetting policy""")
+@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a subsetting operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, subsetting disables redo logging and flashback logging to purge any original data from logs. However, in certain circumstances when you only want to test subsetting, rollback changes, and retry subsetting, you could enable logging and use a flashback database to retrieve the original data after it has been subsetted""")
+@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The subsetting process gathers statistics on subsetted database tables after subsetting completes""")
+@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data subsetting. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve subsetting performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism""")
+@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data subsetting. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after subsetting completes""")
+@cli_util.option('--unrelated-tables-action', help=u"""Strategy to be applied for tables which are not impacted by any of the subsetting rules""")
+@cli_util.option('--pre-subsetting-script', help=u"""A pre-subsetting script, which can contain SQL and PL/SQL statements. It's executed before the subsetting process. It's usually used to perform any preparation or prerequisite work before subsetting data.""")
+@cli_util.option('--post-subsetting-script', help=u"""A post-subsetting script, which can contain SQL and PL/SQL statements. It's executed after the subsetting process. It's usually used to perform additional transformation or cleanup work after subsetting data.""")
+@cli_util.option('--masking-policy-id', help=u"""The OCID of the masking policy to associate with this subsetting policy""")
@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)
@@ -6348,19 +6696,20 @@ def create_target_alert_policy_association(ctx, from_json, wait_for_state, max_w
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'SubsettingPolicy'})
@cli_util.wrap_exceptions
-def create_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, database_details, display_name, description, credentials, tls_config, connection_option, peer_target_database_details, freeform_tags, defined_tags):
+def create_subsetting_policy_create_schema_source_from_sdm_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, schema_source_sensitive_data_model_id, display_name, description, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, unrelated_tables_action, pre_subsetting_script, post_subsetting_script, masking_policy_id, freeform_tags, defined_tags):
kwargs = {}
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['schemaSource'] = {}
_details['compartmentId'] = compartment_id
- _details['databaseDetails'] = cli_util.parse_json_parameter("database_details", database_details)
+ _details['schemaSource']['sensitiveDataModelId'] = schema_source_sensitive_data_model_id
if display_name is not None:
_details['displayName'] = display_name
@@ -6368,17 +6717,29 @@ def create_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wai
if description is not None:
_details['description'] = description
- if credentials is not None:
- _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials)
+ if is_redo_logging_enabled is not None:
+ _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
- if tls_config is not None:
- _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+ if is_refresh_stats_enabled is not None:
+ _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
- if connection_option is not None:
- _details['connectionOption'] = cli_util.parse_json_parameter("connection_option", connection_option)
+ if parallel_degree is not None:
+ _details['parallelDegree'] = parallel_degree
- if peer_target_database_details is not None:
- _details['peerTargetDatabaseDetails'] = cli_util.parse_json_parameter("peer_target_database_details", peer_target_database_details)
+ if recompile is not None:
+ _details['recompile'] = recompile
+
+ if unrelated_tables_action is not None:
+ _details['unrelatedTablesAction'] = unrelated_tables_action
+
+ if pre_subsetting_script is not None:
+ _details['preSubsettingScript'] = pre_subsetting_script
+
+ if post_subsetting_script is not None:
+ _details['postSubsettingScript'] = post_subsetting_script
+
+ if masking_policy_id is not None:
+ _details['maskingPolicyId'] = masking_policy_id
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -6386,9 +6747,11 @@ def create_target_database(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)
+ _details['schemaSource']['schemaSource'] = 'SENSITIVE_DATA_MODEL'
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.create_target_database(
- create_target_database_details=_details,
+ result = client.create_subsetting_policy(
+ create_subsetting_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -6421,44 +6784,47 @@ def create_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wai
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.create_target_database_installed_database_details.command_name', 'create-target-database-installed-database-details'), help=u"""Registers the specified database with Data Safe and creates a Data Safe target database in the Data Safe Console. \n[Command Reference](createTargetDatabase)""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the Data Safe target database.""")
-@cli_util.option('--database-details-infrastructure-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""The infrastructure type the database is running on.""")
-@cli_util.option('--database-details-listener-port', required=True, type=click.INT, help=u"""The port number of the database listener.""")
-@cli_util.option('--database-details-service-name', required=True, help=u"""The service name of the database registered as target database.""")
-@cli_util.option('--display-name', help=u"""The display name of the target database in Data Safe. The name is modifiable and does not need to be unique.""")
-@cli_util.option('--description', help=u"""The description of the target database in Data Safe.""")
-@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--connection-option', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--peer-target-database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The details of the database to be registered as a peer target database.
+@subsetting_policy_group.command(name=cli_util.override('data_safe.create_subsetting_policy_create_schema_source_from_target_details.command_name', 'create-subsetting-policy-create-schema-source-from-target-details'), help=u"""Creates a new subsetting policy and associates it with a sensitive data model or a target database.
-This option is a JSON list with items of type CreatePeerTargetDatabaseDetails. For documentation on CreatePeerTargetDatabaseDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/CreatePeerTargetDatabaseDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+To use a sensitive data model as the source of subsetting schemas, set the schemaSource attribute to SENSITIVE_DATA_MODEL and provide the sensitiveDataModelId attribute. In this case, the target database associated with the sensitive data model is used for subsetting rules validations.
+
+You can also create a subsetting policy without using a sensitive data model. In this case, you need to associate your subsetting policy with a target database by setting the schemaSource attribute to TARGET and providing the targetId attribute. The specified target database is used for subsetting rules validations.
+
+After creating a subsetting policy, you can use the CreateSubsettingRule operation to manually add subsetting rules to the policy. \n[Command Reference](createSubsettingPolicy)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment where the subsetting policy should be created""")
+@cli_util.option('--schema-source-target-id', required=True, help=u"""The OCID of the target database that's used as the source of subsetting schemas""")
+@cli_util.option('--display-name', help=u"""The display name of the subsetting policy. The name does not have to be unique, and it's changeable""")
+@cli_util.option('--description', help=u"""The description of the subsetting policy""")
+@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a subsetting operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, subsetting disables redo logging and flashback logging to purge any original data from logs. However, in certain circumstances when you only want to test subsetting, rollback changes, and retry subsetting, you could enable logging and use a flashback database to retrieve the original data after it has been subsetted""")
+@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The subsetting process gathers statistics on subsetted database tables after subsetting completes""")
+@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data subsetting. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve subsetting performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism""")
+@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data subsetting. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after subsetting completes""")
+@cli_util.option('--unrelated-tables-action', help=u"""Strategy to be applied for tables which are not impacted by any of the subsetting rules""")
+@cli_util.option('--pre-subsetting-script', help=u"""A pre-subsetting script, which can contain SQL and PL/SQL statements. It's executed before the subsetting process. It's usually used to perform any preparation or prerequisite work before subsetting data.""")
+@cli_util.option('--post-subsetting-script', help=u"""A post-subsetting script, which can contain SQL and PL/SQL statements. It's executed after the subsetting process. It's usually used to perform additional transformation or cleanup work after subsetting data.""")
+@cli_util.option('--masking-policy-id', help=u"""The OCID of the masking policy to associate with this subsetting policy""")
@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('--database-details-instance-id', help=u"""The OCID of the compute instance on which the database is running.""")
-@cli_util.option('--database-details-ip-addresses', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database host IP Addresses. Fully qualified domain names can be used if connectionType is 'ONPREM_CONNECTOR'.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--schema-source-schemas-for-subsetting', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The schemas to be subsetted""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'database-details-ip-addresses': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'schema-source-schemas-for-subsetting': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'database-details-ip-addresses': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'schema-source-schemas-for-subsetting': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SubsettingPolicy'})
@cli_util.wrap_exceptions
-def create_target_database_installed_database_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, database_details_infrastructure_type, database_details_listener_port, database_details_service_name, display_name, description, credentials, tls_config, connection_option, peer_target_database_details, freeform_tags, defined_tags, database_details_instance_id, database_details_ip_addresses):
+def create_subsetting_policy_create_schema_source_from_target_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, schema_source_target_id, display_name, description, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, unrelated_tables_action, pre_subsetting_script, post_subsetting_script, masking_policy_id, freeform_tags, defined_tags, schema_source_schemas_for_subsetting):
kwargs = {}
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['databaseDetails'] = {}
+ _details['schemaSource'] = {}
_details['compartmentId'] = compartment_id
- _details['databaseDetails']['infrastructureType'] = database_details_infrastructure_type
- _details['databaseDetails']['listenerPort'] = database_details_listener_port
- _details['databaseDetails']['serviceName'] = database_details_service_name
+ _details['schemaSource']['targetId'] = schema_source_target_id
if display_name is not None:
_details['displayName'] = display_name
@@ -6466,17 +6832,29 @@ def create_target_database_installed_database_details(ctx, from_json, wait_for_s
if description is not None:
_details['description'] = description
- if credentials is not None:
- _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials)
+ if is_redo_logging_enabled is not None:
+ _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
- if tls_config is not None:
- _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+ if is_refresh_stats_enabled is not None:
+ _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
- if connection_option is not None:
- _details['connectionOption'] = cli_util.parse_json_parameter("connection_option", connection_option)
+ if parallel_degree is not None:
+ _details['parallelDegree'] = parallel_degree
- if peer_target_database_details is not None:
- _details['peerTargetDatabaseDetails'] = cli_util.parse_json_parameter("peer_target_database_details", peer_target_database_details)
+ if recompile is not None:
+ _details['recompile'] = recompile
+
+ if unrelated_tables_action is not None:
+ _details['unrelatedTablesAction'] = unrelated_tables_action
+
+ if pre_subsetting_script is not None:
+ _details['preSubsettingScript'] = pre_subsetting_script
+
+ if post_subsetting_script is not None:
+ _details['postSubsettingScript'] = post_subsetting_script
+
+ if masking_policy_id is not None:
+ _details['maskingPolicyId'] = masking_policy_id
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -6484,17 +6862,14 @@ def create_target_database_installed_database_details(ctx, from_json, wait_for_s
if defined_tags is not None:
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
- if database_details_instance_id is not None:
- _details['databaseDetails']['instanceId'] = database_details_instance_id
-
- if database_details_ip_addresses is not None:
- _details['databaseDetails']['ipAddresses'] = cli_util.parse_json_parameter("database_details_ip_addresses", database_details_ip_addresses)
+ if schema_source_schemas_for_subsetting is not None:
+ _details['schemaSource']['schemasForSubsetting'] = cli_util.parse_json_parameter("schema_source_schemas_for_subsetting", schema_source_schemas_for_subsetting)
- _details['databaseDetails']['databaseType'] = 'INSTALLED_DATABASE'
+ _details['schemaSource']['schemaSource'] = 'TARGET'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.create_target_database(
- create_target_database_details=_details,
+ result = client.create_subsetting_policy(
+ create_subsetting_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -6527,40 +6902,34 @@ def create_target_database_installed_database_details(ctx, from_json, wait_for_s
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.create_target_database_autonomous_database_details.command_name', 'create-target-database-autonomous-database-details'), help=u"""Registers the specified database with Data Safe and creates a Data Safe target database in the Data Safe Console. \n[Command Reference](createTargetDatabase)""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the Data Safe target database.""")
-@cli_util.option('--database-details-infrastructure-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""The infrastructure type the database is running on.""")
-@cli_util.option('--database-details-autonomous-database-id', required=True, help=u"""The OCID of the Autonomous Database registered as a target database in Data Safe.""")
-@cli_util.option('--display-name', help=u"""The display name of the target database in Data Safe. The name is modifiable and does not need to be unique.""")
-@cli_util.option('--description', help=u"""The description of the target database in Data Safe.""")
-@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--connection-option', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--peer-target-database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The details of the database to be registered as a peer target database.
-
-This option is a JSON list with items of type CreatePeerTargetDatabaseDetails. For documentation on CreatePeerTargetDatabaseDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/CreatePeerTargetDatabaseDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
-
-Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@subsetting_rule_group.command(name=cli_util.override('data_safe.create_subsetting_rule.command_name', 'create'), help=u"""Details to create a new subsetting rule \n[Command Reference](createSubsettingRule)""")
+@cli_util.option('--scope', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--subset-rule-entry', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the subset rule""")
+@cli_util.option('--description', help=u"""The description of the subset rule""")
+@cli_util.option('--rule-combination-mode', type=custom_types.CliCaseInsensitiveChoice(["UNION", "SERIAL"]), help=u"""Specifies how this rule combines with other rules. UNION evaluates this rule independently and adds matching rows to the result set. SERIAL applies this rule sequentially to filter rows selected by a compatible preceding rule.""")
+@cli_util.option('--related-tables-propagation', type=custom_types.CliCaseInsensitiveChoice(["ANCESTORS_AND_DESCENDANTS", "ANCESTORS", "DESCENDANTS", "NONE"]), help=u"""Strategy to be applied while propagating subsetting rule to related tables""")
+@cli_util.option('--peer-tables-action', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_ROWS", "SUBSET", "MAXIMUM_ROWS"]), help=u"""Strategy to be applied while processing peer tables""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'scope': {'module': 'data_safe', 'class': 'SubsetScope'}, 'subset-rule-entry': {'module': 'data_safe', 'class': 'SubsetRuleEntry'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'scope': {'module': 'data_safe', 'class': 'SubsetScope'}, 'subset-rule-entry': {'module': 'data_safe', 'class': 'SubsetRuleEntry'}})
@cli_util.wrap_exceptions
-def create_target_database_autonomous_database_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, database_details_infrastructure_type, database_details_autonomous_database_id, display_name, description, credentials, tls_config, connection_option, peer_target_database_details, freeform_tags, defined_tags):
+def create_subsetting_rule(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, scope, subset_rule_entry, subsetting_policy_id, display_name, description, rule_combination_mode, related_tables_propagation, peer_tables_action):
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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['databaseDetails'] = {}
- _details['compartmentId'] = compartment_id
- _details['databaseDetails']['infrastructureType'] = database_details_infrastructure_type
- _details['databaseDetails']['autonomousDatabaseId'] = database_details_autonomous_database_id
+ _details['scope'] = cli_util.parse_json_parameter("scope", scope)
+ _details['subsetRuleEntry'] = cli_util.parse_json_parameter("subset_rule_entry", subset_rule_entry)
if display_name is not None:
_details['displayName'] = display_name
@@ -6568,29 +6937,19 @@ def create_target_database_autonomous_database_details(ctx, from_json, wait_for_
if description is not None:
_details['description'] = description
- if credentials is not None:
- _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials)
-
- if tls_config is not None:
- _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
-
- if connection_option is not None:
- _details['connectionOption'] = cli_util.parse_json_parameter("connection_option", connection_option)
-
- if peer_target_database_details is not None:
- _details['peerTargetDatabaseDetails'] = cli_util.parse_json_parameter("peer_target_database_details", peer_target_database_details)
-
- if freeform_tags is not None:
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+ if rule_combination_mode is not None:
+ _details['ruleCombinationMode'] = rule_combination_mode
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if related_tables_propagation is not None:
+ _details['relatedTablesPropagation'] = related_tables_propagation
- _details['databaseDetails']['databaseType'] = 'AUTONOMOUS_DATABASE'
+ if peer_tables_action is not None:
+ _details['peerTablesAction'] = peer_tables_action
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.create_target_database(
- create_target_database_details=_details,
+ result = client.create_subsetting_rule(
+ subsetting_policy_id=subsetting_policy_id,
+ create_subsetting_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -6623,43 +6982,34 @@ def create_target_database_autonomous_database_details(ctx, from_json, wait_for_
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.create_target_database_database_cloud_service_details.command_name', 'create-target-database-database-cloud-service-details'), help=u"""Registers the specified database with Data Safe and creates a Data Safe target database in the Data Safe Console. \n[Command Reference](createTargetDatabase)""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the Data Safe target database.""")
-@cli_util.option('--database-details-infrastructure-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""The infrastructure type the database is running on.""")
-@cli_util.option('--display-name', help=u"""The display name of the target database in Data Safe. The name is modifiable and does not need to be unique.""")
-@cli_util.option('--description', help=u"""The description of the target database in Data Safe.""")
-@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--connection-option', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--peer-target-database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The details of the database to be registered as a peer target database.
-
-This option is a JSON list with items of type CreatePeerTargetDatabaseDetails. For documentation on CreatePeerTargetDatabaseDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/CreatePeerTargetDatabaseDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
-
-Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--database-details-vm-cluster-id', help=u"""The OCID of the VM cluster in which the database is running.""")
-@cli_util.option('--database-details-db-system-id', help=u"""The OCID of the cloud database registered as a target database in Data Safe.""")
-@cli_util.option('--database-details-pluggable-database-id', help=u"""The OCID of the pluggable database registered as a target database in Data Safe.""")
-@cli_util.option('--database-details-listener-port', type=click.INT, help=u"""The port number of the database listener.""")
-@cli_util.option('--database-details-service-name', help=u"""The database service name.""")
+@subsetting_rule_group.command(name=cli_util.override('data_safe.create_subsetting_rule_subset_scope_for_all_objects.command_name', 'create-subsetting-rule-subset-scope-for-all-objects'), help=u"""Details to create a new subsetting rule \n[Command Reference](createSubsettingRule)""")
+@cli_util.option('--subset-rule-entry', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the subset rule""")
+@cli_util.option('--description', help=u"""The description of the subset rule""")
+@cli_util.option('--rule-combination-mode', type=custom_types.CliCaseInsensitiveChoice(["UNION", "SERIAL"]), help=u"""Specifies how this rule combines with other rules. UNION evaluates this rule independently and adds matching rows to the result set. SERIAL applies this rule sequentially to filter rows selected by a compatible preceding rule.""")
+@cli_util.option('--related-tables-propagation', type=custom_types.CliCaseInsensitiveChoice(["ANCESTORS_AND_DESCENDANTS", "ANCESTORS", "DESCENDANTS", "NONE"]), help=u"""Strategy to be applied while propagating subsetting rule to related tables""")
+@cli_util.option('--peer-tables-action', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_ROWS", "SUBSET", "MAXIMUM_ROWS"]), help=u"""Strategy to be applied while processing peer tables""")
+@cli_util.option('--scope-schema-name', help=u"""The name of the schema containing the objects to be subsetted""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'subset-rule-entry': {'module': 'data_safe', 'class': 'SubsetRuleEntry'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'subset-rule-entry': {'module': 'data_safe', 'class': 'SubsetRuleEntry'}})
@cli_util.wrap_exceptions
-def create_target_database_database_cloud_service_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, database_details_infrastructure_type, display_name, description, credentials, tls_config, connection_option, peer_target_database_details, freeform_tags, defined_tags, database_details_vm_cluster_id, database_details_db_system_id, database_details_pluggable_database_id, database_details_listener_port, database_details_service_name):
+def create_subsetting_rule_subset_scope_for_all_objects(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subset_rule_entry, subsetting_policy_id, display_name, description, rule_combination_mode, related_tables_propagation, peer_tables_action, scope_schema_name):
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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['databaseDetails'] = {}
- _details['compartmentId'] = compartment_id
- _details['databaseDetails']['infrastructureType'] = database_details_infrastructure_type
+ _details['scope'] = {}
+ _details['subsetRuleEntry'] = cli_util.parse_json_parameter("subset_rule_entry", subset_rule_entry)
if display_name is not None:
_details['displayName'] = display_name
@@ -6667,44 +7017,24 @@ def create_target_database_database_cloud_service_details(ctx, from_json, wait_f
if description is not None:
_details['description'] = description
- if credentials is not None:
- _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials)
-
- if tls_config is not None:
- _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
-
- if connection_option is not None:
- _details['connectionOption'] = cli_util.parse_json_parameter("connection_option", connection_option)
-
- if peer_target_database_details is not None:
- _details['peerTargetDatabaseDetails'] = cli_util.parse_json_parameter("peer_target_database_details", peer_target_database_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 database_details_vm_cluster_id is not None:
- _details['databaseDetails']['vmClusterId'] = database_details_vm_cluster_id
+ if rule_combination_mode is not None:
+ _details['ruleCombinationMode'] = rule_combination_mode
- if database_details_db_system_id is not None:
- _details['databaseDetails']['dbSystemId'] = database_details_db_system_id
-
- if database_details_pluggable_database_id is not None:
- _details['databaseDetails']['pluggableDatabaseId'] = database_details_pluggable_database_id
+ if related_tables_propagation is not None:
+ _details['relatedTablesPropagation'] = related_tables_propagation
- if database_details_listener_port is not None:
- _details['databaseDetails']['listenerPort'] = database_details_listener_port
+ if peer_tables_action is not None:
+ _details['peerTablesAction'] = peer_tables_action
- if database_details_service_name is not None:
- _details['databaseDetails']['serviceName'] = database_details_service_name
+ if scope_schema_name is not None:
+ _details['scope']['schemaName'] = scope_schema_name
- _details['databaseDetails']['databaseType'] = 'DATABASE_CLOUD_SERVICE'
+ _details['scope']['scopeType'] = 'ALL'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.create_target_database(
- create_target_database_details=_details,
+ result = client.create_subsetting_rule(
+ subsetting_policy_id=subsetting_policy_id,
+ create_subsetting_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -6737,39 +7067,37 @@ def create_target_database_database_cloud_service_details(ctx, from_json, wait_f
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.create_target_database_private_endpoint.command_name', 'create-target-database-private-endpoint'), help=u"""Registers the specified database with Data Safe and creates a Data Safe target database in the Data Safe Console. \n[Command Reference](createTargetDatabase)""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the Data Safe target database.""")
-@cli_util.option('--database-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--connection-option-datasafe-private-endpoint-id', required=True, help=u"""The OCID of the Data Safe private endpoint.""")
-@cli_util.option('--display-name', help=u"""The display name of the target database in Data Safe. The name is modifiable and does not need to be unique.""")
-@cli_util.option('--description', help=u"""The description of the target database in Data Safe.""")
-@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--peer-target-database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The details of the database to be registered as a peer target database.
-
-This option is a JSON list with items of type CreatePeerTargetDatabaseDetails. For documentation on CreatePeerTargetDatabaseDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/CreatePeerTargetDatabaseDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
-
-Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@subsetting_rule_group.command(name=cli_util.override('data_safe.create_subsetting_rule_subset_scope_for_specific_objects.command_name', 'create-subsetting-rule-subset-scope-for-specific-objects'), help=u"""Details to create a new subsetting rule \n[Command Reference](createSubsettingRule)""")
+@cli_util.option('--subset-rule-entry', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--scope-schema-name', required=True, help=u"""The name of the schema containing the specific object to be subsetted""")
+@cli_util.option('--scope-object-name', required=True, help=u"""The name of the specific object (e.g., table) to be subsetted""")
+@cli_util.option('--display-name', help=u"""The display name of the subset rule""")
+@cli_util.option('--description', help=u"""The description of the subset rule""")
+@cli_util.option('--rule-combination-mode', type=custom_types.CliCaseInsensitiveChoice(["UNION", "SERIAL"]), help=u"""Specifies how this rule combines with other rules. UNION evaluates this rule independently and adds matching rows to the result set. SERIAL applies this rule sequentially to filter rows selected by a compatible preceding rule.""")
+@cli_util.option('--related-tables-propagation', type=custom_types.CliCaseInsensitiveChoice(["ANCESTORS_AND_DESCENDANTS", "ANCESTORS", "DESCENDANTS", "NONE"]), help=u"""Strategy to be applied while propagating subsetting rule to related tables""")
+@cli_util.option('--peer-tables-action', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_ROWS", "SUBSET", "MAXIMUM_ROWS"]), help=u"""Strategy to be applied while processing peer tables""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'subset-rule-entry': {'module': 'data_safe', 'class': 'SubsetRuleEntry'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'subset-rule-entry': {'module': 'data_safe', 'class': 'SubsetRuleEntry'}})
@cli_util.wrap_exceptions
-def create_target_database_private_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, database_details, connection_option_datasafe_private_endpoint_id, display_name, description, credentials, tls_config, peer_target_database_details, freeform_tags, defined_tags):
+def create_subsetting_rule_subset_scope_for_specific_objects(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subset_rule_entry, subsetting_policy_id, scope_schema_name, scope_object_name, display_name, description, rule_combination_mode, related_tables_propagation, peer_tables_action):
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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['connectionOption'] = {}
- _details['compartmentId'] = compartment_id
- _details['databaseDetails'] = cli_util.parse_json_parameter("database_details", database_details)
- _details['connectionOption']['datasafePrivateEndpointId'] = connection_option_datasafe_private_endpoint_id
+ _details['scope'] = {}
+ _details['subsetRuleEntry'] = cli_util.parse_json_parameter("subset_rule_entry", subset_rule_entry)
+ _details['scope']['schemaName'] = scope_schema_name
+ _details['scope']['objectName'] = scope_object_name
if display_name is not None:
_details['displayName'] = display_name
@@ -6777,26 +7105,21 @@ def create_target_database_private_endpoint(ctx, from_json, wait_for_state, max_
if description is not None:
_details['description'] = description
- if credentials is not None:
- _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials)
-
- if tls_config is not None:
- _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
-
- if peer_target_database_details is not None:
- _details['peerTargetDatabaseDetails'] = cli_util.parse_json_parameter("peer_target_database_details", peer_target_database_details)
+ if rule_combination_mode is not None:
+ _details['ruleCombinationMode'] = rule_combination_mode
- if freeform_tags is not None:
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+ if related_tables_propagation is not None:
+ _details['relatedTablesPropagation'] = related_tables_propagation
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if peer_tables_action is not None:
+ _details['peerTablesAction'] = peer_tables_action
- _details['connectionOption']['connectionType'] = 'PRIVATE_ENDPOINT'
+ _details['scope']['scopeType'] = 'SPECIFIC'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.create_target_database(
- create_target_database_details=_details,
+ result = client.create_subsetting_rule(
+ subsetting_policy_id=subsetting_policy_id,
+ create_subsetting_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -6829,39 +7152,35 @@ def create_target_database_private_endpoint(ctx, from_json, wait_for_state, max_
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.create_target_database_on_premise_connector.command_name', 'create-target-database-on-premise-connector'), help=u"""Registers the specified database with Data Safe and creates a Data Safe target database in the Data Safe Console. \n[Command Reference](createTargetDatabase)""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the Data Safe target database.""")
-@cli_util.option('--database-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--connection-option-on-prem-connector-id', required=True, help=u"""The OCID of the on-premises connector.""")
-@cli_util.option('--display-name', help=u"""The display name of the target database in Data Safe. The name is modifiable and does not need to be unique.""")
-@cli_util.option('--description', help=u"""The description of the target database in Data Safe.""")
-@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--peer-target-database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The details of the database to be registered as a peer target database.
-
-This option is a JSON list with items of type CreatePeerTargetDatabaseDetails. For documentation on CreatePeerTargetDatabaseDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/CreatePeerTargetDatabaseDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
-
-Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@subsetting_rule_group.command(name=cli_util.override('data_safe.create_subsetting_rule_partition_subset_rule_entry.command_name', 'create-subsetting-rule-partition-subset-rule-entry'), help=u"""Details to create a new subsetting rule \n[Command Reference](createSubsettingRule)""")
+@cli_util.option('--scope', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the subset rule""")
+@cli_util.option('--description', help=u"""The description of the subset rule""")
+@cli_util.option('--rule-combination-mode', type=custom_types.CliCaseInsensitiveChoice(["UNION", "SERIAL"]), help=u"""Specifies how this rule combines with other rules. UNION evaluates this rule independently and adds matching rows to the result set. SERIAL applies this rule sequentially to filter rows selected by a compatible preceding rule.""")
+@cli_util.option('--related-tables-propagation', type=custom_types.CliCaseInsensitiveChoice(["ANCESTORS_AND_DESCENDANTS", "ANCESTORS", "DESCENDANTS", "NONE"]), help=u"""Strategy to be applied while propagating subsetting rule to related tables""")
+@cli_util.option('--peer-tables-action', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_ROWS", "SUBSET", "MAXIMUM_ROWS"]), help=u"""Strategy to be applied while processing peer tables""")
+@cli_util.option('--subset-rule-entry-partitions-list', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A list of partition names which are to be part of the subset data""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--subset-rule-entry-sub-partitions-list', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A list of sub-partition names which are to be part of the subset data. The sub-partition names should have the partition name also, separated by a dot""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'scope': {'module': 'data_safe', 'class': 'SubsetScope'}, 'subset-rule-entry-partitions-list': {'module': 'data_safe', 'class': 'list[string]'}, 'subset-rule-entry-sub-partitions-list': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'scope': {'module': 'data_safe', 'class': 'SubsetScope'}, 'subset-rule-entry-partitions-list': {'module': 'data_safe', 'class': 'list[string]'}, 'subset-rule-entry-sub-partitions-list': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.wrap_exceptions
-def create_target_database_on_premise_connector(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, database_details, connection_option_on_prem_connector_id, display_name, description, credentials, tls_config, peer_target_database_details, freeform_tags, defined_tags):
+def create_subsetting_rule_partition_subset_rule_entry(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, scope, subsetting_policy_id, display_name, description, rule_combination_mode, related_tables_propagation, peer_tables_action, subset_rule_entry_partitions_list, subset_rule_entry_sub_partitions_list):
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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['connectionOption'] = {}
- _details['compartmentId'] = compartment_id
- _details['databaseDetails'] = cli_util.parse_json_parameter("database_details", database_details)
- _details['connectionOption']['onPremConnectorId'] = connection_option_on_prem_connector_id
+ _details['subsetRuleEntry'] = {}
+ _details['scope'] = cli_util.parse_json_parameter("scope", scope)
if display_name is not None:
_details['displayName'] = display_name
@@ -6869,26 +7188,27 @@ def create_target_database_on_premise_connector(ctx, from_json, wait_for_state,
if description is not None:
_details['description'] = description
- if credentials is not None:
- _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials)
+ if rule_combination_mode is not None:
+ _details['ruleCombinationMode'] = rule_combination_mode
- if tls_config is not None:
- _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+ if related_tables_propagation is not None:
+ _details['relatedTablesPropagation'] = related_tables_propagation
- if peer_target_database_details is not None:
- _details['peerTargetDatabaseDetails'] = cli_util.parse_json_parameter("peer_target_database_details", peer_target_database_details)
+ if peer_tables_action is not None:
+ _details['peerTablesAction'] = peer_tables_action
- if freeform_tags is not None:
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+ if subset_rule_entry_partitions_list is not None:
+ _details['subsetRuleEntry']['partitionsList'] = cli_util.parse_json_parameter("subset_rule_entry_partitions_list", subset_rule_entry_partitions_list)
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if subset_rule_entry_sub_partitions_list is not None:
+ _details['subsetRuleEntry']['subPartitionsList'] = cli_util.parse_json_parameter("subset_rule_entry_sub_partitions_list", subset_rule_entry_sub_partitions_list)
- _details['connectionOption']['connectionType'] = 'ONPREM_CONNECTOR'
+ _details['subsetRuleEntry']['ruleType'] = 'PARTITION'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.create_target_database(
- create_target_database_details=_details,
+ result = client.create_subsetting_rule(
+ subsetting_policy_id=subsetting_policy_id,
+ create_subsetting_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -6921,45 +7241,57 @@ def create_target_database_on_premise_connector(ctx, from_json, wait_for_state,
cli_util.render_response(result, ctx)
-@target_database_group_group.command(name=cli_util.override('data_safe.create_target_database_group.command_name', 'create'), help=u"""Creates a new target database group. \n[Command Reference](createTargetDatabaseGroup)""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment to create the target database group.""")
-@cli_util.option('--display-name', required=True, help=u"""The name of the target database group.""")
-@cli_util.option('--matching-criteria', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--description', help=u"""Description of the target database group (optional).""")
-@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)
+@subsetting_rule_group.command(name=cli_util.override('data_safe.create_subsetting_rule_percent_subset_rule_entry.command_name', 'create-subsetting-rule-percent-subset-rule-entry'), help=u"""Details to create a new subsetting rule \n[Command Reference](createSubsettingRule)""")
+@cli_util.option('--scope', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--subset-rule-entry-percent', required=True, type=click.INT, help=u"""The percentage of rows to retain in the subset (between 0 and 100)""")
+@cli_util.option('--display-name', help=u"""The display name of the subset rule""")
+@cli_util.option('--description', help=u"""The description of the subset rule""")
+@cli_util.option('--rule-combination-mode', type=custom_types.CliCaseInsensitiveChoice(["UNION", "SERIAL"]), help=u"""Specifies how this rule combines with other rules. UNION evaluates this rule independently and adds matching rows to the result set. SERIAL applies this rule sequentially to filter rows selected by a compatible preceding rule.""")
+@cli_util.option('--related-tables-propagation', type=custom_types.CliCaseInsensitiveChoice(["ANCESTORS_AND_DESCENDANTS", "ANCESTORS", "DESCENDANTS", "NONE"]), help=u"""Strategy to be applied while propagating subsetting rule to related tables""")
+@cli_util.option('--peer-tables-action', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_ROWS", "SUBSET", "MAXIMUM_ROWS"]), help=u"""Strategy to be applied while processing peer tables""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'matching-criteria': {'module': 'data_safe', 'class': 'MatchingCriteria'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'scope': {'module': 'data_safe', 'class': 'SubsetScope'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'matching-criteria': {'module': 'data_safe', 'class': 'MatchingCriteria'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabaseGroup'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'scope': {'module': 'data_safe', 'class': 'SubsetScope'}})
@cli_util.wrap_exceptions
-def create_target_database_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, matching_criteria, description, freeform_tags, defined_tags):
+def create_subsetting_rule_percent_subset_rule_entry(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, scope, subsetting_policy_id, subset_rule_entry_percent, display_name, description, rule_combination_mode, related_tables_propagation, peer_tables_action):
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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['compartmentId'] = compartment_id
- _details['displayName'] = display_name
- _details['matchingCriteria'] = cli_util.parse_json_parameter("matching_criteria", matching_criteria)
+ _details['subsetRuleEntry'] = {}
+ _details['scope'] = cli_util.parse_json_parameter("scope", scope)
+ _details['subsetRuleEntry']['percent'] = subset_rule_entry_percent
+
+ if display_name is not None:
+ _details['displayName'] = display_name
if description is not None:
_details['description'] = description
- if freeform_tags is not None:
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+ if rule_combination_mode is not None:
+ _details['ruleCombinationMode'] = rule_combination_mode
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if related_tables_propagation is not None:
+ _details['relatedTablesPropagation'] = related_tables_propagation
+
+ if peer_tables_action is not None:
+ _details['peerTablesAction'] = peer_tables_action
+
+ _details['subsetRuleEntry']['ruleType'] = 'PERCENT'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.create_target_database_group(
- create_target_database_group_details=_details,
+ result = client.create_subsetting_rule(
+ subsetting_policy_id=subsetting_policy_id,
+ create_subsetting_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -6992,37 +7324,35 @@ def create_target_database_group(ctx, from_json, wait_for_state, max_wait_second
cli_util.render_response(result, ctx)
-@unified_audit_policy_group.command(name=cli_util.override('data_safe.create_unified_audit_policy.command_name', 'create'), help=u"""Creates the specified unified audit policy. \n[Command Reference](createUnifiedAuditPolicy)""")
-@cli_util.option('--security-policy-id', required=True, help=u"""The OCID of the security policy corresponding to the unified audit policy.""")
-@cli_util.option('--unified-audit-policy-definition-id', required=True, help=u"""The OCID of the associated unified audit policy definition.""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the unified audit policy.""")
-@cli_util.option('--status', required=True, help=u"""Indicates whether the unified audit policy has been enabled or disabled.""")
-@cli_util.option('--conditions', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Lists the audit policy provisioning conditions.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--display-name', help=u"""The display name of the unified audit policy in Data Safe. The name is modifiable and does not need to be unique.""")
-@cli_util.option('--description', help=u"""The description of the unified audit policy in Data Safe.""")
-@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)
+@subsetting_rule_group.command(name=cli_util.override('data_safe.create_subsetting_rule_condition_subset_rule_entry.command_name', 'create-subsetting-rule-condition-subset-rule-entry'), help=u"""Details to create a new subsetting rule \n[Command Reference](createSubsettingRule)""")
+@cli_util.option('--scope', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--subset-rule-entry-condition', required=True, help=u"""The SQL WHERE clause condition used to filter rows for the subset""")
+@cli_util.option('--display-name', help=u"""The display name of the subset rule""")
+@cli_util.option('--description', help=u"""The description of the subset rule""")
+@cli_util.option('--rule-combination-mode', type=custom_types.CliCaseInsensitiveChoice(["UNION", "SERIAL"]), help=u"""Specifies how this rule combines with other rules. UNION evaluates this rule independently and adds matching rows to the result set. SERIAL applies this rule sequentially to filter rows selected by a compatible preceding rule.""")
+@cli_util.option('--related-tables-propagation', type=custom_types.CliCaseInsensitiveChoice(["ANCESTORS_AND_DESCENDANTS", "ANCESTORS", "DESCENDANTS", "NONE"]), help=u"""Strategy to be applied while propagating subsetting rule to related tables""")
+@cli_util.option('--peer-tables-action', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_ROWS", "SUBSET", "MAXIMUM_ROWS"]), help=u"""Strategy to be applied while processing peer tables""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'conditions': {'module': 'data_safe', 'class': 'list[PolicyCondition]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'scope': {'module': 'data_safe', 'class': 'SubsetScope'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'conditions': {'module': 'data_safe', 'class': 'list[PolicyCondition]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'UnifiedAuditPolicy'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'scope': {'module': 'data_safe', 'class': 'SubsetScope'}})
@cli_util.wrap_exceptions
-def create_unified_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_id, unified_audit_policy_definition_id, compartment_id, status, conditions, display_name, description, freeform_tags, defined_tags):
+def create_subsetting_rule_condition_subset_rule_entry(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, scope, subsetting_policy_id, subset_rule_entry_condition, display_name, description, rule_combination_mode, related_tables_propagation, peer_tables_action):
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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['securityPolicyId'] = security_policy_id
- _details['unifiedAuditPolicyDefinitionId'] = unified_audit_policy_definition_id
- _details['compartmentId'] = compartment_id
- _details['status'] = status
- _details['conditions'] = cli_util.parse_json_parameter("conditions", conditions)
+ _details['subsetRuleEntry'] = {}
+ _details['scope'] = cli_util.parse_json_parameter("scope", scope)
+ _details['subsetRuleEntry']['condition'] = subset_rule_entry_condition
if display_name is not None:
_details['displayName'] = display_name
@@ -7030,15 +7360,21 @@ def create_unified_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds
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 rule_combination_mode is not None:
+ _details['ruleCombinationMode'] = rule_combination_mode
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if related_tables_propagation is not None:
+ _details['relatedTablesPropagation'] = related_tables_propagation
+
+ if peer_tables_action is not None:
+ _details['peerTablesAction'] = peer_tables_action
+
+ _details['subsetRuleEntry']['ruleType'] = 'CONDITION'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.create_unified_audit_policy(
- create_unified_audit_policy_details=_details,
+ result = client.create_subsetting_rule(
+ subsetting_policy_id=subsetting_policy_id,
+ create_subsetting_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -7071,16 +7407,90 @@ def create_unified_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.create_user_assessment.command_name', 'create'), help=u"""Creates a new saved user assessment for a target database or target database group in a compartment. It saves the latest assessment in the specified compartment. If a schedule is passed in, this operation persists the latest assessment that exists at the defined date and time, in the format defined by [RFC3339]. \n[Command Reference](createUserAssessment)""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment that contains the user assessment.""")
-@cli_util.option('--target-id', required=True, help=u"""The OCID of the target database or target database group on which user assessment is to be run.""")
-@cli_util.option('--description', help=u"""The description of the user assessment.""")
-@cli_util.option('--display-name', help=u"""The display name of the user assessment.""")
-@cli_util.option('--is-assessment-scheduled', type=click.BOOL, help=u"""Indicates whether the assessment is scheduled to run.""")
-@cli_util.option('--schedule', help=u"""To schedule the assessment for saving periodically, specify the schedule in this attribute. Create or schedule one assessment per compartment. If not defined, the assessment runs immediately. Format - ;
+@subsetting_schema_relation_summary_group.command(name=cli_util.override('data_safe.create_subsetting_schema_relation.command_name', 'create-subsetting-schema-relation'), help=u"""Details to create a new referential relation. \n[Command Reference](createSubsettingSchemaRelation)""")
+@cli_util.option('--parent-schema-name', required=True, help=u"""The database schema that contains the parent subsetting table""")
+@cli_util.option('--parent-object-name', required=True, help=u"""The name of the parent subsetting table""")
+@cli_util.option('--parent-columns', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Unique identifiers identifying the parents columns in the relation.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--child-schema-name', required=True, help=u"""The database schema that contains the child subsetting table""")
+@cli_util.option('--child-object-name', required=True, help=u"""The name of the child subsetting table""")
+@cli_util.option('--child-columns', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Unique identifiers identifying the child columns in the relation.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--parent-object-key', help=u"""The key that identifies the parent subsetting table in this relation.""")
+@cli_util.option('--child-object-key', help=u"""The key that identifies the child subsetting table in this relation.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'parent-columns': {'module': 'data_safe', 'class': 'list[string]'}, 'child-columns': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'parent-columns': {'module': 'data_safe', 'class': 'list[string]'}, 'child-columns': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.wrap_exceptions
+def create_subsetting_schema_relation(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, parent_schema_name, parent_object_name, parent_columns, child_schema_name, child_object_name, child_columns, subsetting_policy_id, parent_object_key, child_object_key):
- Allowed version strings - \"v1\" v1's version specific schedule - Each of the above fields potentially introduce constraints. A workrequest is created only when clock time satisfies all the constraints. Constraints introduced: 1. seconds = (So, the allowed range for is [0, 59]) 2. minutes = (So, the allowed range for is [0, 59]) 3. hours = (So, the allowed range for is [0, 23]) can be either '*' (without quotes or a number between 1(Monday) and 7(Sunday)) 4. No constraint introduced when it is '*'. When not, day of week must equal the given value can be either '*' (without quotes or a number between 1 and 28) 5. No constraint introduced when it is '*'. When not, day of month must equal the given value""")
-@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""The type of user assessment resource whether it is individual or group resource. For individual target use type TARGET_DATABASE and for group resource use type TARGET_DATABASE_GROUP. If not provided, TARGET_DATABASE would be used as default value.""")
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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['parentSchemaName'] = parent_schema_name
+ _details['parentObjectName'] = parent_object_name
+ _details['parentColumns'] = cli_util.parse_json_parameter("parent_columns", parent_columns)
+ _details['childSchemaName'] = child_schema_name
+ _details['childObjectName'] = child_object_name
+ _details['childColumns'] = cli_util.parse_json_parameter("child_columns", child_columns)
+
+ if parent_object_key is not None:
+ _details['parentObjectKey'] = parent_object_key
+
+ if child_object_key is not None:
+ _details['childObjectKey'] = child_object_key
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.create_subsetting_schema_relation(
+ subsetting_policy_id=subsetting_policy_id,
+ create_subsetting_schema_relation_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)
+
+
+@target_alert_policy_association_group.command(name=cli_util.override('data_safe.create_target_alert_policy_association.command_name', 'create'), help=u"""Creates a new target-alert policy association to track a alert policy applied on target. \n[Command Reference](createTargetAlertPolicyAssociation)""")
+@cli_util.option('--policy-id', required=True, help=u"""The OCID of the alert policy.""")
+@cli_util.option('--target-id', required=True, help=u"""The OCID of the target or target database group.""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment where the target-alert policy association is created.""")
+@cli_util.option('--is-enabled', required=True, type=click.BOOL, help=u"""Indicates if the target-alert policy association is enabled or disabled by user.""")
+@cli_util.option('--display-name', help=u"""The display name of the target-alert policy association.""")
+@cli_util.option('--description', help=u"""Describes the target-alert policy association.""")
+@cli_util.option('--target-type', help=u"""The resource type that is represented by the alert policy association. Default is considered as TARGET_DATABASE.""")
@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)
@@ -7091,28 +7501,24 @@ def create_unified_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds
@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'UserAssessment'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetAlertPolicyAssociation'})
@cli_util.wrap_exceptions
-def create_user_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, target_id, description, display_name, is_assessment_scheduled, schedule, target_type, freeform_tags, defined_tags):
+def create_target_alert_policy_association(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, policy_id, target_id, compartment_id, is_enabled, display_name, description, target_type, 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['policyId'] = policy_id
_details['targetId'] = target_id
-
- if description is not None:
- _details['description'] = description
+ _details['compartmentId'] = compartment_id
+ _details['isEnabled'] = is_enabled
if display_name is not None:
_details['displayName'] = display_name
- if is_assessment_scheduled is not None:
- _details['isAssessmentScheduled'] = is_assessment_scheduled
-
- if schedule is not None:
- _details['schedule'] = schedule
+ if description is not None:
+ _details['description'] = description
if target_type is not None:
_details['targetType'] = target_type
@@ -7124,8 +7530,8 @@ def create_user_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wai
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.create_user_assessment(
- create_user_assessment_details=_details,
+ result = client.create_target_alert_policy_association(
+ create_target_alert_policy_association_details=_details,
**kwargs
)
if wait_for_state:
@@ -7158,29 +7564,65 @@ def create_user_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wai
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.deactivate_target_database.command_name', 'deactivate'), help=u"""Deactivates a target database in Data Safe. \n[Command Reference](deactivateTargetDatabase)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
-@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.""")
+@target_database_group.command(name=cli_util.override('data_safe.create_target_database.command_name', 'create'), help=u"""Registers the specified database with Data Safe and creates a Data Safe target database in the Data Safe Console. \n[Command Reference](createTargetDatabase)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the Data Safe target database.""")
+@cli_util.option('--database-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"""The display name of the target database in Data Safe. The name is modifiable and does not need to be unique.""")
+@cli_util.option('--description', help=u"""The description of the target database in Data Safe.""")
+@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--connection-option', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--peer-target-database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The details of the database to be registered as a peer target database.
+
+This option is a JSON list with items of type CreatePeerTargetDatabaseDetails. For documentation on CreatePeerTargetDatabaseDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/CreatePeerTargetDatabaseDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
@cli_util.wrap_exceptions
-def deactivate_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, if_match):
-
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+def create_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, database_details, display_name, description, credentials, tls_config, connection_option, peer_target_database_details, freeform_tags, defined_tags):
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
+ _details['databaseDetails'] = cli_util.parse_json_parameter("database_details", database_details)
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if credentials is not None:
+ _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials)
+
+ if tls_config is not None:
+ _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+
+ if connection_option is not None:
+ _details['connectionOption'] = cli_util.parse_json_parameter("connection_option", connection_option)
+
+ if peer_target_database_details is not None:
+ _details['peerTargetDatabaseDetails'] = cli_util.parse_json_parameter("peer_target_database_details", peer_target_database_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_safe', 'data_safe', ctx)
- result = client.deactivate_target_database(
- target_database_id=target_database_id,
+ result = client.create_target_database(
+ create_target_database_details=_details,
**kwargs
)
if wait_for_state:
@@ -7213,30 +7655,80 @@ def deactivate_target_database(ctx, from_json, wait_for_state, max_wait_seconds,
cli_util.render_response(result, ctx)
-@alert_policy_group.command(name=cli_util.override('data_safe.delete_alert_policy.command_name', 'delete'), help=u"""Deletes the specified user-defined alert policy. \n[Command Reference](deleteAlertPolicy)""")
-@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
+@target_database_group.command(name=cli_util.override('data_safe.create_target_database_installed_database_details.command_name', 'create-target-database-installed-database-details'), help=u"""Registers the specified database with Data Safe and creates a Data Safe target database in the Data Safe Console. \n[Command Reference](createTargetDatabase)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the Data Safe target database.""")
+@cli_util.option('--database-details-infrastructure-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""The infrastructure type the database is running on.""")
+@cli_util.option('--database-details-listener-port', required=True, type=click.INT, help=u"""The port number of the database listener.""")
+@cli_util.option('--database-details-service-name', required=True, help=u"""The service name of the database registered as target database.""")
+@cli_util.option('--display-name', help=u"""The display name of the target database in Data Safe. The name is modifiable and does not need to be unique.""")
+@cli_util.option('--description', help=u"""The description of the target database in Data Safe.""")
+@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--connection-option', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--peer-target-database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The details of the database to be registered as a peer target database.
+
+This option is a JSON list with items of type CreatePeerTargetDatabaseDetails. For documentation on CreatePeerTargetDatabaseDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/CreatePeerTargetDatabaseDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--database-details-instance-id', help=u"""The OCID of the compute instance on which the database is running.""")
+@cli_util.option('--database-details-ip-addresses', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database host IP Addresses. Fully qualified domain names can be used if connectionType is 'ONPREM_CONNECTOR'.""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'database-details-ip-addresses': {'module': 'data_safe', 'class': 'list[string]'}})
@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={'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'database-details-ip-addresses': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
@cli_util.wrap_exceptions
-def delete_alert_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, alert_policy_id, if_match):
-
- if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --alert-policy-id cannot be whitespace or empty string')
+def create_target_database_installed_database_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, database_details_infrastructure_type, database_details_listener_port, database_details_service_name, display_name, description, credentials, tls_config, connection_option, peer_target_database_details, freeform_tags, defined_tags, database_details_instance_id, database_details_ip_addresses):
kwargs = {}
- if if_match is not None:
- kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+ _details['databaseDetails'] = {}
+ _details['compartmentId'] = compartment_id
+ _details['databaseDetails']['infrastructureType'] = database_details_infrastructure_type
+ _details['databaseDetails']['listenerPort'] = database_details_listener_port
+ _details['databaseDetails']['serviceName'] = database_details_service_name
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if credentials is not None:
+ _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials)
+
+ if tls_config is not None:
+ _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+
+ if connection_option is not None:
+ _details['connectionOption'] = cli_util.parse_json_parameter("connection_option", connection_option)
+
+ if peer_target_database_details is not None:
+ _details['peerTargetDatabaseDetails'] = cli_util.parse_json_parameter("peer_target_database_details", peer_target_database_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 database_details_instance_id is not None:
+ _details['databaseDetails']['instanceId'] = database_details_instance_id
+
+ if database_details_ip_addresses is not None:
+ _details['databaseDetails']['ipAddresses'] = cli_util.parse_json_parameter("database_details_ip_addresses", database_details_ip_addresses)
+
+ _details['databaseDetails']['databaseType'] = 'INSTALLED_DATABASE'
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.delete_alert_policy(
- alert_policy_id=alert_policy_id,
+ result = client.create_target_database(
+ create_target_database_details=_details,
**kwargs
)
if wait_for_state:
@@ -7257,7 +7749,7 @@ def delete_alert_policy(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. Please retrieve the work request to find its current state', file=sys.stderr)
+ 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:
@@ -7269,35 +7761,70 @@ def delete_alert_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_i
cli_util.render_response(result, ctx)
-@alert_policy_rule_group.command(name=cli_util.override('data_safe.delete_alert_policy_rule.command_name', 'delete'), help=u"""Deletes the specified user-defined alert policy rule. \n[Command Reference](deleteAlertPolicyRule)""")
-@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
-@cli_util.option('--rule-key', required=True, help=u"""The key of the alert policy rule.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
-@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
+@target_database_group.command(name=cli_util.override('data_safe.create_target_database_autonomous_database_details.command_name', 'create-target-database-autonomous-database-details'), help=u"""Registers the specified database with Data Safe and creates a Data Safe target database in the Data Safe Console. \n[Command Reference](createTargetDatabase)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the Data Safe target database.""")
+@cli_util.option('--database-details-infrastructure-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""The infrastructure type the database is running on.""")
+@cli_util.option('--database-details-autonomous-database-id', required=True, help=u"""The OCID of the Autonomous Database registered as a target database in Data Safe.""")
+@cli_util.option('--display-name', help=u"""The display name of the target database in Data Safe. The name is modifiable and does not need to be unique.""")
+@cli_util.option('--description', help=u"""The description of the target database in Data Safe.""")
+@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--connection-option', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--peer-target-database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The details of the database to be registered as a peer target database.
+
+This option is a JSON list with items of type CreatePeerTargetDatabaseDetails. For documentation on CreatePeerTargetDatabaseDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/CreatePeerTargetDatabaseDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
@cli_util.wrap_exceptions
-def delete_alert_policy_rule(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, alert_policy_id, rule_key, if_match):
-
- if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --alert-policy-id cannot be whitespace or empty string')
-
- if isinstance(rule_key, six.string_types) and len(rule_key.strip()) == 0:
- raise click.UsageError('Parameter --rule-key cannot be whitespace or empty string')
+def create_target_database_autonomous_database_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, database_details_infrastructure_type, database_details_autonomous_database_id, display_name, description, credentials, tls_config, connection_option, peer_target_database_details, freeform_tags, defined_tags):
kwargs = {}
- if if_match is not None:
- kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+ _details['databaseDetails'] = {}
+ _details['compartmentId'] = compartment_id
+ _details['databaseDetails']['infrastructureType'] = database_details_infrastructure_type
+ _details['databaseDetails']['autonomousDatabaseId'] = database_details_autonomous_database_id
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if credentials is not None:
+ _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials)
+
+ if tls_config is not None:
+ _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+
+ if connection_option is not None:
+ _details['connectionOption'] = cli_util.parse_json_parameter("connection_option", connection_option)
+
+ if peer_target_database_details is not None:
+ _details['peerTargetDatabaseDetails'] = cli_util.parse_json_parameter("peer_target_database_details", peer_target_database_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['databaseDetails']['databaseType'] = 'AUTONOMOUS_DATABASE'
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.delete_alert_policy_rule(
- alert_policy_id=alert_policy_id,
- rule_key=rule_key,
+ result = client.create_target_database(
+ create_target_database_details=_details,
**kwargs
)
if wait_for_state:
@@ -7318,7 +7845,7 @@ def delete_alert_policy_rule(ctx, from_json, wait_for_state, max_wait_seconds, w
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
except oci.exceptions.MaximumWaitTimeExceeded as e:
# If we fail, we should show an error, but we should still provide the information to the customer
- click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ 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:
@@ -7330,30 +7857,88 @@ def delete_alert_policy_rule(ctx, from_json, wait_for_state, max_wait_seconds, w
cli_util.render_response(result, ctx)
-@attribute_set_group.command(name=cli_util.override('data_safe.delete_attribute_set.command_name', 'delete'), help=u"""Submits a work request to delete an attribute set. \n[Command Reference](deleteAttributeSet)""")
-@cli_util.option('--attribute-set-id', required=True, help=u"""OCID of an attribute set.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
+@target_database_group.command(name=cli_util.override('data_safe.create_target_database_database_cloud_service_details.command_name', 'create-target-database-database-cloud-service-details'), help=u"""Registers the specified database with Data Safe and creates a Data Safe target database in the Data Safe Console. \n[Command Reference](createTargetDatabase)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the Data Safe target database.""")
+@cli_util.option('--database-details-infrastructure-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""The infrastructure type the database is running on.""")
+@cli_util.option('--display-name', help=u"""The display name of the target database in Data Safe. The name is modifiable and does not need to be unique.""")
+@cli_util.option('--description', help=u"""The description of the target database in Data Safe.""")
+@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--connection-option', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--peer-target-database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The details of the database to be registered as a peer target database.
+
+This option is a JSON list with items of type CreatePeerTargetDatabaseDetails. For documentation on CreatePeerTargetDatabaseDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/CreatePeerTargetDatabaseDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--database-details-vm-cluster-id', help=u"""The OCID of the VM cluster in which the database is running.""")
+@cli_util.option('--database-details-db-system-id', help=u"""The OCID of the cloud database registered as a target database in Data Safe.""")
+@cli_util.option('--database-details-pluggable-database-id', help=u"""The OCID of the pluggable database registered as a target database in Data Safe.""")
+@cli_util.option('--database-details-listener-port', type=click.INT, help=u"""The port number of the database listener.""")
+@cli_util.option('--database-details-service-name', help=u"""The database service name.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'connection-option': {'module': 'data_safe', 'class': 'ConnectionOption'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
@cli_util.wrap_exceptions
-def delete_attribute_set(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, attribute_set_id, if_match):
-
- if isinstance(attribute_set_id, six.string_types) and len(attribute_set_id.strip()) == 0:
- raise click.UsageError('Parameter --attribute-set-id cannot be whitespace or empty string')
+def create_target_database_database_cloud_service_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, database_details_infrastructure_type, display_name, description, credentials, tls_config, connection_option, peer_target_database_details, freeform_tags, defined_tags, database_details_vm_cluster_id, database_details_db_system_id, database_details_pluggable_database_id, database_details_listener_port, database_details_service_name):
kwargs = {}
- if if_match is not None:
- kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+ _details['databaseDetails'] = {}
+ _details['compartmentId'] = compartment_id
+ _details['databaseDetails']['infrastructureType'] = database_details_infrastructure_type
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if credentials is not None:
+ _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials)
+
+ if tls_config is not None:
+ _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+
+ if connection_option is not None:
+ _details['connectionOption'] = cli_util.parse_json_parameter("connection_option", connection_option)
+
+ if peer_target_database_details is not None:
+ _details['peerTargetDatabaseDetails'] = cli_util.parse_json_parameter("peer_target_database_details", peer_target_database_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 database_details_vm_cluster_id is not None:
+ _details['databaseDetails']['vmClusterId'] = database_details_vm_cluster_id
+
+ if database_details_db_system_id is not None:
+ _details['databaseDetails']['dbSystemId'] = database_details_db_system_id
+
+ if database_details_pluggable_database_id is not None:
+ _details['databaseDetails']['pluggableDatabaseId'] = database_details_pluggable_database_id
+
+ if database_details_listener_port is not None:
+ _details['databaseDetails']['listenerPort'] = database_details_listener_port
+
+ if database_details_service_name is not None:
+ _details['databaseDetails']['serviceName'] = database_details_service_name
+
+ _details['databaseDetails']['databaseType'] = 'DATABASE_CLOUD_SERVICE'
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.delete_attribute_set(
- attribute_set_id=attribute_set_id,
+ result = client.create_target_database(
+ create_target_database_details=_details,
**kwargs
)
if wait_for_state:
@@ -7374,7 +7959,7 @@ def delete_attribute_set(ctx, from_json, wait_for_state, max_wait_seconds, wait_
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
except oci.exceptions.MaximumWaitTimeExceeded as e:
# If we fail, we should show an error, but we should still provide the information to the customer
- click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ 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:
@@ -7386,30 +7971,66 @@ def delete_attribute_set(ctx, from_json, wait_for_state, max_wait_seconds, wait_
cli_util.render_response(result, ctx)
-@audit_archive_retrieval_group.command(name=cli_util.override('data_safe.delete_audit_archive_retrieval.command_name', 'delete'), help=u"""To unload retrieved archive data, call the operation ListAuditArchiveRetrieval first. This will return the auditArchiveRetrievalId. Then call this operation with auditArchiveRetrievalId. \n[Command Reference](deleteAuditArchiveRetrieval)""")
-@cli_util.option('--audit-archive-retrieval-id', required=True, help=u"""OCID of the archive retrieval.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
+@target_database_group.command(name=cli_util.override('data_safe.create_target_database_private_endpoint.command_name', 'create-target-database-private-endpoint'), help=u"""Registers the specified database with Data Safe and creates a Data Safe target database in the Data Safe Console. \n[Command Reference](createTargetDatabase)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the Data Safe target database.""")
+@cli_util.option('--database-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--connection-option-datasafe-private-endpoint-id', required=True, help=u"""The OCID of the Data Safe private endpoint.""")
+@cli_util.option('--display-name', help=u"""The display name of the target database in Data Safe. The name is modifiable and does not need to be unique.""")
+@cli_util.option('--description', help=u"""The description of the target database in Data Safe.""")
+@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--peer-target-database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The details of the database to be registered as a peer target database.
+
+This option is a JSON list with items of type CreatePeerTargetDatabaseDetails. For documentation on CreatePeerTargetDatabaseDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/CreatePeerTargetDatabaseDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
@cli_util.wrap_exceptions
-def delete_audit_archive_retrieval(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_archive_retrieval_id, if_match):
-
- if isinstance(audit_archive_retrieval_id, six.string_types) and len(audit_archive_retrieval_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-archive-retrieval-id cannot be whitespace or empty string')
+def create_target_database_private_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, database_details, connection_option_datasafe_private_endpoint_id, display_name, description, credentials, tls_config, peer_target_database_details, freeform_tags, defined_tags):
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['connectionOption'] = {}
+ _details['compartmentId'] = compartment_id
+ _details['databaseDetails'] = cli_util.parse_json_parameter("database_details", database_details)
+ _details['connectionOption']['datasafePrivateEndpointId'] = connection_option_datasafe_private_endpoint_id
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if credentials is not None:
+ _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials)
+
+ if tls_config is not None:
+ _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+
+ if peer_target_database_details is not None:
+ _details['peerTargetDatabaseDetails'] = cli_util.parse_json_parameter("peer_target_database_details", peer_target_database_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['connectionOption']['connectionType'] = 'PRIVATE_ENDPOINT'
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.delete_audit_archive_retrieval(
- audit_archive_retrieval_id=audit_archive_retrieval_id,
+ result = client.create_target_database(
+ create_target_database_details=_details,
**kwargs
)
if wait_for_state:
@@ -7430,7 +8051,7 @@ def delete_audit_archive_retrieval(ctx, from_json, wait_for_state, max_wait_seco
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
except oci.exceptions.MaximumWaitTimeExceeded as e:
# If we fail, we should show an error, but we should still provide the information to the customer
- click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ 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:
@@ -7442,30 +8063,66 @@ def delete_audit_archive_retrieval(ctx, from_json, wait_for_state, max_wait_seco
cli_util.render_response(result, ctx)
-@audit_profile_group.command(name=cli_util.override('data_safe.delete_audit_profile.command_name', 'delete'), help=u"""Deletes the specified audit profile. The audit profile delete operation is only supported for audit profiles with target type as TARGET_DATABASE_GROUP. \n[Command Reference](deleteAuditProfile)""")
-@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
+@target_database_group.command(name=cli_util.override('data_safe.create_target_database_on_premise_connector.command_name', 'create-target-database-on-premise-connector'), help=u"""Registers the specified database with Data Safe and creates a Data Safe target database in the Data Safe Console. \n[Command Reference](createTargetDatabase)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the Data Safe target database.""")
+@cli_util.option('--database-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--connection-option-on-prem-connector-id', required=True, help=u"""The OCID of the on-premises connector.""")
+@cli_util.option('--display-name', help=u"""The display name of the target database in Data Safe. The name is modifiable and does not need to be unique.""")
+@cli_util.option('--description', help=u"""The description of the target database in Data Safe.""")
+@cli_util.option('--credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--peer-target-database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The details of the database to be registered as a peer target database.
+
+This option is a JSON list with items of type CreatePeerTargetDatabaseDetails. For documentation on CreatePeerTargetDatabaseDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/CreatePeerTargetDatabaseDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'credentials': {'module': 'data_safe', 'class': 'Credentials'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'peer-target-database-details': {'module': 'data_safe', 'class': 'list[CreatePeerTargetDatabaseDetails]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
@cli_util.wrap_exceptions
-def delete_audit_profile(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_profile_id, if_match):
-
- if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-profile-id cannot be whitespace or empty string')
+def create_target_database_on_premise_connector(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, database_details, connection_option_on_prem_connector_id, display_name, description, credentials, tls_config, peer_target_database_details, freeform_tags, defined_tags):
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_safe', 'data_safe', ctx)
- result = client.delete_audit_profile(
- audit_profile_id=audit_profile_id,
+
+ _details = {}
+ _details['connectionOption'] = {}
+ _details['compartmentId'] = compartment_id
+ _details['databaseDetails'] = cli_util.parse_json_parameter("database_details", database_details)
+ _details['connectionOption']['onPremConnectorId'] = connection_option_on_prem_connector_id
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if credentials is not None:
+ _details['credentials'] = cli_util.parse_json_parameter("credentials", credentials)
+
+ if tls_config is not None:
+ _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+
+ if peer_target_database_details is not None:
+ _details['peerTargetDatabaseDetails'] = cli_util.parse_json_parameter("peer_target_database_details", peer_target_database_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['connectionOption']['connectionType'] = 'ONPREM_CONNECTOR'
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.create_target_database(
+ create_target_database_details=_details,
**kwargs
)
if wait_for_state:
@@ -7486,7 +8143,7 @@ def delete_audit_profile(ctx, from_json, wait_for_state, max_wait_seconds, wait_
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
except oci.exceptions.MaximumWaitTimeExceeded as e:
# If we fail, we should show an error, but we should still provide the information to the customer
- click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ 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:
@@ -7498,30 +8155,45 @@ def delete_audit_profile(ctx, from_json, wait_for_state, max_wait_seconds, wait_
cli_util.render_response(result, ctx)
-@audit_trail_group.command(name=cli_util.override('data_safe.delete_audit_trail.command_name', 'delete'), help=u"""Deletes the specified audit trail. \n[Command Reference](deleteAuditTrail)""")
-@cli_util.option('--audit-trail-id', required=True, help=u"""The OCID of the audit trail.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
+@target_database_group_group.command(name=cli_util.override('data_safe.create_target_database_group.command_name', 'create'), help=u"""Creates a new target database group. \n[Command Reference](createTargetDatabaseGroup)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment to create the target database group.""")
+@cli_util.option('--display-name', required=True, help=u"""The name of the target database group.""")
+@cli_util.option('--matching-criteria', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--description', help=u"""Description of the target database group (optional).""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'matching-criteria': {'module': 'data_safe', 'class': 'MatchingCriteria'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'matching-criteria': {'module': 'data_safe', 'class': 'MatchingCriteria'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'TargetDatabaseGroup'})
@cli_util.wrap_exceptions
-def delete_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_trail_id, if_match):
-
- if isinstance(audit_trail_id, six.string_types) and len(audit_trail_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-trail-id cannot be whitespace or empty string')
+def create_target_database_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, matching_criteria, description, freeform_tags, defined_tags):
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
+ _details['displayName'] = display_name
+ _details['matchingCriteria'] = cli_util.parse_json_parameter("matching_criteria", matching_criteria)
+
+ if description is not None:
+ _details['description'] = description
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.delete_audit_trail(
- audit_trail_id=audit_trail_id,
+ result = client.create_target_database_group(
+ create_target_database_group_details=_details,
**kwargs
)
if wait_for_state:
@@ -7542,7 +8214,7 @@ def delete_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_in
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
except oci.exceptions.MaximumWaitTimeExceeded as e:
# If we fail, we should show an error, but we should still provide the information to the customer
- click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ 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:
@@ -7554,30 +8226,53 @@ def delete_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_in
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.delete_crypto_assessment.command_name', 'delete'), help=u"""Deletes the specified saved crypto assessment. Only assessments of type `SAVED` can be deleted. Attempts to delete a `LATEST` assessment return `400 InvalidParameter`. \n[Command Reference](deleteCryptoAssessment)""")
-@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
+@unified_audit_policy_group.command(name=cli_util.override('data_safe.create_unified_audit_policy.command_name', 'create'), help=u"""Creates the specified unified audit policy. \n[Command Reference](createUnifiedAuditPolicy)""")
+@cli_util.option('--security-policy-id', required=True, help=u"""The OCID of the security policy corresponding to the unified audit policy.""")
+@cli_util.option('--unified-audit-policy-definition-id', required=True, help=u"""The OCID of the associated unified audit policy definition.""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which to create the unified audit policy.""")
+@cli_util.option('--status', required=True, help=u"""Indicates whether the unified audit policy has been enabled or disabled.""")
+@cli_util.option('--conditions', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Lists the audit policy provisioning conditions.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--display-name', help=u"""The display name of the unified audit policy in Data Safe. The name is modifiable and does not need to be unique.""")
+@cli_util.option('--description', help=u"""The description of the unified audit policy in Data Safe.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'conditions': {'module': 'data_safe', 'class': 'list[PolicyCondition]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'conditions': {'module': 'data_safe', 'class': 'list[PolicyCondition]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'UnifiedAuditPolicy'})
@cli_util.wrap_exceptions
-def delete_crypto_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, crypto_assessment_id, if_match):
-
- if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
+def create_unified_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_id, unified_audit_policy_definition_id, compartment_id, status, conditions, display_name, description, freeform_tags, defined_tags):
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['securityPolicyId'] = security_policy_id
+ _details['unifiedAuditPolicyDefinitionId'] = unified_audit_policy_definition_id
+ _details['compartmentId'] = compartment_id
+ _details['status'] = status
+ _details['conditions'] = cli_util.parse_json_parameter("conditions", conditions)
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.delete_crypto_assessment(
- crypto_assessment_id=crypto_assessment_id,
+ result = client.create_unified_audit_policy(
+ create_unified_audit_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -7598,7 +8293,7 @@ def delete_crypto_assessment(ctx, from_json, wait_for_state, max_wait_seconds, w
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
except oci.exceptions.MaximumWaitTimeExceeded as e:
# If we fail, we should show an error, but we should still provide the information to the customer
- click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ 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:
@@ -7610,30 +8305,61 @@ def delete_crypto_assessment(ctx, from_json, wait_for_state, max_wait_seconds, w
cli_util.render_response(result, ctx)
-@data_safe_private_endpoint_group.command(name=cli_util.override('data_safe.delete_data_safe_private_endpoint.command_name', 'delete'), help=u"""Deletes the specified Data Safe private endpoint. \n[Command Reference](deleteDataSafePrivateEndpoint)""")
-@cli_util.option('--data-safe-private-endpoint-id', required=True, help=u"""The OCID of the private endpoint.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
+@user_assessment_group.command(name=cli_util.override('data_safe.create_user_assessment.command_name', 'create'), help=u"""Creates a new saved user assessment for a target database or target database group in a compartment. It saves the latest assessment in the specified compartment. If a schedule is passed in, this operation persists the latest assessment that exists at the defined date and time, in the format defined by [RFC3339]. \n[Command Reference](createUserAssessment)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment that contains the user assessment.""")
+@cli_util.option('--target-id', required=True, help=u"""The OCID of the target database or target database group on which user assessment is to be run.""")
+@cli_util.option('--description', help=u"""The description of the user assessment.""")
+@cli_util.option('--display-name', help=u"""The display name of the user assessment.""")
+@cli_util.option('--is-assessment-scheduled', type=click.BOOL, help=u"""Indicates whether the assessment is scheduled to run.""")
+@cli_util.option('--schedule', help=u"""To schedule the assessment for saving periodically, specify the schedule in this attribute. Create or schedule one assessment per compartment. If not defined, the assessment runs immediately. Format - ;
+
+ Allowed version strings - \"v1\" v1's version specific schedule - Each of the above fields potentially introduce constraints. A workrequest is created only when clock time satisfies all the constraints. Constraints introduced: 1. seconds = (So, the allowed range for is [0, 59]) 2. minutes = (So, the allowed range for is [0, 59]) 3. hours = (So, the allowed range for is [0, 23]) can be either '*' (without quotes or a number between 1(Monday) and 7(Sunday)) 4. No constraint introduced when it is '*'. When not, day of week must equal the given value can be either '*' (without quotes or a number between 1 and 28) 5. No constraint introduced when it is '*'. When not, day of month must equal the given value""")
+@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""The type of user assessment resource whether it is individual or group resource. For individual target use type TARGET_DATABASE and for group resource use type TARGET_DATABASE_GROUP. If not provided, TARGET_DATABASE would be used as default value.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'UserAssessment'})
@cli_util.wrap_exceptions
-def delete_data_safe_private_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, data_safe_private_endpoint_id, if_match):
-
- if isinstance(data_safe_private_endpoint_id, six.string_types) and len(data_safe_private_endpoint_id.strip()) == 0:
- raise click.UsageError('Parameter --data-safe-private-endpoint-id cannot be whitespace or empty string')
+def create_user_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, target_id, description, display_name, is_assessment_scheduled, schedule, target_type, freeform_tags, defined_tags):
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
+ _details['targetId'] = target_id
+
+ if description is not None:
+ _details['description'] = description
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if is_assessment_scheduled is not None:
+ _details['isAssessmentScheduled'] = is_assessment_scheduled
+
+ if schedule is not None:
+ _details['schedule'] = schedule
+
+ if target_type is not None:
+ _details['targetType'] = target_type
+
+ 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_safe', 'data_safe', ctx)
- result = client.delete_data_safe_private_endpoint(
- data_safe_private_endpoint_id=data_safe_private_endpoint_id,
+ result = client.create_user_assessment(
+ create_user_assessment_details=_details,
**kwargs
)
if wait_for_state:
@@ -7654,7 +8380,7 @@ def delete_data_safe_private_endpoint(ctx, from_json, wait_for_state, max_wait_s
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
except oci.exceptions.MaximumWaitTimeExceeded as e:
# If we fail, we should show an error, but we should still provide the information to the customer
- click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ 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:
@@ -7666,10 +8392,9 @@ def delete_data_safe_private_endpoint(ctx, from_json, wait_for_state, max_wait_s
cli_util.render_response(result, ctx)
-@discovery_job_group.command(name=cli_util.override('data_safe.delete_discovery_job.command_name', 'delete'), help=u"""Deletes the specified discovery job. \n[Command Reference](deleteDiscoveryJob)""")
-@cli_util.option('--discovery-job-id', required=True, help=u"""The OCID of the discovery job.""")
+@target_database_group.command(name=cli_util.override('data_safe.deactivate_target_database.command_name', 'deactivate'), help=u"""Deactivates a target database in Data Safe. \n[Command Reference](deactivateTargetDatabase)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -7678,18 +8403,18 @@ def delete_data_safe_private_endpoint(ctx, from_json, wait_for_state, max_wait_s
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_discovery_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, discovery_job_id, if_match):
+def deactivate_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, if_match):
- if isinstance(discovery_job_id, six.string_types) and len(discovery_job_id.strip()) == 0:
- raise click.UsageError('Parameter --discovery-job-id cannot be whitespace or empty string')
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.delete_discovery_job(
- discovery_job_id=discovery_job_id,
+ result = client.deactivate_target_database(
+ target_database_id=target_database_id,
**kwargs
)
if wait_for_state:
@@ -7710,7 +8435,7 @@ def delete_discovery_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
except oci.exceptions.MaximumWaitTimeExceeded as e:
# If we fail, we should show an error, but we should still provide the information to the customer
- click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ 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:
@@ -7722,134 +8447,65 @@ def delete_discovery_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_
cli_util.render_response(result, ctx)
-@discovery_job_result_group.command(name=cli_util.override('data_safe.delete_discovery_job_result.command_name', 'delete'), help=u"""Deletes the specified discovery result. \n[Command Reference](deleteDiscoveryJobResult)""")
-@cli_util.option('--discovery-job-id', required=True, help=u"""The OCID of the discovery job.""")
-@cli_util.option('--result-key', required=True, help=u"""The unique key that identifies the discovery result.""")
+@alert_policy_group.command(name=cli_util.override('data_safe.delete_alert_policy.command_name', 'delete'), help=u"""Deletes the specified user-defined alert policy. \n[Command Reference](deleteAlertPolicy)""")
+@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_discovery_job_result(ctx, from_json, discovery_job_id, result_key, if_match):
-
- if isinstance(discovery_job_id, six.string_types) and len(discovery_job_id.strip()) == 0:
- raise click.UsageError('Parameter --discovery-job-id cannot be whitespace or empty string')
+def delete_alert_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, alert_policy_id, if_match):
- if isinstance(result_key, six.string_types) and len(result_key.strip()) == 0:
- raise click.UsageError('Parameter --result-key cannot be whitespace or empty string')
+ if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --alert-policy-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_safe', 'data_safe', ctx)
- result = client.delete_discovery_job_result(
- discovery_job_id=discovery_job_id,
- result_key=result_key,
+ result = client.delete_alert_policy(
+ alert_policy_id=alert_policy_id,
**kwargs
)
- cli_util.render_response(result, ctx)
+ 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
-@library_masking_format_group.command(name=cli_util.override('data_safe.delete_library_masking_format.command_name', 'delete'), help=u"""Deletes the specified library masking format. \n[Command Reference](deleteLibraryMaskingFormat)""")
-@cli_util.option('--library-masking-format-id', required=True, help=u"""The OCID of the library masking format.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
-@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "NEEDS_ATTENTION", "FAILED"]), 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 FAILED 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({})
-@cli_util.help_option
-@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
-@cli_util.wrap_exceptions
-def delete_library_masking_format(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, library_masking_format_id, if_match):
-
- if isinstance(library_masking_format_id, six.string_types) and len(library_masking_format_id.strip()) == 0:
- raise click.UsageError('Parameter --library-masking-format-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_safe', 'data_safe', ctx)
- result = client.delete_library_masking_format(
- library_masking_format_id=library_masking_format_id,
- **kwargs
- )
- if wait_for_state:
-
- if hasattr(client, 'get_library_masking_format') and callable(getattr(client, 'get_library_masking_format')):
- 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)
- oci.wait_until(client, client.get_library_masking_format(library_masking_format_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
- except oci.exceptions.ServiceError as e:
- # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
- # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
- # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
- # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
- # succeed_on_not_found=True to the waiter).
- #
- # Any non-404 should still result in the exception being thrown.
- if e.status == 404:
- pass
- else:
- raise
+ 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 resource entered the specified state. Please retrieve the resource to find its current 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:
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ 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 resource to enter the specified state', file=sys.stderr)
- cli_util.render_response(result, ctx)
-
-
-@masking_column_group.command(name=cli_util.override('data_safe.delete_masking_column.command_name', 'delete'), help=u"""Deletes the specified masking column. \n[Command Reference](deleteMaskingColumn)""")
-@cli_util.option('--masking-column-key', required=True, help=u"""The unique key that identifies the masking column. It's numeric and unique within a masking policy.""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
-@json_skeleton_utils.get_cli_json_input_option({})
-@cli_util.help_option
-@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
-@cli_util.wrap_exceptions
-def delete_masking_column(ctx, from_json, masking_column_key, masking_policy_id, if_match):
-
- if isinstance(masking_column_key, six.string_types) and len(masking_column_key.strip()) == 0:
- raise click.UsageError('Parameter --masking-column-key cannot be whitespace or empty string')
-
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-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_safe', 'data_safe', ctx)
- result = client.delete_masking_column(
- masking_column_key=masking_column_key,
- masking_policy_id=masking_policy_id,
- **kwargs
- )
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.delete_masking_policy.command_name', 'delete'), help=u"""Deletes the specified masking policy. \n[Command Reference](deleteMaskingPolicy)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@alert_policy_rule_group.command(name=cli_util.override('data_safe.delete_alert_policy_rule.command_name', 'delete'), help=u"""Deletes the specified user-defined alert policy rule. \n[Command Reference](deleteAlertPolicyRule)""")
+@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
+@cli_util.option('--rule-key', required=True, help=u"""The key of the alert policy rule.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -7860,18 +8516,22 @@ def delete_masking_column(ctx, from_json, masking_column_key, masking_policy_id,
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_masking_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, if_match):
+def delete_alert_policy_rule(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, alert_policy_id, rule_key, if_match):
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --alert-policy-id cannot be whitespace or empty string')
+
+ if isinstance(rule_key, six.string_types) and len(rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --rule-key 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_safe', 'data_safe', ctx)
- result = client.delete_masking_policy(
- masking_policy_id=masking_policy_id,
+ result = client.delete_alert_policy_rule(
+ alert_policy_id=alert_policy_id,
+ rule_key=rule_key,
**kwargs
)
if wait_for_state:
@@ -7904,8 +8564,8 @@ def delete_masking_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait
cli_util.render_response(result, ctx)
-@masking_policy_health_report_group.command(name=cli_util.override('data_safe.delete_masking_policy_health_report.command_name', 'delete'), help=u"""Deletes the specified masking policy health report. \n[Command Reference](deleteMaskingPolicyHealthReport)""")
-@cli_util.option('--masking-policy-health-report-id', required=True, help=u"""The OCID of the masking health report.""")
+@attribute_set_group.command(name=cli_util.override('data_safe.delete_attribute_set.command_name', 'delete'), help=u"""Submits a work request to delete an attribute set. \n[Command Reference](deleteAttributeSet)""")
+@cli_util.option('--attribute-set-id', required=True, help=u"""OCID of an attribute set.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -7916,18 +8576,18 @@ def delete_masking_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_masking_policy_health_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_health_report_id, if_match):
+def delete_attribute_set(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, attribute_set_id, if_match):
- if isinstance(masking_policy_health_report_id, six.string_types) and len(masking_policy_health_report_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-health-report-id cannot be whitespace or empty string')
+ if isinstance(attribute_set_id, six.string_types) and len(attribute_set_id.strip()) == 0:
+ raise click.UsageError('Parameter --attribute-set-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_safe', 'data_safe', ctx)
- result = client.delete_masking_policy_health_report(
- masking_policy_health_report_id=masking_policy_health_report_id,
+ result = client.delete_attribute_set(
+ attribute_set_id=attribute_set_id,
**kwargs
)
if wait_for_state:
@@ -7960,8 +8620,8 @@ def delete_masking_policy_health_report(ctx, from_json, wait_for_state, max_wait
cli_util.render_response(result, ctx)
-@masking_report_group.command(name=cli_util.override('data_safe.delete_masking_report.command_name', 'delete'), help=u"""Deletes the specified masking report. \n[Command Reference](deleteMaskingReport)""")
-@cli_util.option('--masking-report-id', required=True, help=u"""The OCID of the masking report.""")
+@audit_archive_retrieval_group.command(name=cli_util.override('data_safe.delete_audit_archive_retrieval.command_name', 'delete'), help=u"""To unload retrieved archive data, call the operation ListAuditArchiveRetrieval first. This will return the auditArchiveRetrievalId. Then call this operation with auditArchiveRetrievalId. \n[Command Reference](deleteAuditArchiveRetrieval)""")
+@cli_util.option('--audit-archive-retrieval-id', required=True, help=u"""OCID of the archive retrieval.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -7972,18 +8632,18 @@ def delete_masking_policy_health_report(ctx, from_json, wait_for_state, max_wait
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_masking_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_report_id, if_match):
+def delete_audit_archive_retrieval(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_archive_retrieval_id, if_match):
- if isinstance(masking_report_id, six.string_types) and len(masking_report_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-report-id cannot be whitespace or empty string')
+ if isinstance(audit_archive_retrieval_id, six.string_types) and len(audit_archive_retrieval_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-archive-retrieval-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_safe', 'data_safe', ctx)
- result = client.delete_masking_report(
- masking_report_id=masking_report_id,
+ result = client.delete_audit_archive_retrieval(
+ audit_archive_retrieval_id=audit_archive_retrieval_id,
**kwargs
)
if wait_for_state:
@@ -8016,8 +8676,8 @@ def delete_masking_report(ctx, from_json, wait_for_state, max_wait_seconds, wait
cli_util.render_response(result, ctx)
-@on_prem_connector_group.command(name=cli_util.override('data_safe.delete_on_prem_connector.command_name', 'delete'), help=u"""Deletes the specified on-premises connector. \n[Command Reference](deleteOnPremConnector)""")
-@cli_util.option('--on-prem-connector-id', required=True, help=u"""The OCID of the on-premises connector.""")
+@audit_profile_group.command(name=cli_util.override('data_safe.delete_audit_profile.command_name', 'delete'), help=u"""Deletes the specified audit profile. The audit profile delete operation is only supported for audit profiles with target type as TARGET_DATABASE_GROUP. \n[Command Reference](deleteAuditProfile)""")
+@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8028,18 +8688,18 @@ def delete_masking_report(ctx, from_json, wait_for_state, max_wait_seconds, wait
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_on_prem_connector(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, on_prem_connector_id, if_match):
+def delete_audit_profile(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_profile_id, if_match):
- if isinstance(on_prem_connector_id, six.string_types) and len(on_prem_connector_id.strip()) == 0:
- raise click.UsageError('Parameter --on-prem-connector-id cannot be whitespace or empty string')
+ if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-profile-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_safe', 'data_safe', ctx)
- result = client.delete_on_prem_connector(
- on_prem_connector_id=on_prem_connector_id,
+ result = client.delete_audit_profile(
+ audit_profile_id=audit_profile_id,
**kwargs
)
if wait_for_state:
@@ -8072,9 +8732,8 @@ def delete_on_prem_connector(ctx, from_json, wait_for_state, max_wait_seconds, w
cli_util.render_response(result, ctx)
-@peer_target_database_group.command(name=cli_util.override('data_safe.delete_peer_target_database.command_name', 'delete'), help=u"""Removes the specified peer target database from Data Safe. \n[Command Reference](deletePeerTargetDatabase)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
-@cli_util.option('--peer-target-database-id', required=True, type=click.INT, help=u"""The unique id of the peer target database.""")
+@audit_trail_group.command(name=cli_util.override('data_safe.delete_audit_trail.command_name', 'delete'), help=u"""Deletes the specified audit trail. \n[Command Reference](deleteAuditTrail)""")
+@cli_util.option('--audit-trail-id', required=True, help=u"""The OCID of the audit trail.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8085,22 +8744,18 @@ def delete_on_prem_connector(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={})
@cli_util.wrap_exceptions
-def delete_peer_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, peer_target_database_id, if_match):
-
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+def delete_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_trail_id, if_match):
- if isinstance(peer_target_database_id, six.string_types) and len(peer_target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --peer-target-database-id cannot be whitespace or empty string')
+ if isinstance(audit_trail_id, six.string_types) and len(audit_trail_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-trail-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_safe', 'data_safe', ctx)
- result = client.delete_peer_target_database(
- target_database_id=target_database_id,
- peer_target_database_id=peer_target_database_id,
+ result = client.delete_audit_trail(
+ audit_trail_id=audit_trail_id,
**kwargs
)
if wait_for_state:
@@ -8133,39 +8788,8 @@ def delete_peer_target_database(ctx, from_json, wait_for_state, max_wait_seconds
cli_util.render_response(result, ctx)
-@referential_relation_group.command(name=cli_util.override('data_safe.delete_referential_relation.command_name', 'delete'), help=u"""Deletes the specified referential relation. \n[Command Reference](deleteReferentialRelation)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--referential-relation-key', required=True, help=u"""The unique key that identifies the referential relation. It's numeric and unique within a sensitive data model.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
-@json_skeleton_utils.get_cli_json_input_option({})
-@cli_util.help_option
-@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
-@cli_util.wrap_exceptions
-def delete_referential_relation(ctx, from_json, sensitive_data_model_id, referential_relation_key, if_match):
-
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
-
- if isinstance(referential_relation_key, six.string_types) and len(referential_relation_key.strip()) == 0:
- raise click.UsageError('Parameter --referential-relation-key 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_safe', 'data_safe', ctx)
- result = client.delete_referential_relation(
- sensitive_data_model_id=sensitive_data_model_id,
- referential_relation_key=referential_relation_key,
- **kwargs
- )
- cli_util.render_response(result, ctx)
-
-
-@report_definition_group.command(name=cli_util.override('data_safe.delete_report_definition.command_name', 'delete'), help=u"""Deletes the specified report definition. Only the user created report definition can be deleted. The seeded report definitions cannot be deleted. \n[Command Reference](deleteReportDefinition)""")
-@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.delete_crypto_assessment.command_name', 'delete'), help=u"""Deletes the specified saved crypto assessment. Only assessments of type `SAVED` can be deleted. Attempts to delete a `LATEST` assessment return `400 InvalidParameter`. \n[Command Reference](deleteCryptoAssessment)""")
+@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8176,18 +8800,18 @@ def delete_referential_relation(ctx, from_json, sensitive_data_model_id, referen
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_report_definition(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, report_definition_id, if_match):
+def delete_crypto_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, crypto_assessment_id, if_match):
- if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
- raise click.UsageError('Parameter --report-definition-id cannot be whitespace or empty string')
+ if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --crypto-assessment-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_safe', 'data_safe', ctx)
- result = client.delete_report_definition(
- report_definition_id=report_definition_id,
+ result = client.delete_crypto_assessment(
+ crypto_assessment_id=crypto_assessment_id,
**kwargs
)
if wait_for_state:
@@ -8220,8 +8844,8 @@ def delete_report_definition(ctx, from_json, wait_for_state, max_wait_seconds, w
cli_util.render_response(result, ctx)
-@sdm_masking_policy_difference_group.command(name=cli_util.override('data_safe.delete_sdm_masking_policy_difference.command_name', 'delete'), help=u"""Deletes the specified SDM Masking policy difference. \n[Command Reference](deleteSdmMaskingPolicyDifference)""")
-@cli_util.option('--sdm-masking-policy-difference-id', required=True, help=u"""The OCID of the SDM masking policy difference.""")
+@data_safe_private_endpoint_group.command(name=cli_util.override('data_safe.delete_data_safe_private_endpoint.command_name', 'delete'), help=u"""Deletes the specified Data Safe private endpoint. \n[Command Reference](deleteDataSafePrivateEndpoint)""")
+@cli_util.option('--data-safe-private-endpoint-id', required=True, help=u"""The OCID of the private endpoint.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8232,18 +8856,18 @@ def delete_report_definition(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={})
@cli_util.wrap_exceptions
-def delete_sdm_masking_policy_difference(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sdm_masking_policy_difference_id, if_match):
+def delete_data_safe_private_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, data_safe_private_endpoint_id, if_match):
- if isinstance(sdm_masking_policy_difference_id, six.string_types) and len(sdm_masking_policy_difference_id.strip()) == 0:
- raise click.UsageError('Parameter --sdm-masking-policy-difference-id cannot be whitespace or empty string')
+ if isinstance(data_safe_private_endpoint_id, six.string_types) and len(data_safe_private_endpoint_id.strip()) == 0:
+ raise click.UsageError('Parameter --data-safe-private-endpoint-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.delete_sdm_masking_policy_difference(
- sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
+ result = client.delete_data_safe_private_endpoint(
+ data_safe_private_endpoint_id=data_safe_private_endpoint_id,
**kwargs
)
if wait_for_state:
@@ -8276,8 +8900,8 @@ def delete_sdm_masking_policy_difference(ctx, from_json, wait_for_state, max_wai
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.delete_security_assessment.command_name', 'delete'), help=u"""Deletes the specified saved security assessment or schedule. To delete a security assessment schedule, first call the operation ListSecurityAssessments with filters \"type = save_schedule\". That operation returns the scheduleAssessmentId. Then, call DeleteSecurityAssessment with the scheduleAssessmentId. If the assessment being deleted is the baseline for that compartment, then it will impact all baselines in the compartment. \n[Command Reference](deleteSecurityAssessment)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
+@discovery_job_group.command(name=cli_util.override('data_safe.delete_discovery_job.command_name', 'delete'), help=u"""Deletes the specified discovery job. \n[Command Reference](deleteDiscoveryJob)""")
+@cli_util.option('--discovery-job-id', required=True, help=u"""The OCID of the discovery job.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8288,18 +8912,18 @@ def delete_sdm_masking_policy_difference(ctx, from_json, wait_for_state, max_wai
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_security_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, if_match):
+def delete_discovery_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, discovery_job_id, if_match):
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+ if isinstance(discovery_job_id, six.string_types) and len(discovery_job_id.strip()) == 0:
+ raise click.UsageError('Parameter --discovery-job-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_safe', 'data_safe', ctx)
- result = client.delete_security_assessment(
- security_assessment_id=security_assessment_id,
+ result = client.delete_discovery_job(
+ discovery_job_id=discovery_job_id,
**kwargs
)
if wait_for_state:
@@ -8332,64 +8956,134 @@ def delete_security_assessment(ctx, from_json, wait_for_state, max_wait_seconds,
cli_util.render_response(result, ctx)
-@security_policy_group.command(name=cli_util.override('data_safe.delete_security_policy.command_name', 'delete'), help=u"""Deletes the specified security policy. \n[Command Reference](deleteSecurityPolicy)""")
-@cli_util.option('--security-policy-id', required=True, help=u"""The OCID of the security policy resource.""")
+@discovery_job_result_group.command(name=cli_util.override('data_safe.delete_discovery_job_result.command_name', 'delete'), help=u"""Deletes the specified discovery result. \n[Command Reference](deleteDiscoveryJobResult)""")
+@cli_util.option('--discovery-job-id', required=True, help=u"""The OCID of the discovery job.""")
+@cli_util.option('--result-key', required=True, help=u"""The unique key that identifies the discovery result.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
-@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
-@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
-@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_security_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_id, if_match):
+def delete_discovery_job_result(ctx, from_json, discovery_job_id, result_key, if_match):
- if isinstance(security_policy_id, six.string_types) and len(security_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-id cannot be whitespace or empty string')
+ if isinstance(discovery_job_id, six.string_types) and len(discovery_job_id.strip()) == 0:
+ raise click.UsageError('Parameter --discovery-job-id cannot be whitespace or empty string')
+
+ if isinstance(result_key, six.string_types) and len(result_key.strip()) == 0:
+ raise click.UsageError('Parameter --result-key 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_safe', 'data_safe', ctx)
- result = client.delete_security_policy(
- security_policy_id=security_policy_id,
+ result = client.delete_discovery_job_result(
+ discovery_job_id=discovery_job_id,
+ result_key=result_key,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@library_masking_format_group.command(name=cli_util.override('data_safe.delete_library_masking_format.command_name', 'delete'), help=u"""Deletes the specified library masking format. \n[Command Reference](deleteLibraryMaskingFormat)""")
+@cli_util.option('--library-masking-format-id', required=True, help=u"""The OCID of the library masking format.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "NEEDS_ATTENTION", "FAILED"]), 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 FAILED 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({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
+@cli_util.wrap_exceptions
+def delete_library_masking_format(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, library_masking_format_id, if_match):
+
+ if isinstance(library_masking_format_id, six.string_types) and len(library_masking_format_id.strip()) == 0:
+ raise click.UsageError('Parameter --library-masking-format-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_safe', 'data_safe', ctx)
+ result = client.delete_library_masking_format(
+ library_masking_format_id=library_masking_format_id,
**kwargs
)
if wait_for_state:
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
+ if hasattr(client, 'get_library_masking_format') and callable(getattr(client, 'get_library_masking_format')):
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)
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
+ oci.wait_until(client, client.get_library_masking_format(library_masking_format_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
+ except oci.exceptions.ServiceError as e:
+ # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
+ # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
+ # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
+ # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
+ # succeed_on_not_found=True to the waiter).
+ #
+ # Any non-404 should still result in the exception being thrown.
+ if e.status == 404:
+ pass
+ else:
+ raise
except oci.exceptions.MaximumWaitTimeExceeded as e:
# If we fail, we should show an error, but we should still provide the information to the customer
- click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
cli_util.render_response(result, ctx)
sys.exit(2)
except Exception:
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ 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 work request to enter the specified state', file=sys.stderr)
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
cli_util.render_response(result, ctx)
-@security_policy_config_group.command(name=cli_util.override('data_safe.delete_security_policy_config.command_name', 'delete'), help=u"""Deletes the specified Security policy configuration. \n[Command Reference](deleteSecurityPolicyConfig)""")
-@cli_util.option('--security-policy-config-id', required=True, help=u"""The OCID of the security policy configuration resource.""")
+@masking_column_group.command(name=cli_util.override('data_safe.delete_masking_column.command_name', 'delete'), help=u"""Deletes the specified masking column. \n[Command Reference](deleteMaskingColumn)""")
+@cli_util.option('--masking-column-key', required=True, help=u"""The unique key that identifies the masking column. It's numeric and unique within a masking policy.""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
+@cli_util.wrap_exceptions
+def delete_masking_column(ctx, from_json, masking_column_key, masking_policy_id, if_match):
+
+ if isinstance(masking_column_key, six.string_types) and len(masking_column_key.strip()) == 0:
+ raise click.UsageError('Parameter --masking-column-key cannot be whitespace or empty string')
+
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-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_safe', 'data_safe', ctx)
+ result = client.delete_masking_column(
+ masking_column_key=masking_column_key,
+ masking_policy_id=masking_policy_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@masking_policy_group.command(name=cli_util.override('data_safe.delete_masking_policy.command_name', 'delete'), help=u"""Deletes the specified masking policy. \n[Command Reference](deleteMaskingPolicy)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8400,18 +9094,18 @@ def delete_security_policy(ctx, from_json, wait_for_state, max_wait_seconds, wai
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_security_policy_config(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_config_id, if_match):
+def delete_masking_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, if_match):
- if isinstance(security_policy_config_id, six.string_types) and len(security_policy_config_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-config-id cannot be whitespace or empty string')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-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_safe', 'data_safe', ctx)
- result = client.delete_security_policy_config(
- security_policy_config_id=security_policy_config_id,
+ result = client.delete_masking_policy(
+ masking_policy_id=masking_policy_id,
**kwargs
)
if wait_for_state:
@@ -8444,8 +9138,8 @@ def delete_security_policy_config(ctx, from_json, wait_for_state, max_wait_secon
cli_util.render_response(result, ctx)
-@security_policy_deployment_group.command(name=cli_util.override('data_safe.delete_security_policy_deployment.command_name', 'delete'), help=u"""Deletes the specified Security policy deployment. \n[Command Reference](deleteSecurityPolicyDeployment)""")
-@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
+@masking_policy_health_report_group.command(name=cli_util.override('data_safe.delete_masking_policy_health_report.command_name', 'delete'), help=u"""Deletes the specified masking policy health report. \n[Command Reference](deleteMaskingPolicyHealthReport)""")
+@cli_util.option('--masking-policy-health-report-id', required=True, help=u"""The OCID of the masking health report.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8456,18 +9150,18 @@ def delete_security_policy_config(ctx, from_json, wait_for_state, max_wait_secon
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_security_policy_deployment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_deployment_id, if_match):
+def delete_masking_policy_health_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_health_report_id, if_match):
- if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-deployment-id cannot be whitespace or empty string')
+ if isinstance(masking_policy_health_report_id, six.string_types) and len(masking_policy_health_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-health-report-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_safe', 'data_safe', ctx)
- result = client.delete_security_policy_deployment(
- security_policy_deployment_id=security_policy_deployment_id,
+ result = client.delete_masking_policy_health_report(
+ masking_policy_health_report_id=masking_policy_health_report_id,
**kwargs
)
if wait_for_state:
@@ -8500,39 +9194,8 @@ def delete_security_policy_deployment(ctx, from_json, wait_for_state, max_wait_s
cli_util.render_response(result, ctx)
-@sensitive_column_group.command(name=cli_util.override('data_safe.delete_sensitive_column.command_name', 'delete'), help=u"""Deletes the specified sensitive column. \n[Command Reference](deleteSensitiveColumn)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--sensitive-column-key', required=True, help=u"""The unique key that identifies the sensitive column. It's numeric and unique within a sensitive data model.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.confirm_delete_option
-@json_skeleton_utils.get_cli_json_input_option({})
-@cli_util.help_option
-@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
-@cli_util.wrap_exceptions
-def delete_sensitive_column(ctx, from_json, sensitive_data_model_id, sensitive_column_key, if_match):
-
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
-
- if isinstance(sensitive_column_key, six.string_types) and len(sensitive_column_key.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-column-key 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_safe', 'data_safe', ctx)
- result = client.delete_sensitive_column(
- sensitive_data_model_id=sensitive_data_model_id,
- sensitive_column_key=sensitive_column_key,
- **kwargs
- )
- cli_util.render_response(result, ctx)
-
-
-@sensitive_data_model_group.command(name=cli_util.override('data_safe.delete_sensitive_data_model.command_name', 'delete'), help=u"""Deletes the specified sensitive data model. \n[Command Reference](deleteSensitiveDataModel)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@masking_report_group.command(name=cli_util.override('data_safe.delete_masking_report.command_name', 'delete'), help=u"""Deletes the specified masking report. \n[Command Reference](deleteMaskingReport)""")
+@cli_util.option('--masking-report-id', required=True, help=u"""The OCID of the masking report.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8543,18 +9206,18 @@ def delete_sensitive_column(ctx, from_json, sensitive_data_model_id, sensitive_c
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_sensitive_data_model(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_data_model_id, if_match):
+def delete_masking_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_report_id, if_match):
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+ if isinstance(masking_report_id, six.string_types) and len(masking_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-report-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_safe', 'data_safe', ctx)
- result = client.delete_sensitive_data_model(
- sensitive_data_model_id=sensitive_data_model_id,
+ result = client.delete_masking_report(
+ masking_report_id=masking_report_id,
**kwargs
)
if wait_for_state:
@@ -8587,72 +9250,65 @@ def delete_sensitive_data_model(ctx, from_json, wait_for_state, max_wait_seconds
cli_util.render_response(result, ctx)
-@sensitive_type_group.command(name=cli_util.override('data_safe.delete_sensitive_type.command_name', 'delete'), help=u"""Deletes the specified sensitive type. \n[Command Reference](deleteSensitiveType)""")
-@cli_util.option('--sensitive-type-id', required=True, help=u"""The OCID of the sensitive type.""")
+@on_prem_connector_group.command(name=cli_util.override('data_safe.delete_on_prem_connector.command_name', 'delete'), help=u"""Deletes the specified on-premises connector. \n[Command Reference](deleteOnPremConnector)""")
+@cli_util.option('--on-prem-connector-id', required=True, help=u"""The OCID of the on-premises connector.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
-@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), 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 FAILED 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.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_sensitive_type(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_id, if_match):
+def delete_on_prem_connector(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, on_prem_connector_id, if_match):
- if isinstance(sensitive_type_id, six.string_types) and len(sensitive_type_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-type-id cannot be whitespace or empty string')
+ if isinstance(on_prem_connector_id, six.string_types) and len(on_prem_connector_id.strip()) == 0:
+ raise click.UsageError('Parameter --on-prem-connector-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_safe', 'data_safe', ctx)
- result = client.delete_sensitive_type(
- sensitive_type_id=sensitive_type_id,
+ result = client.delete_on_prem_connector(
+ on_prem_connector_id=on_prem_connector_id,
**kwargs
)
if wait_for_state:
- if hasattr(client, 'get_sensitive_type') and callable(getattr(client, 'get_sensitive_type')):
+ 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 resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
- oci.wait_until(client, client.get_sensitive_type(sensitive_type_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
- except oci.exceptions.ServiceError as e:
- # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
- # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
- # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
- # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
- # succeed_on_not_found=True to the waiter).
- #
- # Any non-404 should still result in the exception being thrown.
- if e.status == 404:
- pass
- else:
- raise
+ 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 resource entered the specified state. Please retrieve the resource to find its current 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:
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ 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 resource to enter the specified state', file=sys.stderr)
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
cli_util.render_response(result, ctx)
-@sensitive_type_group_group.command(name=cli_util.override('data_safe.delete_sensitive_type_group.command_name', 'delete'), help=u"""Deletes the specified sensitive type group. \n[Command Reference](deleteSensitiveTypeGroup)""")
-@cli_util.option('--sensitive-type-group-id', required=True, help=u"""The OCID of the sensitive type group.""")
+@peer_target_database_group.command(name=cli_util.override('data_safe.delete_peer_target_database.command_name', 'delete'), help=u"""Removes the specified peer target database from Data Safe. \n[Command Reference](deletePeerTargetDatabase)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@cli_util.option('--peer-target-database-id', required=True, type=click.INT, help=u"""The unique id of the peer target database.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8663,18 +9319,22 @@ def delete_sensitive_type(ctx, from_json, wait_for_state, max_wait_seconds, wait
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_sensitive_type_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_group_id, if_match):
+def delete_peer_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, peer_target_database_id, if_match):
- if isinstance(sensitive_type_group_id, six.string_types) and len(sensitive_type_group_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-type-group-id cannot be whitespace or empty string')
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+
+ if isinstance(peer_target_database_id, six.string_types) and len(peer_target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --peer-target-database-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.delete_sensitive_type_group(
- sensitive_type_group_id=sensitive_type_group_id,
+ result = client.delete_peer_target_database(
+ target_database_id=target_database_id,
+ peer_target_database_id=peer_target_database_id,
**kwargs
)
if wait_for_state:
@@ -8707,72 +9367,39 @@ def delete_sensitive_type_group(ctx, from_json, wait_for_state, max_wait_seconds
cli_util.render_response(result, ctx)
-@sensitive_types_export_group.command(name=cli_util.override('data_safe.delete_sensitive_types_export.command_name', 'delete'), help=u"""Deletes the specified sensitive types export. \n[Command Reference](deleteSensitiveTypesExport)""")
-@cli_util.option('--sensitive-types-export-id', required=True, help=u"""The OCID of the sensitive types export.""")
+@referential_relation_group.command(name=cli_util.override('data_safe.delete_referential_relation.command_name', 'delete'), help=u"""Deletes the specified referential relation. \n[Command Reference](deleteReferentialRelation)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--referential-relation-key', required=True, help=u"""The unique key that identifies the referential relation. It's numeric and unique within a sensitive data model.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
-@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), 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 FAILED 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({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_sensitive_types_export(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_types_export_id, if_match):
+def delete_referential_relation(ctx, from_json, sensitive_data_model_id, referential_relation_key, if_match):
- if isinstance(sensitive_types_export_id, six.string_types) and len(sensitive_types_export_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-types-export-id cannot be whitespace or empty string')
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+
+ if isinstance(referential_relation_key, six.string_types) and len(referential_relation_key.strip()) == 0:
+ raise click.UsageError('Parameter --referential-relation-key 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_safe', 'data_safe', ctx)
- result = client.delete_sensitive_types_export(
- sensitive_types_export_id=sensitive_types_export_id,
+ result = client.delete_referential_relation(
+ sensitive_data_model_id=sensitive_data_model_id,
+ referential_relation_key=referential_relation_key,
**kwargs
)
- if wait_for_state:
+ cli_util.render_response(result, ctx)
- if hasattr(client, 'get_sensitive_types_export') and callable(getattr(client, 'get_sensitive_types_export')):
- 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)
- oci.wait_until(client, client.get_sensitive_types_export(sensitive_types_export_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
- except oci.exceptions.ServiceError as e:
- # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
- # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
- # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
- # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
- # succeed_on_not_found=True to the waiter).
- #
- # Any non-404 should still result in the exception being thrown.
- if e.status == 404:
- pass
- else:
- raise
- 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. Please retrieve the resource to find its current state', file=sys.stderr)
- cli_util.render_response(result, ctx)
- sys.exit(2)
- except Exception:
- click.echo('Encountered error while waiting for 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)
-
-@sql_collection_group.command(name=cli_util.override('data_safe.delete_sql_collection.command_name', 'delete'), help=u"""Deletes the specified SQL collection. \n[Command Reference](deleteSqlCollection)""")
-@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
+@registration_policy_group.command(name=cli_util.override('data_safe.delete_registration_policy.command_name', 'delete'), help=u"""Deletes the specified registration policy. \n[Command Reference](deleteRegistrationPolicy)""")
+@cli_util.option('--registration-policy-id', required=True, help=u"""The OCID of the registration policy to be used for identification""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8783,18 +9410,18 @@ def delete_sensitive_types_export(ctx, from_json, wait_for_state, max_wait_secon
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_sql_collection(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, if_match):
+def delete_registration_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, registration_policy_id, if_match):
- if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
+ if isinstance(registration_policy_id, six.string_types) and len(registration_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --registration-policy-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_safe', 'data_safe', ctx)
- result = client.delete_sql_collection(
- sql_collection_id=sql_collection_id,
+ result = client.delete_registration_policy(
+ registration_policy_id=registration_policy_id,
**kwargs
)
if wait_for_state:
@@ -8827,8 +9454,8 @@ def delete_sql_collection(ctx, from_json, wait_for_state, max_wait_seconds, wait
cli_util.render_response(result, ctx)
-@sql_firewall_allowed_sql_group.command(name=cli_util.override('data_safe.delete_sql_firewall_allowed_sql.command_name', 'delete'), help=u"""Deletes the specified allowed sql. \n[Command Reference](deleteSqlFirewallAllowedSql)""")
-@cli_util.option('--sql-firewall-allowed-sql-id', required=True, help=u"""The OCID of the sqlFirewallAllowedSql resource.""")
+@report_definition_group.command(name=cli_util.override('data_safe.delete_report_definition.command_name', 'delete'), help=u"""Deletes the specified report definition. Only the user created report definition can be deleted. The seeded report definitions cannot be deleted. \n[Command Reference](deleteReportDefinition)""")
+@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8839,18 +9466,18 @@ def delete_sql_collection(ctx, from_json, wait_for_state, max_wait_seconds, wait
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_sql_firewall_allowed_sql(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_firewall_allowed_sql_id, if_match):
+def delete_report_definition(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, report_definition_id, if_match):
- if isinstance(sql_firewall_allowed_sql_id, six.string_types) and len(sql_firewall_allowed_sql_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-firewall-allowed-sql-id cannot be whitespace or empty string')
+ if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
+ raise click.UsageError('Parameter --report-definition-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_safe', 'data_safe', ctx)
- result = client.delete_sql_firewall_allowed_sql(
- sql_firewall_allowed_sql_id=sql_firewall_allowed_sql_id,
+ result = client.delete_report_definition(
+ report_definition_id=report_definition_id,
**kwargs
)
if wait_for_state:
@@ -8883,8 +9510,8 @@ def delete_sql_firewall_allowed_sql(ctx, from_json, wait_for_state, max_wait_sec
cli_util.render_response(result, ctx)
-@sql_firewall_policy_group.command(name=cli_util.override('data_safe.delete_sql_firewall_policy.command_name', 'delete'), help=u"""Deletes the SQL Firewall policy resource. \n[Command Reference](deleteSqlFirewallPolicy)""")
-@cli_util.option('--sql-firewall-policy-id', required=True, help=u"""The OCID of the SQL Firewall policy resource.""")
+@sdm_masking_policy_difference_group.command(name=cli_util.override('data_safe.delete_sdm_masking_policy_difference.command_name', 'delete'), help=u"""Deletes the specified SDM Masking policy difference. \n[Command Reference](deleteSdmMaskingPolicyDifference)""")
+@cli_util.option('--sdm-masking-policy-difference-id', required=True, help=u"""The OCID of the SDM masking policy difference.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8895,18 +9522,18 @@ def delete_sql_firewall_allowed_sql(ctx, from_json, wait_for_state, max_wait_sec
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_sql_firewall_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_firewall_policy_id, if_match):
+def delete_sdm_masking_policy_difference(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sdm_masking_policy_difference_id, if_match):
- if isinstance(sql_firewall_policy_id, six.string_types) and len(sql_firewall_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-firewall-policy-id cannot be whitespace or empty string')
+ if isinstance(sdm_masking_policy_difference_id, six.string_types) and len(sdm_masking_policy_difference_id.strip()) == 0:
+ raise click.UsageError('Parameter --sdm-masking-policy-difference-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_safe', 'data_safe', ctx)
- result = client.delete_sql_firewall_policy(
- sql_firewall_policy_id=sql_firewall_policy_id,
+ result = client.delete_sdm_masking_policy_difference(
+ sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
**kwargs
)
if wait_for_state:
@@ -8939,8 +9566,8 @@ def delete_sql_firewall_policy(ctx, from_json, wait_for_state, max_wait_seconds,
cli_util.render_response(result, ctx)
-@target_alert_policy_association_group.command(name=cli_util.override('data_safe.delete_target_alert_policy_association.command_name', 'delete'), help=u"""Deletes the specified target-alert policy Association. \n[Command Reference](deleteTargetAlertPolicyAssociation)""")
-@cli_util.option('--target-alert-policy-association-id', required=True, help=u"""The OCID of the target-alert policy association.""")
+@security_assessment_group.command(name=cli_util.override('data_safe.delete_security_assessment.command_name', 'delete'), help=u"""Deletes the specified saved security assessment or schedule. To delete a security assessment schedule, first call the operation ListSecurityAssessments with filters \"type = save_schedule\". That operation returns the scheduleAssessmentId. Then, call DeleteSecurityAssessment with the scheduleAssessmentId. If the assessment being deleted is the baseline for that compartment, then it will impact all baselines in the compartment. \n[Command Reference](deleteSecurityAssessment)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -8951,18 +9578,18 @@ def delete_sql_firewall_policy(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 delete_target_alert_policy_association(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_alert_policy_association_id, if_match):
+def delete_security_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, if_match):
- if isinstance(target_alert_policy_association_id, six.string_types) and len(target_alert_policy_association_id.strip()) == 0:
- raise click.UsageError('Parameter --target-alert-policy-association-id cannot be whitespace or empty string')
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-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_safe', 'data_safe', ctx)
- result = client.delete_target_alert_policy_association(
- target_alert_policy_association_id=target_alert_policy_association_id,
+ result = client.delete_security_assessment(
+ security_assessment_id=security_assessment_id,
**kwargs
)
if wait_for_state:
@@ -8995,8 +9622,8 @@ def delete_target_alert_policy_association(ctx, from_json, wait_for_state, max_w
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.delete_target_database.command_name', 'delete'), help=u"""Deregisters the specified database from Data Safe and removes the target database from the Data Safe Console. \n[Command Reference](deleteTargetDatabase)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@security_policy_group.command(name=cli_util.override('data_safe.delete_security_policy.command_name', 'delete'), help=u"""Deletes the specified security policy. \n[Command Reference](deleteSecurityPolicy)""")
+@cli_util.option('--security-policy-id', required=True, help=u"""The OCID of the security policy resource.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -9007,18 +9634,18 @@ def delete_target_alert_policy_association(ctx, from_json, wait_for_state, max_w
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, if_match):
+def delete_security_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_id, if_match):
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+ if isinstance(security_policy_id, six.string_types) and len(security_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-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_safe', 'data_safe', ctx)
- result = client.delete_target_database(
- target_database_id=target_database_id,
+ result = client.delete_security_policy(
+ security_policy_id=security_policy_id,
**kwargs
)
if wait_for_state:
@@ -9051,8 +9678,8 @@ def delete_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wai
cli_util.render_response(result, ctx)
-@target_database_group_group.command(name=cli_util.override('data_safe.delete_target_database_group.command_name', 'delete'), help=u"""Deletes the specified target database group. \n[Command Reference](deleteTargetDatabaseGroup)""")
-@cli_util.option('--target-database-group-id', required=True, help=u"""The OCID of the specified target database group.""")
+@security_policy_config_group.command(name=cli_util.override('data_safe.delete_security_policy_config.command_name', 'delete'), help=u"""Deletes the specified Security policy configuration. \n[Command Reference](deleteSecurityPolicyConfig)""")
+@cli_util.option('--security-policy-config-id', required=True, help=u"""The OCID of the security policy configuration resource.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -9063,18 +9690,18 @@ def delete_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wai
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_target_database_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_group_id, if_match):
+def delete_security_policy_config(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_config_id, if_match):
- if isinstance(target_database_group_id, six.string_types) and len(target_database_group_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-group-id cannot be whitespace or empty string')
+ if isinstance(security_policy_config_id, six.string_types) and len(security_policy_config_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-config-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_safe', 'data_safe', ctx)
- result = client.delete_target_database_group(
- target_database_group_id=target_database_group_id,
+ result = client.delete_security_policy_config(
+ security_policy_config_id=security_policy_config_id,
**kwargs
)
if wait_for_state:
@@ -9107,8 +9734,8 @@ def delete_target_database_group(ctx, from_json, wait_for_state, max_wait_second
cli_util.render_response(result, ctx)
-@unified_audit_policy_group.command(name=cli_util.override('data_safe.delete_unified_audit_policy.command_name', 'delete'), help=u"""Deletes the Unified Audit policy resource. \n[Command Reference](deleteUnifiedAuditPolicy)""")
-@cli_util.option('--unified-audit-policy-id', required=True, help=u"""The OCID of the Unified Audit policy resource.""")
+@security_policy_deployment_group.command(name=cli_util.override('data_safe.delete_security_policy_deployment.command_name', 'delete'), help=u"""Deletes the specified Security policy deployment. \n[Command Reference](deleteSecurityPolicyDeployment)""")
+@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -9119,18 +9746,18 @@ def delete_target_database_group(ctx, from_json, wait_for_state, max_wait_second
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_unified_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, unified_audit_policy_id, if_match):
+def delete_security_policy_deployment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_deployment_id, if_match):
- if isinstance(unified_audit_policy_id, six.string_types) and len(unified_audit_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --unified-audit-policy-id cannot be whitespace or empty string')
+ if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-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'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.delete_unified_audit_policy(
- unified_audit_policy_id=unified_audit_policy_id,
+ result = client.delete_security_policy_deployment(
+ security_policy_deployment_id=security_policy_deployment_id,
**kwargs
)
if wait_for_state:
@@ -9163,8 +9790,39 @@ def delete_unified_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds
cli_util.render_response(result, ctx)
-@unified_audit_policy_definition_group.command(name=cli_util.override('data_safe.delete_unified_audit_policy_definition.command_name', 'delete'), help=u"""Deletes the specified Unified audit policy definition. \n[Command Reference](deleteUnifiedAuditPolicyDefinition)""")
-@cli_util.option('--unified-audit-policy-definition-id', required=True, help=u"""The OCID of the unified audit policy definition resource.""")
+@sensitive_column_group.command(name=cli_util.override('data_safe.delete_sensitive_column.command_name', 'delete'), help=u"""Deletes the specified sensitive column. \n[Command Reference](deleteSensitiveColumn)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--sensitive-column-key', required=True, help=u"""The unique key that identifies the sensitive column. It's numeric and unique within a sensitive data model.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
+@cli_util.wrap_exceptions
+def delete_sensitive_column(ctx, from_json, sensitive_data_model_id, sensitive_column_key, if_match):
+
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+
+ if isinstance(sensitive_column_key, six.string_types) and len(sensitive_column_key.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-column-key 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_safe', 'data_safe', ctx)
+ result = client.delete_sensitive_column(
+ sensitive_data_model_id=sensitive_data_model_id,
+ sensitive_column_key=sensitive_column_key,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sensitive_data_model_group.command(name=cli_util.override('data_safe.delete_sensitive_data_model.command_name', 'delete'), help=u"""Deletes the specified sensitive data model. \n[Command Reference](deleteSensitiveDataModel)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -9175,18 +9833,18 @@ def delete_unified_audit_policy(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 delete_unified_audit_policy_definition(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, unified_audit_policy_definition_id, if_match):
+def delete_sensitive_data_model(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_data_model_id, if_match):
- if isinstance(unified_audit_policy_definition_id, six.string_types) and len(unified_audit_policy_definition_id.strip()) == 0:
- raise click.UsageError('Parameter --unified-audit-policy-definition-id cannot be whitespace or empty string')
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-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_safe', 'data_safe', ctx)
- result = client.delete_unified_audit_policy_definition(
- unified_audit_policy_definition_id=unified_audit_policy_definition_id,
+ result = client.delete_sensitive_data_model(
+ sensitive_data_model_id=sensitive_data_model_id,
**kwargs
)
if wait_for_state:
@@ -9219,65 +9877,74 @@ def delete_unified_audit_policy_definition(ctx, from_json, wait_for_state, max_w
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.delete_user_assessment.command_name', 'delete'), help=u"""Deletes the specified saved user assessment or schedule. To delete a user assessment schedule, first call the operation ListUserAssessments with filters \"type = save_schedule\". That call returns the scheduleAssessmentId. Then call DeleteUserAssessment with the scheduleAssessmentId. If the assessment being deleted is the baseline for that compartment, then it will impact all baselines in the compartment. \n[Command Reference](deleteUserAssessment)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@sensitive_type_group.command(name=cli_util.override('data_safe.delete_sensitive_type.command_name', 'delete'), help=u"""Deletes the specified sensitive type. \n[Command Reference](deleteSensitiveType)""")
+@cli_util.option('--sensitive-type-id', required=True, help=u"""The OCID of the sensitive type.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.confirm_delete_option
-@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), 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 FAILED 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({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def delete_user_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, user_assessment_id, if_match):
+def delete_sensitive_type(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_id, if_match):
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+ if isinstance(sensitive_type_id, six.string_types) and len(sensitive_type_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-type-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_safe', 'data_safe', ctx)
- result = client.delete_user_assessment(
- user_assessment_id=user_assessment_id,
+ result = client.delete_sensitive_type(
+ sensitive_type_id=sensitive_type_id,
**kwargs
)
if wait_for_state:
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
+ if hasattr(client, 'get_sensitive_type') and callable(getattr(client, 'get_sensitive_type')):
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)
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
+ oci.wait_until(client, client.get_sensitive_type(sensitive_type_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
+ except oci.exceptions.ServiceError as e:
+ # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
+ # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
+ # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
+ # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
+ # succeed_on_not_found=True to the waiter).
+ #
+ # Any non-404 should still result in the exception being thrown.
+ if e.status == 404:
+ pass
+ else:
+ raise
except oci.exceptions.MaximumWaitTimeExceeded as e:
# If we fail, we should show an error, but we should still provide the information to the customer
- click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
cli_util.render_response(result, ctx)
sys.exit(2)
except Exception:
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ 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 work request to enter the specified state', file=sys.stderr)
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
cli_util.render_response(result, ctx)
-@security_policy_deployment_group.command(name=cli_util.override('data_safe.deploy_security_policy_deployment.command_name', 'deploy'), help=u"""Deploy the security policy to the specified target or target groups. \n[Command Reference](deploySecurityPolicyDeployment)""")
-@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
+@sensitive_type_group_group.command(name=cli_util.override('data_safe.delete_sensitive_type_group.command_name', 'delete'), help=u"""Deletes the specified sensitive type group. \n[Command Reference](deleteSensitiveTypeGroup)""")
+@cli_util.option('--sensitive-type-group-id', required=True, help=u"""The OCID of the sensitive type group.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -9286,18 +9953,18 @@ def delete_user_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wai
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def deploy_security_policy_deployment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_deployment_id, if_match):
+def delete_sensitive_type_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_group_id, if_match):
- if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-deployment-id cannot be whitespace or empty string')
+ if isinstance(sensitive_type_group_id, six.string_types) and len(sensitive_type_group_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-type-group-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_safe', 'data_safe', ctx)
- result = client.deploy_security_policy_deployment(
- security_policy_deployment_id=security_policy_deployment_id,
+ result = client.delete_sensitive_type_group(
+ sensitive_type_group_id=sensitive_type_group_id,
**kwargs
)
if wait_for_state:
@@ -9318,7 +9985,7 @@ def deploy_security_policy_deployment(ctx, from_json, wait_for_state, max_wait_s
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:
@@ -9330,41 +9997,106 @@ def deploy_security_policy_deployment(ctx, from_json, wait_for_state, max_wait_s
cli_util.render_response(result, ctx)
-@audit_profile_group.command(name=cli_util.override('data_safe.discover_audit_trails.command_name', 'discover-audit-trails'), help=u"""Updates the list of audit trails created under audit profile.The operation can be used to create new audit trails for target database when they become available for audit collection because of change of database version or change of database unified mode or change of data base edition or being deleted previously etc. \n[Command Reference](discoverAuditTrails)""")
-@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
+@sensitive_types_export_group.command(name=cli_util.override('data_safe.delete_sensitive_types_export.command_name', 'delete'), help=u"""Deletes the specified sensitive types export. \n[Command Reference](deleteSensitiveTypesExport)""")
+@cli_util.option('--sensitive-types-export-id', required=True, help=u"""The OCID of the sensitive types export.""")
@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), 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 FAILED 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({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def discover_audit_trails(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_profile_id, if_match):
+def delete_sensitive_types_export(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_types_export_id, if_match):
- if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-profile-id cannot be whitespace or empty string')
+ if isinstance(sensitive_types_export_id, six.string_types) and len(sensitive_types_export_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-types-export-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_safe', 'data_safe', ctx)
- result = client.discover_audit_trails(
- audit_profile_id=audit_profile_id,
+ result = client.delete_sensitive_types_export(
+ sensitive_types_export_id=sensitive_types_export_id,
**kwargs
)
if wait_for_state:
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
+ if hasattr(client, 'get_sensitive_types_export') and callable(getattr(client, 'get_sensitive_types_export')):
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('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
+ oci.wait_until(client, client.get_sensitive_types_export(sensitive_types_export_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
+ except oci.exceptions.ServiceError as e:
+ # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
+ # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
+ # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
+ # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
+ # succeed_on_not_found=True to the waiter).
+ #
+ # Any non-404 should still result in the exception being thrown.
+ if e.status == 404:
+ pass
+ else:
+ raise
+ 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. Please retrieve the resource to find its current state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ sys.exit(2)
+ except Exception:
+ click.echo('Encountered error while waiting for 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)
+
+
+@sql_collection_group.command(name=cli_util.override('data_safe.delete_sql_collection.command_name', 'delete'), help=u"""Deletes the specified SQL collection. \n[Command Reference](deleteSqlCollection)""")
+@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
+@cli_util.wrap_exceptions
+def delete_sql_collection(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, if_match):
+
+ if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-collection-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_safe', 'data_safe', ctx)
+ result = client.delete_sql_collection(
+ sql_collection_id=sql_collection_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
@@ -9373,7 +10105,7 @@ def discover_audit_trails(ctx, from_json, wait_for_state, max_wait_seconds, wait
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:
@@ -9385,573 +10117,379 @@ def discover_audit_trails(ctx, from_json, wait_for_state, max_wait_seconds, wait
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.download_crypto_assessment_report.command_name', 'download-crypto-assessment-report'), help=u"""Downloads the report of the specified crypto assessment. To download the crypto assessment report, it needs to be generated first. Please use GenerateCryptoAssessmentReport to generate a downloadable report in the preferred format (PDF, XLS). \n[Command Reference](downloadCryptoAssessmentReport)""")
-@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
-@cli_util.option('--format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the crypto assessment report.""")
-@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@sql_firewall_allowed_sql_group.command(name=cli_util.override('data_safe.delete_sql_firewall_allowed_sql.command_name', 'delete'), help=u"""Deletes the specified allowed sql. \n[Command Reference](deleteSqlFirewallAllowedSql)""")
+@cli_util.option('--sql-firewall-allowed-sql-id', required=True, help=u"""The OCID of the sqlFirewallAllowedSql resource.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 download_crypto_assessment_report(ctx, from_json, file, crypto_assessment_id, format, if_match):
+def delete_sql_firewall_allowed_sql(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_firewall_allowed_sql_id, if_match):
- if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
+ if isinstance(sql_firewall_allowed_sql_id, six.string_types) and len(sql_firewall_allowed_sql_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-firewall-allowed-sql-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['format'] = format
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.download_crypto_assessment_report(
- crypto_assessment_id=crypto_assessment_id,
- download_crypto_assessment_report_details=_details,
+ result = client.delete_sql_firewall_allowed_sql(
+ sql_firewall_allowed_sql_id=sql_firewall_allowed_sql_id,
**kwargs
)
+ if wait_for_state:
- # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
- # Also we need a non-zero Content-Length in order to display a meaningful progress bar
- bar = None
- if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
- content_length = int(result.headers['Content-Length'])
- if content_length > 0:
- bar = click.progressbar(length=content_length, label='Downloading file')
-
- try:
- if bar:
- bar.__enter__()
+ 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
- # TODO: Make the download size a configurable option
- # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
- for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
- if bar:
- bar.update(len(chunk))
- file.write(chunk)
- finally:
- if bar:
- bar.render_finish()
- file.close()
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
+ # If we fail, we should show an error, but we should still provide the information to the customer
+ click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ sys.exit(2)
+ except Exception:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ raise
+ else:
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
-@sensitive_data_model_group.command(name=cli_util.override('data_safe.download_discovery_report.command_name', 'download-discovery-report'), help=u"""Downloads an already-generated discovery report. Note that the GenerateDiscoveryReportForDownload operation is a prerequisite for the DownloadDiscoveryReport operation. Use GenerateDiscoveryReportForDownload to generate a discovery report file and then use DownloadDiscoveryReport to download the generated file. By default, it downloads report for all the columns in a sensitive data model. Use the discoveryJobId attribute to download report for a specific discovery job. \n[Command Reference](downloadDiscoveryReport)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
-@cli_util.option('--discovery-job-id', help=u"""The OCID of the discovery job.""")
-@cli_util.option('--report-format', type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
+@sql_firewall_policy_group.command(name=cli_util.override('data_safe.delete_sql_firewall_policy.command_name', 'delete'), help=u"""Deletes the SQL Firewall policy resource. \n[Command Reference](deleteSqlFirewallPolicy)""")
+@cli_util.option('--sql-firewall-policy-id', required=True, help=u"""The OCID of the SQL Firewall policy resource.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 download_discovery_report(ctx, from_json, file, sensitive_data_model_id, discovery_job_id, report_format):
+def delete_sql_firewall_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_firewall_policy_id, if_match):
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+ if isinstance(sql_firewall_policy_id, six.string_types) and len(sql_firewall_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-firewall-policy-id cannot be whitespace or empty string')
kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
-
- if discovery_job_id is not None:
- _details['discoveryJobId'] = discovery_job_id
-
- if report_format is not None:
- _details['reportFormat'] = report_format
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.download_discovery_report(
- sensitive_data_model_id=sensitive_data_model_id,
- download_discovery_report_details=_details,
+ result = client.delete_sql_firewall_policy(
+ sql_firewall_policy_id=sql_firewall_policy_id,
**kwargs
)
+ if wait_for_state:
- # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
- # Also we need a non-zero Content-Length in order to display a meaningful progress bar
- bar = None
- if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
- content_length = int(result.headers['Content-Length'])
- if content_length > 0:
- bar = click.progressbar(length=content_length, label='Downloading file')
-
- try:
- if bar:
- bar.__enter__()
+ 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
- # TODO: Make the download size a configurable option
- # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
- for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
- if bar:
- bar.update(len(chunk))
- file.write(chunk)
- finally:
- if bar:
- bar.render_finish()
- file.close()
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
+ # If we fail, we should show an error, but we should still provide the information to the customer
+ click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ sys.exit(2)
+ except Exception:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ raise
+ else:
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.download_masking_log.command_name', 'download-masking-log'), help=u"""Downloads the masking log generated by the last masking operation on a target database using the specified masking policy. \n[Command Reference](downloadMaskingLog)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
-@cli_util.option('--target-id', help=u"""The OCID of the target database for which the masking log is to be downloaded.""")
-@cli_util.option('--masking-work-request-id', help=u"""The OCID of the masking work request that resulted in this masking log.""")
+@subsetting_policy_group.command(name=cli_util.override('data_safe.delete_subsetting_policy.command_name', 'delete'), help=u"""Deletes the specified subsetting policy. \n[Command Reference](deleteSubsettingPolicy)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 download_masking_log(ctx, from_json, file, masking_policy_id, target_id, masking_work_request_id):
+def delete_subsetting_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_policy_id, if_match):
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
-
- if target_id is not None:
- _details['targetId'] = target_id
-
- if masking_work_request_id is not None:
- _details['maskingWorkRequestId'] = masking_work_request_id
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.download_masking_log(
- masking_policy_id=masking_policy_id,
- download_masking_log_details=_details,
+ result = client.delete_subsetting_policy(
+ subsetting_policy_id=subsetting_policy_id,
**kwargs
)
+ if wait_for_state:
- # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
- # Also we need a non-zero Content-Length in order to display a meaningful progress bar
- bar = None
- if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
- content_length = int(result.headers['Content-Length'])
- if content_length > 0:
- bar = click.progressbar(length=content_length, label='Downloading file')
-
- try:
- if bar:
- bar.__enter__()
+ 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
- # TODO: Make the download size a configurable option
- # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
- for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
- if bar:
- bar.update(len(chunk))
- file.write(chunk)
- finally:
- if bar:
- bar.render_finish()
- file.close()
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
+ # If we fail, we should show an error, but we should still provide the information to the customer
+ click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ sys.exit(2)
+ except Exception:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ raise
+ else:
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.download_masking_policy.command_name', 'download'), help=u"""Downloads an already-generated file corresponding to the specified masking policy. Note that the GenerateMaskingPolicyForDownload operation is a prerequisite for the DownloadMaskingPolicy operation. Use GenerateMaskingPolicyForDownload to generate a masking policy file and then use DownloadMaskingPolicy to download the generated file. \n[Command Reference](downloadMaskingPolicy)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
-@cli_util.option('--policy-format', type=custom_types.CliCaseInsensitiveChoice(["XML"]), help=u"""The format of the masking policy file.""")
+@subsetting_policy_health_report_group.command(name=cli_util.override('data_safe.delete_subsetting_policy_health_report.command_name', 'delete'), help=u"""Deletes the specified subsetting policy health report. \n[Command Reference](deleteSubsettingPolicyHealthReport)""")
+@cli_util.option('--subsetting-policy-health-report-id', required=True, help=u"""The OCID of the subsetting health report.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 download_masking_policy(ctx, from_json, file, masking_policy_id, policy_format):
+def delete_subsetting_policy_health_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_policy_health_report_id, if_match):
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if isinstance(subsetting_policy_health_report_id, six.string_types) and len(subsetting_policy_health_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-health-report-id cannot be whitespace or empty string')
kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
-
- if policy_format is not None:
- _details['policyFormat'] = policy_format
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.download_masking_policy(
- masking_policy_id=masking_policy_id,
- download_masking_policy_details=_details,
+ result = client.delete_subsetting_policy_health_report(
+ subsetting_policy_health_report_id=subsetting_policy_health_report_id,
**kwargs
)
+ if wait_for_state:
- # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
- # Also we need a non-zero Content-Length in order to display a meaningful progress bar
- bar = None
- if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
- content_length = int(result.headers['Content-Length'])
- if content_length > 0:
- bar = click.progressbar(length=content_length, label='Downloading file')
-
- try:
- if bar:
- bar.__enter__()
+ 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
- # TODO: Make the download size a configurable option
- # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
- for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
- if bar:
- bar.update(len(chunk))
- file.write(chunk)
- finally:
- if bar:
- bar.render_finish()
- file.close()
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
+ # If we fail, we should show an error, but we should still provide the information to the customer
+ click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ sys.exit(2)
+ except Exception:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ raise
+ else:
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.download_masking_report.command_name', 'download-masking-report'), help=u"""Downloads an already-generated masking report. Note that the GenerateMaskingReportForDownload operation is a prerequisite for the DownloadMaskingReport operation. Use GenerateMaskingReportForDownload to generate a masking report file and then use DownloadMaskingReport to download the generated file. \n[Command Reference](downloadMaskingReport)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--report-id', required=True, help=u"""The OCID of the masking report to be downloaded.""")
-@cli_util.option('--report-format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
-@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@subsetting_report_group.command(name=cli_util.override('data_safe.delete_subsetting_report.command_name', 'delete'), help=u"""Deletes the specified subsetting report. \n[Command Reference](deleteSubsettingReport)""")
+@cli_util.option('--subsetting-report-id', required=True, help=u"""The OCID of the subsetting report.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 download_masking_report(ctx, from_json, file, masking_policy_id, report_id, report_format):
+def delete_subsetting_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_report_id, if_match):
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if isinstance(subsetting_report_id, six.string_types) and len(subsetting_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-report-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['reportId'] = report_id
- _details['reportFormat'] = report_format
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.download_masking_report(
- masking_policy_id=masking_policy_id,
- download_masking_report_details=_details,
+ result = client.delete_subsetting_report(
+ subsetting_report_id=subsetting_report_id,
**kwargs
)
+ if wait_for_state:
- # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
- # Also we need a non-zero Content-Length in order to display a meaningful progress bar
- bar = None
- if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
- content_length = int(result.headers['Content-Length'])
- if content_length > 0:
- bar = click.progressbar(length=content_length, label='Downloading file')
-
- try:
- if bar:
- bar.__enter__()
+ 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
- # TODO: Make the download size a configurable option
- # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
- for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
- if bar:
- bar.update(len(chunk))
- file.write(chunk)
- finally:
- if bar:
- bar.render_finish()
- file.close()
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
+ # If we fail, we should show an error, but we should still provide the information to the customer
+ click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ sys.exit(2)
+ except Exception:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ raise
+ else:
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.download_privilege_script.command_name', 'download-privilege-script'), help=u"""Downloads the privilege script to grant/revoke required roles from the Data Safe account on the target database. \n[Command Reference](downloadPrivilegeScript)""")
-@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@subsetting_rule_group.command(name=cli_util.override('data_safe.delete_subsetting_rule.command_name', 'delete'), help=u"""Deletes the specified subsetting rule. \n[Command Reference](deleteSubsettingRule)""")
+@cli_util.option('--subsetting-rule-key', required=True, help=u"""The unique key that identifies the subsetting rule. It's numeric and unique within a subsetting policy.""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 download_privilege_script(ctx, from_json, file, if_match):
+def delete_subsetting_rule(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_rule_key, subsetting_policy_id, if_match):
+
+ if isinstance(subsetting_rule_key, six.string_types) and len(subsetting_rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-rule-key cannot be whitespace or empty string')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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_safe', 'data_safe', ctx)
- result = client.download_privilege_script(
+ result = client.delete_subsetting_rule(
+ subsetting_rule_key=subsetting_rule_key,
+ subsetting_policy_id=subsetting_policy_id,
**kwargs
)
+ if wait_for_state:
- # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
- # Also we need a non-zero Content-Length in order to display a meaningful progress bar
- bar = None
- if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
- content_length = int(result.headers['Content-Length'])
- if content_length > 0:
- bar = click.progressbar(length=content_length, label='Downloading file')
-
- try:
- if bar:
- bar.__enter__()
-
- # TODO: Make the download size a configurable option
- # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
- for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
- if bar:
- bar.update(len(chunk))
- file.write(chunk)
- finally:
- if bar:
- bar.render_finish()
- file.close()
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
+ try:
+ wait_period_kwargs = {}
+ if max_wait_seconds is not None:
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
+ if wait_interval_seconds is not None:
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
+ if 'opc-work-request-id' not in result.headers:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
+ cli_util.render_response(result, ctx)
+ return
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
+ # If we fail, we should show an error, but we should still provide the information to the customer
+ click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ sys.exit(2)
+ except Exception:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ raise
+ else:
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.download_security_assessment_report.command_name', 'download-security-assessment-report'), help=u"""Downloads the report of the specified security assessment. To download the security assessment report, it needs to be generated first. Please use GenerateSecurityAssessmentReport to generate a downloadable report in the preferred format (PDF, XLS). \n[Command Reference](downloadSecurityAssessmentReport)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@cli_util.option('--format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS", "STIGXLS"]), help=u"""Format of the Security Assessment report.""")
-@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
-@cli_util.option('--is-single-report', type=click.BOOL, help=u"""Optional flag controlling the output format of a target group report: - true: Return a single consolidated report file for the entire target group. - false/null (default): Return a ZIP archive containing one file per target in the group.
-Important: - This flag is only applicable when the security assessment OCID refers to a target group assessment (targetType TARGET_DATABASE_GROUP). - If `isSingleReport` is set to true for an individual target (targetType TARGET_DATABASE), the request will return an error. - If `isSingleReport` is null or false for an individual target, the value is ignored and the selected output format for the assessment type is returned.""")
+@subsetting_schema_relation_group.command(name=cli_util.override('data_safe.delete_subsetting_schema_relation.command_name', 'delete'), help=u"""Deletes the specified referential relation. Note that only the relation created by the user can be deleted \n[Command Reference](deleteSubsettingSchemaRelation)""")
+@cli_util.option('--subsetting-schema-relation-key', required=True, help=u"""The unique key that identifies the subsetting relation. It's numeric and unique within a subsetting policy.""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 download_security_assessment_report(ctx, from_json, file, security_assessment_id, format, is_single_report, if_match):
+def delete_subsetting_schema_relation(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_schema_relation_key, subsetting_policy_id, if_match):
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+ if isinstance(subsetting_schema_relation_key, six.string_types) and len(subsetting_schema_relation_key.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-schema-relation-key cannot be whitespace or empty string')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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['format'] = format
-
- if is_single_report is not None:
- _details['isSingleReport'] = is_single_report
-
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.download_security_assessment_report(
- security_assessment_id=security_assessment_id,
- download_security_assessment_report_details=_details,
- **kwargs
- )
-
- # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
- # Also we need a non-zero Content-Length in order to display a meaningful progress bar
- bar = None
- if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
- content_length = int(result.headers['Content-Length'])
- if content_length > 0:
- bar = click.progressbar(length=content_length, label='Downloading file')
-
- try:
- if bar:
- bar.__enter__()
-
- # TODO: Make the download size a configurable option
- # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
- for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
- if bar:
- bar.update(len(chunk))
- file.write(chunk)
- finally:
- if bar:
- bar.render_finish()
- file.close()
-
-
-@sensitive_data_model_group.command(name=cli_util.override('data_safe.download_sensitive_data_model.command_name', 'download'), help=u"""Downloads an already-generated file corresponding to the specified sensitive data model. Note that the GenerateSensitiveDataModelForDownload operation is a prerequisite for the DownloadSensitiveDataModel operation. Use GenerateSensitiveDataModelForDownload to generate a data model file and then use DownloadSensitiveDataModel to download the generated file. \n[Command Reference](downloadSensitiveDataModel)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
-@cli_util.option('--data-model-format', type=custom_types.CliCaseInsensitiveChoice(["XML"]), help=u"""The format of the sensitive data model file.""")
-@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 download_sensitive_data_model(ctx, from_json, file, sensitive_data_model_id, data_model_format):
-
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
-
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
-
- if data_model_format is not None:
- _details['dataModelFormat'] = data_model_format
-
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.download_sensitive_data_model(
- sensitive_data_model_id=sensitive_data_model_id,
- download_sensitive_data_model_details=_details,
- **kwargs
- )
-
- # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
- # Also we need a non-zero Content-Length in order to display a meaningful progress bar
- bar = None
- if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
- content_length = int(result.headers['Content-Length'])
- if content_length > 0:
- bar = click.progressbar(length=content_length, label='Downloading file')
-
- try:
- if bar:
- bar.__enter__()
-
- # TODO: Make the download size a configurable option
- # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
- for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
- if bar:
- bar.update(len(chunk))
- file.write(chunk)
- finally:
- if bar:
- bar.render_finish()
- file.close()
-
-
-@sensitive_types_export_group.command(name=cli_util.override('data_safe.download_sensitive_types_export.command_name', 'download'), help=u"""Downloads an already-generated file corresponding to the specified sensitive types export. Use CreateSensitiveTypesExport to generate an XML file and then use DownloadSensitiveTypesExport to download the generated file. \n[Command Reference](downloadSensitiveTypesExport)""")
-@cli_util.option('--sensitive-types-export-id', required=True, help=u"""The OCID of the sensitive types export.""")
-@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
-@cli_util.option('--data-model-format', type=custom_types.CliCaseInsensitiveChoice(["XML"]), help=u"""The format of the sensitive types export file.""")
-@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 download_sensitive_types_export(ctx, from_json, file, sensitive_types_export_id, data_model_format):
-
- if isinstance(sensitive_types_export_id, six.string_types) and len(sensitive_types_export_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-types-export-id cannot be whitespace or empty string')
-
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
-
- if data_model_format is not None:
- _details['dataModelFormat'] = data_model_format
-
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.download_sensitive_types_export(
- sensitive_types_export_id=sensitive_types_export_id,
- download_sensitive_types_export_details=_details,
- **kwargs
- )
-
- # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
- # Also we need a non-zero Content-Length in order to display a meaningful progress bar
- bar = None
- if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
- content_length = int(result.headers['Content-Length'])
- if content_length > 0:
- bar = click.progressbar(length=content_length, label='Downloading file')
-
- try:
- if bar:
- bar.__enter__()
-
- # TODO: Make the download size a configurable option
- # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
- for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
- if bar:
- bar.update(len(chunk))
- file.write(chunk)
- finally:
- if bar:
- bar.render_finish()
- file.close()
-
-
-@user_assessment_group.command(name=cli_util.override('data_safe.download_user_assessment_report.command_name', 'download-user-assessment-report'), help=u"""Downloads the report of the specified user assessment. To download the user assessment report, it needs to be generated first. Please use GenerateUserAssessmentReport to generate a downloadable report in the preferred format (PDF, XLS). \n[Command Reference](downloadUserAssessmentReport)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
-@cli_util.option('--format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
-@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@json_skeleton_utils.get_cli_json_input_option({})
-@cli_util.help_option
-@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
-@cli_util.wrap_exceptions
-def download_user_assessment_report(ctx, from_json, file, user_assessment_id, format, if_match):
-
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-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['format'] = format
-
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.download_user_assessment_report(
- user_assessment_id=user_assessment_id,
- download_user_assessment_report_details=_details,
- **kwargs
- )
-
- # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
- # Also we need a non-zero Content-Length in order to display a meaningful progress bar
- bar = None
- if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
- content_length = int(result.headers['Content-Length'])
- if content_length > 0:
- bar = click.progressbar(length=content_length, label='Downloading file')
-
- try:
- if bar:
- bar.__enter__()
-
- # TODO: Make the download size a configurable option
- # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
- for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
- if bar:
- bar.update(len(chunk))
- file.write(chunk)
- finally:
- if bar:
- bar.render_finish()
- file.close()
-
-
-@data_safe_configuration_group.command(name=cli_util.override('data_safe.enable_data_safe_configuration.command_name', 'enable'), help=u"""Enables Data Safe in the tenancy and region. \n[Command Reference](enableDataSafeConfiguration)""")
-@cli_util.option('--is-enabled', required=True, type=click.BOOL, help=u"""Indicates if Data Safe is enabled.""")
-@cli_util.option('--compartment-id', help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 enable_data_safe_configuration(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, is_enabled, compartment_id, if_match):
-
- kwargs = {}
- if compartment_id is not None:
- kwargs['compartment_id'] = compartment_id
- if if_match is not None:
- kwargs['if_match'] = if_match
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
- _details['isEnabled'] = is_enabled
-
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.enable_data_safe_configuration(
- enable_data_safe_configuration_details=_details,
- **kwargs
- )
- if wait_for_state:
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.delete_subsetting_schema_relation(
+ subsetting_schema_relation_key=subsetting_schema_relation_key,
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ if wait_for_state:
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
try:
@@ -9969,7 +10507,7 @@ def enable_data_safe_configuration(ctx, from_json, wait_for_state, max_wait_seco
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:
@@ -9981,10 +10519,10 @@ def enable_data_safe_configuration(ctx, from_json, wait_for_state, max_wait_seco
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.generate_crypto_assessment_report.command_name', 'generate-crypto-assessment-report'), help=u"""Generates the report of the specified crypto assessment. Supported output formats are PDF and XLS. \n[Command Reference](generateCryptoAssessmentReport)""")
-@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
-@cli_util.option('--format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the crypto assessment report.""")
+@target_alert_policy_association_group.command(name=cli_util.override('data_safe.delete_target_alert_policy_association.command_name', 'delete'), help=u"""Deletes the specified target-alert policy Association. \n[Command Reference](deleteTargetAlertPolicyAssociation)""")
+@cli_util.option('--target-alert-policy-association-id', required=True, help=u"""The OCID of the target-alert policy association.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -9993,23 +10531,18 @@ def enable_data_safe_configuration(ctx, from_json, wait_for_state, max_wait_seco
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def generate_crypto_assessment_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, crypto_assessment_id, format, if_match):
+def delete_target_alert_policy_association(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_alert_policy_association_id, if_match):
- if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
+ if isinstance(target_alert_policy_association_id, six.string_types) and len(target_alert_policy_association_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-alert-policy-association-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['format'] = format
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.generate_crypto_assessment_report(
- crypto_assessment_id=crypto_assessment_id,
- generate_crypto_assessment_report_details=_details,
+ result = client.delete_target_alert_policy_association(
+ target_alert_policy_association_id=target_alert_policy_association_id,
**kwargs
)
if wait_for_state:
@@ -10030,7 +10563,7 @@ def generate_crypto_assessment_report(ctx, from_json, wait_for_state, max_wait_s
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:
@@ -10042,11 +10575,11 @@ def generate_crypto_assessment_report(ctx, from_json, wait_for_state, max_wait_s
cli_util.render_response(result, ctx)
-@sensitive_data_model_group.command(name=cli_util.override('data_safe.generate_discovery_report_for_download.command_name', 'generate-discovery-report-for-download'), help=u"""Generates a downloadable discovery report. It's a prerequisite for the DownloadDiscoveryReport operation. Use this endpoint to generate a discovery report file and then use DownloadDiscoveryReport to download the generated file. By default, it generates report for all the columns in a sensitive data model. Use the discoveryJobId attribute to generate report for a specific discovery job. \n[Command Reference](generateDiscoveryReportForDownload)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--report-format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
-@cli_util.option('--discovery-job-id', help=u"""The OCID of the discovery job.""")
-@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
+@target_database_group.command(name=cli_util.override('data_safe.delete_target_database.command_name', 'delete'), help=u"""Deregisters the specified database from Data Safe and removes the target database from the Data Safe Console. \n[Command Reference](deleteTargetDatabase)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({})
@@ -10054,24 +10587,18 @@ def generate_crypto_assessment_report(ctx, from_json, wait_for_state, max_wait_s
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def generate_discovery_report_for_download(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_data_model_id, report_format, discovery_job_id):
+def delete_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, if_match):
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
- _details['reportFormat'] = report_format
-
- if discovery_job_id is not None:
- _details['discoveryJobId'] = discovery_job_id
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.generate_discovery_report_for_download(
- sensitive_data_model_id=sensitive_data_model_id,
- generate_discovery_report_for_download_details=_details,
+ result = client.delete_target_database(
+ target_database_id=target_database_id,
**kwargs
)
if wait_for_state:
@@ -10092,7 +10619,7 @@ def generate_discovery_report_for_download(ctx, from_json, wait_for_state, max_w
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:
@@ -10104,60 +10631,30 @@ def generate_discovery_report_for_download(ctx, from_json, wait_for_state, max_w
cli_util.render_response(result, ctx)
-@masking_policy_health_report_group.command(name=cli_util.override('data_safe.generate_health_report.command_name', 'generate-health-report'), help=u"""Performs health check on the masking policy. \n[Command Reference](generateHealthReport)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--check-type', type=custom_types.CliCaseInsensitiveChoice(["ALL"]), help=u"""The type of health check. The default behaviour is to perform all health checks.""")
-@cli_util.option('--target-id', help=u"""The OCID of the target database to use for the masking policy health check. The targetId associated with the masking policy is used if this is not passed.""")
-@cli_util.option('--compartment-id', help=u"""The OCID of the compartment where the health report resource should be created.""")
-@cli_util.option('--tablespace', help=u"""The tablespace that should be used to estimate space. If no tablespace is provided, the DEFAULT tablespace is used.""")
-@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('--target-credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@target_database_group_group.command(name=cli_util.override('data_safe.delete_target_database_group.command_name', 'delete'), help=u"""Deletes the specified target database group. \n[Command Reference](deleteTargetDatabaseGroup)""")
+@cli_util.option('--target-database-group-id', required=True, help=u"""The OCID of the specified target database group.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
+@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={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def generate_health_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, check_type, target_id, compartment_id, tablespace, freeform_tags, defined_tags, target_credentials):
+def delete_target_database_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_group_id, if_match):
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if isinstance(target_database_group_id, six.string_types) and len(target_database_group_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-group-id cannot be whitespace or empty string')
kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
-
- if check_type is not None:
- _details['checkType'] = check_type
-
- if target_id is not None:
- _details['targetId'] = target_id
-
- if compartment_id is not None:
- _details['compartmentId'] = compartment_id
-
- if tablespace is not None:
- _details['tablespace'] = tablespace
-
- 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 target_credentials is not None:
- _details['targetCredentials'] = cli_util.parse_json_parameter("target_credentials", target_credentials)
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.generate_health_report(
- masking_policy_id=masking_policy_id,
- generate_health_report_details=_details,
+ result = client.delete_target_database_group(
+ target_database_group_id=target_database_group_id,
**kwargs
)
if wait_for_state:
@@ -10178,7 +10675,7 @@ def generate_health_report(ctx, from_json, wait_for_state, max_wait_seconds, wai
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:
@@ -10190,9 +10687,10 @@ def generate_health_report(ctx, from_json, wait_for_state, max_wait_seconds, wai
cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.generate_masking_policy_for_download.command_name', 'generate-masking-policy-for-download'), help=u"""Generates a downloadable file corresponding to the specified masking policy. It's a prerequisite for the DownloadMaskingPolicy operation. Use this endpoint to generate a masking policy file and then use DownloadMaskingPolicy to download the generated file. Note that file generation and download are serial operations. The download operation can't be invoked while the generate operation is in progress. \n[Command Reference](generateMaskingPolicyForDownload)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--policy-format', type=custom_types.CliCaseInsensitiveChoice(["XML"]), help=u"""The format of the masking policy file.""")
+@unified_audit_policy_group.command(name=cli_util.override('data_safe.delete_unified_audit_policy.command_name', 'delete'), help=u"""Deletes the Unified Audit policy resource. \n[Command Reference](deleteUnifiedAuditPolicy)""")
+@cli_util.option('--unified-audit-policy-id', required=True, help=u"""The OCID of the Unified Audit policy resource.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -10201,23 +10699,18 @@ def generate_health_report(ctx, from_json, wait_for_state, max_wait_seconds, wai
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def generate_masking_policy_for_download(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, policy_format):
+def delete_unified_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, unified_audit_policy_id, if_match):
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if isinstance(unified_audit_policy_id, six.string_types) and len(unified_audit_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --unified-audit-policy-id cannot be whitespace or empty string')
kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
-
- if policy_format is not None:
- _details['policyFormat'] = policy_format
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.generate_masking_policy_for_download(
- masking_policy_id=masking_policy_id,
- generate_masking_policy_for_download_details=_details,
+ result = client.delete_unified_audit_policy(
+ unified_audit_policy_id=unified_audit_policy_id,
**kwargs
)
if wait_for_state:
@@ -10238,7 +10731,7 @@ def generate_masking_policy_for_download(ctx, from_json, wait_for_state, max_wai
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:
@@ -10250,10 +10743,10 @@ def generate_masking_policy_for_download(ctx, from_json, wait_for_state, max_wai
cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.generate_masking_report_for_download.command_name', 'generate-masking-report-for-download'), help=u"""Generates a downloadable masking report. It's a prerequisite for the DownloadMaskingReport operation. Use this endpoint to generate a masking report file and then use DownloadMaskingReport to download the generated file. \n[Command Reference](generateMaskingReportForDownload)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--report-id', required=True, help=u"""The OCID of the masking report for which a downloadable file is to be generated.""")
-@cli_util.option('--report-format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
+@unified_audit_policy_definition_group.command(name=cli_util.override('data_safe.delete_unified_audit_policy_definition.command_name', 'delete'), help=u"""Deletes the specified Unified audit policy definition. \n[Command Reference](deleteUnifiedAuditPolicyDefinition)""")
+@cli_util.option('--unified-audit-policy-definition-id', required=True, help=u"""The OCID of the unified audit policy definition resource.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -10262,22 +10755,18 @@ def generate_masking_policy_for_download(ctx, from_json, wait_for_state, max_wai
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def generate_masking_report_for_download(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, report_id, report_format):
+def delete_unified_audit_policy_definition(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, unified_audit_policy_definition_id, if_match):
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if isinstance(unified_audit_policy_definition_id, six.string_types) and len(unified_audit_policy_definition_id.strip()) == 0:
+ raise click.UsageError('Parameter --unified-audit-policy-definition-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['reportId'] = report_id
- _details['reportFormat'] = report_format
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.generate_masking_report_for_download(
- masking_policy_id=masking_policy_id,
- generate_masking_report_for_download_details=_details,
+ result = client.delete_unified_audit_policy_definition(
+ unified_audit_policy_definition_id=unified_audit_policy_definition_id,
**kwargs
)
if wait_for_state:
@@ -10298,7 +10787,7 @@ def generate_masking_report_for_download(ctx, from_json, wait_for_state, max_wai
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:
@@ -10310,129 +10799,88 @@ def generate_masking_report_for_download(ctx, from_json, wait_for_state, max_wai
cli_util.render_response(result, ctx)
-@on_prem_connector_group.command(name=cli_util.override('data_safe.generate_on_prem_connector_configuration.command_name', 'generate-on-prem-connector-configuration'), help=u"""Creates and downloads the configuration of the specified on-premises connector. \n[Command Reference](generateOnPremConnectorConfiguration)""")
-@cli_util.option('--password', required=True, help=u"""The password to encrypt the keys inside the wallet included as part of the configuration. The password must be between 15 and 30 characters long and must contain atleast 1 uppercase, 1 lowercase, 1 numeric, and 1 special character.""")
-@cli_util.option('--on-prem-connector-id', required=True, help=u"""The OCID of the on-premises connector.""")
-@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@user_assessment_group.command(name=cli_util.override('data_safe.delete_user_assessment.command_name', 'delete'), help=u"""Deletes the specified saved user assessment or schedule. To delete a user assessment schedule, first call the operation ListUserAssessments with filters \"type = save_schedule\". That call returns the scheduleAssessmentId. Then call DeleteUserAssessment with the scheduleAssessmentId. If the assessment being deleted is the baseline for that compartment, then it will impact all baselines in the compartment. \n[Command Reference](deleteUserAssessment)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.confirm_delete_option
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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_on_prem_connector_configuration(ctx, from_json, file, password, on_prem_connector_id, if_match):
+def delete_user_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, user_assessment_id, if_match):
- if isinstance(on_prem_connector_id, six.string_types) and len(on_prem_connector_id.strip()) == 0:
- raise click.UsageError('Parameter --on-prem-connector-id cannot be whitespace or empty string')
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
- _details['password'] = password
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.generate_on_prem_connector_configuration(
- on_prem_connector_id=on_prem_connector_id,
- generate_on_prem_connector_configuration_details=_details,
+ result = client.delete_user_assessment(
+ user_assessment_id=user_assessment_id,
**kwargs
)
+ if wait_for_state:
- # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
- # Also we need a non-zero Content-Length in order to display a meaningful progress bar
- bar = None
- if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
- content_length = int(result.headers['Content-Length'])
- if content_length > 0:
- bar = click.progressbar(length=content_length, label='Downloading file')
-
- try:
- if bar:
- bar.__enter__()
+ 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
- # TODO: Make the download size a configurable option
- # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
- for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
- if bar:
- bar.update(len(chunk))
- file.write(chunk)
- finally:
- if bar:
- bar.render_finish()
- file.close()
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
+ # If we fail, we should show an error, but we should still provide the information to the customer
+ click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ sys.exit(2)
+ except Exception:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ raise
+ else:
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
-@report_definition_group.command(name=cli_util.override('data_safe.generate_report.command_name', 'generate-report'), help=u"""Generates a .xls or .pdf report based on parameters and report definition. \n[Command Reference](generateReport)""")
-@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
-@cli_util.option('--display-name', required=True, help=u"""The name of the report to be generated""")
-@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment into which the resource should be moved.""")
-@cli_util.option('--mime-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS", "JSON"]), help=u"""Specifies the format of report to be .xls or .pdf or .json""")
-@cli_util.option('--target-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Array of database target OCIDs.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--target-group-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Array of target group OCIDs.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--description', help=u"""The description of the report to be generated""")
-@cli_util.option('--time-less-than', type=custom_types.CLI_DATETIME, help=u"""Specifies the time until which the data needs to be reported.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-greater-than', type=custom_types.CLI_DATETIME, help=u"""Specifies the time after which the data needs to be reported.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--row-limit', type=click.INT, help=u"""Specifies the limit on the number of rows in the report.""")
-@cli_util.option('--is-pagination-enabled', type=click.BOOL, help=u"""Indicates if the reports being generated should be pagination enabled. If set to true, multiple reports can be generated and the details of next and previous report are present in Report. Values can either be 'true' or 'false'.""")
+@security_policy_deployment_group.command(name=cli_util.override('data_safe.deploy_security_policy_deployment.command_name', 'deploy'), help=u"""Deploy the security policy to the specified target or target groups. \n[Command Reference](deploySecurityPolicyDeployment)""")
+@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
-
-**Example:** query=(auditEventTime ge \"2021-06-04T01:00:26.000Z\") and (eventName eq \"LOGON\")""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'target-group-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'target-group-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def generate_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, report_definition_id, display_name, compartment_id, mime_type, target_ids, target_group_ids, description, time_less_than, time_greater_than, row_limit, is_pagination_enabled, if_match, scim_query):
+def deploy_security_policy_deployment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_deployment_id, if_match):
- if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
- raise click.UsageError('Parameter --report-definition-id cannot be whitespace or empty string')
+ if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-deployment-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
- if scim_query is not None:
- kwargs['scim_query'] = scim_query
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
- _details['displayName'] = display_name
- _details['compartmentId'] = compartment_id
- _details['mimeType'] = mime_type
-
- if target_ids is not None:
- _details['targetIds'] = cli_util.parse_json_parameter("target_ids", target_ids)
-
- if target_group_ids is not None:
- _details['targetGroupIds'] = cli_util.parse_json_parameter("target_group_ids", target_group_ids)
-
- if description is not None:
- _details['description'] = description
-
- if time_less_than is not None:
- _details['timeLessThan'] = time_less_than
-
- if time_greater_than is not None:
- _details['timeGreaterThan'] = time_greater_than
-
- if row_limit is not None:
- _details['rowLimit'] = row_limit
-
- if is_pagination_enabled is not None:
- _details['isPaginationEnabled'] = is_pagination_enabled
-
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.generate_report(
- report_definition_id=report_definition_id,
- generate_report_details=_details,
- **kwargs
- )
- if wait_for_state:
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.deploy_security_policy_deployment(
+ security_policy_deployment_id=security_policy_deployment_id,
+ **kwargs
+ )
+ if wait_for_state:
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
try:
@@ -10462,12 +10910,8 @@ def generate_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_inter
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.generate_security_assessment_report.command_name', 'generate-security-assessment-report'), help=u"""Generates the report of the specified security assessment. You can get the report in PDF or XLS format. After generating the report, use DownloadSecurityAssessmentReport to download it in the preferred format. \n[Command Reference](generateSecurityAssessmentReport)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@cli_util.option('--format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS", "STIGXLS"]), help=u"""Format of the Security Assessment report.""")
-@cli_util.option('--is-single-report', type=click.BOOL, help=u"""Optional flag controlling the output format of a target group report: - true: Generate a single consolidated report file for the entire target group. - false: Generate a ZIP archive containing one file per target in the group.
-
-Important: - This flag is only applicable when the security assessment OCID refers to a target group assessment (targetType TARGET_DATABASE_GROUP). - If `isSingleReport` is set to true for an individual target (targetType TARGET_DATABASE), the request will return an error. - If `isSingleReport` is null or false for an individual target, the value is ignored and the selected output format for the assessment type is generated.""")
+@audit_profile_group.command(name=cli_util.override('data_safe.discover_audit_trails.command_name', 'discover-audit-trails'), help=u"""Updates the list of audit trails created under audit profile.The operation can be used to create new audit trails for target database when they become available for audit collection because of change of database version or change of database unified mode or change of data base edition or being deleted previously etc. \n[Command Reference](discoverAuditTrails)""")
+@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -10477,26 +10921,18 @@ def generate_report(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={})
@cli_util.wrap_exceptions
-def generate_security_assessment_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, format, is_single_report, if_match):
+def discover_audit_trails(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_profile_id, if_match):
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+ if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-profile-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['format'] = format
-
- if is_single_report is not None:
- _details['isSingleReport'] = is_single_report
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.generate_security_assessment_report(
- security_assessment_id=security_assessment_id,
- generate_security_assessment_report_details=_details,
+ result = client.discover_audit_trails(
+ audit_profile_id=audit_profile_id,
**kwargs
)
if wait_for_state:
@@ -10529,964 +10965,1183 @@ def generate_security_assessment_report(ctx, from_json, wait_for_state, max_wait
cli_util.render_response(result, ctx)
-@sensitive_data_model_group.command(name=cli_util.override('data_safe.generate_sensitive_data_model_for_download.command_name', 'generate-sensitive-data-model-for-download'), help=u"""Generates a downloadable file corresponding to the specified sensitive data model. It's a prerequisite for the DownloadSensitiveDataModel operation. Use this endpoint to generate a data model file and then use DownloadSensitiveDataModel to download the generated file. Note that file generation and download are serial operations. The download operation can't be invoked while the generate operation is in progress. \n[Command Reference](generateSensitiveDataModelForDownload)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--data-model-format', type=custom_types.CliCaseInsensitiveChoice(["XML"]), help=u"""The format of the sensitive data model file.""")
-@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.download_crypto_assessment_report.command_name', 'download-crypto-assessment-report'), help=u"""Downloads the report of the specified crypto assessment. To download the crypto assessment report, it needs to be generated first. Please use GenerateCryptoAssessmentReport to generate a downloadable report in the preferred format (PDF, XLS). \n[Command Reference](downloadCryptoAssessmentReport)""")
+@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
+@cli_util.option('--format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the crypto assessment report.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def generate_sensitive_data_model_for_download(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_data_model_id, data_model_format):
+def download_crypto_assessment_report(ctx, from_json, file, crypto_assessment_id, format, if_match):
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+ if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
-
- if data_model_format is not None:
- _details['dataModelFormat'] = data_model_format
+ _details['format'] = format
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.generate_sensitive_data_model_for_download(
- sensitive_data_model_id=sensitive_data_model_id,
- generate_sensitive_data_model_for_download_details=_details,
+ result = client.download_crypto_assessment_report(
+ crypto_assessment_id=crypto_assessment_id,
+ download_crypto_assessment_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
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
- 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)
+ try:
+ if bar:
+ bar.__enter__()
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
-@sql_collection_group.command(name=cli_util.override('data_safe.generate_sql_firewall_policy.command_name', 'generate-sql-firewall-policy'), help=u"""Generates or appends to the SQL Firewall policy using the specified SQL collection. \n[Command Reference](generateSqlFirewallPolicy)""")
-@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
+
+@sensitive_data_model_group.command(name=cli_util.override('data_safe.download_discovery_report.command_name', 'download-discovery-report'), help=u"""Downloads an already-generated discovery report. Note that the GenerateDiscoveryReportForDownload operation is a prerequisite for the DownloadDiscoveryReport operation. Use GenerateDiscoveryReportForDownload to generate a discovery report file and then use DownloadDiscoveryReport to download the generated file. By default, it downloads report for all the columns in a sensitive data model. Use the discoveryJobId attribute to download report for a specific discovery job. \n[Command Reference](downloadDiscoveryReport)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@cli_util.option('--discovery-job-id', help=u"""The OCID of the discovery job.""")
+@cli_util.option('--report-format', type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
@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_sql_firewall_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, if_match):
+def download_discovery_report(ctx, from_json, file, sensitive_data_model_id, discovery_job_id, report_format):
- if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
kwargs = {}
- if if_match is not None:
- kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if discovery_job_id is not None:
+ _details['discoveryJobId'] = discovery_job_id
+
+ if report_format is not None:
+ _details['reportFormat'] = report_format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.generate_sql_firewall_policy(
- sql_collection_id=sql_collection_id,
+ result = client.download_discovery_report(
+ sensitive_data_model_id=sensitive_data_model_id,
+ download_discovery_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
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
- 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)
+ try:
+ if bar:
+ bar.__enter__()
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
-@user_assessment_group.command(name=cli_util.override('data_safe.generate_user_assessment_report.command_name', 'generate-user-assessment-report'), help=u"""Generates the report of the specified user assessment. The report is available in PDF or XLS format. After generating the report, use DownloadUserAssessmentReport to download it in the preferred format. \n[Command Reference](generateUserAssessmentReport)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
-@cli_util.option('--format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
-@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
+
+@masking_policy_group.command(name=cli_util.override('data_safe.download_masking_log.command_name', 'download-masking-log'), help=u"""Downloads the masking log generated by the last masking operation on a target database using the specified masking policy. \n[Command Reference](downloadMaskingLog)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@cli_util.option('--target-id', help=u"""The OCID of the target database for which the masking log is to be downloaded.""")
+@cli_util.option('--masking-work-request-id', help=u"""The OCID of the masking work request that resulted in this masking log.""")
@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_user_assessment_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, user_assessment_id, format, if_match):
+def download_masking_log(ctx, from_json, file, masking_policy_id, target_id, masking_work_request_id):
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-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['format'] = format
+
+ if target_id is not None:
+ _details['targetId'] = target_id
+
+ if masking_work_request_id is not None:
+ _details['maskingWorkRequestId'] = masking_work_request_id
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.generate_user_assessment_report(
- user_assessment_id=user_assessment_id,
- generate_user_assessment_report_details=_details,
+ result = client.download_masking_log(
+ masking_policy_id=masking_policy_id,
+ download_masking_log_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)
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
+ try:
+ if bar:
+ bar.__enter__()
-@alert_group.command(name=cli_util.override('data_safe.get_alert.command_name', 'get'), help=u"""Gets the details of the specified alerts. \n[Command Reference](getAlert)""")
-@cli_util.option('--alert-id', required=True, help=u"""The OCID of alert.""")
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
+
+
+@masking_policy_group.command(name=cli_util.override('data_safe.download_masking_policy.command_name', 'download'), help=u"""Downloads an already-generated file corresponding to the specified masking policy. Note that the GenerateMaskingPolicyForDownload operation is a prerequisite for the DownloadMaskingPolicy operation. Use GenerateMaskingPolicyForDownload to generate a masking policy file and then use DownloadMaskingPolicy to download the generated file. \n[Command Reference](downloadMaskingPolicy)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@cli_util.option('--policy-format', type=custom_types.CliCaseInsensitiveChoice(["XML"]), help=u"""The format of the masking policy file.""")
@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_safe', 'class': 'Alert'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_alert(ctx, from_json, alert_id):
+def download_masking_policy(ctx, from_json, file, masking_policy_id, policy_format):
- if isinstance(alert_id, six.string_types) and len(alert_id.strip()) == 0:
- raise click.UsageError('Parameter --alert-id cannot be whitespace or empty string')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-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_safe', 'data_safe', ctx)
- result = client.get_alert(
- alert_id=alert_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
+ _details = {}
-@alert_policy_group.command(name=cli_util.override('data_safe.get_alert_policy.command_name', 'get'), help=u"""Gets the details of alert policy by its ID. \n[Command Reference](getAlertPolicy)""")
-@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
-@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_safe', 'class': 'AlertPolicy'})
-@cli_util.wrap_exceptions
-def get_alert_policy(ctx, from_json, alert_policy_id):
-
- if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --alert-policy-id cannot be whitespace or empty string')
+ if policy_format is not None:
+ _details['policyFormat'] = policy_format
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_alert_policy(
- alert_policy_id=alert_policy_id,
+ result = client.download_masking_policy(
+ masking_policy_id=masking_policy_id,
+ download_masking_policy_details=_details,
**kwargs
)
- cli_util.render_response(result, ctx)
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
+
+ try:
+ if bar:
+ bar.__enter__()
-@alert_policy_rule_group.command(name=cli_util.override('data_safe.get_alert_policy_rule.command_name', 'get'), help=u"""Gets the details of a policy rule by its key. \n[Command Reference](getAlertPolicyRule)""")
-@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
-@cli_util.option('--rule-key', required=True, help=u"""The key of the alert policy rule.""")
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
+
+
+@masking_policy_group.command(name=cli_util.override('data_safe.download_masking_report.command_name', 'download-masking-report'), help=u"""Downloads an already-generated masking report. Note that the GenerateMaskingReportForDownload operation is a prerequisite for the DownloadMaskingReport operation. Use GenerateMaskingReportForDownload to generate a masking report file and then use DownloadMaskingReport to download the generated file. \n[Command Reference](downloadMaskingReport)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--report-id', required=True, help=u"""The OCID of the masking report to be downloaded.""")
+@cli_util.option('--report-format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
@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_safe', 'class': 'AlertPolicyRule'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_alert_policy_rule(ctx, from_json, alert_policy_id, rule_key):
-
- if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --alert-policy-id cannot be whitespace or empty string')
+def download_masking_report(ctx, from_json, file, masking_policy_id, report_id, report_format):
- if isinstance(rule_key, six.string_types) and len(rule_key.strip()) == 0:
- raise click.UsageError('Parameter --rule-key cannot be whitespace or empty string')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-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['reportId'] = report_id
+ _details['reportFormat'] = report_format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_alert_policy_rule(
- alert_policy_id=alert_policy_id,
- rule_key=rule_key,
+ result = client.download_masking_report(
+ masking_policy_id=masking_policy_id,
+ download_masking_report_details=_details,
**kwargs
)
- cli_util.render_response(result, ctx)
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
+
+ try:
+ if bar:
+ bar.__enter__()
-@attribute_set_group.command(name=cli_util.override('data_safe.get_attribute_set.command_name', 'get'), help=u"""Gets the details of the specified attribute set. \n[Command Reference](getAttributeSet)""")
-@cli_util.option('--attribute-set-id', required=True, help=u"""OCID of an attribute set.""")
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
+
+
+@target_database_group.command(name=cli_util.override('data_safe.download_privilege_script.command_name', 'download-privilege-script'), help=u"""Downloads the privilege script to grant/revoke required roles from the Data Safe account on the target database. \n[Command Reference](downloadPrivilegeScript)""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AttributeSet'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_attribute_set(ctx, from_json, attribute_set_id, if_match):
-
- if isinstance(attribute_set_id, six.string_types) and len(attribute_set_id.strip()) == 0:
- raise click.UsageError('Parameter --attribute-set-id cannot be whitespace or empty string')
+def download_privilege_script(ctx, from_json, file, if_match):
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_safe', 'data_safe', ctx)
- result = client.get_attribute_set(
- attribute_set_id=attribute_set_id,
+ result = client.download_privilege_script(
**kwargs
)
- cli_util.render_response(result, ctx)
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
-@audit_archive_retrieval_group.command(name=cli_util.override('data_safe.get_audit_archive_retrieval.command_name', 'get'), help=u"""Gets the details of the specified archive retreival. \n[Command Reference](getAuditArchiveRetrieval)""")
-@cli_util.option('--audit-archive-retrieval-id', required=True, help=u"""OCID of the archive retrieval.""")
+ try:
+ if bar:
+ bar.__enter__()
+
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
+
+
+@security_assessment_group.command(name=cli_util.override('data_safe.download_security_assessment_report.command_name', 'download-security-assessment-report'), help=u"""Downloads the report of the specified security assessment. To download the security assessment report, it needs to be generated first. Please use GenerateSecurityAssessmentReport to generate a downloadable report in the preferred format (PDF, XLS). \n[Command Reference](downloadSecurityAssessmentReport)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
+@cli_util.option('--format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS", "STIGXLS"]), help=u"""Format of the Security Assessment report.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@cli_util.option('--is-single-report', type=click.BOOL, help=u"""Optional flag controlling the output format of a target group report: - true: Return a single consolidated report file for the entire target group. - false/null (default): Return a ZIP archive containing one file per target in the group.
+
+Important: - This flag is only applicable when the security assessment OCID refers to a target group assessment (targetType TARGET_DATABASE_GROUP). - If `isSingleReport` is set to true for an individual target (targetType TARGET_DATABASE), the request will return an error. - If `isSingleReport` is null or false for an individual target, the value is ignored and the selected output format for the assessment type is returned.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditArchiveRetrieval'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_audit_archive_retrieval(ctx, from_json, audit_archive_retrieval_id, if_match):
+def download_security_assessment_report(ctx, from_json, file, security_assessment_id, format, is_single_report, if_match):
- if isinstance(audit_archive_retrieval_id, six.string_types) and len(audit_archive_retrieval_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-archive-retrieval-id cannot be whitespace or empty string')
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-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['format'] = format
+
+ if is_single_report is not None:
+ _details['isSingleReport'] = is_single_report
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_audit_archive_retrieval(
- audit_archive_retrieval_id=audit_archive_retrieval_id,
+ result = client.download_security_assessment_report(
+ security_assessment_id=security_assessment_id,
+ download_security_assessment_report_details=_details,
**kwargs
)
- cli_util.render_response(result, ctx)
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
+
+ try:
+ if bar:
+ bar.__enter__()
-@audit_policy_group.command(name=cli_util.override('data_safe.get_audit_policy.command_name', 'get'), help=u"""Gets a audit policy by identifier. \n[Command Reference](getAuditPolicy)""")
-@cli_util.option('--audit-policy-id', required=True, help=u"""Unique audit policy identifier.""")
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
+
+
+@sensitive_data_model_group.command(name=cli_util.override('data_safe.download_sensitive_data_model.command_name', 'download'), help=u"""Downloads an already-generated file corresponding to the specified sensitive data model. Note that the GenerateSensitiveDataModelForDownload operation is a prerequisite for the DownloadSensitiveDataModel operation. Use GenerateSensitiveDataModelForDownload to generate a data model file and then use DownloadSensitiveDataModel to download the generated file. \n[Command Reference](downloadSensitiveDataModel)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@cli_util.option('--data-model-format', type=custom_types.CliCaseInsensitiveChoice(["XML"]), help=u"""The format of the sensitive data model file.""")
@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_safe', 'class': 'AuditPolicy'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_audit_policy(ctx, from_json, audit_policy_id):
+def download_sensitive_data_model(ctx, from_json, file, sensitive_data_model_id, data_model_format):
- if isinstance(audit_policy_id, six.string_types) and len(audit_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-policy-id cannot be whitespace or empty string')
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
kwargs = {}
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if data_model_format is not None:
+ _details['dataModelFormat'] = data_model_format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_audit_policy(
- audit_policy_id=audit_policy_id,
+ result = client.download_sensitive_data_model(
+ sensitive_data_model_id=sensitive_data_model_id,
+ download_sensitive_data_model_details=_details,
**kwargs
)
- cli_util.render_response(result, ctx)
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
+
+ try:
+ if bar:
+ bar.__enter__()
-@audit_profile_group.command(name=cli_util.override('data_safe.get_audit_profile.command_name', 'get'), help=u"""Gets the details of audit profile resource and associated audit trails of the audit profile. \n[Command Reference](getAuditProfile)""")
-@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
+
+
+@sensitive_types_export_group.command(name=cli_util.override('data_safe.download_sensitive_types_export.command_name', 'download'), help=u"""Downloads an already-generated file corresponding to the specified sensitive types export. Use CreateSensitiveTypesExport to generate an XML file and then use DownloadSensitiveTypesExport to download the generated file. \n[Command Reference](downloadSensitiveTypesExport)""")
+@cli_util.option('--sensitive-types-export-id', required=True, help=u"""The OCID of the sensitive types export.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@cli_util.option('--data-model-format', type=custom_types.CliCaseInsensitiveChoice(["XML"]), help=u"""The format of the sensitive types export file.""")
@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_safe', 'class': 'AuditProfile'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_audit_profile(ctx, from_json, audit_profile_id):
+def download_sensitive_types_export(ctx, from_json, file, sensitive_types_export_id, data_model_format):
- if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-profile-id cannot be whitespace or empty string')
+ if isinstance(sensitive_types_export_id, six.string_types) and len(sensitive_types_export_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-types-export-id cannot be whitespace or empty string')
kwargs = {}
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if data_model_format is not None:
+ _details['dataModelFormat'] = data_model_format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_audit_profile(
- audit_profile_id=audit_profile_id,
+ result = client.download_sensitive_types_export(
+ sensitive_types_export_id=sensitive_types_export_id,
+ download_sensitive_types_export_details=_details,
**kwargs
)
- cli_util.render_response(result, ctx)
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
+
+ try:
+ if bar:
+ bar.__enter__()
-@audit_trail_group.command(name=cli_util.override('data_safe.get_audit_trail.command_name', 'get'), help=u"""Gets the details of audit trail. \n[Command Reference](getAuditTrail)""")
-@cli_util.option('--audit-trail-id', required=True, help=u"""The OCID of the audit trail.""")
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
+
+
+@subsetting_policy_group.command(name=cli_util.override('data_safe.download_subsetting_log.command_name', 'download-subsetting-log'), help=u"""Downloads the subsetting log generated by the last subsetting operation on a target database using the specified subsetting policy. \n[Command Reference](downloadSubsettingLog)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@cli_util.option('--target-id', help=u"""The OCID of the target database for which the subsetting log is to be downloaded""")
+@cli_util.option('--subsetting-work-request-id', help=u"""The OCID of the subsetting work request that resulted in this subsetting log""")
@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_safe', 'class': 'AuditTrail'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_audit_trail(ctx, from_json, audit_trail_id):
+def download_subsetting_log(ctx, from_json, file, subsetting_policy_id, target_id, subsetting_work_request_id):
- if isinstance(audit_trail_id, six.string_types) and len(audit_trail_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-trail-id cannot be whitespace or empty string')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
kwargs = {}
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if target_id is not None:
+ _details['targetId'] = target_id
+
+ if subsetting_work_request_id is not None:
+ _details['subsettingWorkRequestId'] = subsetting_work_request_id
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_audit_trail(
- audit_trail_id=audit_trail_id,
+ result = client.download_subsetting_log(
+ subsetting_policy_id=subsetting_policy_id,
+ download_subsetting_log_details=_details,
**kwargs
)
- cli_util.render_response(result, ctx)
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
-@masking_column_group.command(name=cli_util.override('data_safe.get_compatible_formats_for_data_types.command_name', 'get-compatible-formats-for-data-types'), help=u"""Gets a list of basic masking formats compatible with the supported data types. The data types are grouped into the following categories - Character - Includes CHAR, NCHAR, VARCHAR2, and NVARCHAR2 Numeric - Includes NUMBER, FLOAT, RAW, BINARY_FLOAT, and BINARY_DOUBLE Date - Includes DATE and TIMESTAMP LOB - Includes BLOB, CLOB, and NCLOB All - Includes all the supported data types \n[Command Reference](getCompatibleFormatsForDataTypes)""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+ try:
+ if bar:
+ bar.__enter__()
+
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
+
+
+@subsetting_policy_group.command(name=cli_util.override('data_safe.download_subsetting_policy.command_name', 'download'), help=u"""Downloads an already-generated file corresponding to the specified subsetting policy. Note that the GenerateSubsettingPolicyForDownload operation is a prerequisite for the DownloadSubsettingPolicy operation. Use GenerateSubsettingPolicyForDownload to generate a subsetting policy file and then use DownloadSubsettingPolicy to download the generated file. \n[Command Reference](downloadSubsettingPolicy)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@cli_util.option('--policy-format', type=custom_types.CliCaseInsensitiveChoice(["XML"]), help=u"""The format of the subsetting policy file""")
@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_safe', 'class': 'CompatibleFormatsForDataTypes'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_compatible_formats_for_data_types(ctx, from_json, limit, page):
+def download_subsetting_policy(ctx, from_json, file, subsetting_policy_id, policy_format):
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
kwargs = {}
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if policy_format is not None:
+ _details['policyFormat'] = policy_format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_compatible_formats_for_data_types(
+ result = client.download_subsetting_policy(
+ subsetting_policy_id=subsetting_policy_id,
+ download_subsetting_policy_details=_details,
**kwargs
)
- cli_util.render_response(result, ctx)
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
-@masking_column_group.command(name=cli_util.override('data_safe.get_compatible_formats_for_sensitive_types.command_name', 'get-compatible-formats-for-sensitive-types'), help=u"""Gets a list of library masking formats compatible with the existing sensitive types. For each sensitive type, it returns the assigned default masking format as well as the other library masking formats that have the sensitiveTypeIds attribute containing the OCID of the sensitive type. \n[Command Reference](getCompatibleFormatsForSensitiveTypes)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+ try:
+ if bar:
+ bar.__enter__()
+
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
+
+
+@subsetting_policy_group.command(name=cli_util.override('data_safe.download_subsetting_report.command_name', 'download-subsetting-report'), help=u"""Downloads an already-generated subsetting report. Note that the GenerateSubsettingReportForDownload operation is a prerequisite for the DownloadSubsettingReport operation. Use GenerateSubsettingReportForDownload to generate a subsetting report file and then use DownloadSubsettingReport to download the generated file. \n[Command Reference](downloadSubsettingReport)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--report-id', required=True, help=u"""The OCID of the subsetting report to be downloaded""")
+@cli_util.option('--report-format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
@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_safe', 'class': 'CompatibleFormatsForSensitiveTypes'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_compatible_formats_for_sensitive_types(ctx, from_json, compartment_id, compartment_id_in_subtree, access_level, limit, page):
+def download_subsetting_report(ctx, from_json, file, subsetting_policy_id, report_id, report_format):
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+ _details['reportId'] = report_id
+ _details['reportFormat'] = report_format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_compatible_formats_for_sensitive_types(
- compartment_id=compartment_id,
+ result = client.download_subsetting_report(
+ subsetting_policy_id=subsetting_policy_id,
+ download_subsetting_report_details=_details,
**kwargs
)
- cli_util.render_response(result, ctx)
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
-@crypto_assessment_group.command(name=cli_util.override('data_safe.get_crypto_assessment.command_name', 'get'), help=u"""Gets the details of the specified crypto assessment. \n[Command Reference](getCryptoAssessment)""")
-@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
+ try:
+ if bar:
+ bar.__enter__()
+
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
+
+
+@user_assessment_group.command(name=cli_util.override('data_safe.download_user_assessment_report.command_name', 'download-user-assessment-report'), help=u"""Downloads the report of the specified user assessment. To download the user assessment report, it needs to be generated first. Please use GenerateUserAssessmentReport to generate a downloadable report in the preferred format (PDF, XLS). \n[Command Reference](downloadUserAssessmentReport)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@cli_util.option('--format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'CryptoAssessment'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_crypto_assessment(ctx, from_json, crypto_assessment_id):
+def download_user_assessment_report(ctx, from_json, file, user_assessment_id, format, if_match):
- if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-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['format'] = format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_crypto_assessment(
- crypto_assessment_id=crypto_assessment_id,
+ result = client.download_user_assessment_report(
+ user_assessment_id=user_assessment_id,
+ download_user_assessment_report_details=_details,
**kwargs
)
- cli_util.render_response(result, ctx)
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
-@crypto_assessment_group.command(name=cli_util.override('data_safe.get_crypto_assessment_sqlnet_parameters.command_name', 'get-crypto-assessment-sqlnet-parameters'), help=u"""Gets SQLNET.ORA parameter values and quantum-readiness evaluation for the specified crypto assessment. \n[Command Reference](getCryptoAssessmentSqlnetParameters)""")
-@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
-@cli_util.option('--parameter', help=u"""A filter to return only the SQLNET parameter with the specified name.""")
-@cli_util.option('--quantum-readiness', type=custom_types.CliCaseInsensitiveChoice(["RESISTANT", "NOT_RESISTANT", "NOT_AVAILABLE", "NOT_APPLICABLE", "NOT_SUPPORTED"]), help=u"""Filters SQLNET parameters by quantum-readiness category.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@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_safe', 'class': 'CryptoAssessmentSqlnetParameters'})
-@cli_util.wrap_exceptions
-def get_crypto_assessment_sqlnet_parameters(ctx, from_json, crypto_assessment_id, parameter, quantum_readiness, limit, page):
-
- if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
+ try:
+ if bar:
+ bar.__enter__()
- kwargs = {}
- if parameter is not None:
- kwargs['parameter'] = parameter
- if quantum_readiness is not None:
- kwargs['quantum_readiness'] = quantum_readiness
- 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_safe', 'data_safe', ctx)
- result = client.get_crypto_assessment_sqlnet_parameters(
- crypto_assessment_id=crypto_assessment_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
-@data_safe_configuration_group.command(name=cli_util.override('data_safe.get_data_safe_configuration.command_name', 'get'), help=u"""Gets the details of the Data Safe configuration. \n[Command Reference](getDataSafeConfiguration)""")
-@cli_util.option('--compartment-id', help=u"""A filter to return the Data Safe configuration for the specified tenancy OCID.""")
+@data_safe_configuration_group.command(name=cli_util.override('data_safe.enable_data_safe_configuration.command_name', 'enable'), help=u"""Enables Data Safe in the tenancy and region. \n[Command Reference](enableDataSafeConfiguration)""")
+@cli_util.option('--is-enabled', required=True, type=click.BOOL, help=u"""Indicates if Data Safe is enabled.""")
+@cli_util.option('--compartment-id', help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={}, output_type={'module': 'data_safe', 'class': 'DataSafeConfiguration'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_data_safe_configuration(ctx, from_json, compartment_id):
+def enable_data_safe_configuration(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, is_enabled, compartment_id, if_match):
kwargs = {}
if compartment_id is not None:
kwargs['compartment_id'] = compartment_id
+ if if_match is not None:
+ kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+ _details['isEnabled'] = is_enabled
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_data_safe_configuration(
+ result = client.enable_data_safe_configuration(
+ enable_data_safe_configuration_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_safe_private_endpoint_group.command(name=cli_util.override('data_safe.get_data_safe_private_endpoint.command_name', 'get'), help=u"""Gets the details of the specified Data Safe private endpoint. \n[Command Reference](getDataSafePrivateEndpoint)""")
-@cli_util.option('--data-safe-private-endpoint-id', required=True, help=u"""The OCID of the private endpoint.""")
-@json_skeleton_utils.get_cli_json_input_option({})
+@subsetting_policy_group.command(name=cli_util.override('data_safe.estimate_table_sizes.command_name', 'estimate-table-sizes'), help=u"""Estimates table sizes for the specified subsetting policy and target database. \n[Command Reference](estimateTableSizes)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--target-credentials', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--target-id', help=u"""The OCID of the target database to use for estimating table sizes. If it's not provided, the value of the targetId attribute in the SubsettingPolicy resource is used.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DataSafePrivateEndpoint'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
@cli_util.wrap_exceptions
-def get_data_safe_private_endpoint(ctx, from_json, data_safe_private_endpoint_id):
+def estimate_table_sizes(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_policy_id, target_credentials, target_id):
- if isinstance(data_safe_private_endpoint_id, six.string_types) and len(data_safe_private_endpoint_id.strip()) == 0:
- raise click.UsageError('Parameter --data-safe-private-endpoint-id cannot be whitespace or empty string')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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_safe', 'data_safe', ctx)
- result = client.get_data_safe_private_endpoint(
- data_safe_private_endpoint_id=data_safe_private_endpoint_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
+ _details = {}
+ _details['targetCredentials'] = cli_util.parse_json_parameter("target_credentials", target_credentials)
-@database_security_config_group.command(name=cli_util.override('data_safe.get_database_security_config.command_name', 'get'), help=u"""Gets a database security configuration by identifier. \n[Command Reference](getDatabaseSecurityConfig)""")
-@cli_util.option('--database-security-config-id', required=True, help=u"""The OCID of the database security configuration 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': 'data_safe', 'class': 'DatabaseSecurityConfig'})
-@cli_util.wrap_exceptions
-def get_database_security_config(ctx, from_json, database_security_config_id):
-
- if isinstance(database_security_config_id, six.string_types) and len(database_security_config_id.strip()) == 0:
- raise click.UsageError('Parameter --database-security-config-id cannot be whitespace or empty string')
+ if target_id is not None:
+ _details['targetId'] = target_id
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_database_security_config(
- database_security_config_id=database_security_config_id,
+ result = client.estimate_table_sizes(
+ subsetting_policy_id=subsetting_policy_id,
+ estimate_table_sizes_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)
-@database_table_access_entry_group.command(name=cli_util.override('data_safe.get_database_table_access_entry.command_name', 'get'), help=u"""Gets a database table access entry object by identifier. \n[Command Reference](getDatabaseTableAccessEntry)""")
-@cli_util.option('--security-policy-report-id', required=True, help=u"""The OCID of the security policy report resource.""")
-@cli_util.option('--database-table-access-entry-key', required=True, help=u"""The unique key that identifies the table access object. This is a system-generated identifier.""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.generate_crypto_assessment_report.command_name', 'generate-crypto-assessment-report'), help=u"""Generates the report of the specified crypto assessment. Supported output formats are PDF and XLS. \n[Command Reference](generateCryptoAssessmentReport)""")
+@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
+@cli_util.option('--format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the crypto assessment report.""")
+@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={}, output_type={'module': 'data_safe', 'class': 'DatabaseTableAccessEntry'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_database_table_access_entry(ctx, from_json, security_policy_report_id, database_table_access_entry_key):
-
- if isinstance(security_policy_report_id, six.string_types) and len(security_policy_report_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-report-id cannot be whitespace or empty string')
+def generate_crypto_assessment_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, crypto_assessment_id, format, if_match):
- if isinstance(database_table_access_entry_key, six.string_types) and len(database_table_access_entry_key.strip()) == 0:
- raise click.UsageError('Parameter --database-table-access-entry-key cannot be whitespace or empty string')
+ if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --crypto-assessment-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['format'] = format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_database_table_access_entry(
- security_policy_report_id=security_policy_report_id,
- database_table_access_entry_key=database_table_access_entry_key,
+ result = client.generate_crypto_assessment_report(
+ crypto_assessment_id=crypto_assessment_id,
+ generate_crypto_assessment_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)
-@database_view_access_entry_group.command(name=cli_util.override('data_safe.get_database_view_access_entry.command_name', 'get'), help=u"""Gets a database view access object by identifier. \n[Command Reference](getDatabaseViewAccessEntry)""")
-@cli_util.option('--security-policy-report-id', required=True, help=u"""The OCID of the security policy report resource.""")
-@cli_util.option('--database-view-access-entry-key', required=True, help=u"""The unique key that identifies the view access object. This is a system-generated identifier.""")
+@sensitive_data_model_group.command(name=cli_util.override('data_safe.generate_discovery_report_for_download.command_name', 'generate-discovery-report-for-download'), help=u"""Generates a downloadable discovery report. It's a prerequisite for the DownloadDiscoveryReport operation. Use this endpoint to generate a discovery report file and then use DownloadDiscoveryReport to download the generated file. By default, it generates report for all the columns in a sensitive data model. Use the discoveryJobId attribute to generate report for a specific discovery job. \n[Command Reference](generateDiscoveryReportForDownload)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--report-format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
+@cli_util.option('--discovery-job-id', help=u"""The OCID of the discovery job.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={}, output_type={'module': 'data_safe', 'class': 'DatabaseViewAccessEntry'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_database_view_access_entry(ctx, from_json, security_policy_report_id, database_view_access_entry_key):
-
- if isinstance(security_policy_report_id, six.string_types) and len(security_policy_report_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-report-id cannot be whitespace or empty string')
+def generate_discovery_report_for_download(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_data_model_id, report_format, discovery_job_id):
- if isinstance(database_view_access_entry_key, six.string_types) and len(database_view_access_entry_key.strip()) == 0:
- raise click.UsageError('Parameter --database-view-access-entry-key cannot be whitespace or empty string')
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-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['reportFormat'] = report_format
+
+ if discovery_job_id is not None:
+ _details['discoveryJobId'] = discovery_job_id
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_database_view_access_entry(
- security_policy_report_id=security_policy_report_id,
- database_view_access_entry_key=database_view_access_entry_key,
+ result = client.generate_discovery_report_for_download(
+ sensitive_data_model_id=sensitive_data_model_id,
+ generate_discovery_report_for_download_details=_details,
**kwargs
)
- cli_util.render_response(result, ctx)
-
+ if wait_for_state:
-@difference_column_group.command(name=cli_util.override('data_safe.get_difference_column.command_name', 'get'), help=u"""Gets the details of the specified SDM Masking policy difference column. \n[Command Reference](getDifferenceColumn)""")
-@cli_util.option('--sdm-masking-policy-difference-id', required=True, help=u"""The OCID of the SDM masking policy difference.""")
-@cli_util.option('--difference-column-key', required=True, help=u"""The unique key that identifies the difference column.""")
-@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_safe', 'class': 'DifferenceColumn'})
-@cli_util.wrap_exceptions
-def get_difference_column(ctx, from_json, sdm_masking_policy_difference_id, difference_column_key):
-
- if isinstance(sdm_masking_policy_difference_id, six.string_types) and len(sdm_masking_policy_difference_id.strip()) == 0:
- raise click.UsageError('Parameter --sdm-masking-policy-difference-id cannot be whitespace or empty string')
-
- if isinstance(difference_column_key, six.string_types) and len(difference_column_key.strip()) == 0:
- raise click.UsageError('Parameter --difference-column-key cannot be whitespace or empty string')
+ 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
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_difference_column(
- sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
- difference_column_key=difference_column_key,
- **kwargs
- )
+ 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)
-@discovery_job_group.command(name=cli_util.override('data_safe.get_discovery_job.command_name', 'get'), help=u"""Gets the details of the specified discovery job. \n[Command Reference](getDiscoveryJob)""")
-@cli_util.option('--discovery-job-id', required=True, help=u"""The OCID of the discovery job.""")
-@json_skeleton_utils.get_cli_json_input_option({})
+@masking_policy_health_report_group.command(name=cli_util.override('data_safe.generate_health_report.command_name', 'generate-health-report'), help=u"""Performs health check on the masking policy. \n[Command Reference](generateHealthReport)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--check-type', type=custom_types.CliCaseInsensitiveChoice(["ALL"]), help=u"""The type of health check. The default behaviour is to perform all health checks.""")
+@cli_util.option('--target-id', help=u"""The OCID of the target database to use for the masking policy health check. The targetId associated with the masking policy is used if this is not passed.""")
+@cli_util.option('--compartment-id', help=u"""The OCID of the compartment where the health report resource should be created.""")
+@cli_util.option('--tablespace', help=u"""The tablespace that should be used to estimate space. If no tablespace is provided, the DEFAULT tablespace is used.""")
+@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('--target-credentials', 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DiscoveryJob'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
@cli_util.wrap_exceptions
-def get_discovery_job(ctx, from_json, discovery_job_id):
+def generate_health_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, check_type, target_id, compartment_id, tablespace, freeform_tags, defined_tags, target_credentials):
- if isinstance(discovery_job_id, six.string_types) and len(discovery_job_id.strip()) == 0:
- raise click.UsageError('Parameter --discovery-job-id cannot be whitespace or empty string')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-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_safe', 'data_safe', ctx)
- result = client.get_discovery_job(
- discovery_job_id=discovery_job_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
+ _details = {}
-@discovery_job_result_group.command(name=cli_util.override('data_safe.get_discovery_job_result.command_name', 'get'), help=u"""Gets the details of the specified discovery result. \n[Command Reference](getDiscoveryJobResult)""")
-@cli_util.option('--discovery-job-id', required=True, help=u"""The OCID of the discovery job.""")
-@cli_util.option('--result-key', required=True, help=u"""The unique key that identifies the discovery result.""")
-@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_safe', 'class': 'DiscoveryJobResult'})
-@cli_util.wrap_exceptions
-def get_discovery_job_result(ctx, from_json, discovery_job_id, result_key):
+ if check_type is not None:
+ _details['checkType'] = check_type
- if isinstance(discovery_job_id, six.string_types) and len(discovery_job_id.strip()) == 0:
- raise click.UsageError('Parameter --discovery-job-id cannot be whitespace or empty string')
+ if target_id is not None:
+ _details['targetId'] = target_id
- if isinstance(result_key, six.string_types) and len(result_key.strip()) == 0:
- raise click.UsageError('Parameter --result-key cannot be whitespace or empty string')
+ if compartment_id is not None:
+ _details['compartmentId'] = compartment_id
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_discovery_job_result(
- discovery_job_id=discovery_job_id,
- result_key=result_key,
- **kwargs
- )
- cli_util.render_response(result, ctx)
+ if tablespace is not None:
+ _details['tablespace'] = tablespace
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
-@target_database_group_group.command(name=cli_util.override('data_safe.get_group_members.command_name', 'get-group-members'), help=u"""Retrieves the members of the target database group with the specified OCID. \n[Command Reference](getGroupMembers)""")
-@cli_util.option('--target-database-group-id', required=True, help=u"""The OCID of the specified target database group.""")
-@cli_util.option('--target-database-id', help=u"""A filter to return the target database only if it is a member of the target database group.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@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_safe', 'class': 'GroupMembersCollection'})
-@cli_util.wrap_exceptions
-def get_group_members(ctx, from_json, target_database_group_id, target_database_id, limit, page):
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
- if isinstance(target_database_group_id, six.string_types) and len(target_database_group_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-group-id cannot be whitespace or empty string')
+ if target_credentials is not None:
+ _details['targetCredentials'] = cli_util.parse_json_parameter("target_credentials", target_credentials)
- kwargs = {}
- if target_database_id is not None:
- kwargs['target_database_id'] = target_database_id
- 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_safe', 'data_safe', ctx)
- result = client.get_group_members(
- target_database_group_id=target_database_group_id,
+ result = client.generate_health_report(
+ masking_policy_id=masking_policy_id,
+ generate_health_report_details=_details,
**kwargs
)
- cli_util.render_response(result, ctx)
-
-
-@library_masking_format_group.command(name=cli_util.override('data_safe.get_library_masking_format.command_name', 'get'), help=u"""Gets the details of the specified library masking format. \n[Command Reference](getLibraryMaskingFormat)""")
-@cli_util.option('--library-masking-format-id', required=True, help=u"""The OCID of the library masking format.""")
-@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_safe', 'class': 'LibraryMaskingFormat'})
-@cli_util.wrap_exceptions
-def get_library_masking_format(ctx, from_json, library_masking_format_id):
+ if wait_for_state:
- if isinstance(library_masking_format_id, six.string_types) and len(library_masking_format_id.strip()) == 0:
- raise click.UsageError('Parameter --library-masking-format-id cannot be whitespace or empty string')
+ 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
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_library_masking_format(
- library_masking_format_id=library_masking_format_id,
- **kwargs
- )
+ 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)
-@masking_column_group.command(name=cli_util.override('data_safe.get_masking_column.command_name', 'get'), help=u"""Gets the details of the specified masking column. \n[Command Reference](getMaskingColumn)""")
+@masking_policy_group.command(name=cli_util.override('data_safe.generate_masking_policy_for_download.command_name', 'generate-masking-policy-for-download'), help=u"""Generates a downloadable file corresponding to the specified masking policy. It's a prerequisite for the DownloadMaskingPolicy operation. Use this endpoint to generate a masking policy file and then use DownloadMaskingPolicy to download the generated file. Note that file generation and download are serial operations. The download operation can't be invoked while the generate operation is in progress. \n[Command Reference](generateMaskingPolicyForDownload)""")
@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--masking-column-key', required=True, help=u"""The unique key that identifies the masking column. It's numeric and unique within a masking policy.""")
+@cli_util.option('--policy-format', type=custom_types.CliCaseInsensitiveChoice(["XML"]), help=u"""The format of the masking policy file.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={}, output_type={'module': 'data_safe', 'class': 'MaskingColumn'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_masking_column(ctx, from_json, masking_policy_id, masking_column_key):
+def generate_masking_policy_for_download(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, policy_format):
if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
- if isinstance(masking_column_key, six.string_types) and len(masking_column_key.strip()) == 0:
- raise click.UsageError('Parameter --masking-column-key cannot be whitespace or empty string')
-
kwargs = {}
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if policy_format is not None:
+ _details['policyFormat'] = policy_format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_masking_column(
+ result = client.generate_masking_policy_for_download(
masking_policy_id=masking_policy_id,
- masking_column_key=masking_column_key,
+ generate_masking_policy_for_download_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)
-@masking_policy_group.command(name=cli_util.override('data_safe.get_masking_policy.command_name', 'get'), help=u"""Gets the details of the specified masking policy. \n[Command Reference](getMaskingPolicy)""")
+@masking_policy_group.command(name=cli_util.override('data_safe.generate_masking_report_for_download.command_name', 'generate-masking-report-for-download'), help=u"""Generates a downloadable masking report. It's a prerequisite for the DownloadMaskingReport operation. Use this endpoint to generate a masking report file and then use DownloadMaskingReport to download the generated file. \n[Command Reference](generateMaskingReportForDownload)""")
@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--report-id', required=True, help=u"""The OCID of the masking report for which a downloadable file is to be generated.""")
+@cli_util.option('--report-format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={}, output_type={'module': 'data_safe', 'class': 'MaskingPolicy'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_masking_policy(ctx, from_json, masking_policy_id):
+def generate_masking_report_for_download(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, report_id, report_format):
if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
raise click.UsageError('Parameter --masking-policy-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['reportId'] = report_id
+ _details['reportFormat'] = report_format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_masking_policy(
+ result = client.generate_masking_report_for_download(
masking_policy_id=masking_policy_id,
+ generate_masking_report_for_download_details=_details,
**kwargs
)
- cli_util.render_response(result, ctx)
-
+ if wait_for_state:
-@masking_policy_health_report_group.command(name=cli_util.override('data_safe.get_masking_policy_health_report.command_name', 'get'), help=u"""Gets the details of the specified masking policy health report. \n[Command Reference](getMaskingPolicyHealthReport)""")
-@cli_util.option('--masking-policy-health-report-id', required=True, help=u"""The OCID of the masking health report.""")
-@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_safe', 'class': 'MaskingPolicyHealthReport'})
-@cli_util.wrap_exceptions
-def get_masking_policy_health_report(ctx, from_json, masking_policy_health_report_id):
-
- if isinstance(masking_policy_health_report_id, six.string_types) and len(masking_policy_health_report_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-health-report-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_safe', 'data_safe', ctx)
- result = client.get_masking_policy_health_report(
- masking_policy_health_report_id=masking_policy_health_report_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
-
-
-@masking_report_group.command(name=cli_util.override('data_safe.get_masking_report.command_name', 'get'), help=u"""Gets the details of the specified masking report. \n[Command Reference](getMaskingReport)""")
-@cli_util.option('--masking-report-id', required=True, help=u"""The OCID of the masking report.""")
-@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_safe', 'class': 'MaskingReport'})
-@cli_util.wrap_exceptions
-def get_masking_report(ctx, from_json, masking_report_id):
-
- if isinstance(masking_report_id, six.string_types) and len(masking_report_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-report-id cannot be whitespace or empty string')
+ 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
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_masking_report(
- masking_report_id=masking_report_id,
- **kwargs
- )
+ 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)
-@on_prem_connector_group.command(name=cli_util.override('data_safe.get_on_prem_connector.command_name', 'get'), help=u"""Gets the details of the specified on-premises connector. \n[Command Reference](getOnPremConnector)""")
+@on_prem_connector_group.command(name=cli_util.override('data_safe.generate_on_prem_connector_configuration.command_name', 'generate-on-prem-connector-configuration'), help=u"""Creates and downloads the configuration of the specified on-premises connector. \n[Command Reference](generateOnPremConnectorConfiguration)""")
+@cli_util.option('--password', required=True, help=u"""The password to encrypt the keys inside the wallet included as part of the configuration. The password must be between 15 and 30 characters long and must contain atleast 1 uppercase, 1 lowercase, 1 numeric, and 1 special character.""")
@cli_util.option('--on-prem-connector-id', required=True, help=u"""The OCID of the on-premises connector.""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'OnPremConnector'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_on_prem_connector(ctx, from_json, on_prem_connector_id):
+def generate_on_prem_connector_configuration(ctx, from_json, file, password, on_prem_connector_id, if_match):
if isinstance(on_prem_connector_id, six.string_types) and len(on_prem_connector_id.strip()) == 0:
raise click.UsageError('Parameter --on-prem-connector-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_safe', 'data_safe', ctx)
- result = client.get_on_prem_connector(
- on_prem_connector_id=on_prem_connector_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
-
-
-@peer_target_database_group.command(name=cli_util.override('data_safe.get_peer_target_database.command_name', 'get'), help=u"""Returns the details of the specified Data Safe peer target database. \n[Command Reference](getPeerTargetDatabase)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
-@cli_util.option('--peer-target-database-id', required=True, type=click.INT, help=u"""The unique id of the peer target database.""")
-@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_safe', 'class': 'PeerTargetDatabase'})
-@cli_util.wrap_exceptions
-def get_peer_target_database(ctx, from_json, target_database_id, peer_target_database_id):
-
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
-
- if isinstance(peer_target_database_id, six.string_types) and len(peer_target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --peer-target-database-id cannot be whitespace or empty string')
-
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_peer_target_database(
- target_database_id=target_database_id,
- peer_target_database_id=peer_target_database_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
-
-
-@user_assessment_group.command(name=cli_util.override('data_safe.get_profile.command_name', 'get-profile'), help=u"""Lists the details of given profile available on the target.
-
-The GetProfile operation returns only the profiles in the specified 'userAssessmentId'. This does not include any subcompartments of the current compartment. \n[Command Reference](getProfile)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
-@cli_util.option('--profile-name', required=True, help=u"""Profile name to get detailed information .""")
-@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_safe', 'class': 'list[Profile]'})
-@cli_util.wrap_exceptions
-def get_profile(ctx, from_json, user_assessment_id, profile_name):
-
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
-
- if isinstance(profile_name, six.string_types) and len(profile_name.strip()) == 0:
- raise click.UsageError('Parameter --profile-name 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_safe', 'data_safe', ctx)
- result = client.get_profile(
- user_assessment_id=user_assessment_id,
- profile_name=profile_name,
- **kwargs
- )
- cli_util.render_response(result, ctx)
-
-
-@referential_relation_group.command(name=cli_util.override('data_safe.get_referential_relation.command_name', 'get'), help=u"""Gets the details of the specified referential relation. \n[Command Reference](getReferentialRelation)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--referential-relation-key', required=True, help=u"""The unique key that identifies the referential relation. It's numeric and unique within a sensitive data model.""")
-@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_safe', 'class': 'ReferentialRelation'})
-@cli_util.wrap_exceptions
-def get_referential_relation(ctx, from_json, sensitive_data_model_id, referential_relation_key):
-
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
-
- if isinstance(referential_relation_key, six.string_types) and len(referential_relation_key.strip()) == 0:
- raise click.UsageError('Parameter --referential-relation-key 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_safe', 'data_safe', ctx)
- result = client.get_referential_relation(
- sensitive_data_model_id=sensitive_data_model_id,
- referential_relation_key=referential_relation_key,
- **kwargs
- )
- cli_util.render_response(result, ctx)
-
-
-@report_group.command(name=cli_util.override('data_safe.get_report.command_name', 'get'), help=u"""Gets a report by identifier \n[Command Reference](getReport)""")
-@cli_util.option('--report-id', required=True, help=u"""Unique report identifier""")
-@json_skeleton_utils.get_cli_json_input_option({})
-@cli_util.help_option
-@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'Report'})
-@cli_util.wrap_exceptions
-def get_report(ctx, from_json, report_id):
-
- if isinstance(report_id, six.string_types) and len(report_id.strip()) == 0:
- raise click.UsageError('Parameter --report-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_safe', 'data_safe', ctx)
- result = client.get_report(
- report_id=report_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
-
-
-@report_group.command(name=cli_util.override('data_safe.get_report_content.command_name', 'get-report-content'), help=u"""Downloads the specified report in the form of .xls or .pdf. \n[Command Reference](getReportContent)""")
-@cli_util.option('--report-id', required=True, help=u"""Unique report identifier""")
-@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
-@json_skeleton_utils.get_cli_json_input_option({})
-@cli_util.help_option
-@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
-@cli_util.wrap_exceptions
-def get_report_content(ctx, from_json, file, report_id):
- if isinstance(report_id, six.string_types) and len(report_id.strip()) == 0:
- raise click.UsageError('Parameter --report-id cannot be whitespace or empty string')
+ _details = {}
+ _details['password'] = password
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_report_content(
- report_id=report_id,
+ result = client.generate_on_prem_connector_configuration(
+ on_prem_connector_id=on_prem_connector_id,
+ generate_on_prem_connector_configuration_details=_details,
**kwargs
)
@@ -11514,3424 +12169,2133 @@ def get_report_content(ctx, from_json, file, report_id):
file.close()
-@report_definition_group.command(name=cli_util.override('data_safe.get_report_definition.command_name', 'get'), help=u"""Gets the details of report definition specified by the identifier \n[Command Reference](getReportDefinition)""")
+@report_definition_group.command(name=cli_util.override('data_safe.generate_report.command_name', 'generate-report'), help=u"""Generates a .xls or .pdf report based on parameters and report definition. \n[Command Reference](generateReport)""")
@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
-@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.option('--display-name', required=True, help=u"""The name of the report to be generated""")
+@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment into which the resource should be moved.""")
+@cli_util.option('--mime-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS", "JSON"]), help=u"""Specifies the format of report to be .xls or .pdf or .json""")
+@cli_util.option('--target-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Array of database target OCIDs.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--target-group-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Array of target group OCIDs.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--description', help=u"""The description of the report to be generated""")
+@cli_util.option('--time-less-than', type=custom_types.CLI_DATETIME, help=u"""Specifies the time until which the data needs to be reported.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-greater-than', type=custom_types.CLI_DATETIME, help=u"""Specifies the time after which the data needs to be reported.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--row-limit', type=click.INT, help=u"""Specifies the limit on the number of rows in the report.""")
+@cli_util.option('--is-pagination-enabled', type=click.BOOL, help=u"""Indicates if the reports being generated should be pagination enabled. If set to true, multiple reports can be generated and the details of next and previous report are present in Report. Values can either be 'true' or 'false'.""")
+@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('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+
+**Example:** query=(auditEventTime ge \"2021-06-04T01:00:26.000Z\") and (eventName eq \"LOGON\")""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'target-group-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'ReportDefinition'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'target-group-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.wrap_exceptions
-def get_report_definition(ctx, from_json, report_definition_id):
+def generate_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, report_definition_id, display_name, compartment_id, mime_type, target_ids, target_group_ids, description, time_less_than, time_greater_than, row_limit, is_pagination_enabled, if_match, scim_query):
if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
raise click.UsageError('Parameter --report-definition-id cannot be whitespace or empty string')
kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ if scim_query is not None:
+ kwargs['scim_query'] = scim_query
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_report_definition(
- report_definition_id=report_definition_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
-
-@sdm_masking_policy_difference_group.command(name=cli_util.override('data_safe.get_sdm_masking_policy_difference.command_name', 'get'), help=u"""Gets the details of the specified SDM Masking policy difference. \n[Command Reference](getSdmMaskingPolicyDifference)""")
-@cli_util.option('--sdm-masking-policy-difference-id', required=True, help=u"""The OCID of the SDM masking policy difference.""")
-@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_safe', 'class': 'SdmMaskingPolicyDifference'})
-@cli_util.wrap_exceptions
-def get_sdm_masking_policy_difference(ctx, from_json, sdm_masking_policy_difference_id):
+ _details = {}
+ _details['displayName'] = display_name
+ _details['compartmentId'] = compartment_id
+ _details['mimeType'] = mime_type
- if isinstance(sdm_masking_policy_difference_id, six.string_types) and len(sdm_masking_policy_difference_id.strip()) == 0:
- raise click.UsageError('Parameter --sdm-masking-policy-difference-id cannot be whitespace or empty string')
+ if target_ids is not None:
+ _details['targetIds'] = cli_util.parse_json_parameter("target_ids", target_ids)
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_sdm_masking_policy_difference(
- sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
+ if target_group_ids is not None:
+ _details['targetGroupIds'] = cli_util.parse_json_parameter("target_group_ids", target_group_ids)
+ if description is not None:
+ _details['description'] = description
-@security_assessment_group.command(name=cli_util.override('data_safe.get_security_assessment.command_name', 'get'), help=u"""Gets the details of the specified security assessment. \n[Command Reference](getSecurityAssessment)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@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_safe', 'class': 'SecurityAssessment'})
-@cli_util.wrap_exceptions
-def get_security_assessment(ctx, from_json, security_assessment_id):
+ if time_less_than is not None:
+ _details['timeLessThan'] = time_less_than
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+ if time_greater_than is not None:
+ _details['timeGreaterThan'] = time_greater_than
+
+ if row_limit is not None:
+ _details['rowLimit'] = row_limit
+
+ if is_pagination_enabled is not None:
+ _details['isPaginationEnabled'] = is_pagination_enabled
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_security_assessment(
- security_assessment_id=security_assessment_id,
+ result = client.generate_report(
+ report_definition_id=report_definition_id,
+ generate_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)
-@security_assessment_group.command(name=cli_util.override('data_safe.get_security_assessment_comparison.command_name', 'get-security-assessment-comparison'), help=u"""Gets the details of the comparison report for the security assessments submitted for comparison. \n[Command Reference](getSecurityAssessmentComparison)""")
+@security_assessment_group.command(name=cli_util.override('data_safe.generate_security_assessment_report.command_name', 'generate-security-assessment-report'), help=u"""Generates the report of the specified security assessment. You can get the report in PDF or XLS format. After generating the report, use DownloadSecurityAssessmentReport to download it in the preferred format. \n[Command Reference](generateSecurityAssessmentReport)""")
@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@cli_util.option('--comparison-security-assessment-id', required=True, help=u"""The OCID of the security assessment baseline.""")
+@cli_util.option('--format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS", "STIGXLS"]), help=u"""Format of the Security Assessment report.""")
+@cli_util.option('--is-single-report', type=click.BOOL, help=u"""Optional flag controlling the output format of a target group report: - true: Generate a single consolidated report file for the entire target group. - false: Generate a ZIP archive containing one file per target in the group.
+
+Important: - This flag is only applicable when the security assessment OCID refers to a target group assessment (targetType TARGET_DATABASE_GROUP). - If `isSingleReport` is set to true for an individual target (targetType TARGET_DATABASE), the request will return an error. - If `isSingleReport` is null or false for an individual target, the value is ignored and the selected output format for the assessment type is generated.""")
+@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={}, output_type={'module': 'data_safe', 'class': 'SecurityAssessmentComparison'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_security_assessment_comparison(ctx, from_json, security_assessment_id, comparison_security_assessment_id):
+def generate_security_assessment_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, format, is_single_report, if_match):
if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
- if isinstance(comparison_security_assessment_id, six.string_types) and len(comparison_security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --comparison-security-assessment-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['format'] = format
+
+ if is_single_report is not None:
+ _details['isSingleReport'] = is_single_report
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_security_assessment_comparison(
+ result = client.generate_security_assessment_report(
security_assessment_id=security_assessment_id,
- comparison_security_assessment_id=comparison_security_assessment_id,
+ generate_security_assessment_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)
-@security_policy_group.command(name=cli_util.override('data_safe.get_security_policy.command_name', 'get'), help=u"""Gets a security policy by the specified OCID of the security policy resource. \n[Command Reference](getSecurityPolicy)""")
-@cli_util.option('--security-policy-id', required=True, help=u"""The OCID of the security policy resource.""")
+@sensitive_data_model_group.command(name=cli_util.override('data_safe.generate_sensitive_data_model_for_download.command_name', 'generate-sensitive-data-model-for-download'), help=u"""Generates a downloadable file corresponding to the specified sensitive data model. It's a prerequisite for the DownloadSensitiveDataModel operation. Use this endpoint to generate a data model file and then use DownloadSensitiveDataModel to download the generated file. Note that file generation and download are serial operations. The download operation can't be invoked while the generate operation is in progress. \n[Command Reference](generateSensitiveDataModelForDownload)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--data-model-format', type=custom_types.CliCaseInsensitiveChoice(["XML"]), help=u"""The format of the sensitive data model file.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicy'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_security_policy(ctx, from_json, security_policy_id):
+def generate_sensitive_data_model_for_download(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_data_model_id, data_model_format):
- if isinstance(security_policy_id, six.string_types) and len(security_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-id cannot be whitespace or empty string')
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
kwargs = {}
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if data_model_format is not None:
+ _details['dataModelFormat'] = data_model_format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_security_policy(
- security_policy_id=security_policy_id,
+ result = client.generate_sensitive_data_model_for_download(
+ sensitive_data_model_id=sensitive_data_model_id,
+ generate_sensitive_data_model_for_download_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)
-@security_policy_config_group.command(name=cli_util.override('data_safe.get_security_policy_config.command_name', 'get'), help=u"""Gets a security policy configuration by identifier. \n[Command Reference](getSecurityPolicyConfig)""")
-@cli_util.option('--security-policy-config-id', required=True, help=u"""The OCID of the security policy configuration resource.""")
+@sql_collection_group.command(name=cli_util.override('data_safe.generate_sql_firewall_policy.command_name', 'generate-sql-firewall-policy'), help=u"""Generates or appends to the SQL Firewall policy using the specified SQL collection. \n[Command Reference](generateSqlFirewallPolicy)""")
+@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicyConfig'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_security_policy_config(ctx, from_json, security_policy_config_id):
+def generate_sql_firewall_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, if_match):
- if isinstance(security_policy_config_id, six.string_types) and len(security_policy_config_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-config-id cannot be whitespace or empty string')
+ if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-collection-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_safe', 'data_safe', ctx)
- result = client.get_security_policy_config(
- security_policy_config_id=security_policy_config_id,
+ result = client.generate_sql_firewall_policy(
+ sql_collection_id=sql_collection_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)
-@security_policy_deployment_group.command(name=cli_util.override('data_safe.get_security_policy_deployment.command_name', 'get'), help=u"""Gets a security policy deployment by identifier. \n[Command Reference](getSecurityPolicyDeployment)""")
-@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
-@json_skeleton_utils.get_cli_json_input_option({})
+@subsetting_policy_health_report_group.command(name=cli_util.override('data_safe.generate_subsetting_health_report.command_name', 'generate-subsetting-health-report'), help=u"""Performs health check on the subsetting policy. \n[Command Reference](generateSubsettingHealthReport)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--target-credentials', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--check-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "TABLESPACE_CHECK"]), help=u"""The type of health check. The default behaviour is to perform all health checks. TABLESPACE_CHECK performs only the tablespace health check.""")
+@cli_util.option('--target-id', help=u"""The OCID of the target database to use for the subsetting policy health check. The targetId associated with the subsetting policy is used if this is not passed.""")
+@cli_util.option('--compartment-id', help=u"""The OCID of the compartment where the health report resource should be created.""")
+@cli_util.option('--tablespace', help=u"""The tablespace that should be used to estimate space. If no tablespace is provided, the DEFAULT tablespace is used.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicyDeployment'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
@cli_util.wrap_exceptions
-def get_security_policy_deployment(ctx, from_json, security_policy_deployment_id):
+def generate_subsetting_health_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_policy_id, target_credentials, check_type, target_id, compartment_id, tablespace, freeform_tags, defined_tags):
- if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-deployment-id cannot be whitespace or empty string')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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_safe', 'data_safe', ctx)
- result = client.get_security_policy_deployment(
- security_policy_deployment_id=security_policy_deployment_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
+ _details = {}
+ _details['targetCredentials'] = cli_util.parse_json_parameter("target_credentials", target_credentials)
-@security_policy_entry_state_group.command(name=cli_util.override('data_safe.get_security_policy_entry_state.command_name', 'get'), help=u"""Gets a security policy entity states by identifier. \n[Command Reference](getSecurityPolicyEntryState)""")
-@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
-@cli_util.option('--security-policy-entry-state-id', required=True, help=u"""Unique security policy entry state identifier. The unique id for a given security policy entry state can be obtained from the list api by passing the OCID of the corresponding security policy deployment resource as the query parameter.""")
-@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_safe', 'class': 'SecurityPolicyEntryState'})
-@cli_util.wrap_exceptions
-def get_security_policy_entry_state(ctx, from_json, security_policy_deployment_id, security_policy_entry_state_id):
+ if check_type is not None:
+ _details['checkType'] = check_type
- if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-deployment-id cannot be whitespace or empty string')
+ if target_id is not None:
+ _details['targetId'] = target_id
- if isinstance(security_policy_entry_state_id, six.string_types) and len(security_policy_entry_state_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-entry-state-id cannot be whitespace or empty string')
+ if compartment_id is not None:
+ _details['compartmentId'] = compartment_id
+
+ if tablespace is not None:
+ _details['tablespace'] = tablespace
+
+ 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)
- kwargs = {}
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_security_policy_entry_state(
- security_policy_deployment_id=security_policy_deployment_id,
- security_policy_entry_state_id=security_policy_entry_state_id,
+ result = client.generate_subsetting_health_report(
+ subsetting_policy_id=subsetting_policy_id,
+ generate_subsetting_health_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)
-@security_policy_report_group.command(name=cli_util.override('data_safe.get_security_policy_report.command_name', 'get'), help=u"""Gets a security policy report by the specified OCID of the security policy report resource. \n[Command Reference](getSecurityPolicyReport)""")
-@cli_util.option('--security-policy-report-id', required=True, help=u"""The OCID of the security policy report resource.""")
+@subsetting_policy_group.command(name=cli_util.override('data_safe.generate_subsetting_policy_for_download.command_name', 'generate-subsetting-policy-for-download'), help=u"""Generates a downloadable file corresponding to the specified subsetting policy. It's a prerequisite for the DownloadSubsettingPolicy operation. Use this operation to generate a subsetting policy file and then use DownloadSubsettingPolicy to download the generated file. Note that file generation and download are serial operations. The download operation can't be invoked while the generate operation is in progress. \n[Command Reference](generateSubsettingPolicyForDownload)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--policy-format', type=custom_types.CliCaseInsensitiveChoice(["XML"]), help=u"""The format of the subsetting policy file.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicyReport'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_security_policy_report(ctx, from_json, security_policy_report_id):
+def generate_subsetting_policy_for_download(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_policy_id, policy_format):
- if isinstance(security_policy_report_id, six.string_types) and len(security_policy_report_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-report-id cannot be whitespace or empty string')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
kwargs = {}
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if policy_format is not None:
+ _details['policyFormat'] = policy_format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_security_policy_report(
- security_policy_report_id=security_policy_report_id,
+ result = client.generate_subsetting_policy_for_download(
+ subsetting_policy_id=subsetting_policy_id,
+ generate_subsetting_policy_for_download_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)
-@sensitive_column_group.command(name=cli_util.override('data_safe.get_sensitive_column.command_name', 'get'), help=u"""Gets the details of the specified sensitive column. \n[Command Reference](getSensitiveColumn)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--sensitive-column-key', required=True, help=u"""The unique key that identifies the sensitive column. It's numeric and unique within a sensitive data model.""")
+@subsetting_policy_group.command(name=cli_util.override('data_safe.generate_subsetting_report_for_download.command_name', 'generate-subsetting-report-for-download'), help=u"""Generates a downloadable subsetting report. It's a prerequisite for the DownloadSubsettingReport operation. Use this endpoint to generate a subsetting report file and then use DownloadSubsettingReport to download the generated file. \n[Command Reference](generateSubsettingReportForDownload)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--report-id', required=True, help=u"""The OCID of the subsetting report for which a downloadable file is to be generated""")
+@cli_util.option('--report-format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={}, output_type={'module': 'data_safe', 'class': 'SensitiveColumn'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_sensitive_column(ctx, from_json, sensitive_data_model_id, sensitive_column_key):
-
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+def generate_subsetting_report_for_download(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_policy_id, report_id, report_format):
- if isinstance(sensitive_column_key, six.string_types) and len(sensitive_column_key.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-column-key cannot be whitespace or empty string')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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['reportId'] = report_id
+ _details['reportFormat'] = report_format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_sensitive_column(
- sensitive_data_model_id=sensitive_data_model_id,
- sensitive_column_key=sensitive_column_key,
+ result = client.generate_subsetting_report_for_download(
+ subsetting_policy_id=subsetting_policy_id,
+ generate_subsetting_report_for_download_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)
-@sensitive_data_model_group.command(name=cli_util.override('data_safe.get_sensitive_data_model.command_name', 'get'), help=u"""Gets the details of the specified sensitive data model. \n[Command Reference](getSensitiveDataModel)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@user_assessment_group.command(name=cli_util.override('data_safe.generate_user_assessment_report.command_name', 'generate-user-assessment-report'), help=u"""Generates the report of the specified user assessment. The report is available in PDF or XLS format. After generating the report, use DownloadUserAssessmentReport to download it in the preferred format. \n[Command Reference](generateUserAssessmentReport)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@cli_util.option('--format', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS"]), help=u"""Format of the report.""")
+@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={}, output_type={'module': 'data_safe', 'class': 'SensitiveDataModel'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def get_sensitive_data_model(ctx, from_json, sensitive_data_model_id):
+def generate_user_assessment_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, user_assessment_id, format, if_match):
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-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['format'] = format
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.get_sensitive_data_model(
- sensitive_data_model_id=sensitive_data_model_id,
+ result = client.generate_user_assessment_report(
+ user_assessment_id=user_assessment_id,
+ generate_user_assessment_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)
-@sensitive_type_group.command(name=cli_util.override('data_safe.get_sensitive_type.command_name', 'get'), help=u"""Gets the details of the specified sensitive type. \n[Command Reference](getSensitiveType)""")
-@cli_util.option('--sensitive-type-id', required=True, help=u"""The OCID of the sensitive type.""")
+@alert_group.command(name=cli_util.override('data_safe.get_alert.command_name', 'get'), help=u"""Gets the details of the specified alerts. \n[Command Reference](getAlert)""")
+@cli_util.option('--alert-id', required=True, help=u"""The OCID of alert.""")
@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_safe', 'class': 'SensitiveType'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'Alert'})
@cli_util.wrap_exceptions
-def get_sensitive_type(ctx, from_json, sensitive_type_id):
+def get_alert(ctx, from_json, alert_id):
- if isinstance(sensitive_type_id, six.string_types) and len(sensitive_type_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-type-id cannot be whitespace or empty string')
+ if isinstance(alert_id, six.string_types) and len(alert_id.strip()) == 0:
+ raise click.UsageError('Parameter --alert-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_safe', 'data_safe', ctx)
- result = client.get_sensitive_type(
- sensitive_type_id=sensitive_type_id,
+ result = client.get_alert(
+ alert_id=alert_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sensitive_type_group_group.command(name=cli_util.override('data_safe.get_sensitive_type_group.command_name', 'get'), help=u"""Gets the details of the specified sensitive type group. \n[Command Reference](getSensitiveTypeGroup)""")
-@cli_util.option('--sensitive-type-group-id', required=True, help=u"""The OCID of the sensitive type group.""")
+@alert_policy_group.command(name=cli_util.override('data_safe.get_alert_policy.command_name', 'get'), help=u"""Gets the details of alert policy by its ID. \n[Command Reference](getAlertPolicy)""")
+@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
@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_safe', 'class': 'SensitiveTypeGroup'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AlertPolicy'})
@cli_util.wrap_exceptions
-def get_sensitive_type_group(ctx, from_json, sensitive_type_group_id):
+def get_alert_policy(ctx, from_json, alert_policy_id):
- if isinstance(sensitive_type_group_id, six.string_types) and len(sensitive_type_group_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-type-group-id cannot be whitespace or empty string')
+ if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --alert-policy-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_safe', 'data_safe', ctx)
- result = client.get_sensitive_type_group(
- sensitive_type_group_id=sensitive_type_group_id,
+ result = client.get_alert_policy(
+ alert_policy_id=alert_policy_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sensitive_types_export_group.command(name=cli_util.override('data_safe.get_sensitive_types_export.command_name', 'get'), help=u"""Gets the details of the specified sensitive types export by identifier. \n[Command Reference](getSensitiveTypesExport)""")
-@cli_util.option('--sensitive-types-export-id', required=True, help=u"""The OCID of the sensitive types export.""")
+@alert_policy_rule_group.command(name=cli_util.override('data_safe.get_alert_policy_rule.command_name', 'get'), help=u"""Gets the details of a policy rule by its key. \n[Command Reference](getAlertPolicyRule)""")
+@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
+@cli_util.option('--rule-key', required=True, help=u"""The key of the alert policy rule.""")
@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_safe', 'class': 'SensitiveTypesExport'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AlertPolicyRule'})
@cli_util.wrap_exceptions
-def get_sensitive_types_export(ctx, from_json, sensitive_types_export_id):
+def get_alert_policy_rule(ctx, from_json, alert_policy_id, rule_key):
- if isinstance(sensitive_types_export_id, six.string_types) and len(sensitive_types_export_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-types-export-id cannot be whitespace or empty string')
+ if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --alert-policy-id cannot be whitespace or empty string')
- kwargs = {}
+ if isinstance(rule_key, six.string_types) and len(rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --rule-key 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_safe', 'data_safe', ctx)
- result = client.get_sensitive_types_export(
- sensitive_types_export_id=sensitive_types_export_id,
+ result = client.get_alert_policy_rule(
+ alert_policy_id=alert_policy_id,
+ rule_key=rule_key,
**kwargs
)
cli_util.render_response(result, ctx)
-@sql_collection_group.command(name=cli_util.override('data_safe.get_sql_collection.command_name', 'get'), help=u"""Gets a SQL collection by identifier. \n[Command Reference](getSqlCollection)""")
-@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
+@attribute_set_group.command(name=cli_util.override('data_safe.get_attribute_set.command_name', 'get'), help=u"""Gets the details of the specified attribute set. \n[Command Reference](getAttributeSet)""")
+@cli_util.option('--attribute-set-id', required=True, help=u"""OCID of an attribute set.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SqlCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AttributeSet'})
@cli_util.wrap_exceptions
-def get_sql_collection(ctx, from_json, sql_collection_id):
+def get_attribute_set(ctx, from_json, attribute_set_id, if_match):
- if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
+ if isinstance(attribute_set_id, six.string_types) and len(attribute_set_id.strip()) == 0:
+ raise click.UsageError('Parameter --attribute-set-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_safe', 'data_safe', ctx)
- result = client.get_sql_collection(
- sql_collection_id=sql_collection_id,
+ result = client.get_attribute_set(
+ attribute_set_id=attribute_set_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sql_firewall_allowed_sql_group.command(name=cli_util.override('data_safe.get_sql_firewall_allowed_sql.command_name', 'get'), help=u"""Gets a SQL firewall allowed SQL by identifier. \n[Command Reference](getSqlFirewallAllowedSql)""")
-@cli_util.option('--sql-firewall-allowed-sql-id', required=True, help=u"""The OCID of the sqlFirewallAllowedSql resource.""")
+@audit_archive_retrieval_group.command(name=cli_util.override('data_safe.get_audit_archive_retrieval.command_name', 'get'), help=u"""Gets the details of the specified archive retreival. \n[Command Reference](getAuditArchiveRetrieval)""")
+@cli_util.option('--audit-archive-retrieval-id', required=True, help=u"""OCID of the archive retrieval.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SqlFirewallAllowedSql'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditArchiveRetrieval'})
@cli_util.wrap_exceptions
-def get_sql_firewall_allowed_sql(ctx, from_json, sql_firewall_allowed_sql_id):
+def get_audit_archive_retrieval(ctx, from_json, audit_archive_retrieval_id, if_match):
- if isinstance(sql_firewall_allowed_sql_id, six.string_types) and len(sql_firewall_allowed_sql_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-firewall-allowed-sql-id cannot be whitespace or empty string')
+ if isinstance(audit_archive_retrieval_id, six.string_types) and len(audit_archive_retrieval_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-archive-retrieval-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_safe', 'data_safe', ctx)
- result = client.get_sql_firewall_allowed_sql(
- sql_firewall_allowed_sql_id=sql_firewall_allowed_sql_id,
+ result = client.get_audit_archive_retrieval(
+ audit_archive_retrieval_id=audit_archive_retrieval_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sql_firewall_policy_group.command(name=cli_util.override('data_safe.get_sql_firewall_policy.command_name', 'get'), help=u"""Gets a SQL Firewall policy by identifier. \n[Command Reference](getSqlFirewallPolicy)""")
-@cli_util.option('--sql-firewall-policy-id', required=True, help=u"""The OCID of the SQL Firewall policy resource.""")
+@audit_policy_group.command(name=cli_util.override('data_safe.get_audit_policy.command_name', 'get'), help=u"""Gets a audit policy by identifier. \n[Command Reference](getAuditPolicy)""")
+@cli_util.option('--audit-policy-id', required=True, help=u"""Unique audit policy identifier.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SqlFirewallPolicy'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditPolicy'})
@cli_util.wrap_exceptions
-def get_sql_firewall_policy(ctx, from_json, sql_firewall_policy_id):
+def get_audit_policy(ctx, from_json, audit_policy_id):
- if isinstance(sql_firewall_policy_id, six.string_types) and len(sql_firewall_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-firewall-policy-id cannot be whitespace or empty string')
+ if isinstance(audit_policy_id, six.string_types) and len(audit_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-policy-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_safe', 'data_safe', ctx)
- result = client.get_sql_firewall_policy(
- sql_firewall_policy_id=sql_firewall_policy_id,
+ result = client.get_audit_policy(
+ audit_policy_id=audit_policy_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@target_alert_policy_association_group.command(name=cli_util.override('data_safe.get_target_alert_policy_association.command_name', 'get'), help=u"""Gets the details of target-alert policy association by its ID. \n[Command Reference](getTargetAlertPolicyAssociation)""")
-@cli_util.option('--target-alert-policy-association-id', required=True, help=u"""The OCID of the target-alert policy association.""")
+@audit_profile_group.command(name=cli_util.override('data_safe.get_audit_profile.command_name', 'get'), help=u"""Gets the details of audit profile resource and associated audit trails of the audit profile. \n[Command Reference](getAuditProfile)""")
+@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
@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_safe', 'class': 'TargetAlertPolicyAssociation'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditProfile'})
@cli_util.wrap_exceptions
-def get_target_alert_policy_association(ctx, from_json, target_alert_policy_association_id):
+def get_audit_profile(ctx, from_json, audit_profile_id):
- if isinstance(target_alert_policy_association_id, six.string_types) and len(target_alert_policy_association_id.strip()) == 0:
- raise click.UsageError('Parameter --target-alert-policy-association-id cannot be whitespace or empty string')
+ if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-profile-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_safe', 'data_safe', ctx)
- result = client.get_target_alert_policy_association(
- target_alert_policy_association_id=target_alert_policy_association_id,
+ result = client.get_audit_profile(
+ audit_profile_id=audit_profile_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.get_target_database.command_name', 'get'), help=u"""Returns the details of the specified Data Safe target database. \n[Command Reference](getTargetDatabase)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@audit_trail_group.command(name=cli_util.override('data_safe.get_audit_trail.command_name', 'get'), help=u"""Gets the details of audit trail. \n[Command Reference](getAuditTrail)""")
+@cli_util.option('--audit-trail-id', required=True, help=u"""The OCID of the audit trail.""")
@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_safe', 'class': 'TargetDatabase'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditTrail'})
@cli_util.wrap_exceptions
-def get_target_database(ctx, from_json, target_database_id):
+def get_audit_trail(ctx, from_json, audit_trail_id):
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+ if isinstance(audit_trail_id, six.string_types) and len(audit_trail_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-trail-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_safe', 'data_safe', ctx)
- result = client.get_target_database(
- target_database_id=target_database_id,
+ result = client.get_audit_trail(
+ audit_trail_id=audit_trail_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@target_database_group_group.command(name=cli_util.override('data_safe.get_target_database_group.command_name', 'get'), help=u"""Returns the details of the specified target database group. \n[Command Reference](getTargetDatabaseGroup)""")
-@cli_util.option('--target-database-group-id', required=True, help=u"""The OCID of the specified target database group.""")
+@masking_column_group.command(name=cli_util.override('data_safe.get_compatible_formats_for_data_types.command_name', 'get-compatible-formats-for-data-types'), help=u"""Gets a list of basic masking formats compatible with the supported data types. The data types are grouped into the following categories - Character - Includes CHAR, NCHAR, VARCHAR2, and NVARCHAR2 Numeric - Includes NUMBER, FLOAT, RAW, BINARY_FLOAT, and BINARY_DOUBLE Date - Includes DATE and TIMESTAMP LOB - Includes BLOB, CLOB, and NCLOB All - Includes all the supported data types \n[Command Reference](getCompatibleFormatsForDataTypes)""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
@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_safe', 'class': 'TargetDatabaseGroup'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'CompatibleFormatsForDataTypes'})
@cli_util.wrap_exceptions
-def get_target_database_group(ctx, from_json, target_database_group_id):
-
- if isinstance(target_database_group_id, six.string_types) and len(target_database_group_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-group-id cannot be whitespace or empty string')
+def get_compatible_formats_for_data_types(ctx, from_json, limit, page):
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_safe', 'data_safe', ctx)
- result = client.get_target_database_group(
- target_database_group_id=target_database_group_id,
+ result = client.get_compatible_formats_for_data_types(
**kwargs
)
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.get_template_baseline_comparison.command_name', 'get-template-baseline-comparison'), help=u"""Gets the details of the comparison report for the security assessments submitted for comparison. \n[Command Reference](getTemplateBaselineComparison)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@cli_util.option('--comparison-security-assessment-id', required=True, help=u"""The OCID of the security assessment baseline.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--category', help=u"""The category of the finding.""")
-@cli_util.option('--finding-key', help=u"""The unique key that identifies the finding. It is a string and unique within a security assessment.""")
+@masking_column_group.command(name=cli_util.override('data_safe.get_compatible_formats_for_sensitive_types.command_name', 'get-compatible-formats-for-sensitive-types'), help=u"""Gets a list of library masking formats compatible with the existing sensitive types. For each sensitive type, it returns the assigned default masking format as well as the other library masking formats that have the sensitiveTypeIds attribute containing the OCID of the sensitive type. \n[Command Reference](getCompatibleFormatsForSensitiveTypes)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
@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_safe', 'class': 'SecurityAssessmentTemplateBaselineComparison'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'CompatibleFormatsForSensitiveTypes'})
@cli_util.wrap_exceptions
-def get_template_baseline_comparison(ctx, from_json, security_assessment_id, comparison_security_assessment_id, target_id, category, finding_key):
-
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
-
- if isinstance(comparison_security_assessment_id, six.string_types) and len(comparison_security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --comparison-security-assessment-id cannot be whitespace or empty string')
+def get_compatible_formats_for_sensitive_types(ctx, from_json, compartment_id, compartment_id_in_subtree, access_level, limit, page):
kwargs = {}
- if target_id is not None:
- kwargs['target_id'] = target_id
- if category is not None:
- kwargs['category'] = category
- if finding_key is not None:
- kwargs['finding_key'] = finding_key
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ 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_safe', 'data_safe', ctx)
- result = client.get_template_baseline_comparison(
- security_assessment_id=security_assessment_id,
- comparison_security_assessment_id=comparison_security_assessment_id,
+ result = client.get_compatible_formats_for_sensitive_types(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@unified_audit_policy_group.command(name=cli_util.override('data_safe.get_unified_audit_policy.command_name', 'get'), help=u"""Gets a Unified Audit policy by identifier. \n[Command Reference](getUnifiedAuditPolicy)""")
-@cli_util.option('--unified-audit-policy-id', required=True, help=u"""The OCID of the Unified Audit policy resource.""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.get_crypto_assessment.command_name', 'get'), help=u"""Gets the details of the specified crypto assessment. \n[Command Reference](getCryptoAssessment)""")
+@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
@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_safe', 'class': 'UnifiedAuditPolicy'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'CryptoAssessment'})
@cli_util.wrap_exceptions
-def get_unified_audit_policy(ctx, from_json, unified_audit_policy_id):
+def get_crypto_assessment(ctx, from_json, crypto_assessment_id):
- if isinstance(unified_audit_policy_id, six.string_types) and len(unified_audit_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --unified-audit-policy-id cannot be whitespace or empty string')
+ if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --crypto-assessment-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_safe', 'data_safe', ctx)
- result = client.get_unified_audit_policy(
- unified_audit_policy_id=unified_audit_policy_id,
+ result = client.get_crypto_assessment(
+ crypto_assessment_id=crypto_assessment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@unified_audit_policy_definition_group.command(name=cli_util.override('data_safe.get_unified_audit_policy_definition.command_name', 'get'), help=u"""Gets a unified audit policy definition by the specified OCID of the unified audit policy definition resource. \n[Command Reference](getUnifiedAuditPolicyDefinition)""")
-@cli_util.option('--unified-audit-policy-definition-id', required=True, help=u"""The OCID of the unified audit policy definition resource.""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.get_crypto_assessment_sqlnet_parameters.command_name', 'get-crypto-assessment-sqlnet-parameters'), help=u"""Gets SQLNET.ORA parameter values and quantum-readiness evaluation for the specified crypto assessment. \n[Command Reference](getCryptoAssessmentSqlnetParameters)""")
+@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
+@cli_util.option('--parameter', help=u"""A filter to return only the SQLNET parameter with the specified name.""")
+@cli_util.option('--quantum-readiness', type=custom_types.CliCaseInsensitiveChoice(["RESISTANT", "NOT_RESISTANT", "NOT_AVAILABLE", "NOT_APPLICABLE", "NOT_SUPPORTED"]), help=u"""Filters SQLNET parameters by quantum-readiness category.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
@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_safe', 'class': 'UnifiedAuditPolicyDefinition'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentSqlnetParameters'})
@cli_util.wrap_exceptions
-def get_unified_audit_policy_definition(ctx, from_json, unified_audit_policy_definition_id):
+def get_crypto_assessment_sqlnet_parameters(ctx, from_json, crypto_assessment_id, parameter, quantum_readiness, limit, page):
- if isinstance(unified_audit_policy_definition_id, six.string_types) and len(unified_audit_policy_definition_id.strip()) == 0:
- raise click.UsageError('Parameter --unified-audit-policy-definition-id cannot be whitespace or empty string')
+ if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
kwargs = {}
+ if parameter is not None:
+ kwargs['parameter'] = parameter
+ if quantum_readiness is not None:
+ kwargs['quantum_readiness'] = quantum_readiness
+ 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_safe', 'data_safe', ctx)
- result = client.get_unified_audit_policy_definition(
- unified_audit_policy_definition_id=unified_audit_policy_definition_id,
+ result = client.get_crypto_assessment_sqlnet_parameters(
+ crypto_assessment_id=crypto_assessment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.get_user_assessment.command_name', 'get'), help=u"""Gets a user assessment by identifier. \n[Command Reference](getUserAssessment)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@data_safe_configuration_group.command(name=cli_util.override('data_safe.get_data_safe_configuration.command_name', 'get'), help=u"""Gets the details of the Data Safe configuration. \n[Command Reference](getDataSafeConfiguration)""")
+@cli_util.option('--compartment-id', help=u"""A filter to return the Data Safe configuration for the specified tenancy OCID.""")
@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_safe', 'class': 'UserAssessment'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DataSafeConfiguration'})
@cli_util.wrap_exceptions
-def get_user_assessment(ctx, from_json, user_assessment_id):
-
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+def get_data_safe_configuration(ctx, from_json, compartment_id):
kwargs = {}
+ 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('data_safe', 'data_safe', ctx)
- result = client.get_user_assessment(
- user_assessment_id=user_assessment_id,
+ result = client.get_data_safe_configuration(
**kwargs
)
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.get_user_assessment_comparison.command_name', 'get-user-assessment-comparison'), help=u"""Gets the details of the comparison report for the user assessments submitted for comparison. \n[Command Reference](getUserAssessmentComparison)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
-@cli_util.option('--comparison-user-assessment-id', required=True, help=u"""The OCID of the baseline user assessment.""")
+@data_safe_private_endpoint_group.command(name=cli_util.override('data_safe.get_data_safe_private_endpoint.command_name', 'get'), help=u"""Gets the details of the specified Data Safe private endpoint. \n[Command Reference](getDataSafePrivateEndpoint)""")
+@cli_util.option('--data-safe-private-endpoint-id', required=True, help=u"""The OCID of the private endpoint.""")
@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_safe', 'class': 'UserAssessmentComparison'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DataSafePrivateEndpoint'})
@cli_util.wrap_exceptions
-def get_user_assessment_comparison(ctx, from_json, user_assessment_id, comparison_user_assessment_id):
-
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+def get_data_safe_private_endpoint(ctx, from_json, data_safe_private_endpoint_id):
- if isinstance(comparison_user_assessment_id, six.string_types) and len(comparison_user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --comparison-user-assessment-id cannot be whitespace or empty string')
+ if isinstance(data_safe_private_endpoint_id, six.string_types) and len(data_safe_private_endpoint_id.strip()) == 0:
+ raise click.UsageError('Parameter --data-safe-private-endpoint-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_safe', 'data_safe', ctx)
- result = client.get_user_assessment_comparison(
- user_assessment_id=user_assessment_id,
- comparison_user_assessment_id=comparison_user_assessment_id,
+ result = client.get_data_safe_private_endpoint(
+ data_safe_private_endpoint_id=data_safe_private_endpoint_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@work_request_group.command(name=cli_util.override('data_safe.get_work_request.command_name', 'get'), help=u"""Gets the details of the specified work request. \n[Command Reference](getWorkRequest)""")
-@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
+@database_security_config_group.command(name=cli_util.override('data_safe.get_database_security_config.command_name', 'get'), help=u"""Gets a database security configuration by identifier. \n[Command Reference](getDatabaseSecurityConfig)""")
+@cli_util.option('--database-security-config-id', required=True, help=u"""The OCID of the database security configuration 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': 'data_safe', 'class': 'WorkRequest'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DatabaseSecurityConfig'})
@cli_util.wrap_exceptions
-def get_work_request(ctx, from_json, work_request_id):
+def get_database_security_config(ctx, from_json, database_security_config_id):
- if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
- raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
+ if isinstance(database_security_config_id, six.string_types) and len(database_security_config_id.strip()) == 0:
+ raise click.UsageError('Parameter --database-security-config-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_safe', 'data_safe', ctx)
- result = client.get_work_request(
- work_request_id=work_request_id,
+ result = client.get_database_security_config(
+ database_security_config_id=database_security_config_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@alert_summary_group.command(name=cli_util.override('data_safe.list_alert_analytics.command_name', 'list-alert-analytics'), help=u"""Returns the aggregation details of the alerts. \n[Command Reference](listAlertAnalytics)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@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('--time-started', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is greater than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-ended', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is less than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--query-time-zone', help=u"""Default time zone is UTC if no time zone provided. The date-time considerations of the resource will be in accordance with the specified time zone.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. If no value is specified timeCreated is default.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
-
-**Example:** | (timeCreated ge \"2021-06-04T01:00:26.000Z\") and (targetNames eq \"target_1\") (featureDetails.userName eq \"user\") and (targetNames eq \"target_1\") Supported fields: severity status alertType targetIds targetNames operationTime lifecycleState displayName timeCreated timeUpdated featureDetails.* (* can be any field in nestedStrMap in Feature Attributes in Alert Summary. For example - userName,object,clientHostname,osUserName,clientIPs,clientId,commandText,commandParam,clientProgram,objectType,targetOwner)""")
-@cli_util.option('--summary-field', type=custom_types.CliCaseInsensitiveChoice(["alertType", "targetIds", "targetNames", "alertSeverity", "alertStatus", "timeCreated", "policyId", "open", "closed", "critical", "high", "medium", "low", "alertcount", "alertPolicyRuleKey", "alertPolicyRuleName", "throttled"]), multiple=True, help=u"""Specifies a subset of summarized fields to be returned in the response.""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["alertType", "targetIds", "targetNames", "alertSeverity", "alertStatus", "timeCreated", "policyId", "alertPolicyRuleKey", "alertPolicyRuleName"]), multiple=True, help=u"""A groupBy can only be used in combination with summaryField parameter. A groupBy value has to be a subset of the values mentioned in summaryField parameter.""")
-@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.""")
+@database_table_access_entry_group.command(name=cli_util.override('data_safe.get_database_table_access_entry.command_name', 'get'), help=u"""Gets a database table access entry object by identifier. \n[Command Reference](getDatabaseTableAccessEntry)""")
+@cli_util.option('--security-policy-report-id', required=True, help=u"""The OCID of the security policy report resource.""")
+@cli_util.option('--database-table-access-entry-key', required=True, help=u"""The unique key that identifies the table access object. This is a system-generated identifier.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AlertAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DatabaseTableAccessEntry'})
@cli_util.wrap_exceptions
-def list_alert_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, limit, page, if_match, time_started, time_ended, query_time_zone, sort_order, sort_by, access_level, scim_query, summary_field, group_by):
+def get_database_table_access_entry(ctx, from_json, security_policy_report_id, database_table_access_entry_key):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(security_policy_report_id, six.string_types) and len(security_policy_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-report-id cannot be whitespace or empty string')
+
+ if isinstance(database_table_access_entry_key, six.string_types) and len(database_table_access_entry_key.strip()) == 0:
+ raise click.UsageError('Parameter --database-table-access-entry-key cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if if_match is not None:
- kwargs['if_match'] = if_match
- if time_started is not None:
- kwargs['time_started'] = time_started
- if time_ended is not None:
- kwargs['time_ended'] = time_ended
- if query_time_zone is not None:
- kwargs['query_time_zone'] = query_time_zone
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if access_level is not None:
- kwargs['access_level'] = access_level
- if scim_query is not None:
- kwargs['scim_query'] = scim_query
- if summary_field is not None and len(summary_field) > 0:
- kwargs['summary_field'] = summary_field
- if group_by is not None and len(group_by) > 0:
- kwargs['group_by'] = group_by
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_alert_analytics,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_alert_analytics,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_alert_analytics(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_database_table_access_entry(
+ security_policy_report_id=security_policy_report_id,
+ database_table_access_entry_key=database_table_access_entry_key,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@alert_policy_group.command(name=cli_util.override('data_safe.list_alert_policies.command_name', 'list'), help=u"""Gets a list of all alert policies. \n[Command Reference](listAlertPolicies)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--alert-policy-id', help=u"""A filter to return policy by it's OCID.""")
-@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["AUDITING", "SECURITY_ASSESSMENT", "USER_ASSESSMENT"]), help=u"""An optional filter to return only alert policies of a certain type.""")
-@cli_util.option('--is-user-defined', type=click.BOOL, help=u"""An optional filter to return only alert policies that are user-defined or not.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""An optional filter to return only alert policies that have the given life-cycle state.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""The field to sort by. Only one sort parameter may be provided.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@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.""")
+@database_view_access_entry_group.command(name=cli_util.override('data_safe.get_database_view_access_entry.command_name', 'get'), help=u"""Gets a database view access object by identifier. \n[Command Reference](getDatabaseViewAccessEntry)""")
+@cli_util.option('--security-policy-report-id', required=True, help=u"""The OCID of the security policy report resource.""")
+@cli_util.option('--database-view-access-entry-key', required=True, help=u"""The unique key that identifies the view access object. This is a system-generated identifier.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AlertPolicyCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DatabaseViewAccessEntry'})
@cli_util.wrap_exceptions
-def list_alert_policies(ctx, from_json, all_pages, page_size, compartment_id, alert_policy_id, type, is_user_defined, display_name, lifecycle_state, limit, page, sort_order, sort_by, time_created_greater_than_or_equal_to, time_created_less_than, compartment_id_in_subtree, access_level):
+def get_database_view_access_entry(ctx, from_json, security_policy_report_id, database_view_access_entry_key):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(security_policy_report_id, six.string_types) and len(security_policy_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-report-id cannot be whitespace or empty string')
+
+ if isinstance(database_view_access_entry_key, six.string_types) and len(database_view_access_entry_key.strip()) == 0:
+ raise click.UsageError('Parameter --database-view-access-entry-key cannot be whitespace or empty string')
kwargs = {}
- if alert_policy_id is not None:
- kwargs['alert_policy_id'] = alert_policy_id
- if type is not None:
- kwargs['type'] = type
- if is_user_defined is not None:
- kwargs['is_user_defined'] = is_user_defined
- 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
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_alert_policies,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_alert_policies,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_alert_policies(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_database_view_access_entry(
+ security_policy_report_id=security_policy_report_id,
+ database_view_access_entry_key=database_view_access_entry_key,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@alert_policy_group.command(name=cli_util.override('data_safe.list_alert_policy_rules.command_name', 'list-alert-policy-rules'), help=u"""Lists the rules of the specified alert policy. The alert policy is said to be satisfied when all rules in the policy evaulate to true. If there are three rules: rule1,rule2 and rule3, the policy is satisfied if rule1 AND rule2 AND rule3 is True. \n[Command Reference](listAlertPolicyRules)""")
-@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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.""")
+@difference_column_group.command(name=cli_util.override('data_safe.get_difference_column.command_name', 'get'), help=u"""Gets the details of the specified SDM Masking policy difference column. \n[Command Reference](getDifferenceColumn)""")
+@cli_util.option('--sdm-masking-policy-difference-id', required=True, help=u"""The OCID of the SDM masking policy difference.""")
+@cli_util.option('--difference-column-key', required=True, help=u"""The unique key that identifies the difference column.""")
@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_safe', 'class': 'AlertPolicyRuleCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DifferenceColumn'})
@cli_util.wrap_exceptions
-def list_alert_policy_rules(ctx, from_json, all_pages, page_size, alert_policy_id, limit, page):
+def get_difference_column(ctx, from_json, sdm_masking_policy_difference_id, difference_column_key):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(sdm_masking_policy_difference_id, six.string_types) and len(sdm_masking_policy_difference_id.strip()) == 0:
+ raise click.UsageError('Parameter --sdm-masking-policy-difference-id cannot be whitespace or empty string')
- if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --alert-policy-id cannot be whitespace or empty string')
+ if isinstance(difference_column_key, six.string_types) and len(difference_column_key.strip()) == 0:
+ raise click.UsageError('Parameter --difference-column-key cannot be whitespace or empty string')
kwargs = {}
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_alert_policy_rules,
- alert_policy_id=alert_policy_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_alert_policy_rules,
- limit,
- page_size,
- alert_policy_id=alert_policy_id,
- **kwargs
- )
- else:
- result = client.list_alert_policy_rules(
- alert_policy_id=alert_policy_id,
- **kwargs
- )
+ result = client.get_difference_column(
+ sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
+ difference_column_key=difference_column_key,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@alert_summary_group.command(name=cli_util.override('data_safe.list_alerts.command_name', 'list-alerts'), help=u"""Gets a list of all alerts. \n[Command Reference](listAlerts)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--id', help=u"""A filter to return alert by it's OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. If no value is specified timeCreated is default.""")
-@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
-
-**Example:** | (timeCreated ge \"2021-06-04T01:00:26.000Z\") and (targetNames eq \"target_1\") (featureDetails.userName eq \"user\") and (targetNames eq \"target_1\") Supported fields: severity status alertType targetIds targetNames operationTime lifecycleState displayName timeCreated timeUpdated featureDetails.* (* can be any field in nestedStrMap in Feature Attributes in Alert Summary. For example - userName,object,clientHostname,osUserName,clientIPs,clientId,commandText,commandParam,clientProgram,objectType,targetOwner)""")
-@cli_util.option('--field', type=custom_types.CliCaseInsensitiveChoice(["id", "displayName", "alertType", "targetIds", "targetNames", "severity", "status", "operationTime", "operation", "operationStatus", "timeCreated", "timeUpdated", "policyId", "lifecycleState"]), multiple=True, help=u"""Specifies a subset of fields to be returned in the response.""")
-@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.""")
+@discovery_job_group.command(name=cli_util.override('data_safe.get_discovery_job.command_name', 'get'), help=u"""Gets the details of the specified discovery job. \n[Command Reference](getDiscoveryJob)""")
+@cli_util.option('--discovery-job-id', required=True, help=u"""The OCID of the discovery job.""")
@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_safe', 'class': 'AlertCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DiscoveryJob'})
@cli_util.wrap_exceptions
-def list_alerts(ctx, from_json, all_pages, page_size, compartment_id, id, compartment_id_in_subtree, limit, page, access_level, sort_order, sort_by, scim_query, field):
+def get_discovery_job(ctx, from_json, discovery_job_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(discovery_job_id, six.string_types) and len(discovery_job_id.strip()) == 0:
+ raise click.UsageError('Parameter --discovery-job-id cannot be whitespace or empty string')
kwargs = {}
- if id is not None:
- kwargs['id'] = id
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if access_level is not None:
- kwargs['access_level'] = access_level
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if scim_query is not None:
- kwargs['scim_query'] = scim_query
- if field is not None and len(field) > 0:
- kwargs['field'] = field
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_alerts,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_alerts,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_alerts(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_discovery_job(
+ discovery_job_id=discovery_job_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@attribute_set_group.command(name=cli_util.override('data_safe.list_associated_resources.command_name', 'list-associated-resources'), help=u"""Returns list of all associated resources. \n[Command Reference](listAssociatedResources)""")
-@cli_util.option('--attribute-set-id', required=True, help=u"""OCID of an attribute set.""")
-@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--associated-resource-type', type=custom_types.CliCaseInsensitiveChoice(["AUDIT_POLICY", "AUDIT_REPORT"]), help=u"""A filter to return attribute set associated resources that matches the specified resource type query param.""")
-@cli_util.option('--associated-resource-id', help=u"""A filter to return attribute set associated resource that matches the specified associated resource id query param.""")
-@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.""")
+@discovery_job_result_group.command(name=cli_util.override('data_safe.get_discovery_job_result.command_name', 'get'), help=u"""Gets the details of the specified discovery result. \n[Command Reference](getDiscoveryJobResult)""")
+@cli_util.option('--discovery-job-id', required=True, help=u"""The OCID of the discovery job.""")
+@cli_util.option('--result-key', required=True, help=u"""The unique key that identifies the discovery result.""")
@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_safe', 'class': 'AssociatedResourceCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DiscoveryJobResult'})
@cli_util.wrap_exceptions
-def list_associated_resources(ctx, from_json, all_pages, page_size, attribute_set_id, if_match, limit, page, associated_resource_type, associated_resource_id):
+def get_discovery_job_result(ctx, from_json, discovery_job_id, result_key):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(discovery_job_id, six.string_types) and len(discovery_job_id.strip()) == 0:
+ raise click.UsageError('Parameter --discovery-job-id cannot be whitespace or empty string')
- if isinstance(attribute_set_id, six.string_types) and len(attribute_set_id.strip()) == 0:
- raise click.UsageError('Parameter --attribute-set-id cannot be whitespace or empty string')
+ if isinstance(result_key, six.string_types) and len(result_key.strip()) == 0:
+ raise click.UsageError('Parameter --result-key cannot be whitespace or empty string')
kwargs = {}
- if if_match is not None:
- kwargs['if_match'] = if_match
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if associated_resource_type is not None:
- kwargs['associated_resource_type'] = associated_resource_type
- if associated_resource_id is not None:
- kwargs['associated_resource_id'] = associated_resource_id
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_associated_resources,
- attribute_set_id=attribute_set_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_associated_resources,
- limit,
- page_size,
- attribute_set_id=attribute_set_id,
- **kwargs
- )
- else:
- result = client.list_associated_resources(
- attribute_set_id=attribute_set_id,
- **kwargs
- )
+ result = client.get_discovery_job_result(
+ discovery_job_id=discovery_job_id,
+ result_key=result_key,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@attribute_set_group.command(name=cli_util.override('data_safe.list_attribute_sets.command_name', 'list'), help=u"""Retrieves the list of attribute sets.
-
-The ListAttributeSets operation returns only the attribute sets in the specified `compartmentId`.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requester has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform ListAttributeSet on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAttributeSets)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@target_database_group_group.command(name=cli_util.override('data_safe.get_group_members.command_name', 'get-group-members'), help=u"""Retrieves the members of the target database group with the specified OCID. \n[Command Reference](getGroupMembers)""")
+@cli_util.option('--target-database-group-id', required=True, help=u"""The OCID of the specified target database group.""")
+@cli_util.option('--target-database-id', help=u"""A filter to return the target database only if it is a member of the target database group.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--attribute-set-id', help=u"""A filter to return only attribute set resources that matches the specified attribute set OCID query param.""")
-@cli_util.option('--attribute-set-type', type=custom_types.CliCaseInsensitiveChoice(["IP_ADDRESS", "CLIENT_PROGRAM", "OS_USER", "DATABASE_USER", "DATABASE_OBJECT"]), help=u"""A filter to return only attribute set resources that matches the specified attribute set type query param.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "FAILED", "DELETING", "UPDATING"]), help=u"""The current state of an attribute set.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
-@cli_util.option('--is-user-defined', type=click.BOOL, help=u"""A filter to return user defined or seeded attribute set resources that matches the specified is user defined query param. A true value indicates user defined attribute set.""")
-@cli_util.option('--in-use', type=custom_types.CliCaseInsensitiveChoice(["YES", "NO"]), help=u"""A filter to return attribute set resources that are in use by other associated resources.""")
-@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_safe', 'class': 'AttributeSetCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'GroupMembersCollection'})
@cli_util.wrap_exceptions
-def list_attribute_sets(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, display_name, attribute_set_id, attribute_set_type, lifecycle_state, sort_order, sort_by, is_user_defined, in_use):
+def get_group_members(ctx, from_json, target_database_group_id, target_database_id, limit, page):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(target_database_group_id, six.string_types) and len(target_database_group_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-group-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
+ if target_database_id is not None:
+ kwargs['target_database_id'] = target_database_id
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if display_name is not None:
- kwargs['display_name'] = display_name
- if attribute_set_id is not None:
- kwargs['attribute_set_id'] = attribute_set_id
- if attribute_set_type is not None:
- kwargs['attribute_set_type'] = attribute_set_type
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if is_user_defined is not None:
- kwargs['is_user_defined'] = is_user_defined
- if in_use is not None:
- kwargs['in_use'] = in_use
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_attribute_sets,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_attribute_sets,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_attribute_sets(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_group_members(
+ target_database_group_id=target_database_group_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@audit_archive_retrieval_group.command(name=cli_util.override('data_safe.list_audit_archive_retrievals.command_name', 'list'), help=u"""Returns the list of audit archive retrieval. \n[Command Reference](listAuditArchiveRetrievals)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--audit-archive-retrieval-id', help=u"""OCID of the archive retrieval.""")
-@cli_util.option('--target-id', help=u"""The OCID of the target associated with the archive retrieval.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "NEEDS_ATTENTION", "FAILED", "DELETING", "DELETED", "UPDATING"]), help=u"""A filter to return only resources that matches the specified lifecycle state.""")
-@cli_util.option('--time-of-expiry', type=custom_types.CLI_DATETIME, help=u"""The date time when retrieved archive data will be deleted from Data Safe and unloaded back into archival.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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.""")
+@library_masking_format_group.command(name=cli_util.override('data_safe.get_library_masking_format.command_name', 'get'), help=u"""Gets the details of the specified library masking format. \n[Command Reference](getLibraryMaskingFormat)""")
+@cli_util.option('--library-masking-format-id', required=True, help=u"""The OCID of the library masking format.""")
@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_safe', 'class': 'AuditArchiveRetrievalCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'LibraryMaskingFormat'})
@cli_util.wrap_exceptions
-def list_audit_archive_retrievals(ctx, from_json, all_pages, page_size, compartment_id, display_name, compartment_id_in_subtree, access_level, audit_archive_retrieval_id, target_id, target_database_group_id, limit, page, lifecycle_state, time_of_expiry, sort_order, sort_by):
+def get_library_masking_format(ctx, from_json, library_masking_format_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(library_masking_format_id, six.string_types) and len(library_masking_format_id.strip()) == 0:
+ raise click.UsageError('Parameter --library-masking-format-id cannot be whitespace or empty string')
kwargs = {}
- if display_name is not None:
- kwargs['display_name'] = display_name
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if audit_archive_retrieval_id is not None:
- kwargs['audit_archive_retrieval_id'] = audit_archive_retrieval_id
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if time_of_expiry is not None:
- kwargs['time_of_expiry'] = time_of_expiry
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_audit_archive_retrievals,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_audit_archive_retrievals,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_audit_archive_retrievals(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_library_masking_format(
+ library_masking_format_id=library_masking_format_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@audit_event_summary_group.command(name=cli_util.override('data_safe.list_audit_event_analytics.command_name', 'list-audit-event-analytics'), help=u"""By default the ListAuditEventAnalytics operation will return all of the summary columns. To filter for a specific summary column, specify it in the `summaryField` query parameter.
-
-**Example:** /auditEventAnalytics?summaryField=targetName&summaryField=userName&summaryField=clientHostname &summaryField=dmls&summaryField=privilegeChanges&summaryField=ddls&summaryField=loginFailure&summaryField=loginSuccess &summaryField=allRecord&scimQuery=(auditEventTime ge \"2021-06-13T23:49:14\")
-
-/auditEventAnalytics?timeStarted=2022-08-18T11:02:26.000Z&timeEnded=2022-08-24T11:02:26.000Z This will give number of events grouped by periods. Period can be 1 day, 1 week, etc.
-
-/auditEventAnalytics?summaryField=targetName&groupBy=targetName This will give the number of events group by targetName. Only targetName summary column would be returned. \n[Command Reference](listAuditEventAnalytics)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@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('--limit', type=click.INT, help=u"""For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
-
-**Example:** (auditEventTime ge \"2021-06-04T01:00:26.000Z\") and (eventName eq \"LOGON\") The attrExp or the field (for example, operationTime and eventName in above example) which is used to filter can be any of the fields returned by AuditEventSummary. adminUser, commonUser, sensitiveActivity, dsActivity can only have eq operation and value 1. These define admin user activity, common user activity, sensitive data activity and data safe activity **Example:** (adminUser eq 1)""")
-@cli_util.option('--summary-field', type=custom_types.CliCaseInsensitiveChoice(["auditEventTime", "dbUserName", "targetId", "targetName", "targetClass", "objectType", "clientHostname", "clientProgram", "clientId", "auditType", "eventName", "allRecord", "auditSettingsChange", "dbSchemaChange", "entitlementChange", "loginFailure", "loginSuccess", "allViolations", "realmViolations", "ruleViolations", "dvconfigActivities", "ddls", "dmls", "privilegeChanges", "auditSettingsEnables", "auditSettingsDisables", "selects", "creates", "alters", "drops", "grants", "revokes", "objectOwner", "auditPolicies", "objectName", "osUserName", "errorCode", "clientIp", "externalUserId"]), multiple=True, help=u"""Specifies a subset of summarized fields to be returned in the response.""")
-@cli_util.option('--time-started', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is greater than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-ended', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is less than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--query-time-zone', help=u"""Default time zone is UTC if no time zone provided. The date-time considerations of the resource will be in accordance with the specified time zone.""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["auditEventTime", "dbUserName", "targetId", "targetName", "targetClass", "objectType", "clientHostname", "clientProgram", "clientId", "auditType", "eventName", "objectOwner", "auditPolicies", "objectName", "osUserName", "errorCode", "clientIp", "externalUserId"]), multiple=True, help=u"""A groupBy can only be used in combination with summaryField parameter. A groupBy value has to be a subset of the values mentioned in summaryField parameter.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "targetClass", "targetName", "objectType", "dbUserName", "eventName", "auditEventTime", "clientHostname", "clientProgram", "clientId", "auditType", "objectOwner", "auditPolicies", "objectName", "osUserName", "errorCode", "clientIp", "externalUserId"]), help=u"""If this query parameter is specified, the result is ordered based on this query parameter value.""")
-@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.""")
+@masking_column_group.command(name=cli_util.override('data_safe.get_masking_column.command_name', 'get'), help=u"""Gets the details of the specified masking column. \n[Command Reference](getMaskingColumn)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--masking-column-key', required=True, help=u"""The unique key that identifies the masking column. It's numeric and unique within a masking policy.""")
@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_safe', 'class': 'AuditEventAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'MaskingColumn'})
@cli_util.wrap_exceptions
-def list_audit_event_analytics(ctx, from_json, all_pages, page_size, compartment_id, if_match, limit, page, compartment_id_in_subtree, access_level, scim_query, summary_field, time_started, time_ended, query_time_zone, group_by, sort_order, sort_by):
+def get_masking_column(ctx, from_json, masking_policy_id, masking_column_key):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+
+ if isinstance(masking_column_key, six.string_types) and len(masking_column_key.strip()) == 0:
+ raise click.UsageError('Parameter --masking-column-key cannot be whitespace or empty string')
kwargs = {}
- if if_match is not None:
- kwargs['if_match'] = if_match
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if scim_query is not None:
- kwargs['scim_query'] = scim_query
- if summary_field is not None and len(summary_field) > 0:
- kwargs['summary_field'] = summary_field
- if time_started is not None:
- kwargs['time_started'] = time_started
- if time_ended is not None:
- kwargs['time_ended'] = time_ended
- if query_time_zone is not None:
- kwargs['query_time_zone'] = query_time_zone
- if group_by is not None and len(group_by) > 0:
- kwargs['group_by'] = group_by
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_audit_event_analytics,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_audit_event_analytics,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_audit_event_analytics(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_masking_column(
+ masking_policy_id=masking_policy_id,
+ masking_column_key=masking_column_key,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@audit_event_summary_group.command(name=cli_util.override('data_safe.list_audit_events.command_name', 'list-audit-events'), help=u"""The ListAuditEvents operation returns specified `compartmentId` audit Events only. The list does not include any audit Events associated with the `subcompartments` of the specified `compartmentId`.
+@masking_policy_group.command(name=cli_util.override('data_safe.get_masking_policy.command_name', 'get'), help=u"""Gets the details of the specified masking policy. \n[Command Reference](getMaskingPolicy)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@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_safe', 'class': 'MaskingPolicy'})
+@cli_util.wrap_exceptions
+def get_masking_policy(ctx, from_json, masking_policy_id):
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
-The parameter `compartmentIdInSubtree` applies when you perform ListAuditEvents on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAuditEvents)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+ kwargs = {}
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.get_masking_policy(
+ masking_policy_id=masking_policy_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
-**Example:** (auditEventTime ge \"2021-06-04T01:00:26.000Z\") and (eventName eq \"LOGON\") The attrExp or the field (for example, operationTime and eventName in above example) which is used to filter can be any of the fields returned by AuditEventSummary. adminUser, commonUser, sensitiveActivity, dsActivity can only have eq operation and value 1. These define admin user activity, common user activity, sensitive data activity and data safe activity **Example:** (adminUser eq 1)""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["dbUserName", "targetName", "databaseType", "targetClass", "auditEventTime", "timeCollected", "osUserName", "operation", "operationStatus", "eventName", "errorCode", "errorMessage", "objectType", "objectName", "objectOwner", "clientHostname", "clientIp", "isAlerted", "actionTaken", "clientProgram", "commandText", "commandParam", "extendedEventAttributes", "auditLocation", "osTerminal", "clientId", "auditPolicies", "auditType", "externalUserId"]), help=u"""If this query parameter is specified, the result is sorted by this query parameter value.""")
-@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.""")
+
+@masking_policy_health_report_group.command(name=cli_util.override('data_safe.get_masking_policy_health_report.command_name', 'get'), help=u"""Gets the details of the specified masking policy health report. \n[Command Reference](getMaskingPolicyHealthReport)""")
+@cli_util.option('--masking-policy-health-report-id', required=True, help=u"""The OCID of the masking health report.""")
@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_safe', 'class': 'AuditEventCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'MaskingPolicyHealthReport'})
@cli_util.wrap_exceptions
-def list_audit_events(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, scim_query, sort_order, sort_by):
+def get_masking_policy_health_report(ctx, from_json, masking_policy_health_report_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(masking_policy_health_report_id, six.string_types) and len(masking_policy_health_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-health-report-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if scim_query is not None:
- kwargs['scim_query'] = scim_query
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_audit_events,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_audit_events,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_audit_events(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_masking_policy_health_report(
+ masking_policy_health_report_id=masking_policy_health_report_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@audit_policy_collection_group.command(name=cli_util.override('data_safe.list_audit_policies.command_name', 'list-audit-policies'), help=u"""Retrieves a list of all audited targets with their corresponding provisioned audit policies, and their provisioning conditions.
+@masking_report_group.command(name=cli_util.override('data_safe.get_masking_report.command_name', 'get'), help=u"""Gets the details of the specified masking report. \n[Command Reference](getMaskingReport)""")
+@cli_util.option('--masking-report-id', required=True, help=u"""The OCID of the masking report.""")
+@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_safe', 'class': 'MaskingReport'})
+@cli_util.wrap_exceptions
+def get_masking_report(ctx, from_json, masking_report_id):
-The ListAuditPolicies operation returns only the audit policies in the specified `compartmentId`. The list does not include any subcompartments of the compartmentId passed.
+ if isinstance(masking_report_id, six.string_types) and len(masking_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-report-id cannot be whitespace or empty string')
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+ kwargs = {}
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.get_masking_report(
+ masking_report_id=masking_report_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
-The parameter `compartmentIdInSubtree` applies when you perform ListAuditPolicies on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAuditPolicies)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "FAILED", "NEEDS_ATTENTION", "DELETING", "DELETED"]), help=u"""The current state of the audit policy.""")
-@cli_util.option('--audit-policy-id', help=u"""An optional filter to return only resources that match the specified 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('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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.""")
+
+@on_prem_connector_group.command(name=cli_util.override('data_safe.get_on_prem_connector.command_name', 'get'), help=u"""Gets the details of the specified on-premises connector. \n[Command Reference](getOnPremConnector)""")
+@cli_util.option('--on-prem-connector-id', required=True, help=u"""The OCID of the on-premises connector.""")
@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_safe', 'class': 'AuditPolicyCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'OnPremConnector'})
@cli_util.wrap_exceptions
-def list_audit_policies(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, target_id, target_database_group_id, lifecycle_state, audit_policy_id, sort_order, sort_by):
+def get_on_prem_connector(ctx, from_json, on_prem_connector_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(on_prem_connector_id, six.string_types) and len(on_prem_connector_id.strip()) == 0:
+ raise click.UsageError('Parameter --on-prem-connector-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if audit_policy_id is not None:
- kwargs['audit_policy_id'] = audit_policy_id
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
+ result = client.get_on_prem_connector(
+ on_prem_connector_id=on_prem_connector_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
- result = cli_util.list_call_get_all_results(
- client.list_audit_policies,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_audit_policies,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_audit_policies(
- compartment_id=compartment_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
+@peer_target_database_group.command(name=cli_util.override('data_safe.get_peer_target_database.command_name', 'get'), help=u"""Returns the details of the specified Data Safe peer target database. \n[Command Reference](getPeerTargetDatabase)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@cli_util.option('--peer-target-database-id', required=True, type=click.INT, help=u"""The unique id of the peer target database.""")
+@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_safe', 'class': 'PeerTargetDatabase'})
+@cli_util.wrap_exceptions
+def get_peer_target_database(ctx, from_json, target_database_id, peer_target_database_id):
-@audit_policy_analytic_collection_group.command(name=cli_util.override('data_safe.list_audit_policy_analytics.command_name', 'list-audit-policy-analytics'), help=u"""Gets a list of aggregated audit policy details on the target databases. A audit policy aggregation helps understand the overall state of policies provisioned on targets. It is especially useful to create dashboards or to support analytics.
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+ if isinstance(peer_target_database_id, six.string_types) and len(peer_target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --peer-target-database-id cannot be whitespace or empty string')
-The parameter `compartmentIdInSubtree` applies when you perform SummarizedAuditPolicyInfo on the specified `compartmentId` and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE.
+ kwargs = {}
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.get_peer_target_database(
+ target_database_id=target_database_id,
+ peer_target_database_id=peer_target_database_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
-**Example:** ListAuditPolicyAnalytics?groupBy=auditPolicyCategory \n[Command Reference](listAuditPolicyAnalytics)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["auditPolicyCategory", "auditPolicyName", "targetId"]), multiple=True, help=u"""The group by parameter to summarize audit policy aggregation.""")
-@cli_util.option('--audit-policy-category', type=custom_types.CliCaseInsensitiveChoice(["BASIC_ACTIVITY", "ADMIN_USER_ACTIVITY", "USER_ACTIVITY", "ORACLE_PREDEFINED", "COMPLIANCE_STANDARD", "CUSTOM", "SQL_FIREWALL_AUDITING"]), help=u"""The category to which the audit policy belongs to.""")
-@cli_util.option('--audit-policy-name', help=u"""In case of seeded policies, it is the policy name defined by Data Safe. In case of custom Policies, it is the policy name that is used to create the policies on the target database. In case of Oracle Pre-seeded policies, it is the default policy name of the same.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "FAILED", "NEEDS_ATTENTION", "DELETING", "DELETED"]), help=u"""The current state of the audit policy.""")
-@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.""")
+
+@user_assessment_group.command(name=cli_util.override('data_safe.get_profile.command_name', 'get-profile'), help=u"""Lists the details of given profile available on the target.
+
+The GetProfile operation returns only the profiles in the specified 'userAssessmentId'. This does not include any subcompartments of the current compartment. \n[Command Reference](getProfile)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@cli_util.option('--profile-name', required=True, help=u"""Profile name to get detailed information .""")
@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_safe', 'class': 'AuditPolicyAnalyticCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[Profile]'})
@cli_util.wrap_exceptions
-def list_audit_policy_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, group_by, audit_policy_category, audit_policy_name, target_id, target_database_group_id, lifecycle_state):
+def get_profile(ctx, from_json, user_assessment_id, profile_name):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+
+ if isinstance(profile_name, six.string_types) and len(profile_name.strip()) == 0:
+ raise click.UsageError('Parameter --profile-name cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if group_by is not None and len(group_by) > 0:
- kwargs['group_by'] = group_by
- if audit_policy_category is not None:
- kwargs['audit_policy_category'] = audit_policy_category
- if audit_policy_name is not None:
- kwargs['audit_policy_name'] = audit_policy_name
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_audit_policy_analytics,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_audit_policy_analytics,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_audit_policy_analytics(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_profile(
+ user_assessment_id=user_assessment_id,
+ profile_name=profile_name,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@audit_profile_analytic_collection_group.command(name=cli_util.override('data_safe.list_audit_profile_analytics.command_name', 'list-audit-profile-analytics'), help=u"""Gets a list of audit profile aggregated details . A audit profile aggregation helps understand the overall state of audit profile profiles. As an example, it helps understand how many audit profiles have paid usage. It is especially useful to create dashboards or to support analytics.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform AuditProfileAnalytics on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAuditProfileAnalytics)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["isPaidUsageEnabled", "targetType", "paidUsageSource", "onlineMonthsSource", "offlineMonthsSource"]), multiple=True, help=u"""The group by parameter for summarize operation on audit.""")
-@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A optional filter to return only resources that belong to the specified audit profile type.""")
-@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.""")
+@referential_relation_group.command(name=cli_util.override('data_safe.get_referential_relation.command_name', 'get'), help=u"""Gets the details of the specified referential relation. \n[Command Reference](getReferentialRelation)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--referential-relation-key', required=True, help=u"""The unique key that identifies the referential relation. It's numeric and unique within a sensitive data model.""")
@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_safe', 'class': 'AuditProfileAnalyticCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'ReferentialRelation'})
@cli_util.wrap_exceptions
-def list_audit_profile_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, group_by, target_type):
+def get_referential_relation(ctx, from_json, sensitive_data_model_id, referential_relation_key):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+
+ if isinstance(referential_relation_key, six.string_types) and len(referential_relation_key.strip()) == 0:
+ raise click.UsageError('Parameter --referential-relation-key cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if group_by is not None and len(group_by) > 0:
- kwargs['group_by'] = group_by
- if target_type is not None:
- kwargs['target_type'] = target_type
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_audit_profile_analytics,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_audit_profile_analytics,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_audit_profile_analytics(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_referential_relation(
+ sensitive_data_model_id=sensitive_data_model_id,
+ referential_relation_key=referential_relation_key,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@audit_profile_group.command(name=cli_util.override('data_safe.list_audit_profiles.command_name', 'list'), help=u"""Gets a list of all audit profiles.
+@registration_policy_group.command(name=cli_util.override('data_safe.get_registration_policy.command_name', 'get'), help=u"""Returns the details of the specified Registration Policy. \n[Command Reference](getRegistrationPolicy)""")
+@cli_util.option('--registration-policy-id', required=True, help=u"""The OCID of the registration policy to be used for identification""")
+@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_safe', 'class': 'RegistrationPolicy'})
+@cli_util.wrap_exceptions
+def get_registration_policy(ctx, from_json, registration_policy_id):
-The ListAuditProfiles operation returns only the audit profiles in the specified `compartmentId`. The list does not include any subcompartments of the compartmentId passed.
+ if isinstance(registration_policy_id, six.string_types) and len(registration_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --registration-policy-id cannot be whitespace or empty string')
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+ kwargs = {}
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.get_registration_policy(
+ registration_policy_id=registration_policy_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
-The parameter `compartmentIdInSubtree` applies when you perform ListAuditProfiles on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAuditProfiles)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--audit-profile-id', help=u"""A optional filter to return only resources that match the specified id.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A optional filter to return only resources that belong to the specified audit profile type.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "FAILED", "NEEDS_ATTENTION", "DELETED"]), help=u"""A optional filter to return only resources that match the specified lifecycle state.""")
-@cli_util.option('--is-override-global-retention-setting', type=click.BOOL, help=u"""A optional filter to return only resources that match the specified retention configured value.""")
-@cli_util.option('--is-paid-usage-enabled', type=click.BOOL, help=u"""Indicates if you want to continue audit record collection beyond the free limit of one million audit records per month per target database, incurring additional charges. The default value is inherited from the global settings. You can change at the global level or at the target level.""")
-@cli_util.option('--audit-collected-volume-greater-than-or-equal-to', type=click.INT, help=u"""A filter to return only items that have count of audit records collected greater than or equal to the specified value.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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.""")
+
+@report_group.command(name=cli_util.override('data_safe.get_report.command_name', 'get'), help=u"""Gets a report by identifier \n[Command Reference](getReport)""")
+@cli_util.option('--report-id', required=True, help=u"""Unique report identifier""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditProfileCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'Report'})
@cli_util.wrap_exceptions
-def list_audit_profiles(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, audit_profile_id, target_id, target_database_group_id, target_type, display_name, limit, page, lifecycle_state, is_override_global_retention_setting, is_paid_usage_enabled, audit_collected_volume_greater_than_or_equal_to, sort_order, sort_by):
+def get_report(ctx, from_json, report_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(report_id, six.string_types) and len(report_id.strip()) == 0:
+ raise click.UsageError('Parameter --report-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if audit_profile_id is not None:
- kwargs['audit_profile_id'] = audit_profile_id
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if target_type is not None:
- kwargs['target_type'] = target_type
- if display_name is not None:
- kwargs['display_name'] = display_name
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if is_override_global_retention_setting is not None:
- kwargs['is_override_global_retention_setting'] = is_override_global_retention_setting
- if is_paid_usage_enabled is not None:
- kwargs['is_paid_usage_enabled'] = is_paid_usage_enabled
- if audit_collected_volume_greater_than_or_equal_to is not None:
- kwargs['audit_collected_volume_greater_than_or_equal_to'] = audit_collected_volume_greater_than_or_equal_to
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_audit_profiles,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_audit_profiles,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_audit_profiles(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_report(
+ report_id=report_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@audit_trail_analytic_collection_group.command(name=cli_util.override('data_safe.list_audit_trail_analytics.command_name', 'list-audit-trail-analytics'), help=u"""Gets a list of audit trail aggregated details . A audit trail aggregation helps understand the overall state of trails. As an example, it helps understand how many trails are running or stopped. It is especially useful to create dashboards or to support analytics.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform AuditTrailAnalytics on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAuditTrailAnalytics)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["location", "lifecycleState", "status", "targetId"]), multiple=True, help=u"""The group by parameter for summarize operation on audit trail.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--time-started', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is greater than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-ended', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is less than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--query-time-zone', help=u"""Default time zone is UTC if no time zone provided. The date-time considerations of the resource will be in accordance with the specified time zone.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@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.""")
+@report_group.command(name=cli_util.override('data_safe.get_report_content.command_name', 'get-report-content'), help=u"""Downloads the specified report in the form of .xls or .pdf. \n[Command Reference](getReportContent)""")
+@cli_util.option('--report-id', required=True, help=u"""Unique report identifier""")
+@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
@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_safe', 'class': 'AuditTrailAnalyticCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def list_audit_trail_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, group_by, target_id, time_started, time_ended, query_time_zone, target_database_group_id):
+def get_report_content(ctx, from_json, file, report_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(report_id, six.string_types) and len(report_id.strip()) == 0:
+ raise click.UsageError('Parameter --report-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if group_by is not None and len(group_by) > 0:
- kwargs['group_by'] = group_by
- if target_id is not None:
- kwargs['target_id'] = target_id
- if time_started is not None:
- kwargs['time_started'] = time_started
- if time_ended is not None:
- kwargs['time_ended'] = time_ended
- if query_time_zone is not None:
- kwargs['query_time_zone'] = query_time_zone
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
+ result = client.get_report_content(
+ report_id=report_id,
+ **kwargs
+ )
- result = cli_util.list_call_get_all_results(
- client.list_audit_trail_analytics,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_audit_trail_analytics,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_audit_trail_analytics(
- compartment_id=compartment_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
+ # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
+ # Also we need a non-zero Content-Length in order to display a meaningful progress bar
+ bar = None
+ if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers:
+ content_length = int(result.headers['Content-Length'])
+ if content_length > 0:
+ bar = click.progressbar(length=content_length, label='Downloading file')
+ try:
+ if bar:
+ bar.__enter__()
-@audit_trail_group.command(name=cli_util.override('data_safe.list_audit_trails.command_name', 'list'), help=u"""Gets a list of all audit trails. The ListAuditTrails operation returns only the audit trails in the specified `compartmentId`. The list does not include any subcompartments of the compartmentId passed.
+ # TODO: Make the download size a configurable option
+ # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
+ for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
+ if bar:
+ bar.update(len(chunk))
+ file.write(chunk)
+ finally:
+ if bar:
+ bar.render_finish()
+ file.close()
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-The parameter `compartmentIdInSubtree` applies when you perform ListAuditTrails on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAuditTrails)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--audit-trail-id', help=u"""A optional filter to return only resources that match the specified id.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["INACTIVE", "UPDATING", "ACTIVE", "DELETING", "FAILED", "NEEDS_ATTENTION"]), help=u"""A optional filter to return only resources that match the specified lifecycle state.""")
-@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["STARTING", "COLLECTING", "RECOVERING", "IDLE", "STOPPING", "STOPPED", "RESUMING", "RETRYING", "NOT_STARTED", "STOPPED_NEEDS_ATTN", "STOPPED_FAILED"]), help=u"""A optional filter to return only resources that match the specified sub-state of audit trail.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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.""")
+@report_definition_group.command(name=cli_util.override('data_safe.get_report_definition.command_name', 'get'), help=u"""Gets the details of report definition specified by the identifier \n[Command Reference](getReportDefinition)""")
+@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditTrailCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'ReportDefinition'})
@cli_util.wrap_exceptions
-def list_audit_trails(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, audit_trail_id, display_name, target_id, target_database_group_id, limit, page, lifecycle_state, status, sort_order, sort_by):
+def get_report_definition(ctx, from_json, report_definition_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
+ raise click.UsageError('Parameter --report-definition-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if audit_trail_id is not None:
- kwargs['audit_trail_id'] = audit_trail_id
- if display_name is not None:
- kwargs['display_name'] = display_name
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if status is not None:
- kwargs['status'] = status
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_audit_trails,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_audit_trails,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_audit_trails(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_report_definition(
+ report_definition_id=report_definition_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@audit_profile_group.command(name=cli_util.override('data_safe.list_available_audit_volumes.command_name', 'list-available-audit-volumes'), help=u"""Retrieves a list of audit trails, and associated audit event volume for each trail up to defined start date. \n[Command Reference](listAvailableAuditVolumes)""")
-@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
-@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
-@cli_util.option('--trail-location', help=u"""The audit trail location.""")
-@cli_util.option('--month-in-consideration-greater-than', type=custom_types.CLI_DATETIME, help=u"""Specifying `monthInConsiderationGreaterThan` parameter will retrieve all items for which the event month is greater than the date and time specified, in the format defined by [RFC3339].
-
-**Example:** 2016-12-19T00:00:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--month-in-consideration-less-than', type=custom_types.CLI_DATETIME, help=u"""Specifying `monthInConsiderationLessThan` parameter will retrieve all items for which the event month is less than the date and time specified, in the format defined by [RFC3339].
-
-**Example:** 2016-12-19T00:00:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["monthInConsideration", "volume", "trailLocation"]), help=u"""The field to sort by. You can specify only one sort order(sortOrder). The default order for all fields is ascending.""")
-@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
-@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+@sdm_masking_policy_difference_group.command(name=cli_util.override('data_safe.get_sdm_masking_policy_difference.command_name', 'get'), help=u"""Gets the details of the specified SDM Masking policy difference. \n[Command Reference](getSdmMaskingPolicyDifference)""")
+@cli_util.option('--sdm-masking-policy-difference-id', required=True, help=u"""The OCID of the SDM masking policy difference.""")
@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_safe', 'class': 'AvailableAuditVolumeCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SdmMaskingPolicyDifference'})
@cli_util.wrap_exceptions
-def list_available_audit_volumes(ctx, from_json, all_pages, page_size, audit_profile_id, work_request_id, trail_location, month_in_consideration_greater_than, month_in_consideration_less_than, 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')
+def get_sdm_masking_policy_difference(ctx, from_json, sdm_masking_policy_difference_id):
- if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-profile-id cannot be whitespace or empty string')
+ if isinstance(sdm_masking_policy_difference_id, six.string_types) and len(sdm_masking_policy_difference_id.strip()) == 0:
+ raise click.UsageError('Parameter --sdm-masking-policy-difference-id cannot be whitespace or empty string')
kwargs = {}
- if trail_location is not None:
- kwargs['trail_location'] = trail_location
- if month_in_consideration_greater_than is not None:
- kwargs['month_in_consideration_greater_than'] = month_in_consideration_greater_than
- if month_in_consideration_less_than is not None:
- kwargs['month_in_consideration_less_than'] = month_in_consideration_less_than
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_available_audit_volumes,
- audit_profile_id=audit_profile_id,
- work_request_id=work_request_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_available_audit_volumes,
- limit,
- page_size,
- audit_profile_id=audit_profile_id,
- work_request_id=work_request_id,
- **kwargs
- )
- else:
- result = client.list_available_audit_volumes(
- audit_profile_id=audit_profile_id,
- work_request_id=work_request_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
+ result = client.get_sdm_masking_policy_difference(
+ sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.list_checks.command_name', 'list-checks'), help=u"""Lists all the security checks in the specified compartment for security assessment of type TEMPLATE. \n[Command Reference](listChecks)""")
+@security_assessment_group.command(name=cli_util.override('data_safe.get_security_assessment.command_name', 'get'), help=u"""Gets the details of the specified security assessment. \n[Command Reference](getSecurityAssessment)""")
@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["title", "category", "key"]), help=u"""The field to sort by. You can specify only one sort order(sortOrder). The default order for title is ascending.""")
-@cli_util.option('--suggested-severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), help=u"""A filter to return only checks of a particular risk level.""")
-@cli_util.option('--contains-severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), multiple=True, help=u"""A filter to return only findings that match the specified risk level(s). Use containsSeverity parameter if need to filter by multiple risk levels.""")
-@cli_util.option('--contains-references', type=custom_types.CliCaseInsensitiveChoice(["STIG", "CIS", "GDPR"]), multiple=True, help=u"""An optional filter to return only findings that match the specified references. Use containsReferences param if need to filter by multiple references.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--key', help=u"""Each check in security assessment has an associated key (think of key as a check's name). For a given check, the key will be the same across targets. The user can use these keys to filter the checks.""")
-@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_safe', 'class': 'list[CheckSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityAssessment'})
@cli_util.wrap_exceptions
-def list_checks(ctx, from_json, all_pages, page_size, security_assessment_id, limit, page, sort_order, sort_by, suggested_severity, contains_severity, contains_references, compartment_id_in_subtree, access_level, key):
-
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+def get_security_assessment(ctx, from_json, security_assessment_id):
if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
kwargs = {}
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if suggested_severity is not None:
- kwargs['suggested_severity'] = suggested_severity
- if contains_severity is not None and len(contains_severity) > 0:
- kwargs['contains_severity'] = contains_severity
- if contains_references is not None and len(contains_references) > 0:
- kwargs['contains_references'] = contains_references
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if key is not None:
- kwargs['key'] = key
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_checks,
- security_assessment_id=security_assessment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_checks,
- limit,
- page_size,
- security_assessment_id=security_assessment_id,
- **kwargs
- )
- else:
- result = client.list_checks(
- security_assessment_id=security_assessment_id,
- **kwargs
- )
+ result = client.get_security_assessment(
+ security_assessment_id=security_assessment_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@audit_profile_group.command(name=cli_util.override('data_safe.list_collected_audit_volumes.command_name', 'list-collected-audit-volumes'), help=u"""Gets a list of all collected audit volume data points. \n[Command Reference](listCollectedAuditVolumes)""")
-@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
-@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
-@cli_util.option('--month-in-consideration-greater-than', type=custom_types.CLI_DATETIME, help=u"""Specifying `monthInConsiderationGreaterThan` parameter will retrieve all items for which the event month is greater than the date and time specified, in the format defined by [RFC3339].
-
-**Example:** 2016-12-19T00:00:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--month-in-consideration-less-than', type=custom_types.CLI_DATETIME, help=u"""Specifying `monthInConsiderationLessThan` parameter will retrieve all items for which the event month is less than the date and time specified, in the format defined by [RFC3339].
-
-**Example:** 2016-12-19T00:00:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["monthInConsideration", "onlineVolume", "archivedVolume"]), help=u"""The field to sort by. You can specify only one sort order(sortOrder). The default order for all fields is ascending.""")
-@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
-@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+@security_assessment_group.command(name=cli_util.override('data_safe.get_security_assessment_comparison.command_name', 'get-security-assessment-comparison'), help=u"""Gets the details of the comparison report for the security assessments submitted for comparison. \n[Command Reference](getSecurityAssessmentComparison)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
+@cli_util.option('--comparison-security-assessment-id', required=True, help=u"""The OCID of the security assessment baseline.""")
@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_safe', 'class': 'CollectedAuditVolumeCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityAssessmentComparison'})
@cli_util.wrap_exceptions
-def list_collected_audit_volumes(ctx, from_json, all_pages, page_size, audit_profile_id, work_request_id, month_in_consideration_greater_than, month_in_consideration_less_than, limit, page, sort_order, sort_by):
+def get_security_assessment_comparison(ctx, from_json, security_assessment_id, comparison_security_assessment_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
- if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-profile-id cannot be whitespace or empty string')
+ if isinstance(comparison_security_assessment_id, six.string_types) and len(comparison_security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --comparison-security-assessment-id cannot be whitespace or empty string')
kwargs = {}
- if month_in_consideration_greater_than is not None:
- kwargs['month_in_consideration_greater_than'] = month_in_consideration_greater_than
- if month_in_consideration_less_than is not None:
- kwargs['month_in_consideration_less_than'] = month_in_consideration_less_than
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_collected_audit_volumes,
- audit_profile_id=audit_profile_id,
- work_request_id=work_request_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_collected_audit_volumes,
- limit,
- page_size,
- audit_profile_id=audit_profile_id,
- work_request_id=work_request_id,
- **kwargs
- )
- else:
- result = client.list_collected_audit_volumes(
- audit_profile_id=audit_profile_id,
- work_request_id=work_request_id,
- **kwargs
- )
+ result = client.get_security_assessment_comparison(
+ security_assessment_id=security_assessment_id,
+ comparison_security_assessment_id=comparison_security_assessment_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.list_columns.command_name', 'list-columns'), help=u"""Returns a list of column metadata objects. \n[Command Reference](listColumns)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--table-name', multiple=True, help=u"""A filter to return only items related to specific table name.""")
-@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
-@cli_util.option('--datatype', multiple=True, help=u"""A filter to return only items related to specific datatype.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["SCHEMANAME", "TABLENAME", "COLUMNNAME", "DATATYPE"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified.""")
-@cli_util.option('--schema-name-contains', help=u"""A filter to return only items if schema name contains a specific string.""")
-@cli_util.option('--table-name-contains', help=u"""A filter to return only items if table name contains a specific string.""")
-@cli_util.option('--column-name-contains', help=u"""A filter to return only items if column name contains a specific string.""")
-@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'table-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'datatype': {'module': 'data_safe', 'class': 'list[string]'}})
+@security_policy_group.command(name=cli_util.override('data_safe.get_security_policy.command_name', 'get'), help=u"""Gets a security policy by the specified OCID of the security policy resource. \n[Command Reference](getSecurityPolicy)""")
+@cli_util.option('--security-policy-id', required=True, help=u"""The OCID of the security policy 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={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'table-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'datatype': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'list[ColumnSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicy'})
@cli_util.wrap_exceptions
-def list_columns(ctx, from_json, all_pages, page_size, target_database_id, limit, page, schema_name, table_name, column_name, datatype, sort_order, sort_by, schema_name_contains, table_name_contains, column_name_contains):
-
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+def get_security_policy(ctx, from_json, security_policy_id):
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+ if isinstance(security_policy_id, six.string_types) and len(security_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-id cannot be whitespace or empty string')
kwargs = {}
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if table_name is not None and len(table_name) > 0:
- kwargs['table_name'] = table_name
- if column_name is not None and len(column_name) > 0:
- kwargs['column_name'] = column_name
- if datatype is not None and len(datatype) > 0:
- kwargs['datatype'] = datatype
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if schema_name_contains is not None:
- kwargs['schema_name_contains'] = schema_name_contains
- if table_name_contains is not None:
- kwargs['table_name_contains'] = table_name_contains
- if column_name_contains is not None:
- kwargs['column_name_contains'] = column_name_contains
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_columns,
- target_database_id=target_database_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_columns,
- limit,
- page_size,
- target_database_id=target_database_id,
- **kwargs
- )
- else:
- result = client.list_columns(
- target_database_id=target_database_id,
- **kwargs
- )
+ result = client.get_security_policy(
+ security_policy_id=security_policy_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_backup_sets.command_name', 'list-crypto-assessment-backup-sets'), help=u"""Gets backup set summaries across targets in a compartment. Use assessmentId to narrow results to one crypto assessment. \n[Command Reference](listCryptoAssessmentBackupSets)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--assessment-id', help=u"""A filter to return only resources associated with the specified crypto assessment OCID.""")
-@cli_util.option('--assessment-type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return targets from assessments of the specified type.""")
-@cli_util.option('--target-id', help=u"""A filter to return only inventory rows associated with the specified target OCID.""")
-@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
-@cli_util.option('--backup-set-key', help=u"""Filters backup set summary rows to an exact matching backupSetKey.""")
-@cli_util.option('--is-encrypted', type=click.BOOL, help=u"""Filters backup set summary rows by whether the backup set is encrypted.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["setStamp", "backupSetKey", "sizeInGBs", "timeCreated"]), help=u"""The field used to sort backup set results.""")
-@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@security_policy_config_group.command(name=cli_util.override('data_safe.get_security_policy_config.command_name', 'get'), help=u"""Gets a security policy configuration by identifier. \n[Command Reference](getSecurityPolicyConfig)""")
+@cli_util.option('--security-policy-config-id', required=True, help=u"""The OCID of the security policy configuration 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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentBackupSetCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicyConfig'})
@cli_util.wrap_exceptions
-def list_crypto_assessment_backup_sets(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, assessment_id, assessment_type, target_id, target_ids, backup_set_key, is_encrypted, sort_by, sort_order, limit, page):
+def get_security_policy_config(ctx, from_json, security_policy_config_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(security_policy_config_id, six.string_types) and len(security_policy_config_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-config-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if assessment_id is not None:
- kwargs['assessment_id'] = assessment_id
- if assessment_type is not None:
- kwargs['assessment_type'] = assessment_type
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_ids is not None and len(target_ids) > 0:
- kwargs['target_ids'] = target_ids
- if backup_set_key is not None:
- kwargs['backup_set_key'] = backup_set_key
- if is_encrypted is not None:
- kwargs['is_encrypted'] = is_encrypted
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_crypto_assessment_backup_sets,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_crypto_assessment_backup_sets,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_crypto_assessment_backup_sets(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_security_policy_config(
+ security_policy_config_id=security_policy_config_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_cbom_items.command_name', 'list-crypto-assessment-cbom-items'), help=u"""Lists the CBOM items for the specified crypto assessment. \n[Command Reference](listCryptoAssessmentCbomItems)""")
-@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
-@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results.""")
+@security_policy_deployment_group.command(name=cli_util.override('data_safe.get_security_policy_deployment.command_name', 'get'), help=u"""Gets a security policy deployment by identifier. \n[Command Reference](getSecurityPolicyDeployment)""")
+@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment 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': 'data_safe', 'class': 'CryptoAssessmentCbomItemCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicyDeployment'})
@cli_util.wrap_exceptions
-def list_crypto_assessment_cbom_items(ctx, from_json, all_pages, crypto_assessment_id):
+def get_security_policy_deployment(ctx, from_json, security_policy_deployment_id):
- if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
+ if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-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('data_safe', 'data_safe', ctx)
- result = client.list_crypto_assessment_cbom_items(
- crypto_assessment_id=crypto_assessment_id,
+ result = client.get_security_policy_deployment(
+ security_policy_deployment_id=security_policy_deployment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_certificates.command_name', 'list-crypto-assessment-certificates'), help=u"""Lists certificates discovered across targets in a compartment, including target, wallet location, issuer, subject, validity window, expiry bucket, public key type, and status so expiring or weak certificates can be identified and prioritized. \n[Command Reference](listCryptoAssessmentCertificates)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--assessment-id', help=u"""A filter to return only resources associated with the specified crypto assessment OCID.""")
-@cli_util.option('--assessment-type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return targets from assessments of the specified type.""")
-@cli_util.option('--target-id', help=u"""A filter to return only inventory rows associated with the specified target OCID.""")
-@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
-@cli_util.option('--certificate-type', type=custom_types.CliCaseInsensitiveChoice(["SERVER", "USER", "TRUSTED"]), multiple=True, help=u"""A filter to return only certificates of any of the specified types.""")
-@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["VALID", "EXPIRING_SOON", "EXPIRED", "INVALID", "IN_USE"]), multiple=True, help=u"""A filter to return only certificates with any of the specified statuses.""")
-@cli_util.option('--public-key-type', multiple=True, help=u"""A filter to return only certificates with any of the specified public key types. Stored values are normalized forms such as RSA2048, RSA4096, or EC256.""")
-@cli_util.option('--signature-algorithm', multiple=True, help=u"""A filter to return only certificates whose signature algorithm contains any of the specified values. For example, use SHA1 to match SHA1-based certificate signatures.""")
-@cli_util.option('--expiry-bucket', help=u"""A filter to return only certificates in the specified expiry bucket. Supported values are 0_15, 15_30, 30_60, 60_90, and 90_PLUS.""")
-@cli_util.option('--days-to-expiry', type=click.INT, help=u"""A filter to return certificates whose validTill timestamp is on or before the current time plus the specified number of days. Negative values are allowed and filter certificates that expired on or before that many days ago.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeValidUntil", "subject"]), help=u"""The field used to sort certificate results.""")
-@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'public-key-type': {'module': 'data_safe', 'class': 'list[string]'}, 'signature-algorithm': {'module': 'data_safe', 'class': 'list[string]'}})
+@security_policy_entry_state_group.command(name=cli_util.override('data_safe.get_security_policy_entry_state.command_name', 'get'), help=u"""Gets a security policy entity states by identifier. \n[Command Reference](getSecurityPolicyEntryState)""")
+@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
+@cli_util.option('--security-policy-entry-state-id', required=True, help=u"""Unique security policy entry state identifier. The unique id for a given security policy entry state can be obtained from the list api by passing the OCID of the corresponding security policy deployment resource as the query parameter.""")
+@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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'public-key-type': {'module': 'data_safe', 'class': 'list[string]'}, 'signature-algorithm': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentCertificateCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicyEntryState'})
@cli_util.wrap_exceptions
-def list_crypto_assessment_certificates(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, assessment_id, assessment_type, target_id, target_ids, certificate_type, status, public_key_type, signature_algorithm, expiry_bucket, days_to_expiry, sort_by, sort_order, limit, page):
+def get_security_policy_entry_state(ctx, from_json, security_policy_deployment_id, security_policy_entry_state_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-deployment-id cannot be whitespace or empty string')
+
+ if isinstance(security_policy_entry_state_id, six.string_types) and len(security_policy_entry_state_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-entry-state-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if assessment_id is not None:
- kwargs['assessment_id'] = assessment_id
- if assessment_type is not None:
- kwargs['assessment_type'] = assessment_type
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_ids is not None and len(target_ids) > 0:
- kwargs['target_ids'] = target_ids
- if certificate_type is not None and len(certificate_type) > 0:
- kwargs['certificate_type'] = certificate_type
- if status is not None and len(status) > 0:
- kwargs['status'] = status
- if public_key_type is not None and len(public_key_type) > 0:
- kwargs['public_key_type'] = public_key_type
- if signature_algorithm is not None and len(signature_algorithm) > 0:
- kwargs['signature_algorithm'] = signature_algorithm
- if expiry_bucket is not None:
- kwargs['expiry_bucket'] = expiry_bucket
- if days_to_expiry is not None:
- kwargs['days_to_expiry'] = days_to_expiry
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_crypto_assessment_certificates,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_crypto_assessment_certificates,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_crypto_assessment_certificates(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_security_policy_entry_state(
+ security_policy_deployment_id=security_policy_deployment_id,
+ security_policy_entry_state_id=security_policy_entry_state_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_finding_analytics.command_name', 'list-crypto-assessment-finding-analytics'), help=u"""Lists findings in a compartment with the number of affected targets. \n[Command Reference](listCryptoAssessmentFindingAnalytics)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--category', type=custom_types.CliCaseInsensitiveChoice(["NETWORK_ENCRYPTION", "DATA_ENCRYPTION", "CERTIFICATES_AND_KEY_MANAGEMENT", "BACKUP_AND_EXPORT_ENCRYPTION", "POST_QUANTUM_READINESS", "NOT_SUPPORTED"]), help=u"""A filter to return only findings in the specified category key.""")
-@cli_util.option('--finding-key', multiple=True, help=u"""A filter to return only findings with any of the specified finding keys.""")
-@cli_util.option('--is-quantum-readiness-check', type=click.BOOL, help=u"""A filter to return only findings that are or are not part of quantum-readiness checks.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["targetCount", "priority"]), help=u"""The field used to sort finding analytics results.""")
-@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({'finding-key': {'module': 'data_safe', 'class': 'list[string]'}})
+@security_policy_report_group.command(name=cli_util.override('data_safe.get_security_policy_report.command_name', 'get'), help=u"""Gets a security policy report by the specified OCID of the security policy report resource. \n[Command Reference](getSecurityPolicyReport)""")
+@cli_util.option('--security-policy-report-id', required=True, help=u"""The OCID of the security policy report 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={'finding-key': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentFindingAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicyReport'})
@cli_util.wrap_exceptions
-def list_crypto_assessment_finding_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, category, finding_key, is_quantum_readiness_check, sort_by, sort_order, limit, page):
+def get_security_policy_report(ctx, from_json, security_policy_report_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(security_policy_report_id, six.string_types) and len(security_policy_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-report-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if category is not None:
- kwargs['category'] = category
- if finding_key is not None and len(finding_key) > 0:
- kwargs['finding_key'] = finding_key
- if is_quantum_readiness_check is not None:
- kwargs['is_quantum_readiness_check'] = is_quantum_readiness_check
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_crypto_assessment_finding_analytics,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_crypto_assessment_finding_analytics,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_crypto_assessment_finding_analytics(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_security_policy_report(
+ security_policy_report_id=security_policy_report_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_finding_targets.command_name', 'list-crypto-assessment-finding-targets'), help=u"""For a selected finding, lists targets where it occurs in assessments. \n[Command Reference](listCryptoAssessmentFindingTargets)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--finding-key', required=True, multiple=True, help=u"""The finding keys for which target occurrences are listed.""")
-@cli_util.option('--assessment-type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return targets from assessments of the specified type.""")
-@cli_util.option('--target-id', help=u"""Filters results to targets with an exact matching target OCID.""")
-@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
-@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["PASS", "FAIL", "ERROR", "EVALUATE", "NOT_AVAILABLE", "NOT_APPLICABLE", "NOT_SUPPORTED"]), help=u"""A filter to return only finding target rows with the specified status.""")
-@cli_util.option('--is-quantum-readiness-check', type=click.BOOL, help=u"""A filter to return only findings that are or are not part of quantum-readiness checks.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "databaseVersion"]), help=u"""The field used to sort finding target results.""")
-@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('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({'finding-key': {'module': 'data_safe', 'class': 'list[string]'}, 'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@sensitive_column_group.command(name=cli_util.override('data_safe.get_sensitive_column.command_name', 'get'), help=u"""Gets the details of the specified sensitive column. \n[Command Reference](getSensitiveColumn)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--sensitive-column-key', required=True, help=u"""The unique key that identifies the sensitive column. It's numeric and unique within a sensitive data model.""")
+@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={'finding-key': {'module': 'data_safe', 'class': 'list[string]'}, 'target-ids': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentFindingTargetCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SensitiveColumn'})
@cli_util.wrap_exceptions
-def list_crypto_assessment_finding_targets(ctx, from_json, all_pages, page_size, compartment_id, finding_key, assessment_type, target_id, target_ids, status, is_quantum_readiness_check, sort_by, sort_order, compartment_id_in_subtree, access_level, limit, page):
+def get_sensitive_column(ctx, from_json, sensitive_data_model_id, sensitive_column_key):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+
+ if isinstance(sensitive_column_key, six.string_types) and len(sensitive_column_key.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-column-key cannot be whitespace or empty string')
kwargs = {}
- if assessment_type is not None:
- kwargs['assessment_type'] = assessment_type
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_ids is not None and len(target_ids) > 0:
- kwargs['target_ids'] = target_ids
- if status is not None:
- kwargs['status'] = status
- if is_quantum_readiness_check is not None:
- kwargs['is_quantum_readiness_check'] = is_quantum_readiness_check
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_crypto_assessment_finding_targets,
- compartment_id=compartment_id,
- finding_key=finding_key,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_crypto_assessment_finding_targets,
- limit,
- page_size,
- compartment_id=compartment_id,
- finding_key=finding_key,
- **kwargs
- )
- else:
- result = client.list_crypto_assessment_finding_targets(
- compartment_id=compartment_id,
- finding_key=finding_key,
- **kwargs
- )
+ result = client.get_sensitive_column(
+ sensitive_data_model_id=sensitive_data_model_id,
+ sensitive_column_key=sensitive_column_key,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_findings.command_name', 'list-crypto-assessment-findings'), help=u"""Lists crypto deviation findings for the specified crypto assessment. \n[Command Reference](listCryptoAssessmentFindings)""")
-@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
-@cli_util.option('--finding-key', help=u"""A filter to return only findings with the specified finding key.""")
-@cli_util.option('--title', help=u"""A filter to return only findings with the specified title.""")
-@cli_util.option('--category', type=custom_types.CliCaseInsensitiveChoice(["NETWORK_ENCRYPTION", "DATA_ENCRYPTION", "CERTIFICATES_AND_KEY_MANAGEMENT", "BACKUP_AND_EXPORT_ENCRYPTION", "POST_QUANTUM_READINESS", "NOT_SUPPORTED"]), help=u"""A filter to return only findings in the specified category key.""")
-@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["PASS", "FAIL", "ERROR", "EVALUATE", "NOT_AVAILABLE", "NOT_APPLICABLE", "NOT_SUPPORTED"]), help=u"""A filter to return only findings with the specified status.""")
-@cli_util.option('--is-quantum-readiness-check', type=click.BOOL, help=u"""A filter to return only findings that are or are not part of quantum-readiness checks.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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.""")
+@sensitive_data_model_group.command(name=cli_util.override('data_safe.get_sensitive_data_model.command_name', 'get'), help=u"""Gets the details of the specified sensitive data model. \n[Command Reference](getSensitiveDataModel)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
@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_safe', 'class': 'CryptoAssessmentFindingCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SensitiveDataModel'})
@cli_util.wrap_exceptions
-def list_crypto_assessment_findings(ctx, from_json, all_pages, page_size, crypto_assessment_id, finding_key, title, category, status, is_quantum_readiness_check, limit, page):
-
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+def get_sensitive_data_model(ctx, from_json, sensitive_data_model_id):
- if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
kwargs = {}
- if finding_key is not None:
- kwargs['finding_key'] = finding_key
- if title is not None:
- kwargs['title'] = title
- if category is not None:
- kwargs['category'] = category
- if status is not None:
- kwargs['status'] = status
- if is_quantum_readiness_check is not None:
- kwargs['is_quantum_readiness_check'] = is_quantum_readiness_check
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_crypto_assessment_findings,
- crypto_assessment_id=crypto_assessment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_crypto_assessment_findings,
- limit,
- page_size,
- crypto_assessment_id=crypto_assessment_id,
- **kwargs
- )
- else:
- result = client.list_crypto_assessment_findings(
- crypto_assessment_id=crypto_assessment_id,
- **kwargs
- )
+ result = client.get_sensitive_data_model(
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_keys.command_name', 'list-crypto-assessment-keys'), help=u"""Gets a paginated list of cryptographic keys across targets in a compartment. Use assessmentId to narrow results to one crypto assessment. \n[Command Reference](listCryptoAssessmentKeys)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--assessment-id', help=u"""A filter to return only resources associated with the specified crypto assessment OCID.""")
-@cli_util.option('--assessment-type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return targets from assessments of the specified type.""")
-@cli_util.option('--target-id', help=u"""A filter to return only inventory rows associated with the specified target OCID.""")
-@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
-@cli_util.option('--feature', type=custom_types.CliCaseInsensitiveChoice(["TDE", "TLS", "NNE"]), help=u"""A filter to return only records for the specified feature.""")
-@cli_util.option('--key-id', help=u"""Filters key results to rows with an exact matching keyId.""")
-@cli_util.option('--key-type', type=custom_types.CliCaseInsensitiveChoice(["MASTER_KEY", "ENCRYPTION_KEY"]), help=u"""Filters key results to rows with the specified key type.""")
-@cli_util.option('--key-manager-type', type=custom_types.CliCaseInsensitiveChoice(["FILE", "OKV", "HSM", "NOT_CONFIGURED", "NOT_APPLICABLE", "NOT_AVAILABLE", "UNKNOWN", "NOT_SUPPORTED"]), multiple=True, help=u"""Filters key results to rows whose primary or secondary keystore type matches any of the specified key manager types.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated"]), help=u"""The field used to sort key results.""")
-@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@sensitive_type_group.command(name=cli_util.override('data_safe.get_sensitive_type.command_name', 'get'), help=u"""Gets the details of the specified sensitive type. \n[Command Reference](getSensitiveType)""")
+@cli_util.option('--sensitive-type-id', required=True, help=u"""The OCID of the sensitive type.""")
+@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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentKeyCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SensitiveType'})
@cli_util.wrap_exceptions
-def list_crypto_assessment_keys(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, assessment_id, assessment_type, target_id, target_ids, feature, key_id, key_type, key_manager_type, sort_by, sort_order, limit, page):
+def get_sensitive_type(ctx, from_json, sensitive_type_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(sensitive_type_id, six.string_types) and len(sensitive_type_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-type-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if assessment_id is not None:
- kwargs['assessment_id'] = assessment_id
- if assessment_type is not None:
- kwargs['assessment_type'] = assessment_type
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_ids is not None and len(target_ids) > 0:
- kwargs['target_ids'] = target_ids
- if feature is not None:
- kwargs['feature'] = feature
- if key_id is not None:
- kwargs['key_id'] = key_id
- if key_type is not None:
- kwargs['key_type'] = key_type
- if key_manager_type is not None and len(key_manager_type) > 0:
- kwargs['key_manager_type'] = key_manager_type
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_crypto_assessment_keys,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_crypto_assessment_keys,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_crypto_assessment_keys(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_sensitive_type(
+ sensitive_type_id=sensitive_type_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_tde_objects.command_name', 'list-crypto-assessment-tde-objects'), help=u"""Lists TDE object encryption summaries across targets in a compartment. Use assessmentId to narrow results to one crypto assessment, and objectType to return either tablespace-level or column-level TDE observations. \n[Command Reference](listCryptoAssessmentTdeObjects)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--object-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["TABLESPACE", "COLUMN"]), help=u"""A required filter to return only TDE objects of the specified type.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--assessment-id', help=u"""A filter to return only resources associated with the specified crypto assessment OCID.""")
-@cli_util.option('--assessment-type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return targets from assessments of the specified type.""")
-@cli_util.option('--target-id', help=u"""A filter to return only inventory rows associated with the specified target OCID.""")
-@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
-@cli_util.option('--quantum-readiness', type=custom_types.CliCaseInsensitiveChoice(["RESISTANT", "NOT_RESISTANT", "NOT_AVAILABLE", "NOT_APPLICABLE", "NOT_SUPPORTED"]), help=u"""Filters TDE object summary rows by quantum-readiness category.""")
-@cli_util.option('--encryption-observed', multiple=True, help=u"""Filters TDE object summary rows by any of the specified observed encryption algorithms.""")
-@cli_util.option('--encryption-status', type=custom_types.CliCaseInsensitiveChoice(["ENCRYPTED", "UNENCRYPTED", "NOT_SUPPORTED"]), help=u"""Filters TDE object summary rows by derived encryption status. NOT_SUPPORTED maps to rows where encryptionObserved is NOT_SUPPORTED, UNENCRYPTED maps to rows where encryptionObserved is null or NONE, and ENCRYPTED maps to rows where the observed encryption algorithm is any other value.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["tablespaceName", "columnName", "quantumReadiness"]), help=u"""The field used to sort TDE object summary results.""")
-@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'encryption-observed': {'module': 'data_safe', 'class': 'list[string]'}})
+@sensitive_type_group_group.command(name=cli_util.override('data_safe.get_sensitive_type_group.command_name', 'get'), help=u"""Gets the details of the specified sensitive type group. \n[Command Reference](getSensitiveTypeGroup)""")
+@cli_util.option('--sensitive-type-group-id', required=True, help=u"""The OCID of the sensitive type group.""")
+@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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'encryption-observed': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentTdeObjectCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SensitiveTypeGroup'})
@cli_util.wrap_exceptions
-def list_crypto_assessment_tde_objects(ctx, from_json, all_pages, page_size, compartment_id, object_type, compartment_id_in_subtree, access_level, assessment_id, assessment_type, target_id, target_ids, quantum_readiness, encryption_observed, encryption_status, sort_by, sort_order, limit, page):
+def get_sensitive_type_group(ctx, from_json, sensitive_type_group_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(sensitive_type_group_id, six.string_types) and len(sensitive_type_group_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-type-group-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if assessment_id is not None:
- kwargs['assessment_id'] = assessment_id
- if assessment_type is not None:
- kwargs['assessment_type'] = assessment_type
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_ids is not None and len(target_ids) > 0:
- kwargs['target_ids'] = target_ids
- if quantum_readiness is not None:
- kwargs['quantum_readiness'] = quantum_readiness
- if encryption_observed is not None and len(encryption_observed) > 0:
- kwargs['encryption_observed'] = encryption_observed
- if encryption_status is not None:
- kwargs['encryption_status'] = encryption_status
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_crypto_assessment_tde_objects,
- compartment_id=compartment_id,
- object_type=object_type,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_crypto_assessment_tde_objects,
- limit,
- page_size,
- compartment_id=compartment_id,
- object_type=object_type,
- **kwargs
- )
- else:
- result = client.list_crypto_assessment_tde_objects(
- compartment_id=compartment_id,
- object_type=object_type,
- **kwargs
- )
+ result = client.get_sensitive_type_group(
+ sensitive_type_group_id=sensitive_type_group_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_wallets.command_name', 'list-crypto-assessment-wallets'), help=u"""Gets wallet details across targets in a compartment. Use assessmentId to narrow results to one crypto assessment. \n[Command Reference](listCryptoAssessmentWallets)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--assessment-id', help=u"""A filter to return only resources associated with the specified crypto assessment OCID.""")
-@cli_util.option('--assessment-type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return targets from assessments of the specified type.""")
-@cli_util.option('--target-id', help=u"""A filter to return only inventory rows associated with the specified target OCID.""")
-@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
-@cli_util.option('--feature', type=custom_types.CliCaseInsensitiveChoice(["TDE", "TLS", "NNE", "ZDLRA"]), help=u"""A filter to return only wallets for the specified feature.""")
-@cli_util.option('--wallet-encryption-algorithm', multiple=True, help=u"""A filter to return only wallets whose encryption algorithm exactly matches any of the specified values, case-insensitively.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["feature", "timeCreated"]), help=u"""The field used to sort wallet results.""")
-@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'wallet-encryption-algorithm': {'module': 'data_safe', 'class': 'list[string]'}})
+@sensitive_types_export_group.command(name=cli_util.override('data_safe.get_sensitive_types_export.command_name', 'get'), help=u"""Gets the details of the specified sensitive types export by identifier. \n[Command Reference](getSensitiveTypesExport)""")
+@cli_util.option('--sensitive-types-export-id', required=True, help=u"""The OCID of the sensitive types export.""")
+@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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'wallet-encryption-algorithm': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentWalletCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SensitiveTypesExport'})
@cli_util.wrap_exceptions
-def list_crypto_assessment_wallets(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, assessment_id, assessment_type, target_id, target_ids, feature, wallet_encryption_algorithm, sort_by, sort_order, limit, page):
+def get_sensitive_types_export(ctx, from_json, sensitive_types_export_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(sensitive_types_export_id, six.string_types) and len(sensitive_types_export_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-types-export-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if assessment_id is not None:
- kwargs['assessment_id'] = assessment_id
- if assessment_type is not None:
- kwargs['assessment_type'] = assessment_type
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_ids is not None and len(target_ids) > 0:
- kwargs['target_ids'] = target_ids
- if feature is not None:
- kwargs['feature'] = feature
- if wallet_encryption_algorithm is not None and len(wallet_encryption_algorithm) > 0:
- kwargs['wallet_encryption_algorithm'] = wallet_encryption_algorithm
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_crypto_assessment_wallets,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_crypto_assessment_wallets,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_crypto_assessment_wallets(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_sensitive_types_export(
+ sensitive_types_export_id=sensitive_types_export_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessments.command_name', 'list'), help=u"""Gets a list of crypto assessments with filtering and pagination support. \n[Command Reference](listCryptoAssessments)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return only crypto assessments that match the specified type.""")
-@cli_util.option('--assessment-id', help=u"""A filter to return only resources associated with the specified crypto assessment OCID.""")
-@cli_util.option('--target-id', help=u"""A filter to return only crypto assessments associated with the specified target OCID. When provided, targetType must also be specified.""")
-@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A filter to return crypto assessments belonging to the specified target type. `ListCryptoAssessments` returns assessment rows; use `targetDatabaseGroupId` to list the underlying target database assessments for a group.""")
-@cli_util.option('--posture-category', type=custom_types.CliCaseInsensitiveChoice(["QUANTUM_RESISTANT", "QUANTUM_CAPABLE", "UPGRADE_RECOMMENDED"]), multiple=True, help=u"""A filter to return only crypto assessments that match any of the specified posture categories.""")
-@cli_util.option('--is-assessment-scheduled', type=click.BOOL, help=u"""A filter to return only crypto assessments whose scheduled execution state matches the specified value.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only resources that match the specified lifecycle state.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["issueCount", "timeCreated", "timeUpdated"]), help=u"""The field used to sort crypto assessments. You can specify only one sort order (sortOrder).""")
-@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@sql_collection_group.command(name=cli_util.override('data_safe.get_sql_collection.command_name', 'get'), help=u"""Gets a SQL collection by identifier. \n[Command Reference](getSqlCollection)""")
+@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection 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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SqlCollection'})
@cli_util.wrap_exceptions
-def list_crypto_assessments(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, type, assessment_id, target_id, target_ids, target_database_group_id, target_type, posture_category, is_assessment_scheduled, lifecycle_state, sort_by, sort_order, limit, page):
+def get_sql_collection(ctx, from_json, sql_collection_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
- if type is not None:
- kwargs['type'] = type
- if assessment_id is not None:
- kwargs['assessment_id'] = assessment_id
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_ids is not None and len(target_ids) > 0:
- kwargs['target_ids'] = target_ids
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if target_type is not None:
- kwargs['target_type'] = target_type
- if posture_category is not None and len(posture_category) > 0:
- kwargs['posture_category'] = posture_category
- if is_assessment_scheduled is not None:
- kwargs['is_assessment_scheduled'] = is_assessment_scheduled
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_crypto_assessments,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_crypto_assessments,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_crypto_assessments(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_sql_collection(
+ sql_collection_id=sql_collection_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@data_safe_private_endpoint_group.command(name=cli_util.override('data_safe.list_data_safe_private_endpoints.command_name', 'list'), help=u"""Gets a list of Data Safe private endpoints. \n[Command Reference](listDataSafePrivateEndpoints)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--vcn-id', help=u"""A filter to return only resources that match the specified VCN OCID.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "NA"]), help=u"""A filter to return only resources that match the specified lifecycle state.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@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.""")
+@sql_firewall_allowed_sql_group.command(name=cli_util.override('data_safe.get_sql_firewall_allowed_sql.command_name', 'get'), help=u"""Gets a SQL firewall allowed SQL by identifier. \n[Command Reference](getSqlFirewallAllowedSql)""")
+@cli_util.option('--sql-firewall-allowed-sql-id', required=True, help=u"""The OCID of the sqlFirewallAllowedSql 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': 'data_safe', 'class': 'list[DataSafePrivateEndpointSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SqlFirewallAllowedSql'})
@cli_util.wrap_exceptions
-def list_data_safe_private_endpoints(ctx, from_json, all_pages, page_size, compartment_id, display_name, vcn_id, lifecycle_state, limit, page, sort_order, sort_by, compartment_id_in_subtree, access_level):
+def get_sql_firewall_allowed_sql(ctx, from_json, sql_firewall_allowed_sql_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(sql_firewall_allowed_sql_id, six.string_types) and len(sql_firewall_allowed_sql_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-firewall-allowed-sql-id cannot be whitespace or empty string')
kwargs = {}
- if display_name is not None:
- kwargs['display_name'] = display_name
- if vcn_id is not None:
- kwargs['vcn_id'] = vcn_id
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_data_safe_private_endpoints,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_data_safe_private_endpoints,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_data_safe_private_endpoints(
- compartment_id=compartment_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
+ result = client.get_sql_firewall_allowed_sql(
+ sql_firewall_allowed_sql_id=sql_firewall_allowed_sql_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
-@database_security_config_collection_group.command(name=cli_util.override('data_safe.list_database_security_configs.command_name', 'list-database-security-configs'), help=u"""Retrieves a list of all database security configurations in Data Safe.
-
-The ListDatabaseSecurityConfigs operation returns only the database security configurations in the specified `compartmentId`.
+@sql_firewall_policy_group.command(name=cli_util.override('data_safe.get_sql_firewall_policy.command_name', 'get'), help=u"""Gets a SQL Firewall policy by identifier. \n[Command Reference](getSqlFirewallPolicy)""")
+@cli_util.option('--sql-firewall-policy-id', required=True, help=u"""The OCID of the SQL Firewall policy 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': 'data_safe', 'class': 'SqlFirewallPolicy'})
+@cli_util.wrap_exceptions
+def get_sql_firewall_policy(ctx, from_json, sql_firewall_policy_id):
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+ if isinstance(sql_firewall_policy_id, six.string_types) and len(sql_firewall_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-firewall-policy-id cannot be whitespace or empty string')
-The parameter `compartmentIdInSubtree` applies when you perform ListDatabaseSecurityConfigs on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listDatabaseSecurityConfigs)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "FAILED", "NEEDS_ATTENTION", "DELETING", "DELETED"]), help=u"""The current state of the database security configuration.""")
-@cli_util.option('--database-security-config-id', help=u"""An optional filter to return only resources that match the specified OCID of the database security configuration resource.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+ kwargs = {}
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.get_sql_firewall_policy(
+ sql_firewall_policy_id=sql_firewall_policy_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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.""")
+@subsetting_policy_group.command(name=cli_util.override('data_safe.get_subsetting_policy.command_name', 'get'), help=u"""Gets the details of the specified subsetting policy. \n[Command Reference](getSubsettingPolicy)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
@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_safe', 'class': 'DatabaseSecurityConfigCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SubsettingPolicy'})
@cli_util.wrap_exceptions
-def list_database_security_configs(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, database_security_config_id, time_created_greater_than_or_equal_to, time_created_less_than, target_id, target_database_group_id, sort_order, sort_by):
+def get_subsetting_policy(ctx, from_json, subsetting_policy_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if database_security_config_id is not None:
- kwargs['database_security_config_id'] = database_security_config_id
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_database_security_configs,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_database_security_configs,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_database_security_configs(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_subsetting_policy(
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@database_table_access_entry_collection_group.command(name=cli_util.override('data_safe.list_database_table_access_entries.command_name', 'list-database-table-access-entries'), help=u"""Retrieves a list of all database table access entries in Data Safe.
-
-The ListDatabaseTableAccessEntries operation returns only the database table access reports for the specified security policy report. \n[Command Reference](listDatabaseTableAccessEntries)""")
-@cli_util.option('--security-policy-report-id', required=True, help=u"""The OCID of the security policy report resource.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
-
-**Example:** query=(accessType eq \"SELECT\") and (grantee eq \"ADMIN\")""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["key", "grantee", "accessType", "tableSchema", "tableName", "privilegeType", "privilege", "privilegeGrantable", "grantFromRole", "accessThroughObject", "columnName", "grantor", "areAllTablesAccessible", "isAccessConstrainedByView", "isAccessConstrainedByLabelSecurity", "isAccessConstrainedByDatabaseVault", "isAccessConstrainedByVirtualPrivateDatabase", "isAccessConstrainedByRedaction", "isAccessConstrainedByRealApplicationSecurity", "isAccessConstrainedBySqlFirewall", "isSensitive"]), help=u"""The field to sort by. Only one sort parameter should be provided.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
-@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+@subsetting_policy_health_report_group.command(name=cli_util.override('data_safe.get_subsetting_policy_health_report.command_name', 'get'), help=u"""Gets the details of the specified subsetting policy health report. \n[Command Reference](getSubsettingPolicyHealthReport)""")
+@cli_util.option('--subsetting-policy-health-report-id', required=True, help=u"""The OCID of the subsetting health report.""")
@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_safe', 'class': 'DatabaseTableAccessEntryCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SubsettingPolicyHealthReport'})
@cli_util.wrap_exceptions
-def list_database_table_access_entries(ctx, from_json, all_pages, page_size, security_policy_report_id, limit, page, scim_query, sort_by, sort_order):
-
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+def get_subsetting_policy_health_report(ctx, from_json, subsetting_policy_health_report_id):
- if isinstance(security_policy_report_id, six.string_types) and len(security_policy_report_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-report-id cannot be whitespace or empty string')
+ if isinstance(subsetting_policy_health_report_id, six.string_types) and len(subsetting_policy_health_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-health-report-id cannot be whitespace or empty string')
kwargs = {}
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if scim_query is not None:
- kwargs['scim_query'] = scim_query
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_database_table_access_entries,
- security_policy_report_id=security_policy_report_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_database_table_access_entries,
- limit,
- page_size,
- security_policy_report_id=security_policy_report_id,
- **kwargs
- )
- else:
- result = client.list_database_table_access_entries(
- security_policy_report_id=security_policy_report_id,
- **kwargs
- )
+ result = client.get_subsetting_policy_health_report(
+ subsetting_policy_health_report_id=subsetting_policy_health_report_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@database_view_access_entry_collection_group.command(name=cli_util.override('data_safe.list_database_view_access_entries.command_name', 'list-database-view-access-entries'), help=u"""Retrieves a list of all database view access entries in Data Safe.
+@subsetting_report_group.command(name=cli_util.override('data_safe.get_subsetting_report.command_name', 'get'), help=u"""Gets the details of the specified subsetting report. \n[Command Reference](getSubsettingReport)""")
+@cli_util.option('--subsetting-report-id', required=True, help=u"""The OCID of the subsetting report.""")
+@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_safe', 'class': 'SubsettingReport'})
+@cli_util.wrap_exceptions
+def get_subsetting_report(ctx, from_json, subsetting_report_id):
-The ListDatabaseViewAccessEntries operation returns only the database view access objects for the specified security policy report. If targetId is specified, it must match the target associated with the securityPolicyReportId path parameter; otherwise, the request is rejected. \n[Command Reference](listDatabaseViewAccessEntries)""")
-@cli_util.option('--security-policy-report-id', required=True, help=u"""The OCID of the security policy report resource.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+ if isinstance(subsetting_report_id, six.string_types) and len(subsetting_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-report-id cannot be whitespace or empty string')
-**Example:** query=(accessType eq \"SELECT\") and (grantee eq \"ADMIN\")""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["key", "grantee", "accessType", "tableSchema", "tableName", "viewSchema", "viewName", "privilegeType", "privilege", "privilegeGrantable", "grantFromRole", "accessThroughObject", "columnName", "grantor", "isAccessConstrainedByDatabaseVault", "isAccessConstrainedByVirtualPrivateDatabase", "isAccessConstrainedByRedaction", "isAccessConstrainedByRealApplicationSecurity", "isAccessConstrainedBySqlFirewall"]), help=u"""The field to sort by. Only one sort parameter should be provided.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
-@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+ kwargs = {}
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.get_subsetting_report(
+ subsetting_report_id=subsetting_report_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_rule_group.command(name=cli_util.override('data_safe.get_subsetting_rule.command_name', 'get'), help=u"""Gets the details of the specified subsetting rule. \n[Command Reference](getSubsettingRule)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--subsetting-rule-key', required=True, help=u"""The unique key that identifies the subsetting rule. It's numeric and unique within a subsetting policy.""")
@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_safe', 'class': 'DatabaseViewAccessEntryCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SubsettingRule'})
@cli_util.wrap_exceptions
-def list_database_view_access_entries(ctx, from_json, all_pages, page_size, security_policy_report_id, limit, page, scim_query, target_id, sort_by, sort_order):
+def get_subsetting_rule(ctx, from_json, subsetting_policy_id, subsetting_rule_key):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
- if isinstance(security_policy_report_id, six.string_types) and len(security_policy_report_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-report-id cannot be whitespace or empty string')
+ if isinstance(subsetting_rule_key, six.string_types) and len(subsetting_rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-rule-key cannot be whitespace or empty string')
kwargs = {}
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if scim_query is not None:
- kwargs['scim_query'] = scim_query
- if target_id is not None:
- kwargs['target_id'] = target_id
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_database_view_access_entries,
- security_policy_report_id=security_policy_report_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_database_view_access_entries,
- limit,
- page_size,
- security_policy_report_id=security_policy_report_id,
- **kwargs
- )
- else:
- result = client.list_database_view_access_entries(
- security_policy_report_id=security_policy_report_id,
- **kwargs
- )
+ result = client.get_subsetting_rule(
+ subsetting_policy_id=subsetting_policy_id,
+ subsetting_rule_key=subsetting_rule_key,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@sdm_masking_policy_difference_group.command(name=cli_util.override('data_safe.list_difference_columns.command_name', 'list-difference-columns'), help=u"""Gets a list of columns of a SDM masking policy difference resource based on the specified query parameters. \n[Command Reference](listDifferenceColumns)""")
-@cli_util.option('--sdm-masking-policy-difference-id', required=True, help=u"""The OCID of the SDM masking policy difference.""")
-@cli_util.option('--difference-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "NEW", "MODIFIED", "DELETED"]), help=u"""A filter to return only the SDM masking policy difference columns that match the specified difference type""")
-@cli_util.option('--planned-action', type=custom_types.CliCaseInsensitiveChoice(["SYNC", "NO_SYNC"]), help=u"""A filter to return only the SDM masking policy difference columns that match the specified planned action.""")
-@cli_util.option('--sync-status', type=custom_types.CliCaseInsensitiveChoice(["SYNCED", "NOT_SYNCED"]), help=u"""A filter to return the SDM masking policy difference columns based on the value of their syncStatus attribute.""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
-@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["differenceType", "schemaName", "objectName", "columnName", "plannedAction"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for schemaName is descending. The default order for differenceType, schemaName, objectName, columnName and plannedAction is ascending.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@subsetting_schema_relation_group.command(name=cli_util.override('data_safe.get_subsetting_schema_relation.command_name', 'get'), help=u"""Gets the details of the specified referential relation in the subsetting policy. \n[Command Reference](getSubsettingSchemaRelation)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--subsetting-schema-relation-key', required=True, help=u"""The unique key that identifies the subsetting relation. It's numeric and unique within a subsetting policy.""")
+@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={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SdmMaskingPolicyDifferenceColumnCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SubsettingSchemaRelation'})
@cli_util.wrap_exceptions
-def list_difference_columns(ctx, from_json, all_pages, page_size, sdm_masking_policy_difference_id, difference_type, planned_action, sync_status, schema_name, object_name, column_name, sort_order, sort_by, limit, page):
+def get_subsetting_schema_relation(ctx, from_json, subsetting_policy_id, subsetting_schema_relation_key):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
- if isinstance(sdm_masking_policy_difference_id, six.string_types) and len(sdm_masking_policy_difference_id.strip()) == 0:
- raise click.UsageError('Parameter --sdm-masking-policy-difference-id cannot be whitespace or empty string')
+ if isinstance(subsetting_schema_relation_key, six.string_types) and len(subsetting_schema_relation_key.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-schema-relation-key cannot be whitespace or empty string')
kwargs = {}
- if difference_type is not None:
- kwargs['difference_type'] = difference_type
- if planned_action is not None:
- kwargs['planned_action'] = planned_action
- if sync_status is not None:
- kwargs['sync_status'] = sync_status
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if object_name is not None and len(object_name) > 0:
- kwargs['object_name'] = object_name
- if column_name is not None and len(column_name) > 0:
- kwargs['column_name'] = column_name
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_difference_columns,
- sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_difference_columns,
- limit,
- page_size,
- sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
- **kwargs
- )
- else:
- result = client.list_difference_columns(
- sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
- **kwargs
- )
+ result = client.get_subsetting_schema_relation(
+ subsetting_policy_id=subsetting_policy_id,
+ subsetting_schema_relation_key=subsetting_schema_relation_key,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@sensitive_data_model_group.command(name=cli_util.override('data_safe.list_discovery_analytics.command_name', 'list-discovery-analytics'), help=u"""Gets consolidated discovery analytics data based on the specified query parameters. If CompartmentIdInSubtreeQueryParam is specified as true, the behaviour is equivalent to accessLevel \"ACCESSIBLE\" by default. \n[Command Reference](listDiscoveryAnalytics)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "sensitiveDataModelId", "sensitiveTypeId", "targetIdAndSensitiveDataModelId", "sensitiveTypeIdAndTargetId", "sensitiveTypeIdAndSensitiveDataModelId"]), help=u"""Attribute by which the discovery analytics data should be grouped.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeLastDiscovered"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for all the fields is ascending.""")
-@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('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
-@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--is-common', type=click.BOOL, help=u"""A filter to return only the common sensitive type resources. Common sensitive types belong to library sensitive types which are frequently used to perform sensitive data discovery.""")
-@cli_util.option('--sensitive-type-group-id', help=u"""An optional filter to return only resources that match the specified OCID of the sensitive type group resource.""")
-@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.""")
+@target_alert_policy_association_group.command(name=cli_util.override('data_safe.get_target_alert_policy_association.command_name', 'get'), help=u"""Gets the details of target-alert policy association by its ID. \n[Command Reference](getTargetAlertPolicyAssociation)""")
+@cli_util.option('--target-alert-policy-association-id', required=True, help=u"""The OCID of the target-alert policy association.""")
@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_safe', 'class': 'DiscoveryAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'TargetAlertPolicyAssociation'})
@cli_util.wrap_exceptions
-def list_discovery_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, group_by, target_id, target_database_group_id, sort_by, sort_order, sensitive_data_model_id, sensitive_type_id, limit, page, is_common, sensitive_type_group_id):
+def get_target_alert_policy_association(ctx, from_json, target_alert_policy_association_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(target_alert_policy_association_id, six.string_types) and len(target_alert_policy_association_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-alert-policy-association-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if group_by is not None:
- kwargs['group_by'] = group_by
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sensitive_data_model_id is not None:
- kwargs['sensitive_data_model_id'] = sensitive_data_model_id
- if sensitive_type_id is not None:
- kwargs['sensitive_type_id'] = sensitive_type_id
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if is_common is not None:
- kwargs['is_common'] = is_common
- if sensitive_type_group_id is not None:
- kwargs['sensitive_type_group_id'] = sensitive_type_group_id
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_discovery_analytics,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_discovery_analytics,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_discovery_analytics(
- compartment_id=compartment_id,
- **kwargs
- )
+ result = client.get_target_alert_policy_association(
+ target_alert_policy_association_id=target_alert_policy_association_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@discovery_job_group.command(name=cli_util.override('data_safe.list_discovery_job_results.command_name', 'list-discovery-job-results'), help=u"""Gets a list of discovery results based on the specified query parameters. \n[Command Reference](listDiscoveryJobResults)""")
-@cli_util.option('--discovery-job-id', required=True, help=u"""The OCID of the discovery job.""")
-@cli_util.option('--discovery-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "NEW", "MODIFIED", "DELETED"]), help=u"""A filter to return only the resources that match the specified discovery type.""")
-@cli_util.option('--planned-action', type=custom_types.CliCaseInsensitiveChoice(["NONE", "ACCEPT", "INVALIDATE", "REJECT"]), help=u"""A filter to return only the resources that match the specified planned action.""")
-@cli_util.option('--is-result-applied', type=click.BOOL, help=u"""A filter to return the discovery result resources based on the value of their isResultApplied attribute.""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
-@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
-@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('--confidence-level', type=custom_types.CliCaseInsensitiveChoice(["NONE", "HIGH", "MEDIUM", "LOW"]), multiple=True, help=u"""A filter to return the discovery job results with the specified confidence level. Confidence level of discovery job result associated with a seeded sensitive type can either be HIGH or LOW. While the confidence level of discovery job result associated with a user defined sensitive will be NONE.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["discoveryType", "timeFinished", "schemaName", "objectName", "columnName", "plannedAction", "confidenceLevel"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeFinished is descending. The default order for discoveryType, schemaName, objectName, columnName and plannedAction is ascending.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@target_database_group.command(name=cli_util.override('data_safe.get_target_database.command_name', 'get'), help=u"""Returns the details of the specified Data Safe target database. \n[Command Reference](getTargetDatabase)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@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={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'DiscoveryJobResultCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'TargetDatabase'})
@cli_util.wrap_exceptions
-def list_discovery_job_results(ctx, from_json, all_pages, page_size, discovery_job_id, discovery_type, planned_action, is_result_applied, schema_name, object_name, column_name, sort_order, confidence_level, sort_by, limit, page):
-
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+def get_target_database(ctx, from_json, target_database_id):
- if isinstance(discovery_job_id, six.string_types) and len(discovery_job_id.strip()) == 0:
- raise click.UsageError('Parameter --discovery-job-id cannot be whitespace or empty string')
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
kwargs = {}
- if discovery_type is not None:
- kwargs['discovery_type'] = discovery_type
- if planned_action is not None:
- kwargs['planned_action'] = planned_action
- if is_result_applied is not None:
- kwargs['is_result_applied'] = is_result_applied
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if object_name is not None and len(object_name) > 0:
- kwargs['object_name'] = object_name
- if column_name is not None and len(column_name) > 0:
- kwargs['column_name'] = column_name
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if confidence_level is not None and len(confidence_level) > 0:
- kwargs['confidence_level'] = confidence_level
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_discovery_job_results,
- discovery_job_id=discovery_job_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_discovery_job_results,
- limit,
- page_size,
- discovery_job_id=discovery_job_id,
- **kwargs
- )
- else:
- result = client.list_discovery_job_results(
- discovery_job_id=discovery_job_id,
- **kwargs
- )
+ result = client.get_target_database(
+ target_database_id=target_database_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@discovery_job_group.command(name=cli_util.override('data_safe.list_discovery_jobs.command_name', 'list'), help=u"""Gets a list of incremental discovery jobs based on the specified query parameters. \n[Command Reference](listDiscoveryJobs)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--discovery-job-id', help=u"""A filter to return only the resources that match the specified discovery job OCID.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle state.""")
-@cli_util.option('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeStarted", "displayName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeFinished is descending. The default order for displayName is ascending.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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.""")
+@target_database_group_group.command(name=cli_util.override('data_safe.get_target_database_group.command_name', 'get'), help=u"""Returns the details of the specified target database group. \n[Command Reference](getTargetDatabaseGroup)""")
+@cli_util.option('--target-database-group-id', required=True, help=u"""The OCID of the specified target database group.""")
@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_safe', 'class': 'DiscoveryJobCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'TargetDatabaseGroup'})
@cli_util.wrap_exceptions
-def list_discovery_jobs(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, discovery_job_id, target_id, lifecycle_state, sensitive_data_model_id, sort_order, sort_by, limit, page):
+def get_target_database_group(ctx, from_json, target_database_group_id):
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(target_database_group_id, six.string_types) and len(target_database_group_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-group-id cannot be whitespace or empty string')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
- if discovery_job_id is not None:
- kwargs['discovery_job_id'] = discovery_job_id
- if target_id is not None:
- kwargs['target_id'] = target_id
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if sensitive_data_model_id is not None:
- kwargs['sensitive_data_model_id'] = sensitive_data_model_id
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- 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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
+ result = client.get_target_database_group(
+ target_database_group_id=target_database_group_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
- result = cli_util.list_call_get_all_results(
- client.list_discovery_jobs,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_discovery_jobs,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_discovery_jobs(
- compartment_id=compartment_id,
- **kwargs
- )
+
+@security_assessment_group.command(name=cli_util.override('data_safe.get_template_baseline_comparison.command_name', 'get-template-baseline-comparison'), help=u"""Gets the details of the comparison report for the security assessments submitted for comparison. \n[Command Reference](getTemplateBaselineComparison)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
+@cli_util.option('--comparison-security-assessment-id', required=True, help=u"""The OCID of the security assessment baseline.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--category', help=u"""The category of the finding.""")
+@cli_util.option('--finding-key', help=u"""The unique key that identifies the finding. It is a string and unique within a security assessment.""")
+@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_safe', 'class': 'SecurityAssessmentTemplateBaselineComparison'})
+@cli_util.wrap_exceptions
+def get_template_baseline_comparison(ctx, from_json, security_assessment_id, comparison_security_assessment_id, target_id, category, finding_key):
+
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+
+ if isinstance(comparison_security_assessment_id, six.string_types) and len(comparison_security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --comparison-security-assessment-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if category is not None:
+ kwargs['category'] = category
+ if finding_key is not None:
+ kwargs['finding_key'] = finding_key
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.get_template_baseline_comparison(
+ security_assessment_id=security_assessment_id,
+ comparison_security_assessment_id=comparison_security_assessment_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.list_finding_analytics.command_name', 'list-finding-analytics'), help=u"""Gets a list of findings aggregated details in the specified compartment. This provides information about the overall state of security assessment findings. You can use groupBy to get the count of findings under a certain risk level and with a certain findingKey, and as well as get the list of the targets that match the condition. This data is especially useful content for the statistic chart or to support analytics.
+@unified_audit_policy_group.command(name=cli_util.override('data_safe.get_unified_audit_policy.command_name', 'get'), help=u"""Gets a Unified Audit policy by identifier. \n[Command Reference](getUnifiedAuditPolicy)""")
+@cli_util.option('--unified-audit-policy-id', required=True, help=u"""The OCID of the Unified Audit policy 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': 'data_safe', 'class': 'UnifiedAuditPolicy'})
+@cli_util.wrap_exceptions
+def get_unified_audit_policy(ctx, from_json, unified_audit_policy_id):
-When you perform the ListFindingAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns statistics from the compartments in which the requestor has INSPECT permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned. \n[Command Reference](listFindingAnalytics)""")
+ if isinstance(unified_audit_policy_id, six.string_types) and len(unified_audit_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --unified-audit-policy-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_safe', 'data_safe', ctx)
+ result = client.get_unified_audit_policy(
+ unified_audit_policy_id=unified_audit_policy_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@unified_audit_policy_definition_group.command(name=cli_util.override('data_safe.get_unified_audit_policy_definition.command_name', 'get'), help=u"""Gets a unified audit policy definition by the specified OCID of the unified audit policy definition resource. \n[Command Reference](getUnifiedAuditPolicyDefinition)""")
+@cli_util.option('--unified-audit-policy-definition-id', required=True, help=u"""The OCID of the unified audit policy definition 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': 'data_safe', 'class': 'UnifiedAuditPolicyDefinition'})
+@cli_util.wrap_exceptions
+def get_unified_audit_policy_definition(ctx, from_json, unified_audit_policy_definition_id):
+
+ if isinstance(unified_audit_policy_definition_id, six.string_types) and len(unified_audit_policy_definition_id.strip()) == 0:
+ raise click.UsageError('Parameter --unified-audit-policy-definition-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_safe', 'data_safe', ctx)
+ result = client.get_unified_audit_policy_definition(
+ unified_audit_policy_definition_id=unified_audit_policy_definition_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@user_assessment_group.command(name=cli_util.override('data_safe.get_user_assessment.command_name', 'get'), help=u"""Gets a user assessment by identifier. \n[Command Reference](getUserAssessment)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@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_safe', 'class': 'UserAssessment'})
+@cli_util.wrap_exceptions
+def get_user_assessment(ctx, from_json, user_assessment_id):
+
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-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_safe', 'data_safe', ctx)
+ result = client.get_user_assessment(
+ user_assessment_id=user_assessment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@user_assessment_group.command(name=cli_util.override('data_safe.get_user_assessment_comparison.command_name', 'get-user-assessment-comparison'), help=u"""Gets the details of the comparison report for the user assessments submitted for comparison. \n[Command Reference](getUserAssessmentComparison)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@cli_util.option('--comparison-user-assessment-id', required=True, help=u"""The OCID of the baseline user assessment.""")
+@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_safe', 'class': 'UserAssessmentComparison'})
+@cli_util.wrap_exceptions
+def get_user_assessment_comparison(ctx, from_json, user_assessment_id, comparison_user_assessment_id):
+
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+
+ if isinstance(comparison_user_assessment_id, six.string_types) and len(comparison_user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --comparison-user-assessment-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_safe', 'data_safe', ctx)
+ result = client.get_user_assessment_comparison(
+ user_assessment_id=user_assessment_id,
+ comparison_user_assessment_id=comparison_user_assessment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@work_request_group.command(name=cli_util.override('data_safe.get_work_request.command_name', 'get'), help=u"""Gets the details of the specified work request. \n[Command Reference](getWorkRequest)""")
+@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
+@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'WorkRequest'})
+@cli_util.wrap_exceptions
+def get_work_request(ctx, from_json, work_request_id):
+
+ if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
+ raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.get_work_request(
+ work_request_id=work_request_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@alert_summary_group.command(name=cli_util.override('data_safe.list_alert_analytics.command_name', 'list-alert-analytics'), help=u"""Returns the aggregation details of the alerts. \n[Command Reference](listAlertAnalytics)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--is-top-finding', type=click.BOOL, help=u"""A filter to return only the findings that are marked as top findings.""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["findingKeyAndTopFindingStatus", "findingKeyAndSeverity", "severity"]), help=u"""Attribute by which the finding analytics data should be grouped.""")
-@cli_util.option('--top-finding-status', type=custom_types.CliCaseInsensitiveChoice(["RISK", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), help=u"""An optional filter to return only the top finding that match the specified status.""")
-@cli_util.option('--severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), help=u"""A filter to return only findings of a particular risk level.""")
-@cli_util.option('--finding-key', help=u"""The unique key that identifies the finding. It is a string and unique within a security assessment.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--contains-references', type=custom_types.CliCaseInsensitiveChoice(["STIG", "CIS", "GDPR"]), multiple=True, help=u"""An optional filter to return only findings that match the specified references. Use containsReferences param if need to filter by multiple references.""")
-@cli_util.option('--target-ids', multiple=True, help=u"""An optional filter to return only findings that match the specified target ids. Use this parameter to filter by multiple target ids.""")
-@cli_util.option('--category', help=u"""The category of the finding.""")
-@cli_util.option('--contains-severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), multiple=True, help=u"""A filter to return only findings that match the specified risk level(s). Use containsSeverity parameter if need to filter by multiple risk levels.""")
+@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('--time-started', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is greater than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-ended', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is less than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--query-time-zone', help=u"""Default time zone is UTC if no time zone provided. The date-time considerations of the resource will be in accordance with the specified time zone.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. If no value is specified timeCreated is default.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
-**Example:** | scimQuery=(severity eq 'high') scimQuery=(category eq \"Users\") and (reference eq 'CIS')
-
-Supported fields: severity reference title category""")
+**Example:** | (timeCreated ge \"2021-06-04T01:00:26.000Z\") and (targetNames eq \"target_1\") (featureDetails.userName eq \"user\") and (targetNames eq \"target_1\") Supported fields: severity status alertType targetIds targetNames operationTime lifecycleState displayName timeCreated timeUpdated featureDetails.* (* can be any field in nestedStrMap in Feature Attributes in Alert Summary. For example - userName,object,clientHostname,osUserName,clientIPs,clientId,commandText,commandParam,clientProgram,objectType,targetOwner)""")
+@cli_util.option('--summary-field', type=custom_types.CliCaseInsensitiveChoice(["alertType", "targetIds", "targetNames", "alertSeverity", "alertStatus", "timeCreated", "policyId", "open", "closed", "critical", "high", "medium", "low", "alertcount", "alertPolicyRuleKey", "alertPolicyRuleName", "throttled"]), multiple=True, help=u"""Specifies a subset of summarized fields to be returned in the response.""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["alertType", "targetIds", "targetNames", "alertSeverity", "alertStatus", "timeCreated", "policyId", "alertPolicyRuleKey", "alertPolicyRuleName"]), multiple=True, help=u"""A groupBy can only be used in combination with summaryField parameter. A groupBy value has to be a subset of the values mentioned in summaryField parameter.""")
@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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'FindingAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AlertAnalyticsCollection'})
@cli_util.wrap_exceptions
-def list_finding_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, is_top_finding, group_by, top_finding_status, severity, finding_key, limit, page, target_database_group_id, contains_references, target_ids, category, contains_severity, scim_query):
+def list_alert_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, limit, page, if_match, time_started, time_ended, query_time_zone, sort_order, sort_by, access_level, scim_query, summary_field, group_by):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
@@ -14939,34 +14303,30 @@ def list_finding_analytics(ctx, from_json, all_pages, page_size, compartment_id,
kwargs = {}
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if is_top_finding is not None:
- kwargs['is_top_finding'] = is_top_finding
- if group_by is not None:
- kwargs['group_by'] = group_by
- if top_finding_status is not None:
- kwargs['top_finding_status'] = top_finding_status
- if severity is not None:
- kwargs['severity'] = severity
- if finding_key is not None:
- kwargs['finding_key'] = finding_key
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if contains_references is not None and len(contains_references) > 0:
- kwargs['contains_references'] = contains_references
- if target_ids is not None and len(target_ids) > 0:
- kwargs['target_ids'] = target_ids
- if category is not None:
- kwargs['category'] = category
- if contains_severity is not None and len(contains_severity) > 0:
- kwargs['contains_severity'] = contains_severity
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ if time_started is not None:
+ kwargs['time_started'] = time_started
+ if time_ended is not None:
+ kwargs['time_ended'] = time_ended
+ if query_time_zone is not None:
+ kwargs['query_time_zone'] = query_time_zone
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if access_level is not None:
+ kwargs['access_level'] = access_level
if scim_query is not None:
kwargs['scim_query'] = scim_query
+ if summary_field is not None and len(summary_field) > 0:
+ kwargs['summary_field'] = summary_field
+ if group_by is not None and len(group_by) > 0:
+ kwargs['group_by'] = group_by
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -14974,108 +14334,84 @@ def list_finding_analytics(ctx, from_json, all_pages, page_size, compartment_id,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_finding_analytics,
+ client.list_alert_analytics,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_finding_analytics,
+ client.list_alert_analytics,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_finding_analytics(
+ result = client.list_alert_analytics(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.list_findings.command_name', 'list-findings'), help=u"""Lists all the findings for the specified assessment except for type TEMPLATE. If the assessment is of type TEMPLATE_BASELINE, the findings returned are the security checks with the user-defined severity from the template. \n[Command Reference](listFindings)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@cli_util.option('--is-top-finding', type=click.BOOL, help=u"""A filter to return only the findings that are marked as top findings.""")
-@cli_util.option('--severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), help=u"""A filter to return only findings of a particular risk level.""")
-@cli_util.option('--contains-severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), multiple=True, help=u"""A filter to return only findings that match the specified risk level(s). Use containsSeverity parameter if need to filter by multiple risk levels.""")
-@cli_util.option('--category', help=u"""The category of the finding.""")
-@cli_util.option('--contains-oracle-defined-severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), multiple=True, help=u"""A filter to return only findings that match the specified risk level(s). Use containsOracleDefinedSeverity parameter if need to filter by one or multiple risk levels.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "UPDATING", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only the findings that match the specified lifecycle states.""")
-@cli_util.option('--references', type=custom_types.CliCaseInsensitiveChoice(["STIG", "CIS", "GDPR"]), help=u"""An optional filter to return only findings that match the specified reference.""")
-@cli_util.option('--contains-references', type=custom_types.CliCaseInsensitiveChoice(["STIG", "CIS", "GDPR"]), multiple=True, help=u"""An optional filter to return only findings that match the specified references. Use containsReferences param if need to filter by multiple references.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--compartment-id', help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-ids', multiple=True, help=u"""An optional filter to return only findings that match the specified target ids. Use this parameter to filter by multiple target ids.""")
-@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+@alert_policy_group.command(name=cli_util.override('data_safe.list_alert_policies.command_name', 'list'), help=u"""Gets a list of all alert policies. \n[Command Reference](listAlertPolicies)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--alert-policy-id', help=u"""A filter to return policy by it's OCID.""")
+@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["AUDITING", "SECURITY_ASSESSMENT", "USER_ASSESSMENT"]), help=u"""An optional filter to return only alert policies of a certain type.""")
+@cli_util.option('--is-user-defined', type=click.BOOL, help=u"""An optional filter to return only alert policies that are user-defined or not.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""An optional filter to return only alert policies that have the given life-cycle state.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""The field to sort by. Only one sort parameter may be provided.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
-**Example:** | scimQuery=(severity eq 'high') and (targetId eq 'target_1') scimQuery=(category eq \"Users\") and (targetId eq \"target_1\") scimQuery=(reference eq 'CIS') and (targetId eq 'target_1')
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-Supported fields: severity findingKey reference targetId isTopFinding title category remarks details summary isRiskModified""")
-@cli_util.option('--field', type=custom_types.CliCaseInsensitiveChoice(["severity", "findingKey", "reference", "targetId", "isTopFinding", "title", "category", "remarks", "details", "summary", "isRiskModified"]), multiple=True, help=u"""Specifies a subset of fields to be returned in the response.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["category", "findingKey", "severity"]), help=u"""The field to sort by. You can specify only one sort order(sortOrder). The default order for category is alphabetical.""")
-@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('--finding-key', help=u"""Each finding in security assessment has an associated key (think of key as a finding's name). For a given finding, the key will be the same across targets. The user can use these keys to filter the findings.""")
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'list[FindingSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AlertPolicyCollection'})
@cli_util.wrap_exceptions
-def list_findings(ctx, from_json, all_pages, page_size, security_assessment_id, is_top_finding, severity, contains_severity, category, contains_oracle_defined_severity, lifecycle_state, references, contains_references, limit, page, compartment_id, compartment_id_in_subtree, access_level, target_id, target_ids, scim_query, field, sort_by, sort_order, finding_key):
+def list_alert_policies(ctx, from_json, all_pages, page_size, compartment_id, alert_policy_id, type, is_user_defined, display_name, lifecycle_state, limit, page, sort_order, sort_by, time_created_greater_than_or_equal_to, time_created_less_than, compartment_id_in_subtree, access_level):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
-
kwargs = {}
- if is_top_finding is not None:
- kwargs['is_top_finding'] = is_top_finding
- if severity is not None:
- kwargs['severity'] = severity
- if contains_severity is not None and len(contains_severity) > 0:
- kwargs['contains_severity'] = contains_severity
- if category is not None:
- kwargs['category'] = category
- if contains_oracle_defined_severity is not None and len(contains_oracle_defined_severity) > 0:
- kwargs['contains_oracle_defined_severity'] = contains_oracle_defined_severity
+ if alert_policy_id is not None:
+ kwargs['alert_policy_id'] = alert_policy_id
+ if type is not None:
+ kwargs['type'] = type
+ if is_user_defined is not None:
+ kwargs['is_user_defined'] = is_user_defined
+ if display_name is not None:
+ kwargs['display_name'] = display_name
if lifecycle_state is not None:
kwargs['lifecycle_state'] = lifecycle_state
- if references is not None:
- kwargs['references'] = references
- if contains_references is not None and len(contains_references) > 0:
- kwargs['contains_references'] = contains_references
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if compartment_id is not None:
- kwargs['compartment_id'] = compartment_id
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
kwargs['access_level'] = access_level
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_ids is not None and len(target_ids) > 0:
- kwargs['target_ids'] = target_ids
- if scim_query is not None:
- kwargs['scim_query'] = scim_query
- if field is not None and len(field) > 0:
- kwargs['field'] = field
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if finding_key is not None:
- kwargs['finding_key'] = finding_key
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -15083,87 +14419,50 @@ def list_findings(ctx, from_json, all_pages, page_size, security_assessment_id,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_findings,
- security_assessment_id=security_assessment_id,
+ client.list_alert_policies,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_findings,
+ client.list_alert_policies,
limit,
page_size,
- security_assessment_id=security_assessment_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_findings(
- security_assessment_id=security_assessment_id,
+ result = client.list_alert_policies(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.list_findings_change_audit_logs.command_name', 'list-findings-change-audit-logs'), help=u"""List all changes made by user to risk level of findings of the specified assessment. \n[Command Reference](listFindingsChangeAuditLogs)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@cli_util.option('--severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), help=u"""A filter to return only findings of a particular risk level.""")
-@cli_util.option('--finding-key', help=u"""The unique key that identifies the finding. It is a string and unique within a security assessment.""")
-@cli_util.option('--finding-title', help=u"""The unique title that identifies the finding. It is a string and unique within a security assessment.""")
-@cli_util.option('--is-risk-deferred', type=click.BOOL, help=u"""A filter to check findings whose risks were deferred by the user.""")
-@cli_util.option('--modified-by', help=u"""A filter to check which user modified the risk level of the finding.""")
+@alert_policy_group.command(name=cli_util.override('data_safe.list_alert_policy_rules.command_name', 'list-alert-policy-rules'), help=u"""Lists the rules of the specified alert policy. The alert policy is said to be satisfied when all rules in the policy evaulate to true. If there are three rules: rule1,rule2 and rule3, the policy is satisfied if rule1 AND rule2 AND rule3 is True. \n[Command Reference](listAlertPolicyRules)""")
+@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeUpdated", "modifiedBy", "isRiskDeferred", "timeValidUntil"]), help=u"""The field to sort by. You can specify only one sort order(sortOrder). The default order for timeUpdated is descending.""")
-@cli_util.option('--time-valid-until-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""Specifying `TimeValidUntilGreaterThanOrEqualToQueryParam` parameter will retrieve all items for which the risk level modification by user will no longer be valid greater than the date and time specified, in the format defined by [RFC3339].
-
-**Example:** 2016-12-19T00:00:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-valid-until-less-than', type=custom_types.CLI_DATETIME, help=u"""Specifying `TimeValidUntilLessThanQueryParam` parameter will retrieve all items for which the risk level modification by user will be valid until less than the date and time specified, in the format defined by [RFC3339].
-
-**Example:** 2016-12-19T00:00:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-updated-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were updated after a specific date. Specifying this parameter corresponding `timeUpdatedGreaterThanOrEqualTo` parameter will retrieve all resources updated after the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-updated-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were updated before a specific date. Specifying this parameter corresponding `timeUpdatedLessThan` parameter will retrieve all resources updated before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@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_safe', 'class': 'FindingsChangeAuditLogCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AlertPolicyRuleCollection'})
@cli_util.wrap_exceptions
-def list_findings_change_audit_logs(ctx, from_json, all_pages, page_size, security_assessment_id, severity, finding_key, finding_title, is_risk_deferred, modified_by, limit, page, sort_order, sort_by, time_valid_until_greater_than_or_equal_to, time_valid_until_less_than, time_updated_greater_than_or_equal_to, time_updated_less_than):
+def list_alert_policy_rules(ctx, from_json, all_pages, page_size, alert_policy_id, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+ if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --alert-policy-id cannot be whitespace or empty string')
kwargs = {}
- if severity is not None:
- kwargs['severity'] = severity
- if finding_key is not None:
- kwargs['finding_key'] = finding_key
- if finding_title is not None:
- kwargs['finding_title'] = finding_title
- if is_risk_deferred is not None:
- kwargs['is_risk_deferred'] = is_risk_deferred
- if modified_by is not None:
- kwargs['modified_by'] = modified_by
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if time_valid_until_greater_than_or_equal_to is not None:
- kwargs['time_valid_until_greater_than_or_equal_to'] = time_valid_until_greater_than_or_equal_to
- if time_valid_until_less_than is not None:
- kwargs['time_valid_until_less_than'] = time_valid_until_less_than
- if time_updated_greater_than_or_equal_to is not None:
- kwargs['time_updated_greater_than_or_equal_to'] = time_updated_greater_than_or_equal_to
- if time_updated_less_than is not None:
- kwargs['time_updated_less_than'] = time_updated_less_than
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -15171,81 +14470,70 @@ def list_findings_change_audit_logs(ctx, from_json, all_pages, page_size, securi
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_findings_change_audit_logs,
- security_assessment_id=security_assessment_id,
+ client.list_alert_policy_rules,
+ alert_policy_id=alert_policy_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_findings_change_audit_logs,
+ client.list_alert_policy_rules,
limit,
page_size,
- security_assessment_id=security_assessment_id,
+ alert_policy_id=alert_policy_id,
**kwargs
)
else:
- result = client.list_findings_change_audit_logs(
- security_assessment_id=security_assessment_id,
+ result = client.list_alert_policy_rules(
+ alert_policy_id=alert_policy_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.list_grants.command_name', 'list-grants'), help=u"""Gets a list of grants for a particular user in the specified user assessment. A user grant contains details such as the privilege name, type, category, and depth level. The depth level indicates how deep in the hierarchy of roles granted to roles a privilege grant is. The userKey in this operation is a system-generated identifier. Perform the operation ListUsers to get the userKey for a particular user. \n[Command Reference](listGrants)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
-@cli_util.option('--user-key', required=True, help=u"""The unique user key. This is a system-generated identifier. ListUsers gets the user key for a user.""")
-@cli_util.option('--grant-key', help=u"""A filter to return only items that match the specified user grant key.""")
-@cli_util.option('--grant-name', help=u"""A filter to return only items that match the specified user grant name.""")
-@cli_util.option('--privilege-type', help=u"""A filter to return only items that match the specified privilege grant type.""")
-@cli_util.option('--privilege-category', help=u"""A filter to return only items that match the specified user privilege category.""")
-@cli_util.option('--depth-level', type=click.INT, help=u"""A filter to return only items that match the specified user grant depth level.""")
-@cli_util.option('--depth-level-greater-than-or-equal-to', type=click.INT, help=u"""A filter to return only items that are at a level greater than or equal to the specified user grant depth level.""")
-@cli_util.option('--depth-level-less-than', type=click.INT, help=u"""A filter to return only items that are at a level less than the specified user grant depth level.""")
+@alert_summary_group.command(name=cli_util.override('data_safe.list_alerts.command_name', 'list-alerts'), help=u"""Gets a list of all alerts. \n[Command Reference](listAlerts)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--id', help=u"""A filter to return alert by it's OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["grantName", "grantType", "privilegeCategory", "depthLevel", "key"]), help=u"""The field to sort by. You can specify only one sort order (sortOrder). The default order for grantName is ascending.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. If no value is specified timeCreated is default.""")
+@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+
+**Example:** | (timeCreated ge \"2021-06-04T01:00:26.000Z\") and (targetNames eq \"target_1\") (featureDetails.userName eq \"user\") and (targetNames eq \"target_1\") Supported fields: severity status alertType targetIds targetNames operationTime lifecycleState displayName timeCreated timeUpdated featureDetails.* (* can be any field in nestedStrMap in Feature Attributes in Alert Summary. For example - userName,object,clientHostname,osUserName,clientIPs,clientId,commandText,commandParam,clientProgram,objectType,targetOwner)""")
+@cli_util.option('--field', type=custom_types.CliCaseInsensitiveChoice(["id", "displayName", "alertType", "targetIds", "targetNames", "severity", "status", "operationTime", "operation", "operationStatus", "timeCreated", "timeUpdated", "policyId", "lifecycleState"]), multiple=True, help=u"""Specifies a subset of fields to be returned in the response.""")
@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_safe', 'class': 'list[GrantSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AlertCollection'})
@cli_util.wrap_exceptions
-def list_grants(ctx, from_json, all_pages, page_size, user_assessment_id, user_key, grant_key, grant_name, privilege_type, privilege_category, depth_level, depth_level_greater_than_or_equal_to, depth_level_less_than, limit, page, sort_order, sort_by):
+def list_alerts(ctx, from_json, all_pages, page_size, compartment_id, id, compartment_id_in_subtree, limit, page, access_level, sort_order, sort_by, scim_query, field):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
-
- if isinstance(user_key, six.string_types) and len(user_key.strip()) == 0:
- raise click.UsageError('Parameter --user-key cannot be whitespace or empty string')
-
kwargs = {}
- if grant_key is not None:
- kwargs['grant_key'] = grant_key
- if grant_name is not None:
- kwargs['grant_name'] = grant_name
- if privilege_type is not None:
- kwargs['privilege_type'] = privilege_type
- if privilege_category is not None:
- kwargs['privilege_category'] = privilege_category
- if depth_level is not None:
- kwargs['depth_level'] = depth_level
- if depth_level_greater_than_or_equal_to is not None:
- kwargs['depth_level_greater_than_or_equal_to'] = depth_level_greater_than_or_equal_to
- if depth_level_less_than is not None:
- kwargs['depth_level_less_than'] = depth_level_less_than
+ if id is not None:
+ kwargs['id'] = id
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if access_level is not None:
+ kwargs['access_level'] = access_level
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
+ if scim_query is not None:
+ kwargs['scim_query'] = scim_query
+ if field is not None and len(field) > 0:
+ kwargs['field'] = field
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -15253,56 +14541,59 @@ def list_grants(ctx, from_json, all_pages, page_size, user_assessment_id, user_k
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_grants,
- user_assessment_id=user_assessment_id,
- user_key=user_key,
+ client.list_alerts,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_grants,
+ client.list_alerts,
limit,
page_size,
- user_assessment_id=user_assessment_id,
- user_key=user_key,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_grants(
- user_assessment_id=user_assessment_id,
- user_key=user_key,
+ result = client.list_alerts(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sensitive_type_group_group.command(name=cli_util.override('data_safe.list_grouped_sensitive_types.command_name', 'list-grouped-sensitive-types'), help=u"""Gets the list of sensitive type Ids present in the specified sensitive type group. \n[Command Reference](listGroupedSensitiveTypes)""")
-@cli_util.option('--sensitive-type-group-id', required=True, help=u"""The OCID of the sensitive type group.""")
-@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
+@attribute_set_group.command(name=cli_util.override('data_safe.list_associated_resources.command_name', 'list-associated-resources'), help=u"""Returns list of all associated resources. \n[Command Reference](listAssociatedResources)""")
+@cli_util.option('--attribute-set-id', required=True, help=u"""OCID of an attribute set.""")
+@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--associated-resource-type', type=custom_types.CliCaseInsensitiveChoice(["AUDIT_POLICY", "AUDIT_REPORT"]), help=u"""A filter to return attribute set associated resources that matches the specified resource type query param.""")
+@cli_util.option('--associated-resource-id', help=u"""A filter to return attribute set associated resource that matches the specified associated resource id query param.""")
@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_safe', 'class': 'GroupedSensitiveTypeCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AssociatedResourceCollection'})
@cli_util.wrap_exceptions
-def list_grouped_sensitive_types(ctx, from_json, all_pages, page_size, sensitive_type_group_id, sensitive_type_id, limit, page):
+def list_associated_resources(ctx, from_json, all_pages, page_size, attribute_set_id, if_match, limit, page, associated_resource_type, associated_resource_id):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(sensitive_type_group_id, six.string_types) and len(sensitive_type_group_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-type-group-id cannot be whitespace or empty string')
+ if isinstance(attribute_set_id, six.string_types) and len(attribute_set_id.strip()) == 0:
+ raise click.UsageError('Parameter --attribute-set-id cannot be whitespace or empty string')
kwargs = {}
- if sensitive_type_id is not None:
- kwargs['sensitive_type_id'] = sensitive_type_id
+ if if_match is not None:
+ kwargs['if_match'] = if_match
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if associated_resource_type is not None:
+ kwargs['associated_resource_type'] = associated_resource_type
+ if associated_resource_id is not None:
+ kwargs['associated_resource_id'] = associated_resource_id
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -15310,81 +14601,83 @@ def list_grouped_sensitive_types(ctx, from_json, all_pages, page_size, sensitive
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_grouped_sensitive_types,
- sensitive_type_group_id=sensitive_type_group_id,
+ client.list_associated_resources,
+ attribute_set_id=attribute_set_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_grouped_sensitive_types,
+ client.list_associated_resources,
limit,
page_size,
- sensitive_type_group_id=sensitive_type_group_id,
+ attribute_set_id=attribute_set_id,
**kwargs
)
else:
- result = client.list_grouped_sensitive_types(
- sensitive_type_group_id=sensitive_type_group_id,
+ result = client.list_associated_resources(
+ attribute_set_id=attribute_set_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@library_masking_format_summary_group.command(name=cli_util.override('data_safe.list_library_masking_formats.command_name', 'list-library-masking-formats'), help=u"""Gets a list of library masking formats based on the specified query parameters. \n[Command Reference](listLibraryMaskingFormats)""")
+@attribute_set_group.command(name=cli_util.override('data_safe.list_attribute_sets.command_name', 'list'), help=u"""Retrieves the list of attribute sets.
+
+The ListAttributeSets operation returns only the attribute sets in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requester has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListAttributeSet on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAttributeSets)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--library-masking-format-id', help=u"""A filter to return only the resources that match the specified library masking format OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle states.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--library-masking-format-source', type=custom_types.CliCaseInsensitiveChoice(["ORACLE", "USER"]), help=u"""A filter to return the library masking format resources based on the value of their source attribute.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--attribute-set-id', help=u"""A filter to return only attribute set resources that matches the specified attribute set OCID query param.""")
+@cli_util.option('--attribute-set-type', type=custom_types.CliCaseInsensitiveChoice(["IP_ADDRESS", "CLIENT_PROGRAM", "OS_USER", "DATABASE_USER", "DATABASE_OBJECT"]), help=u"""A filter to return only attribute set resources that matches the specified attribute set type query param.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "FAILED", "DELETING", "UPDATING"]), help=u"""The current state of an attribute set.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated", "timeUpdated", "lifecycleState"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for displayName is ascending. The displayName sort order is case sensitive.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
+@cli_util.option('--is-user-defined', type=click.BOOL, help=u"""A filter to return user defined or seeded attribute set resources that matches the specified is user defined query param. A true value indicates user defined attribute set.""")
+@cli_util.option('--in-use', type=custom_types.CliCaseInsensitiveChoice(["YES", "NO"]), help=u"""A filter to return attribute set resources that are in use by other associated resources.""")
@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_safe', 'class': 'LibraryMaskingFormatCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AttributeSetCollection'})
@cli_util.wrap_exceptions
-def list_library_masking_formats(ctx, from_json, all_pages, page_size, compartment_id, library_masking_format_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, time_created_greater_than_or_equal_to, time_created_less_than, library_masking_format_source, sort_order, sort_by):
+def list_attribute_sets(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, display_name, attribute_set_id, attribute_set_type, lifecycle_state, sort_order, sort_by, is_user_defined, in_use):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
kwargs = {}
- if library_masking_format_id is not None:
- kwargs['library_masking_format_id'] = library_masking_format_id
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if attribute_set_id is not None:
+ kwargs['attribute_set_id'] = attribute_set_id
+ if attribute_set_type is not None:
+ kwargs['attribute_set_type'] = attribute_set_type
if lifecycle_state is not None:
kwargs['lifecycle_state'] = lifecycle_state
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
- if library_masking_format_source is not None:
- kwargs['library_masking_format_source'] = library_masking_format_source
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
+ if is_user_defined is not None:
+ kwargs['is_user_defined'] = is_user_defined
+ if in_use is not None:
+ kwargs['in_use'] = in_use
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -15392,74 +14685,77 @@ def list_library_masking_formats(ctx, from_json, all_pages, page_size, compartme
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_library_masking_formats,
+ client.list_attribute_sets,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_library_masking_formats,
+ client.list_attribute_sets,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_library_masking_formats(
+ result = client.list_attribute_sets(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@masked_column_summary_group.command(name=cli_util.override('data_safe.list_masked_columns.command_name', 'list-masked-columns'), help=u"""Gets a list of masked columns present in the specified masking report and based on the specified query parameters. \n[Command Reference](listMaskedColumns)""")
-@cli_util.option('--masking-report-id', required=True, help=u"""The OCID of the masking report.""")
+@audit_archive_retrieval_group.command(name=cli_util.override('data_safe.list_audit_archive_retrievals.command_name', 'list'), help=u"""Returns the list of audit archive retrieval. \n[Command Reference](listAuditArchiveRetrievals)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--audit-archive-retrieval-id', help=u"""OCID of the archive retrieval.""")
+@cli_util.option('--target-id', help=u"""The OCID of the target associated with the archive retrieval.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "NEEDS_ATTENTION", "FAILED", "DELETING", "DELETED", "UPDATING"]), help=u"""A filter to return only resources that matches the specified lifecycle state.""")
+@cli_util.option('--time-of-expiry', type=custom_types.CLI_DATETIME, help=u"""The date time when retrieved archive data will be deleted from Data Safe and unloaded back into archival.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName", "objectName", "sensitiveTypeId", "maskingColumnGroupId"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for all the fields is ascending.""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
-@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
-@cli_util.option('--object-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "TABLE", "EDITIONING_VIEW"]), multiple=True, help=u"""A filter to return only items related to a specific object type.""")
-@cli_util.option('--masking-column-group', multiple=True, help=u"""A filter to return only the resources that match the specified masking column group.""")
-@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'masking-column-group': {'module': 'data_safe', 'class': 'list[string]'}})
+@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={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'masking-column-group': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'MaskedColumnCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditArchiveRetrievalCollection'})
@cli_util.wrap_exceptions
-def list_masked_columns(ctx, from_json, all_pages, page_size, masking_report_id, limit, page, sort_order, sort_by, schema_name, object_name, column_name, object_type, masking_column_group, sensitive_type_id):
+def list_audit_archive_retrievals(ctx, from_json, all_pages, page_size, compartment_id, display_name, compartment_id_in_subtree, access_level, audit_archive_retrieval_id, target_id, target_database_group_id, limit, page, lifecycle_state, time_of_expiry, sort_order, sort_by):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(masking_report_id, six.string_types) and len(masking_report_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-report-id cannot be whitespace or empty string')
-
kwargs = {}
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if audit_archive_retrieval_id is not None:
+ kwargs['audit_archive_retrieval_id'] = audit_archive_retrieval_id
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if time_of_expiry is not None:
+ kwargs['time_of_expiry'] = time_of_expiry
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if object_name is not None and len(object_name) > 0:
- kwargs['object_name'] = object_name
- if column_name is not None and len(column_name) > 0:
- kwargs['column_name'] = column_name
- if object_type is not None and len(object_type) > 0:
- kwargs['object_type'] = object_type
- if masking_column_group is not None and len(masking_column_group) > 0:
- kwargs['masking_column_group'] = masking_column_group
- if sensitive_type_id is not None:
- kwargs['sensitive_type_id'] = sensitive_type_id
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -15467,71 +14763,88 @@ def list_masked_columns(ctx, from_json, all_pages, page_size, masking_report_id,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_masked_columns,
- masking_report_id=masking_report_id,
+ client.list_audit_archive_retrievals,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_masked_columns,
+ client.list_audit_archive_retrievals,
limit,
page_size,
- masking_report_id=masking_report_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_masked_columns(
- masking_report_id=masking_report_id,
+ result = client.list_audit_archive_retrievals(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.list_masking_analytics.command_name', 'list-masking-analytics'), help=u"""Gets consolidated masking analytics data based on the specified query parameters. If CompartmentIdInSubtreeQueryParam is specified as true, the behaviour is equivalent to accessLevel \"ACCESSIBLE\" by default. \n[Command Reference](listMaskingAnalytics)""")
+@audit_event_summary_group.command(name=cli_util.override('data_safe.list_audit_event_analytics.command_name', 'list-audit-event-analytics'), help=u"""By default the ListAuditEventAnalytics operation will return all of the summary columns. To filter for a specific summary column, specify it in the `summaryField` query parameter.
+
+**Example:** /auditEventAnalytics?summaryField=targetName&summaryField=userName&summaryField=clientHostname &summaryField=dmls&summaryField=privilegeChanges&summaryField=ddls&summaryField=loginFailure&summaryField=loginSuccess &summaryField=allRecord&scimQuery=(auditEventTime ge \"2021-06-13T23:49:14\")
+
+/auditEventAnalytics?timeStarted=2022-08-18T11:02:26.000Z&timeEnded=2022-08-24T11:02:26.000Z This will give number of events grouped by periods. Period can be 1 day, 1 week, etc.
+
+/auditEventAnalytics?summaryField=targetName&groupBy=targetName This will give the number of events group by targetName. Only targetName summary column would be returned. \n[Command Reference](listAuditEventAnalytics)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@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('--limit', type=click.INT, help=u"""For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "policyId", "targetIdAndPolicyId", "sensitiveTypeId"]), help=u"""Attribute by which the masking analytics data should be grouped.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--masking-policy-id', help=u"""A filter to return only the resources that match the specified masking policy OCID.""")
-@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeLastMasked"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for all the fields is ascending.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+
+**Example:** (auditEventTime ge \"2021-06-04T01:00:26.000Z\") and (eventName eq \"LOGON\") The attrExp or the field (for example, operationTime and eventName in above example) which is used to filter can be any of the fields returned by AuditEventSummary. adminUser, commonUser, sensitiveActivity, dsActivity can only have eq operation and value 1. These define admin user activity, common user activity, sensitive data activity and data safe activity **Example:** (adminUser eq 1)""")
+@cli_util.option('--summary-field', type=custom_types.CliCaseInsensitiveChoice(["auditEventTime", "dbUserName", "targetId", "targetName", "targetClass", "objectType", "clientHostname", "clientProgram", "clientId", "auditType", "eventName", "allRecord", "auditSettingsChange", "dbSchemaChange", "entitlementChange", "loginFailure", "loginSuccess", "allViolations", "realmViolations", "ruleViolations", "dvconfigActivities", "ddls", "dmls", "privilegeChanges", "auditSettingsEnables", "auditSettingsDisables", "selects", "creates", "alters", "drops", "grants", "revokes", "objectOwner", "auditPolicies", "objectName", "osUserName", "errorCode", "clientIp", "externalUserId"]), multiple=True, help=u"""Specifies a subset of summarized fields to be returned in the response.""")
+@cli_util.option('--time-started', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is greater than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-ended', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is less than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--query-time-zone', help=u"""Default time zone is UTC if no time zone provided. The date-time considerations of the resource will be in accordance with the specified time zone.""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["auditEventTime", "dbUserName", "targetId", "targetName", "targetClass", "objectType", "clientHostname", "clientProgram", "clientId", "auditType", "eventName", "objectOwner", "auditPolicies", "objectName", "osUserName", "errorCode", "clientIp", "externalUserId"]), multiple=True, help=u"""A groupBy can only be used in combination with summaryField parameter. A groupBy value has to be a subset of the values mentioned in summaryField parameter.""")
@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "targetClass", "targetName", "objectType", "dbUserName", "eventName", "auditEventTime", "clientHostname", "clientProgram", "clientId", "auditType", "objectOwner", "auditPolicies", "objectName", "osUserName", "errorCode", "clientIp", "externalUserId"]), help=u"""If this query parameter is specified, the result is ordered based on this query parameter value.""")
@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_safe', 'class': 'MaskingAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditEventAnalyticsCollection'})
@cli_util.wrap_exceptions
-def list_masking_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, group_by, target_id, masking_policy_id, sensitive_type_id, target_database_group_id, sort_by, sort_order, limit, page):
+def list_audit_event_analytics(ctx, from_json, all_pages, page_size, compartment_id, if_match, limit, page, compartment_id_in_subtree, access_level, scim_query, summary_field, time_started, time_ended, query_time_zone, group_by, 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 if_match is not None:
+ kwargs['if_match'] = if_match
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if group_by is not None:
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if scim_query is not None:
+ kwargs['scim_query'] = scim_query
+ if summary_field is not None and len(summary_field) > 0:
+ kwargs['summary_field'] = summary_field
+ if time_started is not None:
+ kwargs['time_started'] = time_started
+ if time_ended is not None:
+ kwargs['time_ended'] = time_ended
+ if query_time_zone is not None:
+ kwargs['query_time_zone'] = query_time_zone
+ if group_by is not None and len(group_by) > 0:
kwargs['group_by'] = group_by
- if target_id is not None:
- kwargs['target_id'] = target_id
- if masking_policy_id is not None:
- kwargs['masking_policy_id'] = masking_policy_id
- if sensitive_type_id is not None:
- kwargs['sensitive_type_id'] = sensitive_type_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
if sort_order is not None:
kwargs['sort_order'] = sort_order
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
+ if 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_safe', 'data_safe', ctx)
if all_pages:
@@ -15539,102 +14852,68 @@ def list_masking_analytics(ctx, from_json, all_pages, page_size, compartment_id,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_masking_analytics,
+ client.list_audit_event_analytics,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_masking_analytics,
+ client.list_audit_event_analytics,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_masking_analytics(
+ result = client.list_audit_event_analytics(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@masking_column_group.command(name=cli_util.override('data_safe.list_masking_columns.command_name', 'list'), help=u"""Gets a list of masking columns present in the specified masking policy and based on the specified query parameters. \n[Command Reference](listMaskingColumns)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "schemaName", "objectName", "columnName", "dataType"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for other fields is ascending.""")
-@cli_util.option('--masking-column-lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle states.""")
-@cli_util.option('--data-type', type=custom_types.CliCaseInsensitiveChoice(["CHARACTER", "DATE", "LOB", "NUMERIC"]), multiple=True, help=u"""A filter to return only resources that match the specified data types.""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
-@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
-@cli_util.option('--object-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "TABLE", "EDITIONING_VIEW"]), multiple=True, help=u"""A filter to return only items related to a specific object type.""")
-@cli_util.option('--masking-column-group', multiple=True, help=u"""A filter to return only the resources that match the specified masking column group.""")
-@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
-@cli_util.option('--is-masking-enabled', type=click.BOOL, help=u"""A filter to return the masking column resources based on the value of their isMaskingEnabled attribute. A value of true returns only those columns for which masking is enabled. A value of false returns only those columns for which masking is disabled. Omitting this parameter returns all the masking columns in a masking policy.""")
-@cli_util.option('--is-seed-required', type=click.BOOL, help=u"""A filter to return masking columns based on whether the assigned masking formats need a seed value for masking. A value of true returns those masking columns that are using Deterministic Encryption or Deterministic Substitution masking format.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+@audit_event_summary_group.command(name=cli_util.override('data_safe.list_audit_events.command_name', 'list-audit-events'), help=u"""The ListAuditEvents operation returns specified `compartmentId` audit Events only. The list does not include any audit Events associated with the `subcompartments` of the specified `compartmentId`.
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-updated-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were updated after a specific date. Specifying this parameter corresponding `timeUpdatedGreaterThanOrEqualTo` parameter will retrieve all resources updated after the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-updated-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were updated before a specific date. Specifying this parameter corresponding `timeUpdatedLessThan` parameter will retrieve all resources updated before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+The parameter `compartmentIdInSubtree` applies when you perform ListAuditEvents on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAuditEvents)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+
+**Example:** (auditEventTime ge \"2021-06-04T01:00:26.000Z\") and (eventName eq \"LOGON\") The attrExp or the field (for example, operationTime and eventName in above example) which is used to filter can be any of the fields returned by AuditEventSummary. adminUser, commonUser, sensitiveActivity, dsActivity can only have eq operation and value 1. These define admin user activity, common user activity, sensitive data activity and data safe activity **Example:** (adminUser eq 1)""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["dbUserName", "targetName", "databaseType", "targetClass", "auditEventTime", "timeCollected", "osUserName", "operation", "operationStatus", "eventName", "errorCode", "errorMessage", "objectType", "objectName", "objectOwner", "clientHostname", "clientIp", "isAlerted", "actionTaken", "clientProgram", "commandText", "commandParam", "extendedEventAttributes", "auditLocation", "osTerminal", "clientId", "auditPolicies", "auditType", "externalUserId"]), help=u"""If this query parameter is specified, the result is sorted by this query parameter value.""")
@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'masking-column-group': {'module': 'data_safe', 'class': 'list[string]'}})
+@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={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'masking-column-group': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'MaskingColumnCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditEventCollection'})
@cli_util.wrap_exceptions
-def list_masking_columns(ctx, from_json, all_pages, page_size, masking_policy_id, limit, page, sort_order, sort_by, masking_column_lifecycle_state, data_type, schema_name, object_name, column_name, object_type, masking_column_group, sensitive_type_id, is_masking_enabled, is_seed_required, time_created_greater_than_or_equal_to, time_created_less_than, time_updated_greater_than_or_equal_to, time_updated_less_than):
+def list_audit_events(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, scim_query, sort_order, sort_by):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
-
kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if scim_query is not None:
+ kwargs['scim_query'] = scim_query
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
- if masking_column_lifecycle_state is not None:
- kwargs['masking_column_lifecycle_state'] = masking_column_lifecycle_state
- if data_type is not None and len(data_type) > 0:
- kwargs['data_type'] = data_type
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if object_name is not None and len(object_name) > 0:
- kwargs['object_name'] = object_name
- if column_name is not None and len(column_name) > 0:
- kwargs['column_name'] = column_name
- if object_type is not None and len(object_type) > 0:
- kwargs['object_type'] = object_type
- if masking_column_group is not None and len(masking_column_group) > 0:
- kwargs['masking_column_group'] = masking_column_group
- if sensitive_type_id is not None:
- kwargs['sensitive_type_id'] = sensitive_type_id
- if is_masking_enabled is not None:
- kwargs['is_masking_enabled'] = is_masking_enabled
- if is_seed_required is not None:
- kwargs['is_seed_required'] = is_seed_required
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
- if time_updated_greater_than_or_equal_to is not None:
- kwargs['time_updated_greater_than_or_equal_to'] = time_updated_greater_than_or_equal_to
- if time_updated_less_than is not None:
- kwargs['time_updated_less_than'] = time_updated_less_than
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -15642,59 +14921,80 @@ def list_masking_columns(ctx, from_json, all_pages, page_size, masking_policy_id
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_masking_columns,
- masking_policy_id=masking_policy_id,
+ client.list_audit_events,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_masking_columns,
+ client.list_audit_events,
limit,
page_size,
- masking_policy_id=masking_policy_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_masking_columns(
- masking_policy_id=masking_policy_id,
+ result = client.list_audit_events(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@masking_error_summary_group.command(name=cli_util.override('data_safe.list_masking_errors.command_name', 'list-masking-errors'), help=u"""Gets a list of masking errors in a masking run based on the specified query parameters. \n[Command Reference](listMaskingErrors)""")
-@cli_util.option('--masking-report-id', required=True, help=u"""The OCID of the masking report.""")
-@cli_util.option('--step-name', type=custom_types.CliCaseInsensitiveChoice(["VALIDATE", "GENERATE_SCRIPT", "EXECUTE_MASKING", "PRE_MASKING", "POST_MASKING"]), help=u"""A filter to return only masking errors that match the specified step name.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["stepName", "timeCreated"]), help=u"""The field to sort by. The default order will be ascending.""")
+@audit_policy_collection_group.command(name=cli_util.override('data_safe.list_audit_policies.command_name', 'list-audit-policies'), help=u"""Retrieves a list of all audited targets with their corresponding provisioned audit policies, and their provisioning conditions.
+
+The ListAuditPolicies operation returns only the audit policies in the specified `compartmentId`. The list does not include any subcompartments of the compartmentId passed.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListAuditPolicies on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAuditPolicies)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "FAILED", "NEEDS_ATTENTION", "DELETING", "DELETED"]), help=u"""The current state of the audit policy.""")
+@cli_util.option('--audit-policy-id', help=u"""An optional filter to return only resources that match the specified 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('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'MaskingErrorCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditPolicyCollection'})
@cli_util.wrap_exceptions
-def list_masking_errors(ctx, from_json, all_pages, page_size, masking_report_id, step_name, sort_by, limit, page, sort_order):
+def list_audit_policies(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, target_id, target_database_group_id, lifecycle_state, audit_policy_id, sort_order, sort_by):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(masking_report_id, six.string_types) and len(masking_report_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-report-id cannot be whitespace or empty string')
-
kwargs = {}
- if step_name is not None:
- kwargs['step_name'] = step_name
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if audit_policy_id is not None:
+ kwargs['audit_policy_id'] = audit_policy_id
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_safe', 'data_safe', ctx)
if all_pages:
@@ -15702,65 +15002,77 @@ def list_masking_errors(ctx, from_json, all_pages, page_size, masking_report_id,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_masking_errors,
- masking_report_id=masking_report_id,
+ client.list_audit_policies,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_masking_errors,
+ client.list_audit_policies,
limit,
page_size,
- masking_report_id=masking_report_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_masking_errors(
- masking_report_id=masking_report_id,
+ result = client.list_audit_policies(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@masking_object_collection_group.command(name=cli_util.override('data_safe.list_masking_objects.command_name', 'list-masking-objects'), help=u"""Gets a list of masking objects present in the specified masking policy and based on the specified query parameters. \n[Command Reference](listMaskingObjects)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@audit_policy_analytic_collection_group.command(name=cli_util.override('data_safe.list_audit_policy_analytics.command_name', 'list-audit-policy-analytics'), help=u"""Gets a list of aggregated audit policy details on the target databases. A audit policy aggregation helps understand the overall state of policies provisioned on targets. It is especially useful to create dashboards or to support analytics.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform SummarizedAuditPolicyInfo on the specified `compartmentId` and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE.
+
+**Example:** ListAuditPolicyAnalytics?groupBy=auditPolicyCategory \n[Command Reference](listAuditPolicyAnalytics)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName", "objectName", "objectType"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order is ascending.""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
-@cli_util.option('--object-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "TABLE", "EDITIONING_VIEW"]), multiple=True, help=u"""A filter to return only items related to a specific object type.""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["auditPolicyCategory", "auditPolicyName", "targetId"]), multiple=True, help=u"""The group by parameter to summarize audit policy aggregation.""")
+@cli_util.option('--audit-policy-category', type=custom_types.CliCaseInsensitiveChoice(["BASIC_ACTIVITY", "ADMIN_USER_ACTIVITY", "USER_ACTIVITY", "ORACLE_PREDEFINED", "COMPLIANCE_STANDARD", "CUSTOM", "SQL_FIREWALL_AUDITING"]), help=u"""The category to which the audit policy belongs to.""")
+@cli_util.option('--audit-policy-name', help=u"""In case of seeded policies, it is the policy name defined by Data Safe. In case of custom Policies, it is the policy name that is used to create the policies on the target database. In case of Oracle Pre-seeded policies, it is the default policy name of the same.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "FAILED", "NEEDS_ATTENTION", "DELETING", "DELETED"]), help=u"""The current state of the audit policy.""")
@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@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={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'MaskingObjectCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditPolicyAnalyticCollection'})
@cli_util.wrap_exceptions
-def list_masking_objects(ctx, from_json, all_pages, page_size, masking_policy_id, limit, page, sort_order, sort_by, schema_name, object_name, object_type):
+def list_audit_policy_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, group_by, audit_policy_category, audit_policy_name, target_id, target_database_group_id, lifecycle_state):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
-
kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if object_name is not None and len(object_name) > 0:
- kwargs['object_name'] = object_name
- if object_type is not None and len(object_type) > 0:
- kwargs['object_type'] = object_type
+ if group_by is not None and len(group_by) > 0:
+ kwargs['group_by'] = group_by
+ if audit_policy_category is not None:
+ kwargs['audit_policy_category'] = audit_policy_category
+ if audit_policy_name is not None:
+ kwargs['audit_policy_name'] = audit_policy_name
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -15768,84 +15080,63 @@ def list_masking_objects(ctx, from_json, all_pages, page_size, masking_policy_id
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_masking_objects,
- masking_policy_id=masking_policy_id,
+ client.list_audit_policy_analytics,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_masking_objects,
+ client.list_audit_policy_analytics,
limit,
page_size,
- masking_policy_id=masking_policy_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_masking_objects(
- masking_policy_id=masking_policy_id,
+ result = client.list_audit_policy_analytics(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.list_masking_policies.command_name', 'list'), help=u"""Gets a list of masking policies based on the specified query parameters. \n[Command Reference](listMaskingPolicies)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--masking-policy-id', help=u"""A filter to return only the resources that match the specified masking policy OCID.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle states.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for displayName is ascending. The displayName sort order is case sensitive.""")
-@cli_util.option('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+@audit_profile_analytic_collection_group.command(name=cli_util.override('data_safe.list_audit_profile_analytics.command_name', 'list-audit-profile-analytics'), help=u"""Gets a list of audit profile aggregated details . A audit profile aggregation helps understand the overall state of audit profile profiles. As an example, it helps understand how many audit profiles have paid usage. It is especially useful to create dashboards or to support analytics.
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+The parameter `compartmentIdInSubtree` applies when you perform AuditProfileAnalytics on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAuditProfileAnalytics)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["isPaidUsageEnabled", "targetType", "paidUsageSource", "onlineMonthsSource", "offlineMonthsSource"]), multiple=True, help=u"""The group by parameter for summarize operation on audit.""")
+@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A optional filter to return only resources that belong to the specified audit profile type.""")
@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_safe', 'class': 'MaskingPolicyCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditProfileAnalyticCollection'})
@cli_util.wrap_exceptions
-def list_masking_policies(ctx, from_json, all_pages, page_size, compartment_id, masking_policy_id, display_name, limit, page, lifecycle_state, sort_order, sort_by, sensitive_data_model_id, target_id, time_created_greater_than_or_equal_to, time_created_less_than, compartment_id_in_subtree, access_level):
+def list_audit_profile_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, group_by, target_type):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
kwargs = {}
- if masking_policy_id is not None:
- kwargs['masking_policy_id'] = masking_policy_id
- if display_name is not None:
- kwargs['display_name'] = display_name
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sensitive_data_model_id is not None:
- kwargs['sensitive_data_model_id'] = sensitive_data_model_id
- if target_id is not None:
- kwargs['target_id'] = target_id
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
kwargs['access_level'] = access_level
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if group_by is not None and len(group_by) > 0:
+ kwargs['group_by'] = group_by
+ if target_type is not None:
+ kwargs['target_type'] = target_type
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -15853,59 +15144,92 @@ def list_masking_policies(ctx, from_json, all_pages, page_size, compartment_id,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_masking_policies,
+ client.list_audit_profile_analytics,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_masking_policies,
+ client.list_audit_profile_analytics,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_masking_policies(
+ result = client.list_audit_profile_analytics(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@masking_policy_health_report_group.command(name=cli_util.override('data_safe.list_masking_policy_health_report_logs.command_name', 'list-masking-policy-health-report-logs'), help=u"""Gets a list of errors and warnings from a masking policy health check. \n[Command Reference](listMaskingPolicyHealthReportLogs)""")
-@cli_util.option('--masking-policy-health-report-id', required=True, help=u"""The OCID of the masking health report.""")
+@audit_profile_group.command(name=cli_util.override('data_safe.list_audit_profiles.command_name', 'list'), help=u"""Gets a list of all audit profiles.
+
+The ListAuditProfiles operation returns only the audit profiles in the specified `compartmentId`. The list does not include any subcompartments of the compartmentId passed.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListAuditProfiles on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAuditProfiles)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--audit-profile-id', help=u"""A optional filter to return only resources that match the specified id.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A optional filter to return only resources that belong to the specified audit profile type.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "FAILED", "NEEDS_ATTENTION", "DELETED"]), help=u"""A optional filter to return only resources that match the specified lifecycle state.""")
+@cli_util.option('--is-override-global-retention-setting', type=click.BOOL, help=u"""A optional filter to return only resources that match the specified retention configured value.""")
+@cli_util.option('--is-paid-usage-enabled', type=click.BOOL, help=u"""Indicates if you want to continue audit record collection beyond the free limit of one million audit records per month per target database, incurring additional charges. The default value is inherited from the global settings. You can change at the global level or at the target level.""")
+@cli_util.option('--audit-collected-volume-greater-than-or-equal-to', type=click.INT, help=u"""A filter to return only items that have count of audit records collected greater than or equal to the specified value.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["logType"]), help=u"""sort by""")
-@cli_util.option('--message-type', type=custom_types.CliCaseInsensitiveChoice(["PASS", "WARNING", "ERROR"]), help=u"""A filter to return only the resources that match the specified log message type.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'MaskingPolicyHealthReportLogCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditProfileCollection'})
@cli_util.wrap_exceptions
-def list_masking_policy_health_report_logs(ctx, from_json, all_pages, page_size, masking_policy_health_report_id, limit, page, sort_order, sort_by, message_type):
+def list_audit_profiles(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, audit_profile_id, target_id, target_database_group_id, target_type, display_name, limit, page, lifecycle_state, is_override_global_retention_setting, is_paid_usage_enabled, audit_collected_volume_greater_than_or_equal_to, sort_order, sort_by):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(masking_policy_health_report_id, six.string_types) and len(masking_policy_health_report_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-health-report-id cannot be whitespace or empty string')
-
kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if audit_profile_id is not None:
+ kwargs['audit_profile_id'] = audit_profile_id
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ if target_type is not None:
+ kwargs['target_type'] = target_type
+ if display_name is not None:
+ kwargs['display_name'] = display_name
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if is_override_global_retention_setting is not None:
+ kwargs['is_override_global_retention_setting'] = is_override_global_retention_setting
+ if is_paid_usage_enabled is not None:
+ kwargs['is_paid_usage_enabled'] = is_paid_usage_enabled
+ if audit_collected_volume_greater_than_or_equal_to is not None:
+ kwargs['audit_collected_volume_greater_than_or_equal_to'] = audit_collected_volume_greater_than_or_equal_to
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
- if message_type is not None:
- kwargs['message_type'] = message_type
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -15913,74 +15237,75 @@ def list_masking_policy_health_report_logs(ctx, from_json, all_pages, page_size,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_masking_policy_health_report_logs,
- masking_policy_health_report_id=masking_policy_health_report_id,
+ client.list_audit_profiles,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_masking_policy_health_report_logs,
+ client.list_audit_profiles,
limit,
page_size,
- masking_policy_health_report_id=masking_policy_health_report_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_masking_policy_health_report_logs(
- masking_policy_health_report_id=masking_policy_health_report_id,
+ result = client.list_audit_profiles(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@masking_policy_health_report_group.command(name=cli_util.override('data_safe.list_masking_policy_health_reports.command_name', 'list'), help=u"""Gets a list of masking policy health reports based on the specified query parameters. \n[Command Reference](listMaskingPolicyHealthReports)""")
+@audit_trail_analytic_collection_group.command(name=cli_util.override('data_safe.list_audit_trail_analytics.command_name', 'list-audit-trail-analytics'), help=u"""Gets a list of audit trail aggregated details . A audit trail aggregation helps understand the overall state of trails. As an example, it helps understand how many trails are running or stopped. It is especially useful to create dashboards or to support analytics.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform AuditTrailAnalytics on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAuditTrailAnalytics)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--masking-policy-health-report-id', help=u"""A filter to return only the resources that match the specified masking policy health report OCID.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""sort by""")
-@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('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["location", "lifecycleState", "status", "targetId"]), multiple=True, help=u"""The group by parameter for summarize operation on audit trail.""")
@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--masking-policy-id', help=u"""A filter to return only the resources that match the specified masking policy OCID.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle states.""")
+@cli_util.option('--time-started', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is greater than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-ended', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is less than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--query-time-zone', help=u"""Default time zone is UTC if no time zone provided. The date-time considerations of the resource will be in accordance with the specified time zone.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
@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_safe', 'class': 'MaskingPolicyHealthReportCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditTrailAnalyticCollection'})
@cli_util.wrap_exceptions
-def list_masking_policy_health_reports(ctx, from_json, all_pages, page_size, compartment_id, masking_policy_health_report_id, limit, page, compartment_id_in_subtree, access_level, sort_by, sort_order, display_name, target_id, masking_policy_id, lifecycle_state):
+def list_audit_trail_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, group_by, target_id, time_started, time_ended, query_time_zone, target_database_group_id):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
kwargs = {}
- if masking_policy_health_report_id is not None:
- kwargs['masking_policy_health_report_id'] = masking_policy_health_report_id
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
kwargs['access_level'] = access_level
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if display_name is not None:
- kwargs['display_name'] = display_name
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if group_by is not None and len(group_by) > 0:
+ kwargs['group_by'] = group_by
if target_id is not None:
kwargs['target_id'] = target_id
- if masking_policy_id is not None:
- kwargs['masking_policy_id'] = masking_policy_id
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
+ if time_started is not None:
+ kwargs['time_started'] = time_started
+ if time_ended is not None:
+ kwargs['time_ended'] = time_ended
+ if query_time_zone is not None:
+ kwargs['query_time_zone'] = query_time_zone
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -15988,64 +15313,77 @@ def list_masking_policy_health_reports(ctx, from_json, all_pages, page_size, com
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_masking_policy_health_reports,
+ client.list_audit_trail_analytics,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_masking_policy_health_reports,
+ client.list_audit_trail_analytics,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_masking_policy_health_reports(
+ result = client.list_audit_trail_analytics(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@masking_policy_referential_relation_summary_group.command(name=cli_util.override('data_safe.list_masking_policy_referential_relations.command_name', 'list-masking-policy-referential-relations'), help=u"""Gets a list of referential relations present in the specified masking policy based on the specified query parameters. \n[Command Reference](listMaskingPolicyReferentialRelations)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
-@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
-@cli_util.option('--relation-type', type=custom_types.CliCaseInsensitiveChoice(["NONE", "APP_DEFINED", "DB_DEFINED"]), multiple=True, help=u"""A filter to return columns based on their relationship with their parent columns. If set to NONE, it returns the columns that do not have any parent. The response includes the parent columns as well as the independent columns that are not in any relationship. If set to APP_DEFINED, it returns all the child columns that have application-level (non-dictionary) relationship with their parents. If set to DB_DEFINED, it returns all the child columns that have database-level (dictionary-defined) relationship with their parents.""")
+@audit_trail_group.command(name=cli_util.override('data_safe.list_audit_trails.command_name', 'list'), help=u"""Gets a list of all audit trails. The ListAuditTrails operation returns only the audit trails in the specified `compartmentId`. The list does not include any subcompartments of the compartmentId passed.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListAuditTrails on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listAuditTrails)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--audit-trail-id', help=u"""A optional filter to return only resources that match the specified id.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["INACTIVE", "UPDATING", "ACTIVE", "DELETING", "FAILED", "NEEDS_ATTENTION"]), help=u"""A optional filter to return only resources that match the specified lifecycle state.""")
+@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["STARTING", "COLLECTING", "RECOVERING", "IDLE", "STOPPING", "STOPPED", "RESUMING", "RETRYING", "NOT_STARTED", "STOPPED_NEEDS_ATTN", "STOPPED_FAILED"]), help=u"""A optional filter to return only resources that match the specified sub-state of audit trail.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["relationType", "schemaName", "objectName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@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={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'MaskingPolicyReferentialRelationCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AuditTrailCollection'})
@cli_util.wrap_exceptions
-def list_masking_policy_referential_relations(ctx, from_json, all_pages, page_size, masking_policy_id, schema_name, object_name, column_name, relation_type, limit, page, sort_order, sort_by):
+def list_audit_trails(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, audit_trail_id, display_name, target_id, target_database_group_id, limit, page, lifecycle_state, status, sort_order, sort_by):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
-
kwargs = {}
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if object_name is not None and len(object_name) > 0:
- kwargs['object_name'] = object_name
- if column_name is not None and len(column_name) > 0:
- kwargs['column_name'] = column_name
- if relation_type is not None and len(relation_type) > 0:
- kwargs['relation_type'] = relation_type
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if audit_trail_id is not None:
+ kwargs['audit_trail_id'] = audit_trail_id
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if status is not None:
+ kwargs['status'] = status
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
@@ -16057,68 +15395,70 @@ def list_masking_policy_referential_relations(ctx, from_json, all_pages, page_si
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_masking_policy_referential_relations,
- masking_policy_id=masking_policy_id,
+ client.list_audit_trails,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_masking_policy_referential_relations,
+ client.list_audit_trails,
limit,
page_size,
- masking_policy_id=masking_policy_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_masking_policy_referential_relations(
- masking_policy_id=masking_policy_id,
+ result = client.list_audit_trails(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.list_masking_reports.command_name', 'list-masking-reports'), help=u"""Gets a list of masking reports based on the specified query parameters. \n[Command Reference](listMaskingReports)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@audit_profile_group.command(name=cli_util.override('data_safe.list_available_audit_volumes.command_name', 'list-available-audit-volumes'), help=u"""Retrieves a list of audit trails, and associated audit event volume for each trail up to defined start date. \n[Command Reference](listAvailableAuditVolumes)""")
+@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
+@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
+@cli_util.option('--trail-location', help=u"""The audit trail location.""")
+@cli_util.option('--month-in-consideration-greater-than', type=custom_types.CLI_DATETIME, help=u"""Specifying `monthInConsiderationGreaterThan` parameter will retrieve all items for which the event month is greater than the date and time specified, in the format defined by [RFC3339].
+
+**Example:** 2016-12-19T00:00:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--month-in-consideration-less-than', type=custom_types.CLI_DATETIME, help=u"""Specifying `monthInConsiderationLessThan` parameter will retrieve all items for which the event month is less than the date and time specified, in the format defined by [RFC3339].
+
+**Example:** 2016-12-19T00:00:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--masking-policy-id', help=u"""A filter to return only the resources that match the specified masking policy OCID.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeMaskingFinished"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeMaskingFinished is descending.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["monthInConsideration", "volume", "trailLocation"]), help=u"""The field to sort by. You can specify only one sort order(sortOrder). The default order for all fields is ascending.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'MaskingReportCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'AvailableAuditVolumeCollection'})
@cli_util.wrap_exceptions
-def list_masking_reports(ctx, from_json, all_pages, page_size, compartment_id, limit, page, masking_policy_id, target_id, target_database_group_id, sort_order, sort_by, compartment_id_in_subtree, access_level):
+def list_available_audit_volumes(ctx, from_json, all_pages, page_size, audit_profile_id, work_request_id, trail_location, month_in_consideration_greater_than, month_in_consideration_less_than, 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')
+ if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-profile-id cannot be whitespace or empty string')
+
kwargs = {}
+ if trail_location is not None:
+ kwargs['trail_location'] = trail_location
+ if month_in_consideration_greater_than is not None:
+ kwargs['month_in_consideration_greater_than'] = month_in_consideration_greater_than
+ if month_in_consideration_less_than is not None:
+ kwargs['month_in_consideration_less_than'] = month_in_consideration_less_than
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if masking_policy_id is not None:
- kwargs['masking_policy_id'] = masking_policy_id
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -16126,47 +15466,55 @@ def list_masking_reports(ctx, from_json, all_pages, page_size, compartment_id, l
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_masking_reports,
- compartment_id=compartment_id,
+ client.list_available_audit_volumes,
+ audit_profile_id=audit_profile_id,
+ work_request_id=work_request_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_masking_reports,
+ client.list_available_audit_volumes,
limit,
page_size,
- compartment_id=compartment_id,
+ audit_profile_id=audit_profile_id,
+ work_request_id=work_request_id,
**kwargs
)
else:
- result = client.list_masking_reports(
- compartment_id=compartment_id,
+ result = client.list_available_audit_volumes(
+ audit_profile_id=audit_profile_id,
+ work_request_id=work_request_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@masking_schema_collection_group.command(name=cli_util.override('data_safe.list_masking_schemas.command_name', 'list-masking-schemas'), help=u"""Gets a list of masking schemas present in the specified masking policy and based on the specified query parameters. \n[Command Reference](listMaskingSchemas)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@security_assessment_group.command(name=cli_util.override('data_safe.list_checks.command_name', 'list-checks'), help=u"""Lists all the security checks in the specified compartment for security assessment of type TEMPLATE. \n[Command Reference](listChecks)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order is ascending.""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["title", "category", "key"]), help=u"""The field to sort by. You can specify only one sort order(sortOrder). The default order for title is ascending.""")
+@cli_util.option('--suggested-severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), help=u"""A filter to return only checks of a particular risk level.""")
+@cli_util.option('--contains-severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), multiple=True, help=u"""A filter to return only findings that match the specified risk level(s). Use containsSeverity parameter if need to filter by multiple risk levels.""")
+@cli_util.option('--contains-references', type=custom_types.CliCaseInsensitiveChoice(["STIG", "CIS", "GDPR"]), multiple=True, help=u"""An optional filter to return only findings that match the specified references. Use containsReferences param if need to filter by multiple references.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--key', help=u"""Each check in security assessment has an associated key (think of key as a check's name). For a given check, the key will be the same across targets. The user can use these keys to filter the checks.""")
@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@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={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'MaskingSchemaCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[CheckSummary]'})
@cli_util.wrap_exceptions
-def list_masking_schemas(ctx, from_json, all_pages, page_size, masking_policy_id, limit, page, sort_order, sort_by, schema_name):
+def list_checks(ctx, from_json, all_pages, page_size, security_assessment_id, limit, page, sort_order, sort_by, suggested_severity, contains_severity, contains_references, compartment_id_in_subtree, access_level, key):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
kwargs = {}
if limit is not None:
@@ -16177,65 +15525,78 @@ def list_masking_schemas(ctx, from_json, all_pages, page_size, masking_policy_id
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
+ if suggested_severity is not None:
+ kwargs['suggested_severity'] = suggested_severity
+ if contains_severity is not None and len(contains_severity) > 0:
+ kwargs['contains_severity'] = contains_severity
+ if contains_references is not None and len(contains_references) > 0:
+ kwargs['contains_references'] = contains_references
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if key is not None:
+ kwargs['key'] = key
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
if page_size:
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_masking_schemas,
- masking_policy_id=masking_policy_id,
+ client.list_checks,
+ security_assessment_id=security_assessment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_masking_schemas,
+ client.list_checks,
limit,
page_size,
- masking_policy_id=masking_policy_id,
+ security_assessment_id=security_assessment_id,
**kwargs
)
else:
- result = client.list_masking_schemas(
- masking_policy_id=masking_policy_id,
+ result = client.list_checks(
+ security_assessment_id=security_assessment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@on_prem_connector_group.command(name=cli_util.override('data_safe.list_on_prem_connectors.command_name', 'list'), help=u"""Gets a list of on-premises connectors. \n[Command Reference](listOnPremConnectors)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--on-prem-connector-id', help=u"""A filter to return only the on-premises connector that matches the specified id.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@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 on-premises connector resources that match the specified lifecycle state.""")
+@audit_profile_group.command(name=cli_util.override('data_safe.list_collected_audit_volumes.command_name', 'list-collected-audit-volumes'), help=u"""Gets a list of all collected audit volume data points. \n[Command Reference](listCollectedAuditVolumes)""")
+@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
+@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
+@cli_util.option('--month-in-consideration-greater-than', type=custom_types.CLI_DATETIME, help=u"""Specifying `monthInConsiderationGreaterThan` parameter will retrieve all items for which the event month is greater than the date and time specified, in the format defined by [RFC3339].
+
+**Example:** 2016-12-19T00:00:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--month-in-consideration-less-than', type=custom_types.CLI_DATETIME, help=u"""Specifying `monthInConsiderationLessThan` parameter will retrieve all items for which the event month is less than the date and time specified, in the format defined by [RFC3339].
+
+**Example:** 2016-12-19T00:00:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["monthInConsideration", "onlineVolume", "archivedVolume"]), help=u"""The field to sort by. You can specify only one sort order(sortOrder). The default order for all fields is ascending.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[OnPremConnectorSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'CollectedAuditVolumeCollection'})
@cli_util.wrap_exceptions
-def list_on_prem_connectors(ctx, from_json, all_pages, page_size, compartment_id, on_prem_connector_id, display_name, lifecycle_state, limit, page, sort_order, sort_by, compartment_id_in_subtree, access_level):
+def list_collected_audit_volumes(ctx, from_json, all_pages, page_size, audit_profile_id, work_request_id, month_in_consideration_greater_than, month_in_consideration_less_than, 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')
+ if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-profile-id cannot be whitespace or empty string')
+
kwargs = {}
- if on_prem_connector_id is not None:
- kwargs['on_prem_connector_id'] = on_prem_connector_id
- if display_name is not None:
- kwargs['display_name'] = display_name
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
+ if month_in_consideration_greater_than is not None:
+ kwargs['month_in_consideration_greater_than'] = month_in_consideration_greater_than
+ if month_in_consideration_less_than is not None:
+ kwargs['month_in_consideration_less_than'] = month_in_consideration_less_than
if limit is not None:
kwargs['limit'] = limit
if page is not None:
@@ -16244,10 +15605,6 @@ def list_on_prem_connectors(ctx, from_json, all_pages, page_size, compartment_id
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -16255,78 +15612,50 @@ def list_on_prem_connectors(ctx, from_json, all_pages, page_size, compartment_id
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_on_prem_connectors,
- compartment_id=compartment_id,
+ client.list_collected_audit_volumes,
+ audit_profile_id=audit_profile_id,
+ work_request_id=work_request_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_on_prem_connectors,
+ client.list_collected_audit_volumes,
limit,
page_size,
- compartment_id=compartment_id,
+ audit_profile_id=audit_profile_id,
+ work_request_id=work_request_id,
**kwargs
)
else:
- result = client.list_on_prem_connectors(
- compartment_id=compartment_id,
+ result = client.list_collected_audit_volumes(
+ audit_profile_id=audit_profile_id,
+ work_request_id=work_request_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.list_password_expiry_date_analytics.command_name', 'list-password-expiry-date-analytics'), help=u"""Gets a list of count of the users with password expiry dates in next 30 days, between next 30-90 days, and beyond 90 days based on specified user assessment. It internally uses the aforementioned userAnalytics api.
-
-When you perform the ListPasswordExpiryDateAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns compartments in which the requestor has READ permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned.
-
-To use ListPasswordExpiryDateAnalytics to get a full list of all compartments and subcompartments in the tenancy from the root compartment, set the parameter compartmentIdInSubtree to true and accessLevel to ACCESSIBLE. \n[Command Reference](listPasswordExpiryDateAnalytics)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--user-category', help=u"""A filter to return only items that match the specified user category.""")
-@cli_util.option('--time-password-expiry-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose password expiry date in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@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': 'data_safe', 'class': 'list[UserAggregation]'})
-@cli_util.wrap_exceptions
-def list_password_expiry_date_analytics(ctx, from_json, all_pages, user_assessment_id, compartment_id_in_subtree, access_level, user_category, time_password_expiry_less_than):
-
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
-
- kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if user_category is not None:
- kwargs['user_category'] = user_category
- if time_password_expiry_less_than is not None:
- kwargs['time_password_expiry_less_than'] = time_password_expiry_less_than
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.list_password_expiry_date_analytics(
- user_assessment_id=user_assessment_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
-
-
-@peer_target_database_group.command(name=cli_util.override('data_safe.list_peer_target_databases.command_name', 'list'), help=u"""Lists all the peer target databases under the primary target database identified by the OCID passed as path parameter. \n[Command Reference](listPeerTargetDatabases)""")
+@target_database_group.command(name=cli_util.override('data_safe.list_columns.command_name', 'list-columns'), help=u"""Returns a list of column metadata objects. \n[Command Reference](listColumns)""")
@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
-@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--table-name', multiple=True, help=u"""A filter to return only items related to specific table name.""")
+@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
+@cli_util.option('--datatype', multiple=True, help=u"""A filter to return only items related to specific datatype.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["SCHEMANAME", "TABLENAME", "COLUMNNAME", "DATATYPE"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified.""")
+@cli_util.option('--schema-name-contains', help=u"""A filter to return only items if schema name contains a specific string.""")
+@cli_util.option('--table-name-contains', help=u"""A filter to return only items if table name contains a specific string.""")
+@cli_util.option('--column-name-contains', help=u"""A filter to return only items if column name contains a specific string.""")
@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({})
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'table-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'datatype': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'PeerTargetDatabaseCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'table-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'datatype': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'list[ColumnSummary]'})
@cli_util.wrap_exceptions
-def list_peer_target_databases(ctx, from_json, all_pages, page_size, target_database_id, if_match, limit, page):
+def list_columns(ctx, from_json, all_pages, page_size, target_database_id, limit, page, schema_name, table_name, column_name, datatype, sort_order, sort_by, schema_name_contains, table_name_contains, column_name_contains):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
@@ -16335,12 +15664,28 @@ def list_peer_target_databases(ctx, from_json, all_pages, page_size, target_data
raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
kwargs = {}
- if if_match is not None:
- kwargs['if_match'] = if_match
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if table_name is not None and len(table_name) > 0:
+ kwargs['table_name'] = table_name
+ if column_name is not None and len(column_name) > 0:
+ kwargs['column_name'] = column_name
+ if datatype is not None and len(datatype) > 0:
+ kwargs['datatype'] = datatype
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if schema_name_contains is not None:
+ kwargs['schema_name_contains'] = schema_name_contains
+ if table_name_contains is not None:
+ kwargs['table_name_contains'] = table_name_contains
+ if column_name_contains is not None:
+ kwargs['column_name_contains'] = column_name_contains
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -16348,75 +15693,77 @@ def list_peer_target_databases(ctx, from_json, all_pages, page_size, target_data
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_peer_target_databases,
+ client.list_columns,
target_database_id=target_database_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_peer_target_databases,
+ client.list_columns,
limit,
page_size,
target_database_id=target_database_id,
**kwargs
)
else:
- result = client.list_peer_target_databases(
+ result = client.list_columns(
target_database_id=target_database_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@profile_group.command(name=cli_util.override('data_safe.list_profile_analytics.command_name', 'list-profile-analytics'), help=u"""Gets a list of aggregated user profile details in the specified compartment. This provides information about the overall profiles available. For example, the user profile details include how many users have the profile assigned and do how many use password verification function. This data is especially useful content for dashboards or to support analytics.
-
-When you perform the ListProfileAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns compartments in which the requestor has INSPECT permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned.
-
-The parameter compartmentIdInSubtree applies when you perform ListProfileAnalytics on the compartmentId passed and when it is set to true, the entire hierarchy of compartments can be returned.
-
-To use ListProfileAnalytics to get a full list of all compartments and subcompartments in the tenancy from the root compartment, set the parameter compartmentIdInSubtree to true and accessLevel to ACCESSIBLE. \n[Command Reference](listProfileAnalytics)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_backup_sets.command_name', 'list-crypto-assessment-backup-sets'), help=u"""Gets backup set summaries across targets in a compartment. Use assessmentId to narrow results to one crypto assessment. \n[Command Reference](listCryptoAssessmentBackupSets)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--assessment-id', help=u"""A filter to return only resources associated with the specified crypto assessment OCID.""")
+@cli_util.option('--assessment-type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return targets from assessments of the specified type.""")
+@cli_util.option('--target-id', help=u"""A filter to return only inventory rows associated with the specified target OCID.""")
+@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
+@cli_util.option('--backup-set-key', help=u"""Filters backup set summary rows to an exact matching backupSetKey.""")
+@cli_util.option('--is-encrypted', type=click.BOOL, help=u"""Filters backup set summary rows by whether the backup set is encrypted.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["setStamp", "backupSetKey", "sizeInGBs", "timeCreated"]), help=u"""The field used to sort backup set results.""")
+@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--profile-name', help=u"""A filter to return only items that match the specified profile name.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
-@json_skeleton_utils.get_cli_json_input_option({})
+@json_skeleton_utils.get_cli_json_input_option({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[ProfileAggregation]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentBackupSetCollection'})
@cli_util.wrap_exceptions
-def list_profile_analytics(ctx, from_json, all_pages, page_size, user_assessment_id, compartment_id, compartment_id_in_subtree, access_level, target_id, limit, page, profile_name, sort_by, sort_order):
+def list_crypto_assessment_backup_sets(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, assessment_id, assessment_type, target_id, target_ids, backup_set_key, is_encrypted, sort_by, sort_order, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
-
kwargs = {}
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
kwargs['access_level'] = access_level
+ if assessment_id is not None:
+ kwargs['assessment_id'] = assessment_id
+ if assessment_type is not None:
+ kwargs['assessment_type'] = assessment_type
if target_id is not None:
kwargs['target_id'] = target_id
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if profile_name is not None:
- kwargs['profile_name'] = profile_name
+ if target_ids is not None and len(target_ids) > 0:
+ kwargs['target_ids'] = target_ids
+ if backup_set_key is not None:
+ kwargs['backup_set_key'] = backup_set_key
+ if is_encrypted is not None:
+ kwargs['is_encrypted'] = is_encrypted
if sort_by is not None:
kwargs['sort_by'] = sort_by
if sort_order is not None:
kwargs['sort_order'] = sort_order
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -16424,114 +15771,112 @@ def list_profile_analytics(ctx, from_json, all_pages, page_size, user_assessment
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_profile_analytics,
- user_assessment_id=user_assessment_id,
+ client.list_crypto_assessment_backup_sets,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_profile_analytics,
+ client.list_crypto_assessment_backup_sets,
limit,
page_size,
- user_assessment_id=user_assessment_id,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_profile_analytics(
- user_assessment_id=user_assessment_id,
+ result = client.list_crypto_assessment_backup_sets(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.list_profile_summaries.command_name', 'list-profile-summaries'), help=u"""Gets a list of user profiles containing the profile details along with the target id and user counts.
+@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_cbom_items.command_name', 'list-crypto-assessment-cbom-items'), help=u"""Lists the CBOM items for the specified crypto assessment. \n[Command Reference](listCryptoAssessmentCbomItems)""")
+@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
+@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': 'data_safe', 'class': 'CryptoAssessmentCbomItemCollection'})
+@cli_util.wrap_exceptions
+def list_crypto_assessment_cbom_items(ctx, from_json, all_pages, crypto_assessment_id):
-The ListProfiles operation returns only the profiles belonging to a certain target. If compartment type user assessment id is provided, then profile information for all the targets belonging to the pertaining compartment is returned. The list does not include any subcompartments of the compartment under consideration.
+ if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
-The parameter 'accessLevel' specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when 'compartmentIdInSubtree' is set to 'true'.
+ kwargs = {}
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.list_crypto_assessment_cbom_items(
+ crypto_assessment_id=crypto_assessment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
-The parameter 'compartmentIdInSubtree' applies when you perform ListUserProfiles on the 'compartmentId' belonging to the assessmentId passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter 'compartmentIdInSubtree' to true and 'accessLevel' to ACCESSIBLE. \n[Command Reference](listProfileSummaries)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+
+@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_certificates.command_name', 'list-crypto-assessment-certificates'), help=u"""Lists certificates discovered across targets in a compartment, including target, wallet location, issuer, subject, validity window, expiry bucket, public key type, and status so expiring or weak certificates can be identified and prioritized. \n[Command Reference](listCryptoAssessmentCertificates)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--profile-name', help=u"""A filter to return only items that match the specified profile name.""")
-@cli_util.option('--is-user-created', type=click.BOOL, help=u"""An optional filter to return the user created profiles.""")
-@cli_util.option('--password-verification-function', help=u"""An optional filter to filter the profiles based on password verification function.""")
-@cli_util.option('--user-count-greater-than-or-equal', help=u"""An optional filter to return the profiles having user count greater than or equal to the provided value.""")
-@cli_util.option('--user-count-less-than', help=u"""An optional filter to return the profiles having user count less than the provided value.""")
-@cli_util.option('--failed-login-attempts-greater-than-or-equal', help=u"""An optional filter to return the profiles having allow failed login attempts number greater than or equal to the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
-@cli_util.option('--failed-login-attempts-less-than', help=u"""An optional filter to return the profiles having failed login attempts number less than the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
-@cli_util.option('--sessions-per-user-greater-than-or-equal', help=u"""An optional filter to return the profiles permitting the user to spawn multiple sessions having count. greater than or equal to the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
-@cli_util.option('--sessions-per-user-less-than', help=u"""An optional filter to return the profiles permitting the user to spawn multiple sessions having count less than the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
-@cli_util.option('--inactive-account-time-greater-than-or-equal', help=u"""An optional filter to return the profiles allowing inactive account time in days greater than or equal to the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
-@cli_util.option('--inactive-account-time-less-than', help=u"""An optional filter to return the profiles allowing inactive account time in days less than the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
-@cli_util.option('--password-lock-time-greater-than-or-equal', help=u"""An optional filter to return the profiles having password lock number greater than or equal to the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
-@cli_util.option('--password-lock-time-less-than', help=u"""An optional filter to return the profiles having password lock number less than the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["profileName", "targetId", "isUserCreated", "passwordVerificationFunction", "userCount", "sessionsPerUser", "inactiveAccountTime", "passwordLockTime", "failedLoginAttempts"]), help=u"""The field to sort by. You can specify only one sort order (sortOrder). The default order is targetId ASC.""")
+@cli_util.option('--assessment-id', help=u"""A filter to return only resources associated with the specified crypto assessment OCID.""")
+@cli_util.option('--assessment-type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return targets from assessments of the specified type.""")
+@cli_util.option('--target-id', help=u"""A filter to return only inventory rows associated with the specified target OCID.""")
+@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
+@cli_util.option('--certificate-type', type=custom_types.CliCaseInsensitiveChoice(["SERVER", "USER", "TRUSTED"]), multiple=True, help=u"""A filter to return only certificates of any of the specified types.""")
+@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["VALID", "EXPIRING_SOON", "EXPIRED", "INVALID", "IN_USE"]), multiple=True, help=u"""A filter to return only certificates with any of the specified statuses.""")
+@cli_util.option('--public-key-type', multiple=True, help=u"""A filter to return only certificates with any of the specified public key types. Stored values are normalized forms such as RSA2048, RSA4096, or EC256.""")
+@cli_util.option('--signature-algorithm', multiple=True, help=u"""A filter to return only certificates whose signature algorithm contains any of the specified values. For example, use SHA1 to match SHA1-based certificate signatures.""")
+@cli_util.option('--expiry-bucket', help=u"""A filter to return only certificates in the specified expiry bucket. Supported values are 0_15, 15_30, 30_60, 60_90, and 90_PLUS.""")
+@cli_util.option('--days-to-expiry', type=click.INT, help=u"""A filter to return certificates whose validTill timestamp is on or before the current time plus the specified number of days. Negative values are allowed and filter certificates that expired on or before that many days ago.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeValidUntil", "subject"]), help=u"""The field used to sort certificate results.""")
@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({})
+@json_skeleton_utils.get_cli_json_input_option({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'public-key-type': {'module': 'data_safe', 'class': 'list[string]'}, 'signature-algorithm': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[ProfileSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'public-key-type': {'module': 'data_safe', 'class': 'list[string]'}, 'signature-algorithm': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentCertificateCollection'})
@cli_util.wrap_exceptions
-def list_profile_summaries(ctx, from_json, all_pages, page_size, user_assessment_id, compartment_id, compartment_id_in_subtree, access_level, target_id, limit, page, profile_name, is_user_created, password_verification_function, user_count_greater_than_or_equal, user_count_less_than, failed_login_attempts_greater_than_or_equal, failed_login_attempts_less_than, sessions_per_user_greater_than_or_equal, sessions_per_user_less_than, inactive_account_time_greater_than_or_equal, inactive_account_time_less_than, password_lock_time_greater_than_or_equal, password_lock_time_less_than, sort_by, sort_order):
+def list_crypto_assessment_certificates(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, assessment_id, assessment_type, target_id, target_ids, certificate_type, status, public_key_type, signature_algorithm, expiry_bucket, days_to_expiry, sort_by, sort_order, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
-
kwargs = {}
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
kwargs['access_level'] = access_level
+ if assessment_id is not None:
+ kwargs['assessment_id'] = assessment_id
+ if assessment_type is not None:
+ kwargs['assessment_type'] = assessment_type
if target_id is not None:
kwargs['target_id'] = target_id
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if profile_name is not None:
- kwargs['profile_name'] = profile_name
- if is_user_created is not None:
- kwargs['is_user_created'] = is_user_created
- if password_verification_function is not None:
- kwargs['password_verification_function'] = password_verification_function
- if user_count_greater_than_or_equal is not None:
- kwargs['user_count_greater_than_or_equal'] = user_count_greater_than_or_equal
- if user_count_less_than is not None:
- kwargs['user_count_less_than'] = user_count_less_than
- if failed_login_attempts_greater_than_or_equal is not None:
- kwargs['failed_login_attempts_greater_than_or_equal'] = failed_login_attempts_greater_than_or_equal
- if failed_login_attempts_less_than is not None:
- kwargs['failed_login_attempts_less_than'] = failed_login_attempts_less_than
- if sessions_per_user_greater_than_or_equal is not None:
- kwargs['sessions_per_user_greater_than_or_equal'] = sessions_per_user_greater_than_or_equal
- if sessions_per_user_less_than is not None:
- kwargs['sessions_per_user_less_than'] = sessions_per_user_less_than
- if inactive_account_time_greater_than_or_equal is not None:
- kwargs['inactive_account_time_greater_than_or_equal'] = inactive_account_time_greater_than_or_equal
- if inactive_account_time_less_than is not None:
- kwargs['inactive_account_time_less_than'] = inactive_account_time_less_than
- if password_lock_time_greater_than_or_equal is not None:
- kwargs['password_lock_time_greater_than_or_equal'] = password_lock_time_greater_than_or_equal
- if password_lock_time_less_than is not None:
- kwargs['password_lock_time_less_than'] = password_lock_time_less_than
+ if target_ids is not None and len(target_ids) > 0:
+ kwargs['target_ids'] = target_ids
+ if certificate_type is not None and len(certificate_type) > 0:
+ kwargs['certificate_type'] = certificate_type
+ if status is not None and len(status) > 0:
+ kwargs['status'] = status
+ if public_key_type is not None and len(public_key_type) > 0:
+ kwargs['public_key_type'] = public_key_type
+ if signature_algorithm is not None and len(signature_algorithm) > 0:
+ kwargs['signature_algorithm'] = signature_algorithm
+ if expiry_bucket is not None:
+ kwargs['expiry_bucket'] = expiry_bucket
+ if days_to_expiry is not None:
+ kwargs['days_to_expiry'] = days_to_expiry
if sort_by is not None:
kwargs['sort_by'] = sort_by
if sort_order is not None:
kwargs['sort_order'] = sort_order
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -16539,74 +15884,68 @@ def list_profile_summaries(ctx, from_json, all_pages, page_size, user_assessment
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_profile_summaries,
- user_assessment_id=user_assessment_id,
+ client.list_crypto_assessment_certificates,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_profile_summaries,
+ client.list_crypto_assessment_certificates,
limit,
page_size,
- user_assessment_id=user_assessment_id,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_profile_summaries(
- user_assessment_id=user_assessment_id,
+ result = client.list_crypto_assessment_certificates(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@referential_relation_group.command(name=cli_util.override('data_safe.list_referential_relations.command_name', 'list'), help=u"""Gets a list of referential relations present in the specified sensitive data model based on the specified query parameters. \n[Command Reference](listReferentialRelations)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
-@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
-@cli_util.option('--is-sensitive', type=click.BOOL, help=u"""Returns referential relations containing sensitive columns when true. Returns referential relations containing non sensitive columns when false.""")
-@cli_util.option('--relation-type', type=custom_types.CliCaseInsensitiveChoice(["NONE", "APP_DEFINED", "DB_DEFINED"]), multiple=True, help=u"""A filter to return sensitive columns based on their relationship with their parent columns. If set to NONE, it returns the sensitive columns that do not have any parent. The response includes the parent columns as well as the independent columns that are not in any relationship. If set to APP_DEFINED, it returns all the child columns that have application-level (non-dictionary) relationship with their parents. If set to DB_DEFINED, it returns all the child columns that have database-level (dictionary-defined) relationship with their parents.""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_finding_analytics.command_name', 'list-crypto-assessment-finding-analytics'), help=u"""Lists findings in a compartment with the number of affected targets. \n[Command Reference](listCryptoAssessmentFindingAnalytics)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--category', type=custom_types.CliCaseInsensitiveChoice(["NETWORK_ENCRYPTION", "DATA_ENCRYPTION", "CERTIFICATES_AND_KEY_MANAGEMENT", "BACKUP_AND_EXPORT_ENCRYPTION", "POST_QUANTUM_READINESS", "NOT_SUPPORTED"]), help=u"""A filter to return only findings in the specified category key.""")
+@cli_util.option('--finding-key', multiple=True, help=u"""A filter to return only findings with any of the specified finding keys.""")
+@cli_util.option('--is-quantum-readiness-check', type=click.BOOL, help=u"""A filter to return only findings that are or are not part of quantum-readiness checks.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["targetCount", "priority"]), help=u"""The field used to sort finding analytics results.""")
+@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["key", "relationType", "schemaName", "tableName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for key is descending.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
-@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.get_cli_json_input_option({'finding-key': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'ReferentialRelationCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'finding-key': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentFindingAnalyticsCollection'})
@cli_util.wrap_exceptions
-def list_referential_relations(ctx, from_json, all_pages, page_size, sensitive_data_model_id, schema_name, object_name, column_name, is_sensitive, relation_type, limit, page, sort_order, sort_by):
+def list_crypto_assessment_finding_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, category, finding_key, is_quantum_readiness_check, sort_by, sort_order, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
-
kwargs = {}
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if object_name is not None and len(object_name) > 0:
- kwargs['object_name'] = object_name
- if column_name is not None and len(column_name) > 0:
- kwargs['column_name'] = column_name
- if is_sensitive is not None:
- kwargs['is_sensitive'] = is_sensitive
- if relation_type is not None and len(relation_type) > 0:
- kwargs['relation_type'] = relation_type
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if category is not None:
+ kwargs['category'] = category
+ if finding_key is not None and len(finding_key) > 0:
+ kwargs['finding_key'] = finding_key
+ if is_quantum_readiness_check is not None:
+ kwargs['is_quantum_readiness_check'] = is_quantum_readiness_check
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if 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_safe', 'data_safe', ctx)
if all_pages:
@@ -16614,74 +15953,75 @@ def list_referential_relations(ctx, from_json, all_pages, page_size, sensitive_d
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_referential_relations,
- sensitive_data_model_id=sensitive_data_model_id,
+ client.list_crypto_assessment_finding_analytics,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_referential_relations,
+ client.list_crypto_assessment_finding_analytics,
limit,
page_size,
- sensitive_data_model_id=sensitive_data_model_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_referential_relations(
- sensitive_data_model_id=sensitive_data_model_id,
+ result = client.list_crypto_assessment_finding_analytics(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@report_definition_group.command(name=cli_util.override('data_safe.list_report_definitions.command_name', 'list'), help=u"""Gets a list of report definitions. The ListReportDefinitions operation returns only the report definitions in the specified `compartmentId`. It also returns the seeded report definitions which are available to all the compartments. \n[Command Reference](listReportDefinitions)""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_finding_targets.command_name', 'list-crypto-assessment-finding-targets'), help=u"""For a selected finding, lists targets where it occurs in assessments. \n[Command Reference](listCryptoAssessmentFindingTargets)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--finding-key', required=True, multiple=True, help=u"""The finding keys for which target occurrences are listed.""")
+@cli_util.option('--assessment-type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return targets from assessments of the specified type.""")
+@cli_util.option('--target-id', help=u"""Filters results to targets with an exact matching target OCID.""")
+@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
+@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["PASS", "FAIL", "ERROR", "EVALUATE", "NOT_AVAILABLE", "NOT_APPLICABLE", "NOT_SUPPORTED"]), help=u"""A filter to return only finding target rows with the specified status.""")
+@cli_util.option('--is-quantum-readiness-check', type=click.BOOL, help=u"""A filter to return only findings that are or are not part of quantum-readiness checks.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "databaseVersion"]), help=u"""The field used to sort finding target results.""")
+@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('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""The name of the report definition to query.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME", "DISPLAYORDER"]), help=u"""The field used for sorting. Only one sorting parameter order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
-@cli_util.option('--is-seeded', type=click.BOOL, help=u"""A boolean flag indicating to list seeded report definitions. Set this parameter to get list of seeded report definitions.""")
-@cli_util.option('--data-source', type=custom_types.CliCaseInsensitiveChoice(["EVENTS", "ALERTS", "SECURITY_ASSESSMENT", "CRYPTO_ASSESSMENT", "VIOLATIONS", "ALLOWED_SQL"]), help=u"""Specifies the name of a resource that provides data for the report. For example alerts, events.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""An optional filter to return only resources that match the specified lifecycle state.""")
-@cli_util.option('--category', type=custom_types.CliCaseInsensitiveChoice(["CUSTOM_REPORTS", "SUMMARY", "ACTIVITY_AUDITING", "CRYPTO_ASSESSMENT"]), help=u"""An optional filter to return only resources that match the specified category.""")
@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({})
+@json_skeleton_utils.get_cli_json_input_option({'finding-key': {'module': 'data_safe', 'class': 'list[string]'}, 'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'ReportDefinitionCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'finding-key': {'module': 'data_safe', 'class': 'list[string]'}, 'target-ids': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentFindingTargetCollection'})
@cli_util.wrap_exceptions
-def list_report_definitions(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, sort_order, sort_by, is_seeded, data_source, lifecycle_state, category):
+def list_crypto_assessment_finding_targets(ctx, from_json, all_pages, page_size, compartment_id, finding_key, assessment_type, target_id, target_ids, status, is_quantum_readiness_check, sort_by, sort_order, compartment_id_in_subtree, access_level, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
kwargs = {}
+ if assessment_type is not None:
+ kwargs['assessment_type'] = assessment_type
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_ids is not None and len(target_ids) > 0:
+ kwargs['target_ids'] = target_ids
+ if status is not None:
+ kwargs['status'] = status
+ if is_quantum_readiness_check is not None:
+ kwargs['is_quantum_readiness_check'] = is_quantum_readiness_check
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if is_seeded is not None:
- kwargs['is_seeded'] = is_seeded
- if data_source is not None:
- kwargs['data_source'] = data_source
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if category is not None:
- kwargs['category'] = category
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -16689,87 +16029,68 @@ def list_report_definitions(ctx, from_json, all_pages, page_size, compartment_id
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_report_definitions,
+ client.list_crypto_assessment_finding_targets,
compartment_id=compartment_id,
+ finding_key=finding_key,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_report_definitions,
+ client.list_crypto_assessment_finding_targets,
limit,
page_size,
compartment_id=compartment_id,
+ finding_key=finding_key,
**kwargs
)
else:
- result = client.list_report_definitions(
+ result = client.list_crypto_assessment_finding_targets(
compartment_id=compartment_id,
+ finding_key=finding_key,
**kwargs
)
cli_util.render_response(result, ctx)
-@report_summary_group.command(name=cli_util.override('data_safe.list_reports.command_name', 'list-reports'), help=u"""Gets a list of all the reports in the compartment. It contains information such as report generation time. \n[Command Reference](listReports)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""The name of the report definition to query.""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_findings.command_name', 'list-crypto-assessment-findings'), help=u"""Lists crypto deviation findings for the specified crypto assessment. \n[Command Reference](listCryptoAssessmentFindings)""")
+@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
+@cli_util.option('--finding-key', help=u"""A filter to return only findings with the specified finding key.""")
+@cli_util.option('--title', help=u"""A filter to return only findings with the specified title.""")
+@cli_util.option('--category', type=custom_types.CliCaseInsensitiveChoice(["NETWORK_ENCRYPTION", "DATA_ENCRYPTION", "CERTIFICATES_AND_KEY_MANAGEMENT", "BACKUP_AND_EXPORT_ENCRYPTION", "POST_QUANTUM_READINESS", "NOT_SUPPORTED"]), help=u"""A filter to return only findings in the specified category key.""")
+@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["PASS", "FAIL", "ERROR", "EVALUATE", "NOT_AVAILABLE", "NOT_APPLICABLE", "NOT_SUPPORTED"]), help=u"""A filter to return only findings with the specified status.""")
+@cli_util.option('--is-quantum-readiness-check', type=click.BOOL, help=u"""A filter to return only findings that are or are not part of quantum-readiness checks.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeGenerated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeGenerated is descending. Default order for displayName is ascending. If no value is specified timeGenerated is default.""")
-@cli_util.option('--mime-type', type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS", "JSON"]), help=u"""An optional filter to return only resources that match the specified mime type.""")
-@cli_util.option('--report-definition-id', help=u"""The ID of the report definition to filter the list of reports""")
-@cli_util.option('--time-generated-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were generated after the specified date and time, as defined by [RFC3339]. Using TimeGeneratedGreaterThanOrEqualToQueryParam parameter retrieves all resources generated after that date.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-generated-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were generated before a specific date. Specifying this parameter corresponding `timeGeneratedLessThan` parameter will retrieve all resources generated before the specified generated date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["UPDATING", "ACTIVE", "CREATING", "FAILED"]), help=u"""An optional filter to return only resources that match the specified lifecycle state.""")
-@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["GENERATED", "SCHEDULED"]), help=u"""An optional filter to return only resources that match the specified type.""")
-@cli_util.option('--data-source', type=custom_types.CliCaseInsensitiveChoice(["EVENTS", "ALERTS", "SECURITY_ASSESSMENT", "CRYPTO_ASSESSMENT", "VIOLATIONS", "ALLOWED_SQL"]), help=u"""Specifies the name of a resource that provides data for the report. For example alerts, events.""")
@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_safe', 'class': 'ReportCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentFindingCollection'})
@cli_util.wrap_exceptions
-def list_reports(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, sort_order, sort_by, mime_type, report_definition_id, time_generated_greater_than_or_equal_to, time_generated_less_than, lifecycle_state, type, data_source):
+def list_crypto_assessment_findings(ctx, from_json, all_pages, page_size, crypto_assessment_id, finding_key, title, category, status, is_quantum_readiness_check, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
+
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
+ if finding_key is not None:
+ kwargs['finding_key'] = finding_key
+ if title is not None:
+ kwargs['title'] = title
+ if category is not None:
+ kwargs['category'] = category
+ if status is not None:
+ kwargs['status'] = status
+ if is_quantum_readiness_check is not None:
+ kwargs['is_quantum_readiness_check'] = is_quantum_readiness_check
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if mime_type is not None:
- kwargs['mime_type'] = mime_type
- if report_definition_id is not None:
- kwargs['report_definition_id'] = report_definition_id
- if time_generated_greater_than_or_equal_to is not None:
- kwargs['time_generated_greater_than_or_equal_to'] = time_generated_greater_than_or_equal_to
- if time_generated_less_than is not None:
- kwargs['time_generated_less_than'] = time_generated_less_than
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if type is not None:
- kwargs['type'] = type
- if data_source is not None:
- kwargs['data_source'] = data_source
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -16777,50 +16098,79 @@ def list_reports(ctx, from_json, all_pages, page_size, compartment_id, compartme
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_reports,
- compartment_id=compartment_id,
+ client.list_crypto_assessment_findings,
+ crypto_assessment_id=crypto_assessment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_reports,
+ client.list_crypto_assessment_findings,
limit,
page_size,
- compartment_id=compartment_id,
+ crypto_assessment_id=crypto_assessment_id,
**kwargs
)
else:
- result = client.list_reports(
- compartment_id=compartment_id,
+ result = client.list_crypto_assessment_findings(
+ crypto_assessment_id=crypto_assessment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@role_grant_path_collection_group.command(name=cli_util.override('data_safe.list_role_grant_paths.command_name', 'list-role-grant-paths'), help=u"""Retrieves a list of all role grant paths for a particular user.
-
-The ListRoleGrantPaths operation returns only the role grant paths for the specified security policy report. \n[Command Reference](listRoleGrantPaths)""")
-@cli_util.option('--security-policy-report-id', required=True, help=u"""The OCID of the security policy report resource.""")
-@cli_util.option('--grantee', required=True, help=u"""A filter to return only items that match the specified grantee.""")
-@cli_util.option('--granted-role', required=True, help=u"""A filter to return only items that match the specified role.""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_keys.command_name', 'list-crypto-assessment-keys'), help=u"""Gets a paginated list of cryptographic keys across targets in a compartment. Use assessmentId to narrow results to one crypto assessment. \n[Command Reference](listCryptoAssessmentKeys)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--assessment-id', help=u"""A filter to return only resources associated with the specified crypto assessment OCID.""")
+@cli_util.option('--assessment-type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return targets from assessments of the specified type.""")
+@cli_util.option('--target-id', help=u"""A filter to return only inventory rows associated with the specified target OCID.""")
+@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
+@cli_util.option('--feature', type=custom_types.CliCaseInsensitiveChoice(["TDE", "TLS", "NNE"]), help=u"""A filter to return only records for the specified feature.""")
+@cli_util.option('--key-id', help=u"""Filters key results to rows with an exact matching keyId.""")
+@cli_util.option('--key-type', type=custom_types.CliCaseInsensitiveChoice(["MASTER_KEY", "ENCRYPTION_KEY"]), help=u"""Filters key results to rows with the specified key type.""")
+@cli_util.option('--key-manager-type', type=custom_types.CliCaseInsensitiveChoice(["FILE", "OKV", "HSM", "NOT_CONFIGURED", "NOT_APPLICABLE", "NOT_AVAILABLE", "UNKNOWN", "NOT_SUPPORTED"]), multiple=True, help=u"""Filters key results to rows whose primary or secondary keystore type matches any of the specified key manager types.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated"]), help=u"""The field used to sort key results.""")
+@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({})
+@json_skeleton_utils.get_cli_json_input_option({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'RoleGrantPathCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentKeyCollection'})
@cli_util.wrap_exceptions
-def list_role_grant_paths(ctx, from_json, all_pages, page_size, security_policy_report_id, grantee, granted_role, limit, page):
+def list_crypto_assessment_keys(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, assessment_id, assessment_type, target_id, target_ids, feature, key_id, key_type, key_manager_type, sort_by, sort_order, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(security_policy_report_id, six.string_types) and len(security_policy_report_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-report-id cannot be whitespace or empty string')
-
kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if assessment_id is not None:
+ kwargs['assessment_id'] = assessment_id
+ if assessment_type is not None:
+ kwargs['assessment_type'] = assessment_type
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_ids is not None and len(target_ids) > 0:
+ kwargs['target_ids'] = target_ids
+ if feature is not None:
+ kwargs['feature'] = feature
+ if key_id is not None:
+ kwargs['key_id'] = key_id
+ if key_type is not None:
+ kwargs['key_type'] = key_type
+ if key_manager_type is not None and len(key_manager_type) > 0:
+ kwargs['key_manager_type'] = key_manager_type
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
if limit is not None:
kwargs['limit'] = limit
if page is not None:
@@ -16832,74 +16182,81 @@ def list_role_grant_paths(ctx, from_json, all_pages, page_size, security_policy_
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_role_grant_paths,
- security_policy_report_id=security_policy_report_id,
- grantee=grantee,
- granted_role=granted_role,
+ client.list_crypto_assessment_keys,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_role_grant_paths,
+ client.list_crypto_assessment_keys,
limit,
page_size,
- security_policy_report_id=security_policy_report_id,
- grantee=grantee,
- granted_role=granted_role,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_role_grant_paths(
- security_policy_report_id=security_policy_report_id,
- grantee=grantee,
- granted_role=granted_role,
+ result = client.list_crypto_assessment_keys(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.list_roles.command_name', 'list-roles'), help=u"""Returns a list of role metadata objects. \n[Command Reference](listRoles)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_tde_objects.command_name', 'list-crypto-assessment-tde-objects'), help=u"""Lists TDE object encryption summaries across targets in a compartment. Use assessmentId to narrow results to one crypto assessment, and objectType to return either tablespace-level or column-level TDE observations. \n[Command Reference](listCryptoAssessmentTdeObjects)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--object-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["TABLESPACE", "COLUMN"]), help=u"""A required filter to return only TDE objects of the specified type.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--assessment-id', help=u"""A filter to return only resources associated with the specified crypto assessment OCID.""")
+@cli_util.option('--assessment-type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return targets from assessments of the specified type.""")
+@cli_util.option('--target-id', help=u"""A filter to return only inventory rows associated with the specified target OCID.""")
+@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
+@cli_util.option('--quantum-readiness', type=custom_types.CliCaseInsensitiveChoice(["RESISTANT", "NOT_RESISTANT", "NOT_AVAILABLE", "NOT_APPLICABLE", "NOT_SUPPORTED"]), help=u"""Filters TDE object summary rows by quantum-readiness category.""")
+@cli_util.option('--encryption-observed', multiple=True, help=u"""Filters TDE object summary rows by any of the specified observed encryption algorithms.""")
+@cli_util.option('--encryption-status', type=custom_types.CliCaseInsensitiveChoice(["ENCRYPTED", "UNENCRYPTED", "NOT_SUPPORTED"]), help=u"""Filters TDE object summary rows by derived encryption status. NOT_SUPPORTED maps to rows where encryptionObserved is NOT_SUPPORTED, UNENCRYPTED maps to rows where encryptionObserved is null or NONE, and ENCRYPTED maps to rows where the observed encryption algorithm is any other value.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["tablespaceName", "columnName", "quantumReadiness"]), help=u"""The field used to sort TDE object summary results.""")
+@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--role-name', multiple=True, help=u"""A filter to return only a specific role based on role name.""")
-@cli_util.option('--is-oracle-maintained', type=click.BOOL, help=u"""A filter to return roles based on whether they are maintained by oracle or not.""")
-@cli_util.option('--authentication-type', help=u"""A filter to return roles based on authentication type.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["ROLENAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified.""")
-@cli_util.option('--role-name-contains', help=u"""A filter to return only items if role name contains a specific string.""")
@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({'role-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.get_cli_json_input_option({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'encryption-observed': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'role-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'list[RoleSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'encryption-observed': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentTdeObjectCollection'})
@cli_util.wrap_exceptions
-def list_roles(ctx, from_json, all_pages, page_size, target_database_id, limit, page, role_name, is_oracle_maintained, authentication_type, sort_order, sort_by, role_name_contains):
+def list_crypto_assessment_tde_objects(ctx, from_json, all_pages, page_size, compartment_id, object_type, compartment_id_in_subtree, access_level, assessment_id, assessment_type, target_id, target_ids, quantum_readiness, encryption_observed, encryption_status, sort_by, sort_order, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
-
kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if assessment_id is not None:
+ kwargs['assessment_id'] = assessment_id
+ if assessment_type is not None:
+ kwargs['assessment_type'] = assessment_type
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_ids is not None and len(target_ids) > 0:
+ kwargs['target_ids'] = target_ids
+ if quantum_readiness is not None:
+ kwargs['quantum_readiness'] = quantum_readiness
+ if encryption_observed is not None and len(encryption_observed) > 0:
+ kwargs['encryption_observed'] = encryption_observed
+ if encryption_status is not None:
+ kwargs['encryption_status'] = encryption_status
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if role_name is not None and len(role_name) > 0:
- kwargs['role_name'] = role_name
- if is_oracle_maintained is not None:
- kwargs['is_oracle_maintained'] = is_oracle_maintained
- if authentication_type is not None:
- kwargs['authentication_type'] = authentication_type
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if role_name_contains is not None:
- kwargs['role_name_contains'] = role_name_contains
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -16907,65 +16264,80 @@ def list_roles(ctx, from_json, all_pages, page_size, target_database_id, limit,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_roles,
- target_database_id=target_database_id,
+ client.list_crypto_assessment_tde_objects,
+ compartment_id=compartment_id,
+ object_type=object_type,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_roles,
+ client.list_crypto_assessment_tde_objects,
limit,
page_size,
- target_database_id=target_database_id,
+ compartment_id=compartment_id,
+ object_type=object_type,
**kwargs
)
else:
- result = client.list_roles(
- target_database_id=target_database_id,
+ result = client.list_crypto_assessment_tde_objects(
+ compartment_id=compartment_id,
+ object_type=object_type,
**kwargs
)
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.list_schemas.command_name', 'list-schemas'), help=u"""Returns list of schema. \n[Command Reference](listSchemas)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessment_wallets.command_name', 'list-crypto-assessment-wallets'), help=u"""Gets wallet details across targets in a compartment. Use assessmentId to narrow results to one crypto assessment. \n[Command Reference](listCryptoAssessmentWallets)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--assessment-id', help=u"""A filter to return only resources associated with the specified crypto assessment OCID.""")
+@cli_util.option('--assessment-type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return targets from assessments of the specified type.""")
+@cli_util.option('--target-id', help=u"""A filter to return only inventory rows associated with the specified target OCID.""")
+@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
+@cli_util.option('--feature', type=custom_types.CliCaseInsensitiveChoice(["TDE", "TLS", "NNE", "ZDLRA"]), help=u"""A filter to return only wallets for the specified feature.""")
+@cli_util.option('--wallet-encryption-algorithm', multiple=True, help=u"""A filter to return only wallets whose encryption algorithm exactly matches any of the specified values, case-insensitively.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["feature", "timeCreated"]), help=u"""The field used to sort wallet results.""")
+@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["SCHEMANAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified.""")
-@cli_util.option('--is-oracle-maintained', type=click.BOOL, help=u"""A filter to return only items related to specific type of schema.""")
-@cli_util.option('--schema-name-contains', help=u"""A filter to return only items if schema name contains a specific string.""")
@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.get_cli_json_input_option({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'wallet-encryption-algorithm': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'list[SchemaSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'wallet-encryption-algorithm': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentWalletCollection'})
@cli_util.wrap_exceptions
-def list_schemas(ctx, from_json, all_pages, page_size, target_database_id, limit, page, schema_name, sort_order, sort_by, is_oracle_maintained, schema_name_contains):
+def list_crypto_assessment_wallets(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, assessment_id, assessment_type, target_id, target_ids, feature, wallet_encryption_algorithm, sort_by, sort_order, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
-
kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if assessment_id is not None:
+ kwargs['assessment_id'] = assessment_id
+ if assessment_type is not None:
+ kwargs['assessment_type'] = assessment_type
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_ids is not None and len(target_ids) > 0:
+ kwargs['target_ids'] = target_ids
+ if feature is not None:
+ kwargs['feature'] = feature
+ if wallet_encryption_algorithm is not None and len(wallet_encryption_algorithm) > 0:
+ kwargs['wallet_encryption_algorithm'] = wallet_encryption_algorithm
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if is_oracle_maintained is not None:
- kwargs['is_oracle_maintained'] = is_oracle_maintained
- if schema_name_contains is not None:
- kwargs['schema_name_contains'] = schema_name_contains
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -16973,46 +16345,52 @@ def list_schemas(ctx, from_json, all_pages, page_size, target_database_id, limit
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_schemas,
- target_database_id=target_database_id,
+ client.list_crypto_assessment_wallets,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_schemas,
+ client.list_crypto_assessment_wallets,
limit,
page_size,
- target_database_id=target_database_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_schemas(
- target_database_id=target_database_id,
+ result = client.list_crypto_assessment_wallets(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sdm_masking_policy_difference_group.command(name=cli_util.override('data_safe.list_sdm_masking_policy_differences.command_name', 'list'), help=u"""Gets a list of SDM and masking policy difference resources based on the specified query parameters. \n[Command Reference](listSdmMaskingPolicyDifferences)""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.list_crypto_assessments.command_name', 'list'), help=u"""Gets a list of crypto assessments with filtering and pagination support. \n[Command Reference](listCryptoAssessments)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--difference-access-level', type=custom_types.CliCaseInsensitiveChoice(["ACCESSIBLE"]), help=u"""Valid value is ACCESSIBLE. Default is ACCESSIBLE. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment).""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle states.""")
-@cli_util.option('--masking-policy-id', help=u"""A filter to return only the resources that match the specified masking policy OCID.""")
+@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED"]), help=u"""A filter to return only crypto assessments that match the specified type.""")
+@cli_util.option('--assessment-id', help=u"""A filter to return only resources associated with the specified crypto assessment OCID.""")
+@cli_util.option('--target-id', help=u"""A filter to return only crypto assessments associated with the specified target OCID. When provided, targetType must also be specified.""")
+@cli_util.option('--target-ids', multiple=True, help=u"""A filter to return only resources associated with any of the specified target OCIDs.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A filter to return crypto assessments belonging to the specified target type. `ListCryptoAssessments` returns assessment rows; use `targetDatabaseGroupId` to list the underlying target database assessments for a group.""")
+@cli_util.option('--posture-category', type=custom_types.CliCaseInsensitiveChoice(["QUANTUM_RESISTANT", "QUANTUM_CAPABLE", "UPGRADE_RECOMMENDED"]), multiple=True, help=u"""A filter to return only crypto assessments that match any of the specified posture categories.""")
+@cli_util.option('--is-assessment-scheduled', type=click.BOOL, help=u"""A filter to return only crypto assessments whose scheduled execution state matches the specified value.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only resources that match the specified lifecycle state.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["issueCount", "timeCreated", "timeUpdated"]), help=u"""The field used to sort crypto assessments. You can specify only one sort order (sortOrder).""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreationStarted", "displayName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreationStarted is descending. The default order for displayName is ascending.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({})
+@json_skeleton_utils.get_cli_json_input_option({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SdmMaskingPolicyDifferenceCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'CryptoAssessmentCollection'})
@cli_util.wrap_exceptions
-def list_sdm_masking_policy_differences(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, difference_access_level, display_name, sensitive_data_model_id, lifecycle_state, masking_policy_id, sort_order, sort_by, limit, page):
+def list_crypto_assessments(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, type, assessment_id, target_id, target_ids, target_database_group_id, target_type, posture_category, is_assessment_scheduled, lifecycle_state, sort_by, sort_order, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
@@ -17020,20 +16398,32 @@ def list_sdm_masking_policy_differences(ctx, from_json, all_pages, page_size, co
kwargs = {}
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if difference_access_level is not None:
- kwargs['difference_access_level'] = difference_access_level
+ if access_level is not None:
+ kwargs['access_level'] = access_level
if display_name is not None:
kwargs['display_name'] = display_name
- if sensitive_data_model_id is not None:
- kwargs['sensitive_data_model_id'] = sensitive_data_model_id
+ if type is not None:
+ kwargs['type'] = type
+ if assessment_id is not None:
+ kwargs['assessment_id'] = assessment_id
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_ids is not None and len(target_ids) > 0:
+ kwargs['target_ids'] = target_ids
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ if target_type is not None:
+ kwargs['target_type'] = target_type
+ if posture_category is not None and len(posture_category) > 0:
+ kwargs['posture_category'] = posture_category
+ if is_assessment_scheduled is not None:
+ kwargs['is_assessment_scheduled'] = is_assessment_scheduled
if lifecycle_state is not None:
kwargs['lifecycle_state'] = lifecycle_state
- if masking_policy_id is not None:
- kwargs['masking_policy_id'] = masking_policy_id
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
if limit is not None:
kwargs['limit'] = limit
if page is not None:
@@ -17045,108 +16435,68 @@ def list_sdm_masking_policy_differences(ctx, from_json, all_pages, page_size, co
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sdm_masking_policy_differences,
+ client.list_crypto_assessments,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sdm_masking_policy_differences,
+ client.list_crypto_assessments,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_sdm_masking_policy_differences(
+ result = client.list_crypto_assessments(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.list_security_assessments.command_name', 'list'), help=u"""Gets a list of security assessments.
-
-The ListSecurityAssessments operation returns only the assessments in the specified `compartmentId`. The list does not include any subcompartments of the compartmentId passed.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform ListSecurityAssessments on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSecurityAssessments)""")
+@data_safe_private_endpoint_group.command(name=cli_util.override('data_safe.list_data_safe_private_endpoints.command_name', 'list'), help=u"""Gets a list of Data Safe private endpoints. \n[Command Reference](listDataSafePrivateEndpoints)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED", "SAVE_SCHEDULE", "COMPARTMENT", "TEMPLATE", "TEMPLATE_BASELINE"]), help=u"""A filter to return only items that match the specified security assessment type.""")
-@cli_util.option('--schedule-assessment-id', help=u"""The OCID of the security assessment of type SAVE_SCHEDULE.""")
-@cli_util.option('--is-schedule-assessment', type=click.BOOL, help=u"""A filter to return only security assessments of type save schedule.""")
-@cli_util.option('--triggered-by', type=custom_types.CliCaseInsensitiveChoice(["USER", "SYSTEM"]), help=u"""A filter to return only security assessments that were created by either user or system.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@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('--is-baseline', type=click.BOOL, help=u"""A filter to return only the security assessments that are set as a baseline.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName", "timeLastAssessed", "timeUpdated"]), help=u"""The field to sort by. You can specify only one sort order(sortOrder). The default order for timeCreated is descending.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--vcn-id', help=u"""A filter to return only resources that match the specified VCN OCID.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "NA"]), help=u"""A filter to return only resources that match the specified lifecycle state.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "SUCCEEDED", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only resources that match the specified lifecycle state.""")
-@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A filter to return only only target database resources or target database group resources.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--template-assessment-id', help=u"""The OCID of the security assessment of type TEMPLATE.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@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_safe', 'class': 'list[SecurityAssessmentSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[DataSafePrivateEndpointSummary]'})
@cli_util.wrap_exceptions
-def list_security_assessments(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, type, schedule_assessment_id, is_schedule_assessment, triggered_by, target_id, sort_order, is_baseline, sort_by, time_created_greater_than_or_equal_to, time_created_less_than, limit, page, lifecycle_state, target_type, target_database_group_id, template_assessment_id):
+def list_data_safe_private_endpoints(ctx, from_json, all_pages, page_size, compartment_id, display_name, vcn_id, lifecycle_state, limit, page, sort_order, sort_by, compartment_id_in_subtree, access_level):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
if display_name is not None:
kwargs['display_name'] = display_name
- if type is not None:
- kwargs['type'] = type
- if schedule_assessment_id is not None:
- kwargs['schedule_assessment_id'] = schedule_assessment_id
- if is_schedule_assessment is not None:
- kwargs['is_schedule_assessment'] = is_schedule_assessment
- if triggered_by is not None:
- kwargs['triggered_by'] = triggered_by
- if target_id is not None:
- kwargs['target_id'] = target_id
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if is_baseline is not None:
- kwargs['is_baseline'] = is_baseline
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
+ if vcn_id is not None:
+ kwargs['vcn_id'] = vcn_id
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if target_type is not None:
- kwargs['target_type'] = target_type
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if template_assessment_id is not None:
- kwargs['template_assessment_id'] = template_assessment_id
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -17154,126 +16504,154 @@ def list_security_assessments(ctx, from_json, all_pages, page_size, compartment_
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_security_assessments,
+ client.list_data_safe_private_endpoints,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_security_assessments,
+ client.list_data_safe_private_endpoints,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_security_assessments(
+ result = client.list_data_safe_private_endpoints(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.list_security_feature_analytics.command_name', 'list-security-feature-analytics'), help=u"""Gets a list of Database security feature usage aggregated details in the specified compartment. This provides information about the overall security controls, by returning the counting number of the target databases using the security features.
+@database_security_config_collection_group.command(name=cli_util.override('data_safe.list_database_security_configs.command_name', 'list-database-security-configs'), help=u"""Retrieves a list of all database security configurations in Data Safe.
-When you perform the ListSecurityFeatureAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns statistics from the compartments in which the requestor has INSPECT permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned. \n[Command Reference](listSecurityFeatureAnalytics)""")
+The ListDatabaseSecurityConfigs operation returns only the database security configurations in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListDatabaseSecurityConfigs on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listDatabaseSecurityConfigs)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "FAILED", "NEEDS_ATTENTION", "DELETING", "DELETED"]), help=u"""The current state of the database security configuration.""")
+@cli_util.option('--database-security-config-id', help=u"""An optional filter to return only resources that match the specified OCID of the database security configuration resource.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'SecurityFeatureAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DatabaseSecurityConfigCollection'})
@cli_util.wrap_exceptions
-def list_security_feature_analytics(ctx, from_json, all_pages, compartment_id, compartment_id_in_subtree, access_level, target_id, target_database_group_id):
+def list_database_security_configs(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, database_security_config_id, time_created_greater_than_or_equal_to, time_created_less_than, target_id, target_database_group_id, sort_order, sort_by):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
kwargs = {}
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if database_security_config_id is not None:
+ kwargs['database_security_config_id'] = database_security_config_id
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
if target_id is not None:
kwargs['target_id'] = target_id
if target_database_group_id is not None:
kwargs['target_database_group_id'] = target_database_group_id
+ 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_safe', 'data_safe', ctx)
- result = client.list_security_feature_analytics(
- compartment_id=compartment_id,
- **kwargs
- )
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_database_security_configs,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_database_security_configs,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_database_security_configs(
+ compartment_id=compartment_id,
+ **kwargs
+ )
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.list_security_features.command_name', 'list-security-features'), help=u"""Lists the usage of Database security features for a given compartment or a target level, based on the filters provided. \n[Command Reference](listSecurityFeatures)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--targets-with-unified-audit', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Unified Audit enabled/disabled.""")
-@cli_util.option('--targets-with-fine-grained-audit', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Fine Grained Audit enabled/disabled.""")
-@cli_util.option('--targets-with-traditional-audit', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Traditional Audit enabled/disabled.""")
-@cli_util.option('--targets-with-database-vault', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Database Vault enabled/disabled.""")
-@cli_util.option('--targets-with-privilege-analysis', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Privilege Analysis enabled/disabled.""")
-@cli_util.option('--targets-with-tablespace-encryption', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Tablespace Encryption enabled/disabled.""")
-@cli_util.option('--targets-with-column-encryption', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets that enable the DB security feature - Column Encryption enabled/disabled.""")
-@cli_util.option('--targets-with-network-encryption', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Network Encryption enabled/disabled.""")
-@cli_util.option('--targets-with-password-authentication', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Password Authentication enabled/disabled.""")
-@cli_util.option('--targets-with-global-authentication', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Global Authentication enabled/disabled.""")
-@cli_util.option('--targets-with-external-authentication', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - External Authentication enabled/disabled.""")
+@database_table_access_entry_collection_group.command(name=cli_util.override('data_safe.list_database_table_access_entries.command_name', 'list-database-table-access-entries'), help=u"""Retrieves a list of all database table access entries in Data Safe.
+
+The ListDatabaseTableAccessEntries operation returns only the database table access reports for the specified security policy report. \n[Command Reference](listDatabaseTableAccessEntries)""")
+@cli_util.option('--security-policy-report-id', required=True, help=u"""The OCID of the security policy report resource.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+
+**Example:** query=(accessType eq \"SELECT\") and (grantee eq \"ADMIN\")""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["key", "grantee", "accessType", "tableSchema", "tableName", "privilegeType", "privilege", "privilegeGrantable", "grantFromRole", "accessThroughObject", "columnName", "grantor", "areAllTablesAccessible", "isAccessConstrainedByView", "isAccessConstrainedByLabelSecurity", "isAccessConstrainedByDatabaseVault", "isAccessConstrainedByVirtualPrivateDatabase", "isAccessConstrainedByRedaction", "isAccessConstrainedByRealApplicationSecurity", "isAccessConstrainedBySqlFirewall", "isSensitive"]), help=u"""The field to sort by. Only one sort parameter should be provided.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityFeatureCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DatabaseTableAccessEntryCollection'})
@cli_util.wrap_exceptions
-def list_security_features(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, target_id, targets_with_unified_audit, targets_with_fine_grained_audit, targets_with_traditional_audit, targets_with_database_vault, targets_with_privilege_analysis, targets_with_tablespace_encryption, targets_with_column_encryption, targets_with_network_encryption, targets_with_password_authentication, targets_with_global_authentication, targets_with_external_authentication, limit, page, target_database_group_id):
+def list_database_table_access_entries(ctx, from_json, all_pages, page_size, security_policy_report_id, limit, page, scim_query, sort_by, sort_order):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(security_policy_report_id, six.string_types) and len(security_policy_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-report-id cannot be whitespace or empty string')
+
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if target_id is not None:
- kwargs['target_id'] = target_id
- if targets_with_unified_audit is not None:
- kwargs['targets_with_unified_audit'] = targets_with_unified_audit
- if targets_with_fine_grained_audit is not None:
- kwargs['targets_with_fine_grained_audit'] = targets_with_fine_grained_audit
- if targets_with_traditional_audit is not None:
- kwargs['targets_with_traditional_audit'] = targets_with_traditional_audit
- if targets_with_database_vault is not None:
- kwargs['targets_with_database_vault'] = targets_with_database_vault
- if targets_with_privilege_analysis is not None:
- kwargs['targets_with_privilege_analysis'] = targets_with_privilege_analysis
- if targets_with_tablespace_encryption is not None:
- kwargs['targets_with_tablespace_encryption'] = targets_with_tablespace_encryption
- if targets_with_column_encryption is not None:
- kwargs['targets_with_column_encryption'] = targets_with_column_encryption
- if targets_with_network_encryption is not None:
- kwargs['targets_with_network_encryption'] = targets_with_network_encryption
- if targets_with_password_authentication is not None:
- kwargs['targets_with_password_authentication'] = targets_with_password_authentication
- if targets_with_global_authentication is not None:
- kwargs['targets_with_global_authentication'] = targets_with_global_authentication
- if targets_with_external_authentication is not None:
- kwargs['targets_with_external_authentication'] = targets_with_external_authentication
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
+ if scim_query is not None:
+ kwargs['scim_query'] = scim_query
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -17281,77 +16659,66 @@ def list_security_features(ctx, from_json, all_pages, page_size, compartment_id,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_security_features,
- compartment_id=compartment_id,
+ client.list_database_table_access_entries,
+ security_policy_report_id=security_policy_report_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_security_features,
+ client.list_database_table_access_entries,
limit,
page_size,
- compartment_id=compartment_id,
+ security_policy_report_id=security_policy_report_id,
**kwargs
)
else:
- result = client.list_security_features(
- compartment_id=compartment_id,
+ result = client.list_database_table_access_entries(
+ security_policy_report_id=security_policy_report_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@security_policy_collection_group.command(name=cli_util.override('data_safe.list_security_policies.command_name', 'list-security-policies'), help=u"""Retrieves a list of all security policies in Data Safe.
-
-The ListSecurityPolicies operation returns only the security policies in the specified `compartmentId`.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+@database_view_access_entry_collection_group.command(name=cli_util.override('data_safe.list_database_view_access_entries.command_name', 'list-database-view-access-entries'), help=u"""Retrieves a list of all database view access entries in Data Safe.
-The parameter `compartmentIdInSubtree` applies when you perform ListSecurityPolicies on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSecurityPolicies)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+The ListDatabaseViewAccessEntries operation returns only the database view access objects for the specified security policy report. If targetId is specified, it must match the target associated with the securityPolicyReportId path parameter; otherwise, the request is rejected. \n[Command Reference](listDatabaseViewAccessEntries)""")
+@cli_util.option('--security-policy-report-id', required=True, help=u"""The OCID of the security policy report resource.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "FAILED", "DELETING", "DELETED"]), help=u"""The current state of the security policy.""")
-@cli_util.option('--security-policy-type', type=custom_types.CliCaseInsensitiveChoice(["DATASAFE_MANAGED", "SEEDED_POLICY"]), help=u"""The type of the security policy.""")
-@cli_util.option('--security-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy resource.""")
+@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+
+**Example:** query=(accessType eq \"SELECT\") and (grantee eq \"ADMIN\")""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["key", "grantee", "accessType", "tableSchema", "tableName", "viewSchema", "viewName", "privilegeType", "privilege", "privilegeGrantable", "grantFromRole", "accessThroughObject", "columnName", "grantor", "isAccessConstrainedByDatabaseVault", "isAccessConstrainedByVirtualPrivateDatabase", "isAccessConstrainedByRedaction", "isAccessConstrainedByRealApplicationSecurity", "isAccessConstrainedBySqlFirewall"]), help=u"""The field to sort by. Only one sort parameter should be provided.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'SecurityPolicyCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DatabaseViewAccessEntryCollection'})
@cli_util.wrap_exceptions
-def list_security_policies(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, security_policy_type, security_policy_id, sort_order, sort_by):
+def list_database_view_access_entries(ctx, from_json, all_pages, page_size, security_policy_report_id, limit, page, scim_query, target_id, sort_by, sort_order):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(security_policy_report_id, six.string_types) and len(security_policy_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-report-id cannot be whitespace or empty string')
+
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if security_policy_type is not None:
- kwargs['security_policy_type'] = security_policy_type
- if security_policy_id is not None:
- kwargs['security_policy_id'] = security_policy_id
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
+ if scim_query is not None:
+ kwargs['scim_query'] = scim_query
+ if target_id is not None:
+ kwargs['target_id'] = target_id
if sort_by is not None:
kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -17359,87 +16726,74 @@ def list_security_policies(ctx, from_json, all_pages, page_size, compartment_id,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_security_policies,
- compartment_id=compartment_id,
+ client.list_database_view_access_entries,
+ security_policy_report_id=security_policy_report_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_security_policies,
+ client.list_database_view_access_entries,
limit,
page_size,
- compartment_id=compartment_id,
+ security_policy_report_id=security_policy_report_id,
**kwargs
)
else:
- result = client.list_security_policies(
- compartment_id=compartment_id,
+ result = client.list_database_view_access_entries(
+ security_policy_report_id=security_policy_report_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@security_policy_config_collection_group.command(name=cli_util.override('data_safe.list_security_policy_configs.command_name', 'list-security-policy-configs'), help=u"""Retrieves a list of all security policy configurations in Data Safe.
-
-The ListSecurityPolicyConfigs operation returns only the security policy configurations in the specified `compartmentId`.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform ListSecurityPolicyConfigs on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSecurityPolicyConfigs)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--security-policy-config-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy configuration resource.""")
-@cli_util.option('--security-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy resource.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "FAILED", "NEEDS_ATTENTION", "DELETING", "DELETED"]), help=u"""The current state of the security policy configuration resource.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@sdm_masking_policy_difference_group.command(name=cli_util.override('data_safe.list_difference_columns.command_name', 'list-difference-columns'), help=u"""Gets a list of columns of a SDM masking policy difference resource based on the specified query parameters. \n[Command Reference](listDifferenceColumns)""")
+@cli_util.option('--sdm-masking-policy-difference-id', required=True, help=u"""The OCID of the SDM masking policy difference.""")
+@cli_util.option('--difference-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "NEW", "MODIFIED", "DELETED"]), help=u"""A filter to return only the SDM masking policy difference columns that match the specified difference type""")
+@cli_util.option('--planned-action', type=custom_types.CliCaseInsensitiveChoice(["SYNC", "NO_SYNC"]), help=u"""A filter to return only the SDM masking policy difference columns that match the specified planned action.""")
+@cli_util.option('--sync-status', type=custom_types.CliCaseInsensitiveChoice(["SYNCED", "NOT_SYNCED"]), help=u"""A filter to return the SDM masking policy difference columns based on the value of their syncStatus attribute.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["differenceType", "schemaName", "objectName", "columnName", "plannedAction"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for schemaName is descending. The default order for differenceType, schemaName, objectName, columnName and plannedAction is ascending.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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({})
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicyConfigCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SdmMaskingPolicyDifferenceColumnCollection'})
@cli_util.wrap_exceptions
-def list_security_policy_configs(ctx, from_json, all_pages, page_size, compartment_id, security_policy_config_id, security_policy_id, compartment_id_in_subtree, access_level, display_name, lifecycle_state, time_created_greater_than_or_equal_to, time_created_less_than, limit, page, sort_order, sort_by):
+def list_difference_columns(ctx, from_json, all_pages, page_size, sdm_masking_policy_difference_id, difference_type, planned_action, sync_status, schema_name, object_name, column_name, sort_order, sort_by, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(sdm_masking_policy_difference_id, six.string_types) and len(sdm_masking_policy_difference_id.strip()) == 0:
+ raise click.UsageError('Parameter --sdm-masking-policy-difference-id cannot be whitespace or empty string')
+
kwargs = {}
- if security_policy_config_id is not None:
- kwargs['security_policy_config_id'] = security_policy_config_id
- if security_policy_id is not None:
- kwargs['security_policy_id'] = security_policy_id
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
+ if difference_type is not None:
+ kwargs['difference_type'] = difference_type
+ if planned_action is not None:
+ kwargs['planned_action'] = planned_action
+ if sync_status is not None:
+ kwargs['sync_status'] = sync_status
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if column_name is not None and len(column_name) > 0:
+ kwargs['column_name'] = column_name
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
+ 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_safe', 'data_safe', ctx)
if all_pages:
@@ -17447,54 +16801,48 @@ def list_security_policy_configs(ctx, from_json, all_pages, page_size, compartme
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_security_policy_configs,
- compartment_id=compartment_id,
+ client.list_difference_columns,
+ sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_security_policy_configs,
+ client.list_difference_columns,
limit,
page_size,
- compartment_id=compartment_id,
+ sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
**kwargs
)
else:
- result = client.list_security_policy_configs(
- compartment_id=compartment_id,
+ result = client.list_difference_columns(
+ sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@security_policy_deployment_collection_group.command(name=cli_util.override('data_safe.list_security_policy_deployments.command_name', 'list-security-policy-deployments'), help=u"""Retrieves a list of all security policy deployments in Data Safe.
-
-The ListSecurityPolicyDeployments operation returns only the security policy deployments in the specified `compartmentId`.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform ListSecurityPolicyDeployments on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSecurityPolicyDeployments)""")
+@sensitive_data_model_group.command(name=cli_util.override('data_safe.list_discovery_analytics.command_name', 'list-discovery-analytics'), help=u"""Gets consolidated discovery analytics data based on the specified query parameters. If CompartmentIdInSubtreeQueryParam is specified as true, the behaviour is equivalent to accessLevel \"ACCESSIBLE\" by default. \n[Command Reference](listDiscoveryAnalytics)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "DEPLOYED", "PENDING_DEPLOYMENT", "NEEDS_ATTENTION", "FAILED", "DELETING", "DELETED"]), help=u"""The current state of the security policy deployment.""")
-@cli_util.option('--security-policy-deployment-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy deployment resource.""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "sensitiveDataModelId", "sensitiveTypeId", "targetIdAndSensitiveDataModelId", "sensitiveTypeIdAndTargetId", "sensitiveTypeIdAndSensitiveDataModelId"]), help=u"""Attribute by which the discovery analytics data should be grouped.""")
@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A optional filter to return only resources that belong to the specified target type.""")
-@cli_util.option('--security-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy resource.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeLastDiscovered"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for all the fields is ascending.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
+@cli_util.option('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
+@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--is-common', type=click.BOOL, help=u"""A filter to return only the common sensitive type resources. Common sensitive types belong to library sensitive types which are frequently used to perform sensitive data discovery.""")
+@cli_util.option('--sensitive-type-group-id', help=u"""An optional filter to return only resources that match the specified OCID of the sensitive type group resource.""")
@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_safe', 'class': 'SecurityPolicyDeploymentCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DiscoveryAnalyticsCollection'})
@cli_util.wrap_exceptions
-def list_security_policy_deployments(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, security_policy_deployment_id, target_id, target_type, security_policy_id, sort_order, sort_by):
+def list_discovery_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, group_by, target_id, target_database_group_id, sort_by, sort_order, sensitive_data_model_id, sensitive_type_id, limit, page, is_common, sensitive_type_group_id):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
@@ -17502,93 +16850,106 @@ def list_security_policy_deployments(ctx, from_json, all_pages, page_size, compa
kwargs = {}
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if security_policy_deployment_id is not None:
- kwargs['security_policy_deployment_id'] = security_policy_deployment_id
+ if group_by is not None:
+ kwargs['group_by'] = group_by
if target_id is not None:
kwargs['target_id'] = target_id
- if target_type is not None:
- kwargs['target_type'] = target_type
- if security_policy_id is not None:
- kwargs['security_policy_id'] = security_policy_id
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
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'])
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sensitive_data_model_id is not None:
+ kwargs['sensitive_data_model_id'] = sensitive_data_model_id
+ if sensitive_type_id is not None:
+ kwargs['sensitive_type_id'] = sensitive_type_id
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if is_common is not None:
+ kwargs['is_common'] = is_common
+ if sensitive_type_group_id is not None:
+ kwargs['sensitive_type_group_id'] = sensitive_type_group_id
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
if page_size:
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_security_policy_deployments,
+ client.list_discovery_analytics,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_security_policy_deployments,
+ client.list_discovery_analytics,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_security_policy_deployments(
+ result = client.list_discovery_analytics(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@security_policy_entry_state_collection_group.command(name=cli_util.override('data_safe.list_security_policy_entry_states.command_name', 'list-security-policy-entry-states'), help=u"""Retrieves a list of all security policy entry states in Data Safe.
-
-The ListSecurityPolicyEntryStates operation returns only the security policy entry states for the specified security policy entry. \n[Command Reference](listSecurityPolicyEntryStates)""")
-@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
+@discovery_job_group.command(name=cli_util.override('data_safe.list_discovery_job_results.command_name', 'list-discovery-job-results'), help=u"""Gets a list of discovery results based on the specified query parameters. \n[Command Reference](listDiscoveryJobResults)""")
+@cli_util.option('--discovery-job-id', required=True, help=u"""The OCID of the discovery job.""")
+@cli_util.option('--discovery-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "NEW", "MODIFIED", "DELETED"]), help=u"""A filter to return only the resources that match the specified discovery type.""")
+@cli_util.option('--planned-action', type=custom_types.CliCaseInsensitiveChoice(["NONE", "ACCEPT", "INVALIDATE", "REJECT"]), help=u"""A filter to return only the resources that match the specified planned action.""")
+@cli_util.option('--is-result-applied', type=click.BOOL, help=u"""A filter to return the discovery result resources based on the value of their isResultApplied attribute.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
+@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('--confidence-level', type=custom_types.CliCaseInsensitiveChoice(["NONE", "HIGH", "MEDIUM", "LOW"]), multiple=True, help=u"""A filter to return the discovery job results with the specified confidence level. Confidence level of discovery job result associated with a seeded sensitive type can either be HIGH or LOW. While the confidence level of discovery job result associated with a user defined sensitive will be NONE.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["discoveryType", "timeFinished", "schemaName", "objectName", "columnName", "plannedAction", "confidenceLevel"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeFinished is descending. The default order for discoveryType, schemaName, objectName, columnName and plannedAction is ascending.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--deployment-status', type=custom_types.CliCaseInsensitiveChoice(["CREATED", "MODIFIED", "CONFLICT", "CONNECTIVITY_ISSUE", "UNSUPPORTED_SYNTAX", "UNKNOWN_ERROR", "UNAUTHORIZED", "DELETED"]), help=u"""The current state of the security policy deployment.""")
-@cli_util.option('--security-policy-entry-id', help=u"""An optional filter to return only resources that match the specified security policy entry OCID.""")
-@cli_util.option('--security-policy-entry-type', type=custom_types.CliCaseInsensitiveChoice(["FIREWALL_POLICY", "AUDIT_POLICY", "CONFIG"]), help=u"""The type of the security policy deployment.""")
-@cli_util.option('--target-id', help=u"""An optional filter to return only resources that match the specified target id.""")
@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({})
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicyEntryStateCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'DiscoveryJobResultCollection'})
@cli_util.wrap_exceptions
-def list_security_policy_entry_states(ctx, from_json, all_pages, page_size, security_policy_deployment_id, limit, page, deployment_status, security_policy_entry_id, security_policy_entry_type, target_id):
+def list_discovery_job_results(ctx, from_json, all_pages, page_size, discovery_job_id, discovery_type, planned_action, is_result_applied, schema_name, object_name, column_name, sort_order, confidence_level, sort_by, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-deployment-id cannot be whitespace or empty string')
+ if isinstance(discovery_job_id, six.string_types) and len(discovery_job_id.strip()) == 0:
+ raise click.UsageError('Parameter --discovery-job-id cannot be whitespace or empty string')
kwargs = {}
+ if discovery_type is not None:
+ kwargs['discovery_type'] = discovery_type
+ if planned_action is not None:
+ kwargs['planned_action'] = planned_action
+ if is_result_applied is not None:
+ kwargs['is_result_applied'] = is_result_applied
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if column_name is not None and len(column_name) > 0:
+ kwargs['column_name'] = column_name
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if confidence_level is not None and len(confidence_level) > 0:
+ kwargs['confidence_level'] = confidence_level
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if deployment_status is not None:
- kwargs['deployment_status'] = deployment_status
- if security_policy_entry_id is not None:
- kwargs['security_policy_entry_id'] = security_policy_entry_id
- if security_policy_entry_type is not None:
- kwargs['security_policy_entry_type'] = security_policy_entry_type
- if target_id is not None:
- kwargs['target_id'] = target_id
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -17596,52 +16957,47 @@ def list_security_policy_entry_states(ctx, from_json, all_pages, page_size, secu
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_security_policy_entry_states,
- security_policy_deployment_id=security_policy_deployment_id,
+ client.list_discovery_job_results,
+ discovery_job_id=discovery_job_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_security_policy_entry_states,
+ client.list_discovery_job_results,
limit,
page_size,
- security_policy_deployment_id=security_policy_deployment_id,
+ discovery_job_id=discovery_job_id,
**kwargs
)
else:
- result = client.list_security_policy_entry_states(
- security_policy_deployment_id=security_policy_deployment_id,
+ result = client.list_discovery_job_results(
+ discovery_job_id=discovery_job_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@security_policy_report_collection_group.command(name=cli_util.override('data_safe.list_security_policy_reports.command_name', 'list-security-policy-reports'), help=u"""Retrieves a list of all security policy reports in Data Safe.
-
-The ListSecurityPolicyReports operation returns only the security policy reports in the specified `compartmentId`.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform ListSecurityPolicyReports on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSecurityPolicyReports)""")
+@discovery_job_group.command(name=cli_util.override('data_safe.list_discovery_jobs.command_name', 'list'), help=u"""Gets a list of incremental discovery jobs based on the specified query parameters. \n[Command Reference](listDiscoveryJobs)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "SUCCEEDED", "UPDATING", "DELETING", "DELETED", "FAILED", "NEEDS_ATTENTION"]), help=u"""The current state of the security policy report.""")
-@cli_util.option('--security-policy-report-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy report resource.""")
+@cli_util.option('--discovery-job-id', help=u"""A filter to return only the resources that match the specified discovery job OCID.""")
@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle state.""")
+@cli_util.option('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeStarted", "displayName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeFinished is descending. The default order for displayName is ascending.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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_safe', 'class': 'SecurityPolicyReportCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'DiscoveryJobCollection'})
@cli_util.wrap_exceptions
-def list_security_policy_reports(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, security_policy_report_id, target_id, sort_order, sort_by):
+def list_discovery_jobs(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, discovery_job_id, target_id, lifecycle_state, sensitive_data_model_id, sort_order, sort_by, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
@@ -17653,20 +17009,22 @@ def list_security_policy_reports(ctx, from_json, all_pages, page_size, compartme
kwargs['access_level'] = access_level
if display_name is not None:
kwargs['display_name'] = display_name
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if security_policy_report_id is not None:
- kwargs['security_policy_report_id'] = security_policy_report_id
+ if discovery_job_id is not None:
+ kwargs['discovery_job_id'] = discovery_job_id
if target_id is not None:
kwargs['target_id'] = target_id
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if sensitive_data_model_id is not None:
+ kwargs['sensitive_data_model_id'] = sensitive_data_model_id
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
+ 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_safe', 'data_safe', ctx)
if all_pages:
@@ -17674,53 +17032,57 @@ def list_security_policy_reports(ctx, from_json, all_pages, page_size, compartme
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_security_policy_reports,
+ client.list_discovery_jobs,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_security_policy_reports,
+ client.list_discovery_jobs,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_security_policy_reports(
+ result = client.list_discovery_jobs(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sensitive_data_model_group.command(name=cli_util.override('data_safe.list_sensitive_column_analytics.command_name', 'list-sensitive-column-analytics'), help=u"""Gets consolidated sensitive columns analytics data based on the specified query parameters.
-
-When you perform the ListSensitiveColumnAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns compartments in which the requestor has INSPECT permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned.
+@security_assessment_group.command(name=cli_util.override('data_safe.list_finding_analytics.command_name', 'list-finding-analytics'), help=u"""Gets a list of findings aggregated details in the specified compartment. This provides information about the overall state of security assessment findings. You can use groupBy to get the count of findings under a certain risk level and with a certain findingKey, and as well as get the list of the targets that match the condition. This data is especially useful content for the statistic chart or to support analytics.
-To use ListSensitiveColumnAnalytics to get a full list of all compartments and subcompartments in the tenancy from the root compartment, set the parameter compartmentIdInSubtree to true and accessLevel to ACCESSIBLE. \n[Command Reference](listSensitiveColumnAnalytics)""")
+When you perform the ListFindingAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns statistics from the compartments in which the requestor has INSPECT permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned. \n[Command Reference](listFindingAnalytics)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--sensitive-type-id', multiple=True, help=u"""A filter to return only the sensitive columns that are associated with one of the sensitive types identified by the specified OCIDs.""")
-@cli_util.option('--sensitive-type-group-id', help=u"""An optional filter to return only resources that match the specified OCID of the sensitive type group resource.""")
-@cli_util.option('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "sensitiveTypeId", "sensitiveDataModelId"]), multiple=True, help=u"""The group by parameter to summarize the sensitive columns.""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
-@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
+@cli_util.option('--is-top-finding', type=click.BOOL, help=u"""A filter to return only the findings that are marked as top findings.""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["findingKeyAndTopFindingStatus", "findingKeyAndSeverity", "severity"]), help=u"""Attribute by which the finding analytics data should be grouped.""")
+@cli_util.option('--top-finding-status', type=custom_types.CliCaseInsensitiveChoice(["RISK", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), help=u"""An optional filter to return only the top finding that match the specified status.""")
+@cli_util.option('--severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), help=u"""A filter to return only findings of a particular risk level.""")
+@cli_util.option('--finding-key', help=u"""The unique key that identifies the finding. It is a string and unique within a security assessment.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--contains-references', type=custom_types.CliCaseInsensitiveChoice(["STIG", "CIS", "GDPR"]), multiple=True, help=u"""An optional filter to return only findings that match the specified references. Use containsReferences param if need to filter by multiple references.""")
+@cli_util.option('--target-ids', multiple=True, help=u"""An optional filter to return only findings that match the specified target ids. Use this parameter to filter by multiple target ids.""")
+@cli_util.option('--category', help=u"""The category of the finding.""")
+@cli_util.option('--contains-severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), multiple=True, help=u"""A filter to return only findings that match the specified risk level(s). Use containsSeverity parameter if need to filter by multiple risk levels.""")
+@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+
+**Example:** | scimQuery=(severity eq 'high') scimQuery=(category eq \"Users\") and (reference eq 'CIS')
+
+Supported fields: severity reference title category""")
@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({'sensitive-type-id': {'module': 'data_safe', 'class': 'list[string]'}, 'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.get_cli_json_input_option({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'sensitive-type-id': {'module': 'data_safe', 'class': 'list[string]'}, 'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SensitiveColumnAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'FindingAnalyticsCollection'})
@cli_util.wrap_exceptions
-def list_sensitive_column_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, target_id, target_database_group_id, sensitive_type_id, sensitive_type_group_id, sensitive_data_model_id, group_by, schema_name, object_name, column_name, limit, page):
+def list_finding_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, is_top_finding, group_by, top_finding_status, severity, finding_key, limit, page, target_database_group_id, contains_references, target_ids, category, contains_severity, scim_query):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
@@ -17730,28 +17092,32 @@ def list_sensitive_column_analytics(ctx, from_json, all_pages, page_size, compar
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
kwargs['access_level'] = access_level
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if sensitive_type_id is not None and len(sensitive_type_id) > 0:
- kwargs['sensitive_type_id'] = sensitive_type_id
- if sensitive_type_group_id is not None:
- kwargs['sensitive_type_group_id'] = sensitive_type_group_id
- if sensitive_data_model_id is not None:
- kwargs['sensitive_data_model_id'] = sensitive_data_model_id
- if group_by is not None and len(group_by) > 0:
+ if is_top_finding is not None:
+ kwargs['is_top_finding'] = is_top_finding
+ if group_by is not None:
kwargs['group_by'] = group_by
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if object_name is not None and len(object_name) > 0:
- kwargs['object_name'] = object_name
- if column_name is not None and len(column_name) > 0:
- kwargs['column_name'] = column_name
+ if top_finding_status is not None:
+ kwargs['top_finding_status'] = top_finding_status
+ if severity is not None:
+ kwargs['severity'] = severity
+ if finding_key is not None:
+ kwargs['finding_key'] = finding_key
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ if contains_references is not None and len(contains_references) > 0:
+ kwargs['contains_references'] = contains_references
+ if target_ids is not None and len(target_ids) > 0:
+ kwargs['target_ids'] = target_ids
+ if category is not None:
+ kwargs['category'] = category
+ if contains_severity is not None and len(contains_severity) > 0:
+ kwargs['contains_severity'] = contains_severity
+ if scim_query is not None:
+ kwargs['scim_query'] = scim_query
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -17759,114 +17125,108 @@ def list_sensitive_column_analytics(ctx, from_json, all_pages, page_size, compar
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sensitive_column_analytics,
+ client.list_finding_analytics,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sensitive_column_analytics,
+ client.list_finding_analytics,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_sensitive_column_analytics(
+ result = client.list_finding_analytics(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sensitive_column_group.command(name=cli_util.override('data_safe.list_sensitive_columns.command_name', 'list'), help=u"""Gets a list of sensitive columns present in the specified sensitive data model based on the specified query parameters. \n[Command Reference](listSensitiveColumns)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-updated-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were updated after a specific date. Specifying this parameter corresponding `timeUpdatedGreaterThanOrEqualTo` parameter will retrieve all resources updated after the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-updated-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were updated before a specific date. Specifying this parameter corresponding `timeUpdatedLessThan` parameter will retrieve all resources updated before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--sensitive-column-lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "FAILED"]), help=u"""Filters the sensitive column resources with the given lifecycle state values.""")
-@cli_util.option('--column-data-count-filter', type=custom_types.CliCaseInsensitiveChoice(["SHOW_ALL_COLUMNS", "SHOW_COLUMNS_WITH_DATA", "SHOW_COLUMNS_WITHOUT_DATA"]), help=u"""Filters the sensitive columns with respect to the estimated row count.""")
-@cli_util.option('--confidence-level', type=custom_types.CliCaseInsensitiveChoice(["NONE", "HIGH", "MEDIUM", "LOW"]), multiple=True, help=u"""A filter to return the sensitive columns with the specified confidence level. Confidence level of sensitive column associated with a seeded sensitive type can either be HIGH or LOW. While the confidence level of sensitive column associated with a user defined sensitive will be NONE. For sensitive columns added manually the confidence level will also be NONE.""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
-@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
-@cli_util.option('--object-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "TABLE", "EDITIONING_VIEW"]), multiple=True, help=u"""A filter to return only items related to a specific object type.""")
-@cli_util.option('--data-type', multiple=True, help=u"""A filter to return only the resources that match the specified data types.""")
-@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["VALID", "INVALID"]), multiple=True, help=u"""A filter to return only the sensitive columns that match the specified status.""")
-@cli_util.option('--sensitive-type-id', multiple=True, help=u"""A filter to return only the sensitive columns that are associated with one of the sensitive types identified by the specified OCIDs.""")
-@cli_util.option('--parent-column-key', multiple=True, help=u"""A filter to return only the sensitive columns that are children of one of the columns identified by the specified keys.""")
-@cli_util.option('--relation-type', type=custom_types.CliCaseInsensitiveChoice(["NONE", "APP_DEFINED", "DB_DEFINED"]), multiple=True, help=u"""A filter to return sensitive columns based on their relationship with their parent columns. If set to NONE, it returns the sensitive columns that do not have any parent. The response includes the parent columns as well as the independent columns that are not in any relationship. If set to APP_DEFINED, it returns all the child columns that have application-level (non-dictionary) relationship with their parents. If set to DB_DEFINED, it returns all the child columns that have database-level (dictionary-defined) relationship with their parents.""")
-@cli_util.option('--column-group', help=u"""A filter to return only the sensitive columns that belong to the specified column group.""")
+@security_assessment_group.command(name=cli_util.override('data_safe.list_findings.command_name', 'list-findings'), help=u"""Lists all the findings for the specified assessment except for type TEMPLATE. If the assessment is of type TEMPLATE_BASELINE, the findings returned are the security checks with the user-defined severity from the template. \n[Command Reference](listFindings)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
+@cli_util.option('--is-top-finding', type=click.BOOL, help=u"""A filter to return only the findings that are marked as top findings.""")
+@cli_util.option('--severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), help=u"""A filter to return only findings of a particular risk level.""")
+@cli_util.option('--contains-severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), multiple=True, help=u"""A filter to return only findings that match the specified risk level(s). Use containsSeverity parameter if need to filter by multiple risk levels.""")
+@cli_util.option('--category', help=u"""The category of the finding.""")
+@cli_util.option('--contains-oracle-defined-severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), multiple=True, help=u"""A filter to return only findings that match the specified risk level(s). Use containsOracleDefinedSeverity parameter if need to filter by one or multiple risk levels.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "UPDATING", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only the findings that match the specified lifecycle states.""")
+@cli_util.option('--references', type=custom_types.CliCaseInsensitiveChoice(["STIG", "CIS", "GDPR"]), help=u"""An optional filter to return only findings that match the specified reference.""")
+@cli_util.option('--contains-references', type=custom_types.CliCaseInsensitiveChoice(["STIG", "CIS", "GDPR"]), multiple=True, help=u"""An optional filter to return only findings that match the specified references. Use containsReferences param if need to filter by multiple references.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "schemaName", "objectName", "columnName", "dataType", "confidenceLevel"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for schemaName, objectName, and columnName is ascending.""")
-@cli_util.option('--is-case-in-sensitive', type=click.BOOL, help=u"""A boolean flag indicating whether the search should be case-insensitive. The search is case-sensitive by default. Set this parameter to true to do case-insensitive search.""")
-@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'data-type': {'module': 'data_safe', 'class': 'list[string]'}, 'sensitive-type-id': {'module': 'data_safe', 'class': 'list[string]'}, 'parent-column-key': {'module': 'data_safe', 'class': 'list[string]'}})
-@cli_util.help_option
-@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'data-type': {'module': 'data_safe', 'class': 'list[string]'}, 'sensitive-type-id': {'module': 'data_safe', 'class': 'list[string]'}, 'parent-column-key': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SensitiveColumnCollection'})
+@cli_util.option('--compartment-id', help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-ids', multiple=True, help=u"""An optional filter to return only findings that match the specified target ids. Use this parameter to filter by multiple target ids.""")
+@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+
+**Example:** | scimQuery=(severity eq 'high') and (targetId eq 'target_1') scimQuery=(category eq \"Users\") and (targetId eq \"target_1\") scimQuery=(reference eq 'CIS') and (targetId eq 'target_1')
+
+Supported fields: severity findingKey reference targetId isTopFinding title category remarks details summary isRiskModified""")
+@cli_util.option('--field', type=custom_types.CliCaseInsensitiveChoice(["severity", "findingKey", "reference", "targetId", "isTopFinding", "title", "category", "remarks", "details", "summary", "isRiskModified"]), multiple=True, help=u"""Specifies a subset of fields to be returned in the response.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["category", "findingKey", "severity"]), help=u"""The field to sort by. You can specify only one sort order(sortOrder). The default order for category is alphabetical.""")
+@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('--finding-key', help=u"""Each finding in security assessment has an associated key (think of key as a finding's name). For a given finding, the key will be the same across targets. The user can use these keys to filter the findings.""")
+@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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'list[FindingSummary]'})
@cli_util.wrap_exceptions
-def list_sensitive_columns(ctx, from_json, all_pages, page_size, sensitive_data_model_id, time_created_greater_than_or_equal_to, time_created_less_than, time_updated_greater_than_or_equal_to, time_updated_less_than, sensitive_column_lifecycle_state, column_data_count_filter, confidence_level, schema_name, object_name, column_name, object_type, data_type, status, sensitive_type_id, parent_column_key, relation_type, column_group, limit, page, sort_order, sort_by, is_case_in_sensitive):
+def list_findings(ctx, from_json, all_pages, page_size, security_assessment_id, is_top_finding, severity, contains_severity, category, contains_oracle_defined_severity, lifecycle_state, references, contains_references, limit, page, compartment_id, compartment_id_in_subtree, access_level, target_id, target_ids, scim_query, field, sort_by, sort_order, finding_key):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
kwargs = {}
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
- if time_updated_greater_than_or_equal_to is not None:
- kwargs['time_updated_greater_than_or_equal_to'] = time_updated_greater_than_or_equal_to
- if time_updated_less_than is not None:
- kwargs['time_updated_less_than'] = time_updated_less_than
- if sensitive_column_lifecycle_state is not None:
- kwargs['sensitive_column_lifecycle_state'] = sensitive_column_lifecycle_state
- if column_data_count_filter is not None:
- kwargs['column_data_count_filter'] = column_data_count_filter
- if confidence_level is not None and len(confidence_level) > 0:
- kwargs['confidence_level'] = confidence_level
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if object_name is not None and len(object_name) > 0:
- kwargs['object_name'] = object_name
- if column_name is not None and len(column_name) > 0:
- kwargs['column_name'] = column_name
- if object_type is not None and len(object_type) > 0:
- kwargs['object_type'] = object_type
- if data_type is not None and len(data_type) > 0:
- kwargs['data_type'] = data_type
- if status is not None and len(status) > 0:
- kwargs['status'] = status
- if sensitive_type_id is not None and len(sensitive_type_id) > 0:
- kwargs['sensitive_type_id'] = sensitive_type_id
- if parent_column_key is not None and len(parent_column_key) > 0:
- kwargs['parent_column_key'] = parent_column_key
- if relation_type is not None and len(relation_type) > 0:
- kwargs['relation_type'] = relation_type
- if column_group is not None:
- kwargs['column_group'] = column_group
+ if is_top_finding is not None:
+ kwargs['is_top_finding'] = is_top_finding
+ if severity is not None:
+ kwargs['severity'] = severity
+ if contains_severity is not None and len(contains_severity) > 0:
+ kwargs['contains_severity'] = contains_severity
+ if category is not None:
+ kwargs['category'] = category
+ if contains_oracle_defined_severity is not None and len(contains_oracle_defined_severity) > 0:
+ kwargs['contains_oracle_defined_severity'] = contains_oracle_defined_severity
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if references is not None:
+ kwargs['references'] = references
+ if contains_references is not None and len(contains_references) > 0:
+ kwargs['contains_references'] = contains_references
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 compartment_id is not None:
+ kwargs['compartment_id'] = compartment_id
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_ids is not None and len(target_ids) > 0:
+ kwargs['target_ids'] = target_ids
+ if scim_query is not None:
+ kwargs['scim_query'] = scim_query
+ if field is not None and len(field) > 0:
+ kwargs['field'] = field
if sort_by is not None:
kwargs['sort_by'] = sort_by
- if is_case_in_sensitive is not None:
- kwargs['is_case_in_sensitive'] = is_case_in_sensitive
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if finding_key is not None:
+ kwargs['finding_key'] = finding_key
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -17874,59 +17234,87 @@ def list_sensitive_columns(ctx, from_json, all_pages, page_size, sensitive_data_
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sensitive_columns,
- sensitive_data_model_id=sensitive_data_model_id,
+ client.list_findings,
+ security_assessment_id=security_assessment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sensitive_columns,
+ client.list_findings,
limit,
page_size,
- sensitive_data_model_id=sensitive_data_model_id,
+ security_assessment_id=security_assessment_id,
**kwargs
)
else:
- result = client.list_sensitive_columns(
- sensitive_data_model_id=sensitive_data_model_id,
+ result = client.list_findings(
+ security_assessment_id=security_assessment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sensitive_data_model_sensitive_type_collection_group.command(name=cli_util.override('data_safe.list_sensitive_data_model_sensitive_types.command_name', 'list-sensitive-data-model-sensitive-types'), help=u"""Gets a list of sensitive type Ids present in the specified sensitive data model. \n[Command Reference](listSensitiveDataModelSensitiveTypes)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["count"]), help=u"""- The field to sort by. You can specify only one sorting parameter (sortorder). The default order is descending.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@security_assessment_group.command(name=cli_util.override('data_safe.list_findings_change_audit_logs.command_name', 'list-findings-change-audit-logs'), help=u"""List all changes made by user to risk level of findings of the specified assessment. \n[Command Reference](listFindingsChangeAuditLogs)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
+@cli_util.option('--severity', type=custom_types.CliCaseInsensitiveChoice(["HIGH", "MEDIUM", "LOW", "EVALUATE", "ADVISORY", "PASS", "DEFERRED"]), help=u"""A filter to return only findings of a particular risk level.""")
+@cli_util.option('--finding-key', help=u"""The unique key that identifies the finding. It is a string and unique within a security assessment.""")
+@cli_util.option('--finding-title', help=u"""The unique title that identifies the finding. It is a string and unique within a security assessment.""")
+@cli_util.option('--is-risk-deferred', type=click.BOOL, help=u"""A filter to check findings whose risks were deferred by the user.""")
+@cli_util.option('--modified-by', help=u"""A filter to check which user modified the risk level of the finding.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeUpdated", "modifiedBy", "isRiskDeferred", "timeValidUntil"]), help=u"""The field to sort by. You can specify only one sort order(sortOrder). The default order for timeUpdated is descending.""")
+@cli_util.option('--time-valid-until-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""Specifying `TimeValidUntilGreaterThanOrEqualToQueryParam` parameter will retrieve all items for which the risk level modification by user will no longer be valid greater than the date and time specified, in the format defined by [RFC3339].
+
+**Example:** 2016-12-19T00:00:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-valid-until-less-than', type=custom_types.CLI_DATETIME, help=u"""Specifying `TimeValidUntilLessThanQueryParam` parameter will retrieve all items for which the risk level modification by user will be valid until less than the date and time specified, in the format defined by [RFC3339].
+
+**Example:** 2016-12-19T00:00:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-updated-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were updated after a specific date. Specifying this parameter corresponding `timeUpdatedGreaterThanOrEqualTo` parameter will retrieve all resources updated after the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-updated-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were updated before a specific date. Specifying this parameter corresponding `timeUpdatedLessThan` parameter will retrieve all resources updated before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@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_safe', 'class': 'SensitiveDataModelSensitiveTypeCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'FindingsChangeAuditLogCollection'})
@cli_util.wrap_exceptions
-def list_sensitive_data_model_sensitive_types(ctx, from_json, all_pages, page_size, sensitive_data_model_id, sensitive_type_id, sort_by, sort_order, limit, page):
+def list_findings_change_audit_logs(ctx, from_json, all_pages, page_size, security_assessment_id, severity, finding_key, finding_title, is_risk_deferred, modified_by, limit, page, sort_order, sort_by, time_valid_until_greater_than_or_equal_to, time_valid_until_less_than, time_updated_greater_than_or_equal_to, time_updated_less_than):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
kwargs = {}
- if sensitive_type_id is not None:
- kwargs['sensitive_type_id'] = sensitive_type_id
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
+ if severity is not None:
+ kwargs['severity'] = severity
+ if finding_key is not None:
+ kwargs['finding_key'] = finding_key
+ if finding_title is not None:
+ kwargs['finding_title'] = finding_title
+ if is_risk_deferred is not None:
+ kwargs['is_risk_deferred'] = is_risk_deferred
+ if modified_by is not None:
+ kwargs['modified_by'] = modified_by
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if time_valid_until_greater_than_or_equal_to is not None:
+ kwargs['time_valid_until_greater_than_or_equal_to'] = time_valid_until_greater_than_or_equal_to
+ if time_valid_until_less_than is not None:
+ kwargs['time_valid_until_less_than'] = time_valid_until_less_than
+ if time_updated_greater_than_or_equal_to is not None:
+ kwargs['time_updated_greater_than_or_equal_to'] = time_updated_greater_than_or_equal_to
+ if time_updated_less_than is not None:
+ kwargs['time_updated_less_than'] = time_updated_less_than
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -17934,147 +17322,138 @@ def list_sensitive_data_model_sensitive_types(ctx, from_json, all_pages, page_si
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sensitive_data_model_sensitive_types,
- sensitive_data_model_id=sensitive_data_model_id,
+ client.list_findings_change_audit_logs,
+ security_assessment_id=security_assessment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sensitive_data_model_sensitive_types,
+ client.list_findings_change_audit_logs,
limit,
page_size,
- sensitive_data_model_id=sensitive_data_model_id,
+ security_assessment_id=security_assessment_id,
**kwargs
)
else:
- result = client.list_sensitive_data_model_sensitive_types(
- sensitive_data_model_id=sensitive_data_model_id,
+ result = client.list_findings_change_audit_logs(
+ security_assessment_id=security_assessment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sensitive_data_model_group.command(name=cli_util.override('data_safe.list_sensitive_data_models.command_name', 'list'), help=u"""Gets a list of sensitive data models based on the specified query parameters. \n[Command Reference](listSensitiveDataModels)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for displayName is ascending.""")
+@user_assessment_group.command(name=cli_util.override('data_safe.list_grants.command_name', 'list-grants'), help=u"""Gets a list of grants for a particular user in the specified user assessment. A user grant contains details such as the privilege name, type, category, and depth level. The depth level indicates how deep in the hierarchy of roles granted to roles a privilege grant is. The userKey in this operation is a system-generated identifier. Perform the operation ListUsers to get the userKey for a particular user. \n[Command Reference](listGrants)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@cli_util.option('--user-key', required=True, help=u"""The unique user key. This is a system-generated identifier. ListUsers gets the user key for a user.""")
+@cli_util.option('--grant-key', help=u"""A filter to return only items that match the specified user grant key.""")
+@cli_util.option('--grant-name', help=u"""A filter to return only items that match the specified user grant name.""")
+@cli_util.option('--privilege-type', help=u"""A filter to return only items that match the specified privilege grant type.""")
+@cli_util.option('--privilege-category', help=u"""A filter to return only items that match the specified user privilege category.""")
+@cli_util.option('--depth-level', type=click.INT, help=u"""A filter to return only items that match the specified user grant depth level.""")
+@cli_util.option('--depth-level-greater-than-or-equal-to', type=click.INT, help=u"""A filter to return only items that are at a level greater than or equal to the specified user grant depth level.""")
+@cli_util.option('--depth-level-less-than', type=click.INT, help=u"""A filter to return only items that are at a level less than the specified user grant depth level.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle state.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["grantName", "grantType", "privilegeCategory", "depthLevel", "key"]), help=u"""The field to sort by. You can specify only one sort order (sortOrder). The default order for grantName is ascending.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SensitiveDataModelCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[GrantSummary]'})
@cli_util.wrap_exceptions
-def list_sensitive_data_models(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, sensitive_data_model_id, time_created_greater_than_or_equal_to, time_created_less_than, target_id, sort_order, sort_by, limit, page, lifecycle_state):
+def list_grants(ctx, from_json, all_pages, page_size, user_assessment_id, user_key, grant_key, grant_name, privilege_type, privilege_category, depth_level, depth_level_greater_than_or_equal_to, depth_level_less_than, 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')
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+
+ if isinstance(user_key, six.string_types) and len(user_key.strip()) == 0:
+ raise click.UsageError('Parameter --user-key cannot be whitespace or empty string')
+
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
- if sensitive_data_model_id is not None:
- kwargs['sensitive_data_model_id'] = sensitive_data_model_id
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
- if target_id is not None:
- kwargs['target_id'] = target_id
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
+ if grant_key is not None:
+ kwargs['grant_key'] = grant_key
+ if grant_name is not None:
+ kwargs['grant_name'] = grant_name
+ if privilege_type is not None:
+ kwargs['privilege_type'] = privilege_type
+ if privilege_category is not None:
+ kwargs['privilege_category'] = privilege_category
+ if depth_level is not None:
+ kwargs['depth_level'] = depth_level
+ if depth_level_greater_than_or_equal_to is not None:
+ kwargs['depth_level_greater_than_or_equal_to'] = depth_level_greater_than_or_equal_to
+ if depth_level_less_than is not None:
+ kwargs['depth_level_less_than'] = depth_level_less_than
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
if page_size:
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sensitive_data_models,
- compartment_id=compartment_id,
+ client.list_grants,
+ user_assessment_id=user_assessment_id,
+ user_key=user_key,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sensitive_data_models,
+ client.list_grants,
limit,
page_size,
- compartment_id=compartment_id,
+ user_assessment_id=user_assessment_id,
+ user_key=user_key,
**kwargs
)
else:
- result = client.list_sensitive_data_models(
- compartment_id=compartment_id,
+ result = client.list_grants(
+ user_assessment_id=user_assessment_id,
+ user_key=user_key,
**kwargs
)
cli_util.render_response(result, ctx)
-@sensitive_object_collection_group.command(name=cli_util.override('data_safe.list_sensitive_objects.command_name', 'list-sensitive-objects'), help=u"""Gets a list of sensitive objects present in the specified sensitive data model based on the specified query parameters. \n[Command Reference](listSensitiveObjects)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
-@cli_util.option('--object-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "TABLE", "EDITIONING_VIEW"]), multiple=True, help=u"""A filter to return only items related to a specific object type.""")
+@sensitive_type_group_group.command(name=cli_util.override('data_safe.list_grouped_sensitive_types.command_name', 'list-grouped-sensitive-types'), help=u"""Gets the list of sensitive type Ids present in the specified sensitive type group. \n[Command Reference](listGroupedSensitiveTypes)""")
+@cli_util.option('--sensitive-type-group-id', required=True, help=u"""The OCID of the sensitive type group.""")
+@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName", "objectName", "objectType"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order is ascending.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
-@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@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={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SensitiveObjectCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'GroupedSensitiveTypeCollection'})
@cli_util.wrap_exceptions
-def list_sensitive_objects(ctx, from_json, all_pages, page_size, sensitive_data_model_id, schema_name, object_name, object_type, limit, page, sort_order, sort_by):
+def list_grouped_sensitive_types(ctx, from_json, all_pages, page_size, sensitive_type_group_id, sensitive_type_id, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+ if isinstance(sensitive_type_group_id, six.string_types) and len(sensitive_type_group_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-type-group-id cannot be whitespace or empty string')
kwargs = {}
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if object_name is not None and len(object_name) > 0:
- kwargs['object_name'] = object_name
- if object_type is not None and len(object_type) > 0:
- kwargs['object_type'] = object_type
+ if sensitive_type_id is not None:
+ kwargs['sensitive_type_id'] = sensitive_type_id
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -18082,55 +17461,77 @@ def list_sensitive_objects(ctx, from_json, all_pages, page_size, sensitive_data_
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sensitive_objects,
- sensitive_data_model_id=sensitive_data_model_id,
+ client.list_grouped_sensitive_types,
+ sensitive_type_group_id=sensitive_type_group_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sensitive_objects,
+ client.list_grouped_sensitive_types,
limit,
page_size,
- sensitive_data_model_id=sensitive_data_model_id,
+ sensitive_type_group_id=sensitive_type_group_id,
**kwargs
)
else:
- result = client.list_sensitive_objects(
- sensitive_data_model_id=sensitive_data_model_id,
+ result = client.list_grouped_sensitive_types(
+ sensitive_type_group_id=sensitive_type_group_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sensitive_schema_collection_group.command(name=cli_util.override('data_safe.list_sensitive_schemas.command_name', 'list-sensitive-schemas'), help=u"""Gets a list of sensitive schemas present in the specified sensitive data model based on the specified query parameters. \n[Command Reference](listSensitiveSchemas)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@library_masking_format_summary_group.command(name=cli_util.override('data_safe.list_library_masking_formats.command_name', 'list-library-masking-formats'), help=u"""Gets a list of library masking formats based on the specified query parameters. \n[Command Reference](listLibraryMaskingFormats)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--library-masking-format-id', help=u"""A filter to return only the resources that match the specified library masking format OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle states.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--library-masking-format-source', type=custom_types.CliCaseInsensitiveChoice(["ORACLE", "USER"]), help=u"""A filter to return the library masking format resources based on the value of their source attribute.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order is ascending.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated", "timeUpdated", "lifecycleState"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for displayName is ascending. The displayName sort order 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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@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={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SensitiveSchemaCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'LibraryMaskingFormatCollection'})
@cli_util.wrap_exceptions
-def list_sensitive_schemas(ctx, from_json, all_pages, page_size, sensitive_data_model_id, schema_name, limit, page, sort_order, sort_by):
+def list_library_masking_formats(ctx, from_json, all_pages, page_size, compartment_id, library_masking_format_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, time_created_greater_than_or_equal_to, time_created_less_than, library_masking_format_source, sort_order, sort_by):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
-
kwargs = {}
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
+ if library_masking_format_id is not None:
+ kwargs['library_masking_format_id'] = library_masking_format_id
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ if library_masking_format_source is not None:
+ kwargs['library_masking_format_source'] = library_masking_format_source
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
@@ -18142,78 +17543,74 @@ def list_sensitive_schemas(ctx, from_json, all_pages, page_size, sensitive_data_
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sensitive_schemas,
- sensitive_data_model_id=sensitive_data_model_id,
+ client.list_library_masking_formats,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sensitive_schemas,
+ client.list_library_masking_formats,
limit,
page_size,
- sensitive_data_model_id=sensitive_data_model_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_sensitive_schemas(
- sensitive_data_model_id=sensitive_data_model_id,
+ result = client.list_library_masking_formats(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sensitive_type_group_summary_group.command(name=cli_util.override('data_safe.list_sensitive_type_groups.command_name', 'list-sensitive-type-groups'), help=u"""Gets a list of sensitive type groups based on the specified query parameters. \n[Command Reference](listSensitiveTypeGroups)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@masked_column_summary_group.command(name=cli_util.override('data_safe.list_masked_columns.command_name', 'list-masked-columns'), help=u"""Gets a list of masked columns present in the specified masking report and based on the specified query parameters. \n[Command Reference](listMaskedColumns)""")
+@cli_util.option('--masking-report-id', required=True, help=u"""The OCID of the masking report.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle state.""")
-@cli_util.option('--sensitive-type-group-id', help=u"""An optional filter to return only resources that match the specified OCID of the sensitive type group resource.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for displayName is ascending.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName", "objectName", "sensitiveTypeId", "maskingColumnGroupId"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for all the fields is ascending.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
+@cli_util.option('--object-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "TABLE", "EDITIONING_VIEW"]), multiple=True, help=u"""A filter to return only items related to a specific object type.""")
+@cli_util.option('--masking-column-group', multiple=True, help=u"""A filter to return only the resources that match the specified masking column group.""")
+@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
@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({})
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'masking-column-group': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SensitiveTypeGroupCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'masking-column-group': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'MaskedColumnCollection'})
@cli_util.wrap_exceptions
-def list_sensitive_type_groups(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, sensitive_type_group_id, time_created_greater_than_or_equal_to, time_created_less_than, sort_order, sort_by):
+def list_masked_columns(ctx, from_json, all_pages, page_size, masking_report_id, limit, page, sort_order, sort_by, schema_name, object_name, column_name, object_type, masking_column_group, sensitive_type_id):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(masking_report_id, six.string_types) and len(masking_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-report-id cannot be whitespace or empty string')
+
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if sensitive_type_group_id is not None:
- kwargs['sensitive_type_group_id'] = sensitive_type_group_id
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if column_name is not None and len(column_name) > 0:
+ kwargs['column_name'] = column_name
+ if object_type is not None and len(object_type) > 0:
+ kwargs['object_type'] = object_type
+ if masking_column_group is not None and len(masking_column_group) > 0:
+ kwargs['masking_column_group'] = masking_column_group
+ if sensitive_type_id is not None:
+ kwargs['sensitive_type_id'] = sensitive_type_id
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -18221,56 +17618,46 @@ def list_sensitive_type_groups(ctx, from_json, all_pages, page_size, compartment
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sensitive_type_groups,
- compartment_id=compartment_id,
+ client.list_masked_columns,
+ masking_report_id=masking_report_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sensitive_type_groups,
+ client.list_masked_columns,
limit,
page_size,
- compartment_id=compartment_id,
+ masking_report_id=masking_report_id,
**kwargs
)
else:
- result = client.list_sensitive_type_groups(
- compartment_id=compartment_id,
+ result = client.list_masked_columns(
+ masking_report_id=masking_report_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sensitive_type_group.command(name=cli_util.override('data_safe.list_sensitive_types.command_name', 'list'), help=u"""Gets a list of sensitive types based on the specified query parameters. \n[Command Reference](listSensitiveTypes)""")
+@masking_policy_group.command(name=cli_util.override('data_safe.list_masking_analytics.command_name', 'list-masking-analytics'), help=u"""Gets consolidated masking analytics data based on the specified query parameters. If CompartmentIdInSubtreeQueryParam is specified as true, the behaviour is equivalent to accessLevel \"ACCESSIBLE\" by default. \n[Command Reference](listMaskingAnalytics)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "policyId", "targetIdAndPolicyId", "sensitiveTypeId"]), help=u"""Attribute by which the masking analytics data should be grouped.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--masking-policy-id', help=u"""A filter to return only the resources that match the specified masking policy OCID.""")
@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
-@cli_util.option('--sensitive-type-source', type=custom_types.CliCaseInsensitiveChoice(["ORACLE", "USER"]), help=u"""A filter to return the sensitive type resources based on the value of their source attribute.""")
-@cli_util.option('--entity-type', type=custom_types.CliCaseInsensitiveChoice(["SENSITIVE_TYPE", "SENSITIVE_CATEGORY"]), help=u"""A filter to return the sensitive type resources based on the value of their entityType attribute.""")
-@cli_util.option('--parent-category-id', help=u"""A filter to return only the sensitive types that are children of the sensitive category identified by the specified OCID.""")
-@cli_util.option('--default-masking-format-id', help=u"""A filter to return only the sensitive types that have the default masking format identified by the specified OCID.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeLastMasked"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for all the fields is ascending.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for displayName is ascending.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle state.""")
-@cli_util.option('--is-common', type=click.BOOL, help=u"""A filter to return only the common sensitive type resources. Common sensitive types belong to library sensitive types which are frequently used to perform sensitive data discovery.""")
@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_safe', 'class': 'SensitiveTypeCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'MaskingAnalyticsCollection'})
@cli_util.wrap_exceptions
-def list_sensitive_types(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, sensitive_type_id, sensitive_type_source, entity_type, parent_category_id, default_masking_format_id, time_created_greater_than_or_equal_to, time_created_less_than, sort_order, sort_by, limit, page, lifecycle_state, is_common):
+def list_masking_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, group_by, target_id, masking_policy_id, sensitive_type_id, target_database_group_id, sort_by, sort_order, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
@@ -18278,36 +17665,24 @@ def list_sensitive_types(ctx, from_json, all_pages, page_size, compartment_id, c
kwargs = {}
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
+ if group_by is not None:
+ kwargs['group_by'] = group_by
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if masking_policy_id is not None:
+ kwargs['masking_policy_id'] = masking_policy_id
if sensitive_type_id is not None:
kwargs['sensitive_type_id'] = sensitive_type_id
- if sensitive_type_source is not None:
- kwargs['sensitive_type_source'] = sensitive_type_source
- if entity_type is not None:
- kwargs['entity_type'] = entity_type
- if parent_category_id is not None:
- kwargs['parent_category_id'] = parent_category_id
- if default_masking_format_id is not None:
- kwargs['default_masking_format_id'] = default_masking_format_id
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
if sort_by is not None:
kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if is_common is not None:
- kwargs['is_common'] = is_common
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -18315,78 +17690,102 @@ def list_sensitive_types(ctx, from_json, all_pages, page_size, compartment_id, c
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sensitive_types,
+ client.list_masking_analytics,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sensitive_types,
+ client.list_masking_analytics,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_sensitive_types(
+ result = client.list_masking_analytics(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sensitive_types_export_collection_group.command(name=cli_util.override('data_safe.list_sensitive_types_exports.command_name', 'list-sensitive-types-exports'), help=u"""Retrieves a list of all sensitive types export in Data Safe based on the specified query parameters. The ListSensitiveTypesExports operation returns only the sensitive types export in the specified `compartmentId`. \n[Command Reference](listSensitiveTypesExports)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@masking_column_group.command(name=cli_util.override('data_safe.list_masking_columns.command_name', 'list'), help=u"""Gets a list of masking columns present in the specified masking policy and based on the specified query parameters. \n[Command Reference](listMaskingColumns)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle state.""")
-@cli_util.option('--sensitive-types-export-id', help=u"""An optional filter to return only resources that match the specified OCID of the sensitive types export resource.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "schemaName", "objectName", "columnName", "dataType"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for other fields is ascending.""")
+@cli_util.option('--masking-column-lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle states.""")
+@cli_util.option('--data-type', type=custom_types.CliCaseInsensitiveChoice(["CHARACTER", "DATE", "LOB", "NUMERIC"]), multiple=True, help=u"""A filter to return only resources that match the specified data types.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
+@cli_util.option('--object-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "TABLE", "EDITIONING_VIEW"]), multiple=True, help=u"""A filter to return only items related to a specific object type.""")
+@cli_util.option('--masking-column-group', multiple=True, help=u"""A filter to return only the resources that match the specified masking column group.""")
+@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
+@cli_util.option('--is-masking-enabled', type=click.BOOL, help=u"""A filter to return the masking column resources based on the value of their isMaskingEnabled attribute. A value of true returns only those columns for which masking is enabled. A value of false returns only those columns for which masking is disabled. Omitting this parameter returns all the masking columns in a masking policy.""")
+@cli_util.option('--is-seed-required', type=click.BOOL, help=u"""A filter to return masking columns based on whether the assigned masking formats need a seed value for masking. A value of true returns those masking columns that are using Deterministic Encryption or Deterministic Substitution masking format.""")
@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
+@cli_util.option('--time-updated-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were updated after a specific date. Specifying this parameter corresponding `timeUpdatedGreaterThanOrEqualTo` parameter will retrieve all resources updated after the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-updated-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were updated before a specific date. Specifying this parameter corresponding `timeUpdatedLessThan` parameter will retrieve all resources updated before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@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({})
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'masking-column-group': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SensitiveTypesExportCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'masking-column-group': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'MaskingColumnCollection'})
@cli_util.wrap_exceptions
-def list_sensitive_types_exports(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, sensitive_types_export_id, time_created_greater_than_or_equal_to, time_created_less_than, sort_order, sort_by):
+def list_masking_columns(ctx, from_json, all_pages, page_size, masking_policy_id, limit, page, sort_order, sort_by, masking_column_lifecycle_state, data_type, schema_name, object_name, column_name, object_type, masking_column_group, sensitive_type_id, is_masking_enabled, is_seed_required, time_created_greater_than_or_equal_to, time_created_less_than, time_updated_greater_than_or_equal_to, time_updated_less_than):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if sensitive_types_export_id is not None:
- kwargs['sensitive_types_export_id'] = sensitive_types_export_id
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
+ if masking_column_lifecycle_state is not None:
+ kwargs['masking_column_lifecycle_state'] = masking_column_lifecycle_state
+ if data_type is not None and len(data_type) > 0:
+ kwargs['data_type'] = data_type
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if column_name is not None and len(column_name) > 0:
+ kwargs['column_name'] = column_name
+ if object_type is not None and len(object_type) > 0:
+ kwargs['object_type'] = object_type
+ if masking_column_group is not None and len(masking_column_group) > 0:
+ kwargs['masking_column_group'] = masking_column_group
+ if sensitive_type_id is not None:
+ kwargs['sensitive_type_id'] = sensitive_type_id
+ if is_masking_enabled is not None:
+ kwargs['is_masking_enabled'] = is_masking_enabled
+ if is_seed_required is not None:
+ kwargs['is_seed_required'] = is_seed_required
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ if time_updated_greater_than_or_equal_to is not None:
+ kwargs['time_updated_greater_than_or_equal_to'] = time_updated_greater_than_or_equal_to
+ if time_updated_less_than is not None:
+ kwargs['time_updated_less_than'] = time_updated_less_than
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -18394,77 +17793,59 @@ def list_sensitive_types_exports(ctx, from_json, all_pages, page_size, compartme
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sensitive_types_exports,
- compartment_id=compartment_id,
+ client.list_masking_columns,
+ masking_policy_id=masking_policy_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sensitive_types_exports,
+ client.list_masking_columns,
limit,
page_size,
- compartment_id=compartment_id,
+ masking_policy_id=masking_policy_id,
**kwargs
)
else:
- result = client.list_sensitive_types_exports(
- compartment_id=compartment_id,
+ result = client.list_masking_columns(
+ masking_policy_id=masking_policy_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sql_collection_analytics_collection_group.command(name=cli_util.override('data_safe.list_sql_collection_analytics.command_name', 'list-sql-collection-analytics'), help=u"""Retrieves a list of all SQL collection analytics in Data Safe.
-
-The ListSqlCollectionAnalytics operation returns only the analytics for the SQL collections in the specified `compartmentId`.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform ListSqlCollections on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSqlCollectionAnalytics)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@masking_error_summary_group.command(name=cli_util.override('data_safe.list_masking_errors.command_name', 'list-masking-errors'), help=u"""Gets a list of masking errors in a masking run based on the specified query parameters. \n[Command Reference](listMaskingErrors)""")
+@cli_util.option('--masking-report-id', required=True, help=u"""The OCID of the masking report.""")
+@cli_util.option('--step-name', type=custom_types.CliCaseInsensitiveChoice(["VALIDATE", "GENERATE_SCRIPT", "EXECUTE_MASKING", "PRE_MASKING", "POST_MASKING"]), help=u"""A filter to return only masking errors that match the specified step name.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["stepName", "timeCreated"]), help=u"""The field to sort by. The default order will be ascending.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "COLLECTING", "COMPLETED", "INACTIVE", "FAILED", "DELETING", "DELETED", "NEEDS_ATTENTION"]), help=u"""The current state of the SQL collection.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "lifecycleState"]), multiple=True, help=u"""The group by parameter to summarize SQL collection aggregation.""")
-@cli_util.option('--time-started', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return the stats of the SQL collection logs collected after the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-ended', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return the stats of the SQL collection logs collected before the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SqlCollectionAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'MaskingErrorCollection'})
@cli_util.wrap_exceptions
-def list_sql_collection_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, lifecycle_state, target_id, target_database_group_id, group_by, time_started, time_ended):
+def list_masking_errors(ctx, from_json, all_pages, page_size, masking_report_id, step_name, sort_by, limit, page, sort_order):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(masking_report_id, six.string_types) and len(masking_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-report-id cannot be whitespace or empty string')
+
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
+ if step_name is not None:
+ kwargs['step_name'] = step_name
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if group_by is not None and len(group_by) > 0:
- kwargs['group_by'] = group_by
- if time_started is not None:
- kwargs['time_started'] = time_started
- if time_ended is not None:
- kwargs['time_ended'] = time_ended
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -18472,55 +17853,65 @@ def list_sql_collection_analytics(ctx, from_json, all_pages, page_size, compartm
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sql_collection_analytics,
- compartment_id=compartment_id,
+ client.list_masking_errors,
+ masking_report_id=masking_report_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sql_collection_analytics,
+ client.list_masking_errors,
limit,
page_size,
- compartment_id=compartment_id,
+ masking_report_id=masking_report_id,
**kwargs
)
else:
- result = client.list_sql_collection_analytics(
- compartment_id=compartment_id,
+ result = client.list_masking_errors(
+ masking_report_id=masking_report_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sql_collection_log_insights_collection_group.command(name=cli_util.override('data_safe.list_sql_collection_log_insights.command_name', 'list-sql-collection-log-insights'), help=u"""Retrieves a list of the SQL collection log analytics. \n[Command Reference](listSqlCollectionLogInsights)""")
-@cli_util.option('--time-started', required=True, type=custom_types.CLI_DATETIME, help=u"""An optional filter to return the stats of the SQL collection logs collected after the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-ended', required=True, type=custom_types.CLI_DATETIME, help=u"""An optional filter to return the stats of the SQL collection logs collected before the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
+@masking_object_collection_group.command(name=cli_util.override('data_safe.list_masking_objects.command_name', 'list-masking-objects'), help=u"""Gets a list of masking objects present in the specified masking policy and based on the specified query parameters. \n[Command Reference](listMaskingObjects)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["clientIp", "clientProgram", "clientOsUserName"]), help=u"""The group by parameter to summarize SQL collection log insights aggregation.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName", "objectName", "objectType"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order is ascending.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--object-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "TABLE", "EDITIONING_VIEW"]), multiple=True, help=u"""A filter to return only items related to a specific object type.""")
@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({})
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SqlCollectionLogInsightsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'MaskingObjectCollection'})
@cli_util.wrap_exceptions
-def list_sql_collection_log_insights(ctx, from_json, all_pages, page_size, time_started, time_ended, sql_collection_id, limit, page, group_by):
+def list_masking_objects(ctx, from_json, all_pages, page_size, masking_policy_id, limit, page, sort_order, sort_by, schema_name, object_name, object_type):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
kwargs = {}
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if group_by is not None:
- kwargs['group_by'] = group_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if object_type is not None and len(object_type) > 0:
+ kwargs['object_type'] = object_type
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -18528,75 +17919,60 @@ def list_sql_collection_log_insights(ctx, from_json, all_pages, page_size, time_
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sql_collection_log_insights,
- time_started=time_started,
- time_ended=time_ended,
- sql_collection_id=sql_collection_id,
+ client.list_masking_objects,
+ masking_policy_id=masking_policy_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sql_collection_log_insights,
+ client.list_masking_objects,
limit,
page_size,
- time_started=time_started,
- time_ended=time_ended,
- sql_collection_id=sql_collection_id,
+ masking_policy_id=masking_policy_id,
**kwargs
)
else:
- result = client.list_sql_collection_log_insights(
- time_started=time_started,
- time_ended=time_ended,
- sql_collection_id=sql_collection_id,
+ result = client.list_masking_objects(
+ masking_policy_id=masking_policy_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sql_collection_collection_group.command(name=cli_util.override('data_safe.list_sql_collections.command_name', 'list-sql-collections'), help=u"""Retrieves a list of all SQL collections in Data Safe.
-
-The ListSqlCollections operation returns only the SQL collections in the specified `compartmentId`.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform ListSqlCollections on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSqlCollections)""")
+@masking_policy_group.command(name=cli_util.override('data_safe.list_masking_policies.command_name', 'list'), help=u"""Gets a list of masking policies based on the specified query parameters. \n[Command Reference](listMaskingPolicies)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--masking-policy-id', help=u"""A filter to return only the resources that match the specified masking policy OCID.""")
@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "COLLECTING", "COMPLETED", "INACTIVE", "FAILED", "DELETING", "DELETED", "NEEDS_ATTENTION"]), help=u"""The current state of the SQL collection.""")
-@cli_util.option('--sql-collection-id', help=u"""An optional filter to return only resources that match the specified OCID of the SQL collection resource.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle states.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for displayName is ascending. The displayName sort order is case sensitive.""")
+@cli_util.option('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
-@cli_util.option('--db-user-name', help=u"""A filter to return only items that match the specified user name.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME", "TIMELASTSTARTED"]), help=u"""The field used for sorting. Only one sorting parameter order (sortOrder) can be specified. The DISPLAYNAME sort order is case sensitive.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@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_safe', 'class': 'SqlCollectionCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'MaskingPolicyCollection'})
@cli_util.wrap_exceptions
-def list_sql_collections(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, sql_collection_id, time_created_greater_than_or_equal_to, time_created_less_than, target_id, target_database_group_id, db_user_name, sort_order, sort_by):
+def list_masking_policies(ctx, from_json, all_pages, page_size, compartment_id, masking_policy_id, display_name, limit, page, lifecycle_state, sort_order, sort_by, sensitive_data_model_id, target_id, time_created_greater_than_or_equal_to, time_created_less_than, compartment_id_in_subtree, access_level):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
+ if masking_policy_id is not None:
+ kwargs['masking_policy_id'] = masking_policy_id
if display_name is not None:
kwargs['display_name'] = display_name
if limit is not None:
@@ -18605,90 +17981,82 @@ def list_sql_collections(ctx, from_json, all_pages, page_size, compartment_id, c
kwargs['page'] = page
if lifecycle_state is not None:
kwargs['lifecycle_state'] = lifecycle_state
- if sql_collection_id is not None:
- kwargs['sql_collection_id'] = sql_collection_id
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
- if db_user_name is not None:
- kwargs['db_user_name'] = db_user_name
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_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
+ if sensitive_data_model_id is not None:
+ kwargs['sensitive_data_model_id'] = sensitive_data_model_id
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sql_collections,
+ client.list_masking_policies,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sql_collections,
+ client.list_masking_policies,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_sql_collections(
+ result = client.list_masking_policies(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sql_firewall_allowed_sql_analytics_collection_group.command(name=cli_util.override('data_safe.list_sql_firewall_allowed_sql_analytics.command_name', 'list-sql-firewall-allowed-sql-analytics'), help=u"""Returns the aggregation details of all SQL Firewall allowed SQL statements.
-
-The ListSqlFirewallAllowedSqlAnalytics operation returns the aggregates of the SQL Firewall allowed SQL statements in the specified `compartmentId`.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform ListSqlFirewallAllowedSqlAnalytics on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSqlFirewallAllowedSqlAnalytics)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@masking_policy_health_report_group.command(name=cli_util.override('data_safe.list_masking_policy_health_report_logs.command_name', 'list-masking-policy-health-report-logs'), help=u"""Gets a list of errors and warnings from a masking policy health check. \n[Command Reference](listMaskingPolicyHealthReportLogs)""")
+@cli_util.option('--masking-policy-health-report-id', required=True, help=u"""The OCID of the masking health report.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
-
-**Example:** query=(currentUser eq \"SCOTT\") and (topLevel eq \"YES\")""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["dbUserName", "sqlLevel", "sqlFirewallPolicyId", "lifecycleState"]), multiple=True, help=u"""The group by parameter to summarize the allowed SQL aggregation.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["logType"]), help=u"""sort by""")
+@cli_util.option('--message-type', type=custom_types.CliCaseInsensitiveChoice(["PASS", "WARNING", "ERROR"]), help=u"""A filter to return only the resources that match the specified log message type.""")
@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_safe', 'class': 'SqlFirewallAllowedSqlAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'MaskingPolicyHealthReportLogCollection'})
@cli_util.wrap_exceptions
-def list_sql_firewall_allowed_sql_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, scim_query, group_by):
+def list_masking_policy_health_report_logs(ctx, from_json, all_pages, page_size, masking_policy_health_report_id, limit, page, sort_order, sort_by, message_type):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(masking_policy_health_report_id, six.string_types) and len(masking_policy_health_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-health-report-id cannot be whitespace or empty string')
+
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if scim_query is not None:
- kwargs['scim_query'] = scim_query
- if group_by is not None and len(group_by) > 0:
- kwargs['group_by'] = group_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if message_type is not None:
+ kwargs['message_type'] = message_type
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -18696,70 +18064,74 @@ def list_sql_firewall_allowed_sql_analytics(ctx, from_json, all_pages, page_size
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sql_firewall_allowed_sql_analytics,
- compartment_id=compartment_id,
+ client.list_masking_policy_health_report_logs,
+ masking_policy_health_report_id=masking_policy_health_report_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sql_firewall_allowed_sql_analytics,
+ client.list_masking_policy_health_report_logs,
limit,
page_size,
- compartment_id=compartment_id,
+ masking_policy_health_report_id=masking_policy_health_report_id,
**kwargs
)
else:
- result = client.list_sql_firewall_allowed_sql_analytics(
- compartment_id=compartment_id,
+ result = client.list_masking_policy_health_report_logs(
+ masking_policy_health_report_id=masking_policy_health_report_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sql_firewall_allowed_sql_collection_group.command(name=cli_util.override('data_safe.list_sql_firewall_allowed_sqls.command_name', 'list-sql-firewall-allowed-sqls'), help=u"""Retrieves a list of all SQL Firewall allowed SQL statements.
-
-The ListSqlFirewallAllowedSqls operation returns only the SQL Firewall allowed SQL statements in the specified `compartmentId`.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform ListSqlFirewallPolicies on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSqlFirewallAllowedSqls)""")
+@masking_policy_health_report_group.command(name=cli_util.override('data_safe.list_masking_policy_health_reports.command_name', 'list'), help=u"""Gets a list of masking policy health reports based on the specified query parameters. \n[Command Reference](listMaskingPolicyHealthReports)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--masking-policy-health-report-id', help=u"""A filter to return only the resources that match the specified masking policy health report OCID.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
-
-**Example:** query=(currentUser eq \"SCOTT\") and (topLevel eq \"YES\")""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""sort by""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCollected"]), help=u"""The field to sort by. Only one sort parameter should be provided.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--masking-policy-id', help=u"""A filter to return only the resources that match the specified masking policy OCID.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle states.""")
@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_safe', 'class': 'SqlFirewallAllowedSqlCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'MaskingPolicyHealthReportCollection'})
@cli_util.wrap_exceptions
-def list_sql_firewall_allowed_sqls(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, scim_query, sort_order, sort_by):
+def list_masking_policy_health_reports(ctx, from_json, all_pages, page_size, compartment_id, masking_policy_health_report_id, limit, page, compartment_id_in_subtree, access_level, sort_by, sort_order, display_name, target_id, masking_policy_id, lifecycle_state):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
+ if masking_policy_health_report_id is not None:
+ kwargs['masking_policy_health_report_id'] = masking_policy_health_report_id
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if scim_query is not None:
- kwargs['scim_query'] = scim_query
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
if sort_by is not None:
kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if masking_policy_id is not None:
+ kwargs['masking_policy_id'] = masking_policy_id
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -18767,89 +18139,64 @@ def list_sql_firewall_allowed_sqls(ctx, from_json, all_pages, page_size, compart
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sql_firewall_allowed_sqls,
+ client.list_masking_policy_health_reports,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sql_firewall_allowed_sqls,
+ client.list_masking_policy_health_reports,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_sql_firewall_allowed_sqls(
+ result = client.list_masking_policy_health_reports(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sql_firewall_policy_collection_group.command(name=cli_util.override('data_safe.list_sql_firewall_policies.command_name', 'list-sql-firewall-policies'), help=u"""Retrieves a list of all SQL Firewall policies.
-
-The ListSqlFirewallPolicies operation returns only the SQL Firewall policies in the specified `compartmentId`.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform ListSqlFirewallPolicies on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSqlFirewallPolicies)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@masking_policy_referential_relation_summary_group.command(name=cli_util.override('data_safe.list_masking_policy_referential_relations.command_name', 'list-masking-policy-referential-relations'), help=u"""Gets a list of referential relations present in the specified masking policy based on the specified query parameters. \n[Command Reference](listMaskingPolicyReferentialRelations)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
+@cli_util.option('--relation-type', type=custom_types.CliCaseInsensitiveChoice(["NONE", "APP_DEFINED", "DB_DEFINED"]), multiple=True, help=u"""A filter to return columns based on their relationship with their parent columns. If set to NONE, it returns the columns that do not have any parent. The response includes the parent columns as well as the independent columns that are not in any relationship. If set to APP_DEFINED, it returns all the child columns that have application-level (non-dictionary) relationship with their parents. If set to DB_DEFINED, it returns all the child columns that have database-level (dictionary-defined) relationship with their parents.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--security-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy resource.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "FAILED", "DELETING", "DELETED", "NEEDS_ATTENTION"]), help=u"""The current state of the SQL Firewall policy.""")
-@cli_util.option('--sql-firewall-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the SQL Firewall policy resource.""")
-@cli_util.option('--db-user-name', help=u"""A filter to return only items that match the specified user name.""")
-@cli_util.option('--violation-action', type=custom_types.CliCaseInsensitiveChoice(["block", "observe"]), help=u"""An optional filter to return only resources that match the specified violation action.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["relationType", "schemaName", "objectName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder).""")
@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({})
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SqlFirewallPolicyCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'MaskingPolicyReferentialRelationCollection'})
@cli_util.wrap_exceptions
-def list_sql_firewall_policies(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, security_policy_id, lifecycle_state, sql_firewall_policy_id, db_user_name, violation_action, time_created_greater_than_or_equal_to, time_created_less_than, sort_order, sort_by):
+def list_masking_policy_referential_relations(ctx, from_json, all_pages, page_size, masking_policy_id, schema_name, object_name, column_name, relation_type, 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')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if column_name is not None and len(column_name) > 0:
+ kwargs['column_name'] = column_name
+ if relation_type is not None and len(relation_type) > 0:
+ kwargs['relation_type'] = relation_type
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if security_policy_id is not None:
- kwargs['security_policy_id'] = security_policy_id
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if sql_firewall_policy_id is not None:
- kwargs['sql_firewall_policy_id'] = sql_firewall_policy_id
- if db_user_name is not None:
- kwargs['db_user_name'] = db_user_name
- if violation_action is not None:
- kwargs['violation_action'] = violation_action
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
@@ -18861,152 +18208,128 @@ def list_sql_firewall_policies(ctx, from_json, all_pages, page_size, compartment
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sql_firewall_policies,
- compartment_id=compartment_id,
+ client.list_masking_policy_referential_relations,
+ masking_policy_id=masking_policy_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sql_firewall_policies,
+ client.list_masking_policy_referential_relations,
limit,
page_size,
- compartment_id=compartment_id,
+ masking_policy_id=masking_policy_id,
**kwargs
)
else:
- result = client.list_sql_firewall_policies(
- compartment_id=compartment_id,
+ result = client.list_masking_policy_referential_relations(
+ masking_policy_id=masking_policy_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sql_firewall_policy_analytics_collection_group.command(name=cli_util.override('data_safe.list_sql_firewall_policy_analytics.command_name', 'list-sql-firewall-policy-analytics'), help=u"""Gets a list of aggregated SQL Firewall policy details.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform SummarizedSqlFirewallPolicyInfo on the specified `compartmentId` and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSqlFirewallPolicyAnalytics)""")
+@masking_policy_group.command(name=cli_util.override('data_safe.list_masking_reports.command_name', 'list-masking-reports'), help=u"""Gets a list of masking reports based on the specified query parameters. \n[Command Reference](listMaskingReports)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["violationAction", "enforcementScope", "securityPolicyId", "lifecycleState"]), multiple=True, help=u"""The group by parameter to summarize SQL Firewall policy aggregation.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "FAILED", "DELETING", "DELETED", "NEEDS_ATTENTION"]), help=u"""The current state of the SQL Firewall policy.""")
-@cli_util.option('--security-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy resource.""")
-@cli_util.option('--time-started', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return the summary of the SQL Firewall policies created after the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-ended', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return the summary of the SQL Firewall policies created before the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--masking-policy-id', help=u"""A filter to return only the resources that match the specified masking policy OCID.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeMaskingFinished"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeMaskingFinished is descending.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@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_safe', 'class': 'SqlFirewallPolicyAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'MaskingReportCollection'})
@cli_util.wrap_exceptions
-def list_sql_firewall_policy_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, group_by, lifecycle_state, security_policy_id, time_started, time_ended):
+def list_masking_reports(ctx, from_json, all_pages, page_size, compartment_id, limit, page, masking_policy_id, target_id, target_database_group_id, sort_order, sort_by, compartment_id_in_subtree, access_level):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if group_by is not None and len(group_by) > 0:
- kwargs['group_by'] = group_by
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if security_policy_id is not None:
- kwargs['security_policy_id'] = security_policy_id
- if time_started is not None:
- kwargs['time_started'] = time_started
- if time_ended is not None:
- kwargs['time_ended'] = time_ended
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_sql_firewall_policy_analytics,
+ if masking_policy_id is not None:
+ kwargs['masking_policy_id'] = masking_policy_id
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_masking_reports,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sql_firewall_policy_analytics,
+ client.list_masking_reports,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_sql_firewall_policy_analytics(
+ result = client.list_masking_reports(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sql_firewall_violation_summary_group.command(name=cli_util.override('data_safe.list_sql_firewall_violation_analytics.command_name', 'list-sql-firewall-violation-analytics'), help=u"""Returns the aggregation details of the SQL Firewall violations. \n[Command Reference](listSqlFirewallViolationAnalytics)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@masking_schema_collection_group.command(name=cli_util.override('data_safe.list_masking_schemas.command_name', 'list-masking-schemas'), help=u"""Gets a list of masking schemas present in the specified masking policy and based on the specified query parameters. \n[Command Reference](listMaskingSchemas)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--time-started', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is greater than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-ended', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is less than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--query-time-zone', help=u"""Default time zone is UTC if no time zone provided. The date-time considerations of the resource will be in accordance with the specified time zone.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["dbUserName", "targetId", "targetName", "operationTime", "timeCollected", "clientOsUserName", "operation", "currentDbUserName", "sqlLevel", "clientIp", "clientProgram", "violationCause", "violationAction", "violationCount"]), help=u"""If this query parameter is specified, the result is sorted by this query parameter value.""")
-@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
-
-**Example:** query=(operationTime ge \"2021-06-04T01:00:26.000Z\") and (violationAction eq \"BLOCKED\")""")
-@cli_util.option('--summary-field', type=custom_types.CliCaseInsensitiveChoice(["dbUserName", "targetName", "clientOsUserName", "operation", "sqlText", "currentDbUserName", "sqlLevel", "clientIp", "clientProgram", "violationCause", "violationAction", "selects", "creates", "alters", "drops", "grants", "revokes"]), multiple=True, help=u"""Specifies a subset of summarized fields to be returned in the response.""")
-@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["dbUserName", "targetName", "operationTime", "timeCollected", "clientOsUserName", "operation", "sqlText", "currentDbUserName", "sqlLevel", "clientIp", "clientProgram", "violationCause", "violationAction"]), multiple=True, help=u"""A groupBy can only be used in combination with summaryField parameter. A groupBy value has to be a subset of the values mentioned in summaryField parameter.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order is ascending.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
@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({})
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SqlFirewallViolationAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'MaskingSchemaCollection'})
@cli_util.wrap_exceptions
-def list_sql_firewall_violation_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, time_started, time_ended, query_time_zone, sort_order, sort_by, scim_query, summary_field, group_by):
+def list_masking_schemas(ctx, from_json, all_pages, page_size, masking_policy_id, limit, page, sort_order, sort_by, schema_name):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if time_started is not None:
- kwargs['time_started'] = time_started
- if time_ended is not None:
- kwargs['time_ended'] = time_ended
- if query_time_zone is not None:
- kwargs['query_time_zone'] = query_time_zone
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
- if scim_query is not None:
- kwargs['scim_query'] = scim_query
- if summary_field is not None and len(summary_field) > 0:
- kwargs['summary_field'] = summary_field
- if group_by is not None and len(group_by) > 0:
- kwargs['group_by'] = group_by
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -19014,64 +18337,68 @@ def list_sql_firewall_violation_analytics(ctx, from_json, all_pages, page_size,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sql_firewall_violation_analytics,
- compartment_id=compartment_id,
+ client.list_masking_schemas,
+ masking_policy_id=masking_policy_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sql_firewall_violation_analytics,
+ client.list_masking_schemas,
limit,
page_size,
- compartment_id=compartment_id,
+ masking_policy_id=masking_policy_id,
**kwargs
)
else:
- result = client.list_sql_firewall_violation_analytics(
- compartment_id=compartment_id,
+ result = client.list_masking_schemas(
+ masking_policy_id=masking_policy_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@sql_firewall_violation_summary_group.command(name=cli_util.override('data_safe.list_sql_firewall_violations.command_name', 'list-sql-firewall-violations'), help=u"""Gets a list of all the SQL Firewall violations captured by the firewall. \n[Command Reference](listSqlFirewallViolations)""")
+@on_prem_connector_group.command(name=cli_util.override('data_safe.list_on_prem_connectors.command_name', 'list'), help=u"""Gets a list of on-premises connectors. \n[Command Reference](listOnPremConnectors)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--on-prem-connector-id', help=u"""A filter to return only the on-premises connector that matches the specified id.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@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 on-premises connector resources that match the specified lifecycle state.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["dbUserName", "targetId", "targetName", "operationTime", "timeCollected", "clientOsUserName", "operation", "currentDbUserName", "sqlLevel", "clientIp", "clientProgram", "violationCause", "violationAction"]), help=u"""If this query parameter is specified, the result is sorted by this query parameter value.""")
-@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
-
-**Example:** query=(operationTime ge \"2021-06-04T01:00:26.000Z\") and (violationAction eq \"BLOCKED\")""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@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_safe', 'class': 'SqlFirewallViolationsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[OnPremConnectorSummary]'})
@cli_util.wrap_exceptions
-def list_sql_firewall_violations(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, limit, page, access_level, sort_order, sort_by, scim_query):
+def list_on_prem_connectors(ctx, from_json, all_pages, page_size, compartment_id, on_prem_connector_id, display_name, lifecycle_state, limit, page, sort_order, sort_by, compartment_id_in_subtree, access_level):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if on_prem_connector_id is not None:
+ kwargs['on_prem_connector_id'] = on_prem_connector_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 access_level is not None:
- kwargs['access_level'] = access_level
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
- if scim_query is not None:
- kwargs['scim_query'] = scim_query
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -19079,44 +18406,78 @@ def list_sql_firewall_violations(ctx, from_json, all_pages, page_size, compartme
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_sql_firewall_violations,
+ client.list_on_prem_connectors,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_sql_firewall_violations,
+ client.list_on_prem_connectors,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_sql_firewall_violations(
+ result = client.list_on_prem_connectors(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.list_tables.command_name', 'list-tables'), help=u"""Returns a list of table metadata objects. \n[Command Reference](listTables)""")
+@user_assessment_group.command(name=cli_util.override('data_safe.list_password_expiry_date_analytics.command_name', 'list-password-expiry-date-analytics'), help=u"""Gets a list of count of the users with password expiry dates in next 30 days, between next 30-90 days, and beyond 90 days based on specified user assessment. It internally uses the aforementioned userAnalytics api.
+
+When you perform the ListPasswordExpiryDateAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns compartments in which the requestor has READ permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned.
+
+To use ListPasswordExpiryDateAnalytics to get a full list of all compartments and subcompartments in the tenancy from the root compartment, set the parameter compartmentIdInSubtree to true and accessLevel to ACCESSIBLE. \n[Command Reference](listPasswordExpiryDateAnalytics)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--user-category', help=u"""A filter to return only items that match the specified user category.""")
+@cli_util.option('--time-password-expiry-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose password expiry date in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@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': 'data_safe', 'class': 'list[UserAggregation]'})
+@cli_util.wrap_exceptions
+def list_password_expiry_date_analytics(ctx, from_json, all_pages, user_assessment_id, compartment_id_in_subtree, access_level, user_category, time_password_expiry_less_than):
+
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if user_category is not None:
+ kwargs['user_category'] = user_category
+ if time_password_expiry_less_than is not None:
+ kwargs['time_password_expiry_less_than'] = time_password_expiry_less_than
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.list_password_expiry_date_analytics(
+ user_assessment_id=user_assessment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@peer_target_database_group.command(name=cli_util.override('data_safe.list_peer_target_databases.command_name', 'list'), help=u"""Lists all the peer target databases under the primary target database identified by the OCID passed as path parameter. \n[Command Reference](listPeerTargetDatabases)""")
@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
-@cli_util.option('--table-name', multiple=True, help=u"""A filter to return only items related to specific table name.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["SCHEMANAME", "TABLENAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified.""")
-@cli_util.option('--table-name-contains', help=u"""A filter to return only items if table name contains a specific string.""")
-@cli_util.option('--schema-name-contains', help=u"""A filter to return only items if schema name contains a specific string.""")
@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'table-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@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={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'table-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'list[TableSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'PeerTargetDatabaseCollection'})
@cli_util.wrap_exceptions
-def list_tables(ctx, from_json, all_pages, page_size, target_database_id, limit, page, schema_name, table_name, sort_order, sort_by, table_name_contains, schema_name_contains):
+def list_peer_target_databases(ctx, from_json, all_pages, page_size, target_database_id, if_match, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
@@ -19125,22 +18486,12 @@ def list_tables(ctx, from_json, all_pages, page_size, target_database_id, limit,
raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if schema_name is not None and len(schema_name) > 0:
- kwargs['schema_name'] = schema_name
- if table_name is not None and len(table_name) > 0:
- kwargs['table_name'] = table_name
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if table_name_contains is not None:
- kwargs['table_name_contains'] = table_name_contains
- if schema_name_contains is not None:
- kwargs['schema_name_contains'] = schema_name_contains
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -19148,84 +18499,75 @@ def list_tables(ctx, from_json, all_pages, page_size, target_database_id, limit,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_tables,
+ client.list_peer_target_databases,
target_database_id=target_database_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_tables,
+ client.list_peer_target_databases,
limit,
page_size,
target_database_id=target_database_id,
**kwargs
)
else:
- result = client.list_tables(
+ result = client.list_peer_target_databases(
target_database_id=target_database_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@target_alert_policy_association_summary_group.command(name=cli_util.override('data_safe.list_target_alert_policy_associations.command_name', 'list-target-alert-policy-associations'), help=u"""Gets a list of all target-alert policy associations. \n[Command Reference](listTargetAlertPolicyAssociations)""")
+@profile_group.command(name=cli_util.override('data_safe.list_profile_analytics.command_name', 'list-profile-analytics'), help=u"""Gets a list of aggregated user profile details in the specified compartment. This provides information about the overall profiles available. For example, the user profile details include how many users have the profile assigned and do how many use password verification function. This data is especially useful content for dashboards or to support analytics.
+
+When you perform the ListProfileAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns compartments in which the requestor has INSPECT permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned.
+
+The parameter compartmentIdInSubtree applies when you perform ListProfileAnalytics on the compartmentId passed and when it is set to true, the entire hierarchy of compartments can be returned.
+
+To use ListProfileAnalytics to get a full list of all compartments and subcompartments in the tenancy from the root compartment, set the parameter compartmentIdInSubtree to true and accessLevel to ACCESSIBLE. \n[Command Reference](listProfileAnalytics)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--target-alert-policy-association-id', help=u"""A filter to return only items related to a specific target-alert policy association ID.""")
-@cli_util.option('--alert-policy-id', help=u"""A filter to return policy by it's OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""An optional filter to return only alert policies that have the given life-cycle state.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--profile-name', help=u"""A filter to return only items that match the specified profile name.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["DISPLAYNAME", "TIMECREATED", "TIMEUPDATED"]), help=u"""The field to sort by. Only one sort parameter may be provided.""")
-@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A optional filter to return only resources that belong to the specified alert policy association type.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@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_safe', 'class': 'TargetAlertPolicyAssociationCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[ProfileAggregation]'})
@cli_util.wrap_exceptions
-def list_target_alert_policy_associations(ctx, from_json, all_pages, page_size, compartment_id, target_alert_policy_association_id, alert_policy_id, target_id, lifecycle_state, limit, page, sort_order, sort_by, target_type, time_created_greater_than_or_equal_to, time_created_less_than, compartment_id_in_subtree, access_level):
+def list_profile_analytics(ctx, from_json, all_pages, page_size, user_assessment_id, compartment_id, compartment_id_in_subtree, access_level, target_id, limit, page, profile_name, sort_by, sort_order):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+
kwargs = {}
- if target_alert_policy_association_id is not None:
- kwargs['target_alert_policy_association_id'] = target_alert_policy_association_id
- if alert_policy_id is not None:
- kwargs['alert_policy_id'] = alert_policy_id
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
if target_id is not None:
kwargs['target_id'] = target_id
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
+ if profile_name is not None:
+ kwargs['profile_name'] = profile_name
if sort_by is not None:
kwargs['sort_by'] = sort_by
- if target_type is not None:
- kwargs['target_type'] = target_type
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -19233,52 +18575,110 @@ def list_target_alert_policy_associations(ctx, from_json, all_pages, page_size,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_target_alert_policy_associations,
+ client.list_profile_analytics,
+ user_assessment_id=user_assessment_id,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_target_alert_policy_associations,
+ client.list_profile_analytics,
limit,
page_size,
+ user_assessment_id=user_assessment_id,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_target_alert_policy_associations(
+ result = client.list_profile_analytics(
+ user_assessment_id=user_assessment_id,
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@target_alert_policy_association_group.command(name=cli_util.override('data_safe.list_target_alert_policy_unassociated_members.command_name', 'list-target-alert-policy-unassociated-members'), help=u"""Gets the details of target-alert policy association and its unassociated members by its ID. \n[Command Reference](listTargetAlertPolicyUnassociatedMembers)""")
-@cli_util.option('--target-alert-policy-association-id', required=True, help=u"""The OCID of the target-alert policy association.""")
+@user_assessment_group.command(name=cli_util.override('data_safe.list_profile_summaries.command_name', 'list-profile-summaries'), help=u"""Gets a list of user profiles containing the profile details along with the target id and user counts.
+
+The ListProfiles operation returns only the profiles belonging to a certain target. If compartment type user assessment id is provided, then profile information for all the targets belonging to the pertaining compartment is returned. The list does not include any subcompartments of the compartment under consideration.
+
+The parameter 'accessLevel' specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when 'compartmentIdInSubtree' is set to 'true'.
+
+The parameter 'compartmentIdInSubtree' applies when you perform ListUserProfiles on the 'compartmentId' belonging to the assessmentId passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter 'compartmentIdInSubtree' to true and 'accessLevel' to ACCESSIBLE. \n[Command Reference](listProfileSummaries)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "notAppliedReason"]), help=u"""The field to sort by. Only one sort parameter may be provided.""")
+@cli_util.option('--profile-name', help=u"""A filter to return only items that match the specified profile name.""")
+@cli_util.option('--is-user-created', type=click.BOOL, help=u"""An optional filter to return the user created profiles.""")
+@cli_util.option('--password-verification-function', help=u"""An optional filter to filter the profiles based on password verification function.""")
+@cli_util.option('--user-count-greater-than-or-equal', help=u"""An optional filter to return the profiles having user count greater than or equal to the provided value.""")
+@cli_util.option('--user-count-less-than', help=u"""An optional filter to return the profiles having user count less than the provided value.""")
+@cli_util.option('--failed-login-attempts-greater-than-or-equal', help=u"""An optional filter to return the profiles having allow failed login attempts number greater than or equal to the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
+@cli_util.option('--failed-login-attempts-less-than', help=u"""An optional filter to return the profiles having failed login attempts number less than the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
+@cli_util.option('--sessions-per-user-greater-than-or-equal', help=u"""An optional filter to return the profiles permitting the user to spawn multiple sessions having count. greater than or equal to the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
+@cli_util.option('--sessions-per-user-less-than', help=u"""An optional filter to return the profiles permitting the user to spawn multiple sessions having count less than the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
+@cli_util.option('--inactive-account-time-greater-than-or-equal', help=u"""An optional filter to return the profiles allowing inactive account time in days greater than or equal to the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
+@cli_util.option('--inactive-account-time-less-than', help=u"""An optional filter to return the profiles allowing inactive account time in days less than the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
+@cli_util.option('--password-lock-time-greater-than-or-equal', help=u"""An optional filter to return the profiles having password lock number greater than or equal to the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
+@cli_util.option('--password-lock-time-less-than', help=u"""An optional filter to return the profiles having password lock number less than the provided value. String value is used for accommodating the \"UNLIMITED\" and \"DEFAULT\" values.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["profileName", "targetId", "isUserCreated", "passwordVerificationFunction", "userCount", "sessionsPerUser", "inactiveAccountTime", "passwordLockTime", "failedLoginAttempts"]), help=u"""The field to sort by. You can specify only one sort order (sortOrder). The default order is targetId ASC.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'TargetAlertPolicyUnassociatedCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[ProfileSummary]'})
@cli_util.wrap_exceptions
-def list_target_alert_policy_unassociated_members(ctx, from_json, all_pages, page_size, target_alert_policy_association_id, limit, page, sort_by, sort_order):
+def list_profile_summaries(ctx, from_json, all_pages, page_size, user_assessment_id, compartment_id, compartment_id_in_subtree, access_level, target_id, limit, page, profile_name, is_user_created, password_verification_function, user_count_greater_than_or_equal, user_count_less_than, failed_login_attempts_greater_than_or_equal, failed_login_attempts_less_than, sessions_per_user_greater_than_or_equal, sessions_per_user_less_than, inactive_account_time_greater_than_or_equal, inactive_account_time_less_than, password_lock_time_greater_than_or_equal, password_lock_time_less_than, sort_by, sort_order):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(target_alert_policy_association_id, six.string_types) and len(target_alert_policy_association_id.strip()) == 0:
- raise click.UsageError('Parameter --target-alert-policy-association-id cannot be whitespace or empty string')
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if target_id is not None:
+ kwargs['target_id'] = target_id
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if profile_name is not None:
+ kwargs['profile_name'] = profile_name
+ if is_user_created is not None:
+ kwargs['is_user_created'] = is_user_created
+ if password_verification_function is not None:
+ kwargs['password_verification_function'] = password_verification_function
+ if user_count_greater_than_or_equal is not None:
+ kwargs['user_count_greater_than_or_equal'] = user_count_greater_than_or_equal
+ if user_count_less_than is not None:
+ kwargs['user_count_less_than'] = user_count_less_than
+ if failed_login_attempts_greater_than_or_equal is not None:
+ kwargs['failed_login_attempts_greater_than_or_equal'] = failed_login_attempts_greater_than_or_equal
+ if failed_login_attempts_less_than is not None:
+ kwargs['failed_login_attempts_less_than'] = failed_login_attempts_less_than
+ if sessions_per_user_greater_than_or_equal is not None:
+ kwargs['sessions_per_user_greater_than_or_equal'] = sessions_per_user_greater_than_or_equal
+ if sessions_per_user_less_than is not None:
+ kwargs['sessions_per_user_less_than'] = sessions_per_user_less_than
+ if inactive_account_time_greater_than_or_equal is not None:
+ kwargs['inactive_account_time_greater_than_or_equal'] = inactive_account_time_greater_than_or_equal
+ if inactive_account_time_less_than is not None:
+ kwargs['inactive_account_time_less_than'] = inactive_account_time_less_than
+ if password_lock_time_greater_than_or_equal is not None:
+ kwargs['password_lock_time_greater_than_or_equal'] = password_lock_time_greater_than_or_equal
+ if password_lock_time_less_than is not None:
+ kwargs['password_lock_time_less_than'] = password_lock_time_less_than
if sort_by is not None:
kwargs['sort_by'] = sort_by
if sort_order is not None:
@@ -19290,32 +18690,108 @@ def list_target_alert_policy_unassociated_members(ctx, from_json, all_pages, pag
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_target_alert_policy_unassociated_members,
- target_alert_policy_association_id=target_alert_policy_association_id,
+ client.list_profile_summaries,
+ user_assessment_id=user_assessment_id,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_target_alert_policy_unassociated_members,
+ client.list_profile_summaries,
limit,
page_size,
- target_alert_policy_association_id=target_alert_policy_association_id,
+ user_assessment_id=user_assessment_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_target_alert_policy_unassociated_members(
- target_alert_policy_association_id=target_alert_policy_association_id,
+ result = client.list_profile_summaries(
+ user_assessment_id=user_assessment_id,
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@target_database_group_summary_group.command(name=cli_util.override('data_safe.list_target_database_groups.command_name', 'list-target-database-groups'), help=u"""Retrieves a list of target database groups according to the specified query parameters. \n[Command Reference](listTargetDatabaseGroups)""")
+@referential_relation_group.command(name=cli_util.override('data_safe.list_referential_relations.command_name', 'list'), help=u"""Gets a list of referential relations present in the specified sensitive data model based on the specified query parameters. \n[Command Reference](listReferentialRelations)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
+@cli_util.option('--is-sensitive', type=click.BOOL, help=u"""Returns referential relations containing sensitive columns when true. Returns referential relations containing non sensitive columns when false.""")
+@cli_util.option('--relation-type', type=custom_types.CliCaseInsensitiveChoice(["NONE", "APP_DEFINED", "DB_DEFINED"]), multiple=True, help=u"""A filter to return sensitive columns based on their relationship with their parent columns. If set to NONE, it returns the sensitive columns that do not have any parent. The response includes the parent columns as well as the independent columns that are not in any relationship. If set to APP_DEFINED, it returns all the child columns that have application-level (non-dictionary) relationship with their parents. If set to DB_DEFINED, it returns all the child columns that have database-level (dictionary-defined) relationship with their parents.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["key", "relationType", "schemaName", "tableName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for key is descending.""")
+@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
+@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'ReferentialRelationCollection'})
+@cli_util.wrap_exceptions
+def list_referential_relations(ctx, from_json, all_pages, page_size, sensitive_data_model_id, schema_name, object_name, column_name, is_sensitive, relation_type, 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')
+
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if column_name is not None and len(column_name) > 0:
+ kwargs['column_name'] = column_name
+ if is_sensitive is not None:
+ kwargs['is_sensitive'] = is_sensitive
+ if relation_type is not None and len(relation_type) > 0:
+ kwargs['relation_type'] = relation_type
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_referential_relations,
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_referential_relations,
+ limit,
+ page_size,
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ else:
+ result = client.list_referential_relations(
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@registration_policy_summary_group.command(name=cli_util.override('data_safe.list_registration_policies.command_name', 'list-registration-policies'), help=u"""Retrieves a list of registration policies according to the specified query parameters. \n[Command Reference](listRegistrationPolicies)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--filter', help=u"""The scim query filter parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.) Ex:** filter=(targetDatabaseId eq 'ocid1.datasafetargetdatabase.oc1.iad.abuwcljr3u2va4ba5wek53idpe5qq5kkbigzclscc6mysfecxzjt5dgmxqza')""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName", "lifecycleState", "membershipUpdateTime"]), help=u"""The sorting field for your request. You can only specify a single sorting order (sortOrder). The default order for timeCreated is descending.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "NEEDS_ATTENTION"]), help=u"""A filter to retrieve resources that exclusively align with the designated lifecycle state.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName", "enablementLevel", "lifecycleState"]), help=u"""Field to sort the registration policies by. Only one sort order (sortOrder) can be specified. Defaults to sorting by `timeCreated` in descending order""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "NEEDS_ATTENTION", "FAILED", "DELETING"]), help=u"""Filter registration policies by their lifecycle state.""")
+@cli_util.option('--enablement-level', type=custom_types.CliCaseInsensitiveChoice(["DATABASE"]), help=u"""Filter registration policies by resource type.""")
+@cli_util.option('--resource-id', help=u"""Filter to return the registration policy matching the specified resource OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
@@ -19327,15 +18803,17 @@ def list_target_alert_policy_unassociated_members(ctx, from_json, all_pages, pag
**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--registration-policy-id', help=u"""Filter to return the registration policy matching the specified OCID.""")
+@cli_util.option('--connection-type', type=custom_types.CliCaseInsensitiveChoice(["PRIVATE_ENDPOINT", "ONPREM_CONNECTOR"]), help=u"""Filter to return the registration policies matching the specified connectionType i.e ONPREM_CONNECTOR or PRIVATE_ENDPOINT.""")
+@cli_util.option('--connection-id', help=u"""Filter to return the registration policies matching the specified connection ID.""")
@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_safe', 'class': 'TargetDatabaseGroupCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'RegistrationPolicyCollection'})
@cli_util.wrap_exceptions
-def list_target_database_groups(ctx, from_json, all_pages, page_size, compartment_id, display_name, filter, sort_by, lifecycle_state, compartment_id_in_subtree, access_level, sort_order, time_created_greater_than_or_equal_to, time_created_less_than, limit, page, target_database_group_id):
+def list_registration_policies(ctx, from_json, all_pages, page_size, compartment_id, display_name, sort_by, lifecycle_state, enablement_level, resource_id, compartment_id_in_subtree, access_level, sort_order, time_created_greater_than_or_equal_to, time_created_less_than, limit, page, registration_policy_id, connection_type, connection_id):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
@@ -19343,12 +18821,14 @@ def list_target_database_groups(ctx, from_json, all_pages, page_size, compartmen
kwargs = {}
if display_name is not None:
kwargs['display_name'] = display_name
- if filter is not None:
- kwargs['filter'] = filter
if sort_by is not None:
kwargs['sort_by'] = sort_by
if lifecycle_state is not None:
kwargs['lifecycle_state'] = lifecycle_state
+ if enablement_level is not None:
+ kwargs['enablement_level'] = enablement_level
+ if resource_id is not None:
+ kwargs['resource_id'] = resource_id
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
@@ -19363,8 +18843,12 @@ def list_target_database_groups(ctx, from_json, all_pages, page_size, compartmen
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
+ if registration_policy_id is not None:
+ kwargs['registration_policy_id'] = registration_policy_id
+ if connection_type is not None:
+ kwargs['connection_type'] = connection_type
+ if connection_id is not None:
+ kwargs['connection_id'] = connection_id
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -19372,77 +18856,57 @@ def list_target_database_groups(ctx, from_json, all_pages, page_size, compartmen
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_target_database_groups,
+ client.list_registration_policies,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_target_database_groups,
+ client.list_registration_policies,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_target_database_groups(
+ result = client.list_registration_policies(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.list_target_databases.command_name', 'list'), help=u"""Returns the list of registered target databases in Data Safe. \n[Command Reference](listTargetDatabases)""")
+@registration_policy_group.command(name=cli_util.override('data_safe.list_registration_policy_target_databases.command_name', 'list-registration-policy-target-databases'), help=u"""Retrieves the OCIDs of target databases registered via the specified registration policy. Supports optional filtering by registration status (OPTIN/OPTOUT) and by target database OCID. \n[Command Reference](listRegistrationPolicyTargetDatabases)""")
+@cli_util.option('--registration-policy-id', required=True, help=u"""The OCID of the registration policy to be used for identification""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--associated-resource-id', help=u"""A filter to return the target databases that are associated to the resource id passed in as a parameter value.""")
-@cli_util.option('--target-database-id', help=u"""A filter to return the target database that matches the specified OCID.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only target databases that match the specified lifecycle state.""")
-@cli_util.option('--database-type', type=custom_types.CliCaseInsensitiveChoice(["DATABASE_CLOUD_SERVICE", "AUTONOMOUS_DATABASE", "INSTALLED_DATABASE"]), help=u"""A filter to return only target databases that match the specified database type.""")
-@cli_util.option('--infrastructure-type', type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""A filter to return only target databases that match the specified infrastructure type.""")
+@cli_util.option('--target-database-id', help=u"""A filter to return the target database only if it is registered via the registration policy.""")
+@cli_util.option('--membership-status', type=custom_types.CliCaseInsensitiveChoice(["OPTIN", "OPTOUT"]), help=u"""Filters registered targets associated with this registration policy by membership status. - OPTIN: returns targets that are included (opted in) by the policy. - OPTOUT: returns targets that are explicitly excluded (opted out) by the policy.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'list[TargetDatabaseSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'RegistrationPolicyTargetDatabaseSummaryCollection'})
@cli_util.wrap_exceptions
-def list_target_databases(ctx, from_json, all_pages, page_size, compartment_id, associated_resource_id, target_database_id, display_name, lifecycle_state, database_type, infrastructure_type, limit, page, compartment_id_in_subtree, access_level, sort_order, sort_by):
+def list_registration_policy_target_databases(ctx, from_json, all_pages, page_size, registration_policy_id, compartment_id, target_database_id, membership_status, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(registration_policy_id, six.string_types) and len(registration_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --registration-policy-id cannot be whitespace or empty string')
+
kwargs = {}
- if associated_resource_id is not None:
- kwargs['associated_resource_id'] = associated_resource_id
if target_database_id is not None:
kwargs['target_database_id'] = target_database_id
- if display_name is not None:
- kwargs['display_name'] = display_name
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if database_type is not None:
- kwargs['database_type'] = database_type
- if infrastructure_type is not None:
- kwargs['infrastructure_type'] = infrastructure_type
+ if membership_status is not None:
+ kwargs['membership_status'] = membership_status
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- 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_safe', 'data_safe', ctx)
if all_pages:
@@ -19450,59 +18914,77 @@ def list_target_databases(ctx, from_json, all_pages, page_size, compartment_id,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_target_databases,
+ client.list_registration_policy_target_databases,
+ registration_policy_id=registration_policy_id,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_target_databases,
+ client.list_registration_policy_target_databases,
limit,
page_size,
+ registration_policy_id=registration_policy_id,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_target_databases(
+ result = client.list_registration_policy_target_databases(
+ registration_policy_id=registration_policy_id,
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@audit_profile_group.command(name=cli_util.override('data_safe.list_target_overrides.command_name', 'list-target-overrides'), help=u"""Gets a list of all targets whose audit settings override the target group setting. \n[Command Reference](listTargetOverrides)""")
-@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
+@report_definition_group.command(name=cli_util.override('data_safe.list_report_definitions.command_name', 'list'), help=u"""Gets a list of report definitions. The ListReportDefinitions operation returns only the report definitions in the specified `compartmentId`. It also returns the seeded report definitions which are available to all the compartments. \n[Command Reference](listReportDefinitions)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""The name of the report definition to query.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME", "DISPLAYORDER"]), help=u"""The field used for sorting. Only one sorting parameter order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
+@cli_util.option('--is-seeded', type=click.BOOL, help=u"""A boolean flag indicating to list seeded report definitions. Set this parameter to get list of seeded report definitions.""")
+@cli_util.option('--data-source', type=custom_types.CliCaseInsensitiveChoice(["EVENTS", "ALERTS", "SECURITY_ASSESSMENT", "CRYPTO_ASSESSMENT", "VIOLATIONS", "ALLOWED_SQL"]), help=u"""Specifies the name of a resource that provides data for the report. For example alerts, events.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""An optional filter to return only resources that match the specified lifecycle state.""")
+@cli_util.option('--category', type=custom_types.CliCaseInsensitiveChoice(["CUSTOM_REPORTS", "SUMMARY", "ACTIVITY_AUDITING", "CRYPTO_ASSESSMENT"]), help=u"""An optional filter to return only resources that match the specified category.""")
@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_safe', 'class': 'TargetOverrideCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'ReportDefinitionCollection'})
@cli_util.wrap_exceptions
-def list_target_overrides(ctx, from_json, all_pages, page_size, audit_profile_id, limit, page, display_name, sort_by, sort_order):
+def list_report_definitions(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, sort_order, sort_by, is_seeded, data_source, lifecycle_state, category):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-profile-id cannot be whitespace or empty string')
-
kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if display_name is not None:
- kwargs['display_name'] = display_name
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
if sort_order is not None:
kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if is_seeded is not None:
+ kwargs['is_seeded'] = is_seeded
+ if data_source is not None:
+ kwargs['data_source'] = data_source
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if category is not None:
+ kwargs['category'] = category
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -19510,49 +18992,54 @@ def list_target_overrides(ctx, from_json, all_pages, page_size, audit_profile_id
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_target_overrides,
- audit_profile_id=audit_profile_id,
+ client.list_report_definitions,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_target_overrides,
+ client.list_report_definitions,
limit,
page_size,
- audit_profile_id=audit_profile_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_target_overrides(
- audit_profile_id=audit_profile_id,
+ result = client.list_report_definitions(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.list_template_analytics.command_name', 'list-template-analytics'), help=u"""Gets a list of template aggregated details in the specified compartment. This provides information about the overall template usage, by returning the count of the target databases/target groups using the templates. It also provides information about the statistics for the template baseline and the comparison related. If the comparison is done, it will show if there is any drift, and how many checks have drifts. The dimension field - isGroup identifies if the targetId belongs to a target group or a individual target. The dimension field - isCompared identifies if the comparison between the latest assessment and the template baseline assessment is done or not. The dimension field - isCompliant identifies if the latest assessment is compliant with the template baseline assessment or not. The dimension field - totalChecksFailed identifies how many checks in the template have drifts in the comparison.
-
-When you perform the ListTemplateAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns statistics from the compartments in which the requestor has INSPECT permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned. \n[Command Reference](listTemplateAnalytics)""")
+@report_summary_group.command(name=cli_util.override('data_safe.list_reports.command_name', 'list-reports'), help=u"""Gets a list of all the reports in the compartment. It contains information such as report generation time. \n[Command Reference](listReports)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--template-assessment-id', help=u"""The OCID of the security assessment of type TEMPLATE.""")
-@cli_util.option('--template-baseline-assessment-id', help=u"""The OCID of the security assessment of type TEMPLATE_BASELINE.""")
-@cli_util.option('--is-group', type=click.BOOL, help=u"""A filter to return only the target group related information if the OCID belongs to a target group.""")
-@cli_util.option('--is-compared', type=click.BOOL, help=u"""A filter to return only the statistics where the comparison between the latest assessment and the template baseline assessment is done.""")
-@cli_util.option('--is-compliant', type=click.BOOL, help=u"""A filter to return only the statistics where the latest assessment is compliant with the template baseline assessment.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--display-name', help=u"""The name of the report definition to query.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeGenerated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeGenerated is descending. Default order for displayName is ascending. If no value is specified timeGenerated is default.""")
+@cli_util.option('--mime-type', type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS", "JSON"]), help=u"""An optional filter to return only resources that match the specified mime type.""")
+@cli_util.option('--report-definition-id', help=u"""The ID of the report definition to filter the list of reports""")
+@cli_util.option('--time-generated-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were generated after the specified date and time, as defined by [RFC3339]. Using TimeGeneratedGreaterThanOrEqualToQueryParam parameter retrieves all resources generated after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-generated-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were generated before a specific date. Specifying this parameter corresponding `timeGeneratedLessThan` parameter will retrieve all resources generated before the specified generated date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["UPDATING", "ACTIVE", "CREATING", "FAILED"]), help=u"""An optional filter to return only resources that match the specified lifecycle state.""")
+@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["GENERATED", "SCHEDULED"]), help=u"""An optional filter to return only resources that match the specified type.""")
+@cli_util.option('--data-source', type=custom_types.CliCaseInsensitiveChoice(["EVENTS", "ALERTS", "SECURITY_ASSESSMENT", "CRYPTO_ASSESSMENT", "VIOLATIONS", "ALLOWED_SQL"]), help=u"""Specifies the name of a resource that provides data for the report. For example alerts, events.""")
@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_safe', 'class': 'TemplateAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'ReportCollection'})
@cli_util.wrap_exceptions
-def list_template_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, template_assessment_id, template_baseline_assessment_id, is_group, is_compared, is_compliant, target_id, target_database_group_id, limit, page):
+def list_reports(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, sort_order, sort_by, mime_type, report_definition_id, time_generated_greater_than_or_equal_to, time_generated_less_than, lifecycle_state, type, data_source):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
@@ -19562,24 +19049,30 @@ def list_template_analytics(ctx, from_json, all_pages, page_size, compartment_id
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
kwargs['access_level'] = access_level
- if template_assessment_id is not None:
- kwargs['template_assessment_id'] = template_assessment_id
- if template_baseline_assessment_id is not None:
- kwargs['template_baseline_assessment_id'] = template_baseline_assessment_id
- if is_group is not None:
- kwargs['is_group'] = is_group
- if is_compared is not None:
- kwargs['is_compared'] = is_compared
- if is_compliant is not None:
- kwargs['is_compliant'] = is_compliant
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
+ if display_name is not None:
+ kwargs['display_name'] = display_name
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if mime_type is not None:
+ kwargs['mime_type'] = mime_type
+ if report_definition_id is not None:
+ kwargs['report_definition_id'] = report_definition_id
+ if time_generated_greater_than_or_equal_to is not None:
+ kwargs['time_generated_greater_than_or_equal_to'] = time_generated_greater_than_or_equal_to
+ if time_generated_less_than is not None:
+ kwargs['time_generated_less_than'] = time_generated_less_than
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if type is not None:
+ kwargs['type'] = type
+ if data_source is not None:
+ kwargs['data_source'] = data_source
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -19587,40 +19080,32 @@ def list_template_analytics(ctx, from_json, all_pages, page_size, compartment_id
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_template_analytics,
+ client.list_reports,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_template_analytics,
+ client.list_reports,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_template_analytics(
+ result = client.list_reports(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.list_template_association_analytics.command_name', 'list-template-association-analytics'), help=u"""Gets a list of template association details in the specified compartment. This provides information about the overall template usage, by returning the count of the target databases/target groups using the templates.
-
-If the template baseline is created for a target group which contains several targets, we will have each individual target listed there as targetId field together with targetDatabaseGroupId. And if the template baseline is created for an individual target, it will have targetId field only.
-
-By leveraging the targetId filter, you will be able to know all the template or template baseline that this target has something to do with. No matter if they are directly applied or created for this target, or they are for the target group the target belongs to.
+@role_grant_path_collection_group.command(name=cli_util.override('data_safe.list_role_grant_paths.command_name', 'list-role-grant-paths'), help=u"""Retrieves a list of all role grant paths for a particular user.
-When you perform the ListTemplateAssociationAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns statistics from the compartments in which the requestor has INSPECT permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned. \n[Command Reference](listTemplateAssociationAnalytics)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--template-assessment-id', help=u"""The OCID of the security assessment of type TEMPLATE.""")
-@cli_util.option('--template-baseline-assessment-id', help=u"""The OCID of the security assessment of type TEMPLATE_BASELINE.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+The ListRoleGrantPaths operation returns only the role grant paths for the specified security policy report. \n[Command Reference](listRoleGrantPaths)""")
+@cli_util.option('--security-policy-report-id', required=True, help=u"""The OCID of the security policy report resource.""")
+@cli_util.option('--grantee', required=True, help=u"""A filter to return only items that match the specified grantee.""")
+@cli_util.option('--granted-role', required=True, help=u"""A filter to return only items that match the specified role.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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.""")
@@ -19628,26 +19113,17 @@ def list_template_analytics(ctx, from_json, all_pages, page_size, compartment_id
@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_safe', 'class': 'TemplateAssociationAnalyticsCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'RoleGrantPathCollection'})
@cli_util.wrap_exceptions
-def list_template_association_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, template_assessment_id, template_baseline_assessment_id, target_id, target_database_group_id, limit, page):
+def list_role_grant_paths(ctx, from_json, all_pages, page_size, security_policy_report_id, grantee, granted_role, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(security_policy_report_id, six.string_types) and len(security_policy_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-report-id cannot be whitespace or empty string')
+
kwargs = {}
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if template_assessment_id is not None:
- kwargs['template_assessment_id'] = template_assessment_id
- if template_baseline_assessment_id is not None:
- kwargs['template_baseline_assessment_id'] = template_baseline_assessment_id
- if target_id is not None:
- kwargs['target_id'] = target_id
- if target_database_group_id is not None:
- kwargs['target_database_group_id'] = target_database_group_id
if limit is not None:
kwargs['limit'] = limit
if page is not None:
@@ -19659,93 +19135,74 @@ def list_template_association_analytics(ctx, from_json, all_pages, page_size, co
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_template_association_analytics,
- compartment_id=compartment_id,
+ client.list_role_grant_paths,
+ security_policy_report_id=security_policy_report_id,
+ grantee=grantee,
+ granted_role=granted_role,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_template_association_analytics,
+ client.list_role_grant_paths,
limit,
page_size,
- compartment_id=compartment_id,
+ security_policy_report_id=security_policy_report_id,
+ grantee=grantee,
+ granted_role=granted_role,
**kwargs
)
else:
- result = client.list_template_association_analytics(
- compartment_id=compartment_id,
+ result = client.list_role_grant_paths(
+ security_policy_report_id=security_policy_report_id,
+ grantee=grantee,
+ granted_role=granted_role,
**kwargs
)
cli_util.render_response(result, ctx)
-@unified_audit_policy_collection_group.command(name=cli_util.override('data_safe.list_unified_audit_policies.command_name', 'list-unified-audit-policies'), help=u"""Retrieves a list of all Unified Audit policies.
-
-The ListUnifiedAuditPolicies operation returns only the Unified Audit policies in the specified `compartmentId`.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requester has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a sub-compartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform ListUnifiedAuditPolicies on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and sub-compartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listUnifiedAuditPolicies)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--security-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy resource.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "FAILED", "DELETING", "NEEDS_ATTENTION", "DELETED"]), help=u"""The current state of the Unified Audit policy.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--is-seeded', type=click.BOOL, help=u"""A boolean flag indicating to list seeded unified audit policies. Set this parameter to get list of seeded unified audit policies.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@target_database_group.command(name=cli_util.override('data_safe.list_roles.command_name', 'list-roles'), help=u"""Returns a list of role metadata objects. \n[Command Reference](listRoles)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--unified-audit-policy-definition-id', help=u"""An optional filter to return only resources that match the specified OCID of the unified audit policy definition resource.""")
-@cli_util.option('--unified-audit-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the Unified Audit policy resource.""")
+@cli_util.option('--role-name', multiple=True, help=u"""A filter to return only a specific role based on role name.""")
+@cli_util.option('--is-oracle-maintained', type=click.BOOL, help=u"""A filter to return roles based on whether they are maintained by oracle or not.""")
+@cli_util.option('--authentication-type', help=u"""A filter to return roles based on authentication type.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["ROLENAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified.""")
+@cli_util.option('--role-name-contains', help=u"""A filter to return only items if role name contains a specific string.""")
@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({})
+@json_skeleton_utils.get_cli_json_input_option({'role-name': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'UnifiedAuditPolicyCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'role-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'list[RoleSummary]'})
@cli_util.wrap_exceptions
-def list_unified_audit_policies(ctx, from_json, all_pages, page_size, compartment_id, security_policy_id, lifecycle_state, access_level, display_name, is_seeded, time_created_greater_than_or_equal_to, time_created_less_than, limit, page, unified_audit_policy_definition_id, unified_audit_policy_id, sort_order, sort_by, compartment_id_in_subtree):
+def list_roles(ctx, from_json, all_pages, page_size, target_database_id, limit, page, role_name, is_oracle_maintained, authentication_type, sort_order, sort_by, role_name_contains):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+
kwargs = {}
- if security_policy_id is not None:
- kwargs['security_policy_id'] = security_policy_id
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
- if is_seeded is not None:
- kwargs['is_seeded'] = is_seeded
- if time_created_greater_than_or_equal_to is not None:
- kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
- if time_created_less_than is not None:
- kwargs['time_created_less_than'] = time_created_less_than
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if unified_audit_policy_definition_id is not None:
- kwargs['unified_audit_policy_definition_id'] = unified_audit_policy_definition_id
- if unified_audit_policy_id is not None:
- kwargs['unified_audit_policy_id'] = unified_audit_policy_id
+ if role_name is not None and len(role_name) > 0:
+ kwargs['role_name'] = role_name
+ if is_oracle_maintained is not None:
+ kwargs['is_oracle_maintained'] = is_oracle_maintained
+ if authentication_type is not None:
+ kwargs['authentication_type'] = authentication_type
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if role_name_contains is not None:
+ kwargs['role_name_contains'] = role_name_contains
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -19753,83 +19210,65 @@ def list_unified_audit_policies(ctx, from_json, all_pages, page_size, compartmen
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_unified_audit_policies,
- compartment_id=compartment_id,
+ client.list_roles,
+ target_database_id=target_database_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_unified_audit_policies,
+ client.list_roles,
limit,
page_size,
- compartment_id=compartment_id,
+ target_database_id=target_database_id,
**kwargs
)
else:
- result = client.list_unified_audit_policies(
- compartment_id=compartment_id,
+ result = client.list_roles(
+ target_database_id=target_database_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@unified_audit_policy_definition_collection_group.command(name=cli_util.override('data_safe.list_unified_audit_policy_definitions.command_name', 'list-unified-audit-policy-definitions'), help=u"""Retrieves a list of all unified audit policy definitions in Data Safe.
-
-The ListUnifiedAuditPolicyDefinitions operation returns only the unified audit policy definitions in the specified `compartmentId`.
-
-The parameter `accessLevel` specifies whether to return only those compartments for which the requester has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-
-The parameter `compartmentIdInSubtree` applies when you perform ListUnifiedAuditPolicyDefinitions on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listUnifiedAuditPolicyDefinitions)""")
-@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "FAILED", "DELETING", "NEEDS_ATTENTION"]), help=u"""The current state of the unified audit policy definition.""")
-@cli_util.option('--unified-audit-policy-definition-id', help=u"""An optional filter to return only resources that match the specified OCID of the unified audit policy definition resource.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--is-seeded', type=click.BOOL, help=u"""A boolean flag indicating to list seeded unified audit policy definitions. Set this parameter to get list of seeded unified audit policy definitions.""")
-@cli_util.option('--unified-audit-policy-category', type=custom_types.CliCaseInsensitiveChoice(["BASIC_ACTIVITY", "ADMIN_USER_ACTIVITY", "USER_ACTIVITY", "ORACLE_PREDEFINED", "COMPLIANCE_STANDARD", "SQL_FIREWALL_AUDITING", "CUSTOM"]), help=u"""The category to which the unified audit policy definition belongs to.""")
-@cli_util.option('--unified-audit-policy-name', help=u"""The name of the unified audit policy.""")
+@target_database_group.command(name=cli_util.override('data_safe.list_schemas.command_name', 'list-schemas'), help=u"""Returns list of schema. \n[Command Reference](listSchemas)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["SCHEMANAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified.""")
+@cli_util.option('--is-oracle-maintained', type=click.BOOL, help=u"""A filter to return only items related to specific type of schema.""")
+@cli_util.option('--schema-name-contains', help=u"""A filter to return only items if schema name contains a specific string.""")
@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({})
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'UnifiedAuditPolicyDefinitionCollection'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'list[SchemaSummary]'})
@cli_util.wrap_exceptions
-def list_unified_audit_policy_definitions(ctx, from_json, all_pages, page_size, compartment_id, lifecycle_state, unified_audit_policy_definition_id, access_level, display_name, is_seeded, unified_audit_policy_category, unified_audit_policy_name, limit, page, compartment_id_in_subtree, sort_order, sort_by):
+def list_schemas(ctx, from_json, all_pages, page_size, target_database_id, limit, page, schema_name, sort_order, sort_by, is_oracle_maintained, schema_name_contains):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+
kwargs = {}
- if lifecycle_state is not None:
- kwargs['lifecycle_state'] = lifecycle_state
- if unified_audit_policy_definition_id is not None:
- kwargs['unified_audit_policy_definition_id'] = unified_audit_policy_definition_id
- if access_level is not None:
- kwargs['access_level'] = access_level
- if display_name is not None:
- kwargs['display_name'] = display_name
- if is_seeded is not None:
- kwargs['is_seeded'] = is_seeded
- if unified_audit_policy_category is not None:
- kwargs['unified_audit_policy_category'] = unified_audit_policy_category
- if unified_audit_policy_name is not None:
- kwargs['unified_audit_policy_name'] = unified_audit_policy_name
if limit is not None:
kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
+ if is_oracle_maintained is not None:
+ kwargs['is_oracle_maintained'] = is_oracle_maintained
+ if schema_name_contains is not None:
+ kwargs['schema_name_contains'] = schema_name_contains
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -19837,173 +19276,71 @@ def list_unified_audit_policy_definitions(ctx, from_json, all_pages, page_size,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_unified_audit_policy_definitions,
- compartment_id=compartment_id,
- **kwargs
- )
- elif limit is not None:
- result = cli_util.list_call_get_up_to_limit(
- client.list_unified_audit_policy_definitions,
- limit,
- page_size,
- compartment_id=compartment_id,
- **kwargs
- )
- else:
- result = client.list_unified_audit_policy_definitions(
- compartment_id=compartment_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
-
-
-@user_assessment_group.command(name=cli_util.override('data_safe.list_user_access_analytics.command_name', 'list-user-access-analytics'), help=u"""Gets a list of aggregated user access analytics in the specified target in a compartment. \n[Command Reference](listUserAccessAnalytics)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["USERNAME", "COUNT"]), help=u"""The field to sort by. Only one sort parameter may be provided.""")
-@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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_safe', 'class': 'UserAccessAnalyticsCollection'})
-@cli_util.wrap_exceptions
-def list_user_access_analytics(ctx, from_json, all_pages, page_size, user_assessment_id, sort_by, sort_order, limit, page):
-
- if all_pages and limit:
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
-
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
-
- kwargs = {}
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if limit is not None:
- kwargs['limit'] = limit
- if page is not None:
- kwargs['page'] = page
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
- if page_size:
- kwargs['limit'] = page_size
-
- result = cli_util.list_call_get_all_results(
- client.list_user_access_analytics,
- user_assessment_id=user_assessment_id,
+ client.list_schemas,
+ target_database_id=target_database_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_user_access_analytics,
+ client.list_schemas,
limit,
page_size,
- user_assessment_id=user_assessment_id,
+ target_database_id=target_database_id,
**kwargs
)
else:
- result = client.list_user_access_analytics(
- user_assessment_id=user_assessment_id,
+ result = client.list_schemas(
+ target_database_id=target_database_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.list_user_analytics.command_name', 'list-user-analytics'), help=u"""Gets a list of aggregated user details from the specified user assessment. This provides information about the overall state. of database user security. For example, the user details include how many users have the DBA role and how many users are in the critical category. This data is especially useful content for dashboards or to support analytics.
-
-When you perform the ListUserAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns compartments in which the requestor has READ permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned.
-
-The parameter compartmentIdInSubtree applies when you perform ListUserAnalytics on the compartmentId passed and when it is set to true, the entire hierarchy of compartments can be returned.
-
-To use ListUserAnalytics to get a full list of all compartments and subcompartments in the tenancy from the root compartment, set the parameter compartmentIdInSubtree to true and accessLevel to ACCESSIBLE. \n[Command Reference](listUserAnalytics)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@sdm_masking_policy_difference_group.command(name=cli_util.override('data_safe.list_sdm_masking_policy_differences.command_name', 'list'), help=u"""Gets a list of SDM and masking policy difference resources based on the specified query parameters. \n[Command Reference](listSdmMaskingPolicyDifferences)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--difference-access-level', type=custom_types.CliCaseInsensitiveChoice(["ACCESSIBLE"]), help=u"""Valid value is ACCESSIBLE. Default is ACCESSIBLE. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment).""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle states.""")
+@cli_util.option('--masking-policy-id', help=u"""A filter to return only the resources that match the specified masking policy OCID.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreationStarted", "displayName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreationStarted is descending. The default order for displayName is ascending.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--user-category', help=u"""A filter to return only items that match the specified user category.""")
-@cli_util.option('--user-key', help=u"""A filter to return only items that match the specified user key.""")
-@cli_util.option('--account-status', help=u"""A filter to return only items that match the specified account status.""")
-@cli_util.option('--authentication-type', help=u"""A filter to return only items that match the specified authentication type.""")
-@cli_util.option('--user-name', help=u"""A filter to return only items that match the specified user name.""")
-@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--time-last-login-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last login time in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339].
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-last-login-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last login time in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-user-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose creation time in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-user-created-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose creation time in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-password-last-changed-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last password change in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339].
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-password-last-changed-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last password change in the database is less than the date and time specified, in the format defined by [RFC3339].
-
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-password-expiry-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose password expiry date in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-password-expiry-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose password expiry date in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["userName", "userCategory", "accountStatus", "timeLastLogin", "targetId", "timeUserCreated", "authenticationType", "timePasswordChanged"]), help=u"""The field to sort by. You can specify only one sort order (sortOrder). The default order for userName is ascending.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[UserAggregation]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SdmMaskingPolicyDifferenceCollection'})
@cli_util.wrap_exceptions
-def list_user_analytics(ctx, from_json, all_pages, page_size, user_assessment_id, compartment_id_in_subtree, access_level, limit, user_category, user_key, account_status, authentication_type, user_name, target_id, time_last_login_greater_than_or_equal_to, time_last_login_less_than, time_user_created_greater_than_or_equal_to, time_user_created_less_than, time_password_last_changed_greater_than_or_equal_to, time_password_last_changed_less_than, time_password_expiry_greater_than_or_equal_to, time_password_expiry_less_than, page, sort_order, sort_by):
+def list_sdm_masking_policy_differences(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, difference_access_level, display_name, sensitive_data_model_id, lifecycle_state, masking_policy_id, sort_order, sort_by, limit, page):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
-
kwargs = {}
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
- if limit is not None:
- kwargs['limit'] = limit
- if user_category is not None:
- kwargs['user_category'] = user_category
- if user_key is not None:
- kwargs['user_key'] = user_key
- if account_status is not None:
- kwargs['account_status'] = account_status
- if authentication_type is not None:
- kwargs['authentication_type'] = authentication_type
- if user_name is not None:
- kwargs['user_name'] = user_name
- if target_id is not None:
- kwargs['target_id'] = target_id
- if time_last_login_greater_than_or_equal_to is not None:
- kwargs['time_last_login_greater_than_or_equal_to'] = time_last_login_greater_than_or_equal_to
- if time_last_login_less_than is not None:
- kwargs['time_last_login_less_than'] = time_last_login_less_than
- if time_user_created_greater_than_or_equal_to is not None:
- kwargs['time_user_created_greater_than_or_equal_to'] = time_user_created_greater_than_or_equal_to
- if time_user_created_less_than is not None:
- kwargs['time_user_created_less_than'] = time_user_created_less_than
- if time_password_last_changed_greater_than_or_equal_to is not None:
- kwargs['time_password_last_changed_greater_than_or_equal_to'] = time_password_last_changed_greater_than_or_equal_to
- if time_password_last_changed_less_than is not None:
- kwargs['time_password_last_changed_less_than'] = time_password_last_changed_less_than
- if time_password_expiry_greater_than_or_equal_to is not None:
- kwargs['time_password_expiry_greater_than_or_equal_to'] = time_password_expiry_greater_than_or_equal_to
- if time_password_expiry_less_than is not None:
- kwargs['time_password_expiry_less_than'] = time_password_expiry_less_than
- if page is not None:
- kwargs['page'] = page
+ if difference_access_level is not None:
+ kwargs['difference_access_level'] = difference_access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if sensitive_data_model_id is not None:
+ kwargs['sensitive_data_model_id'] = sensitive_data_model_id
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if masking_policy_id is not None:
+ kwargs['masking_policy_id'] = masking_policy_id
if sort_order is not None:
kwargs['sort_order'] = sort_order
if sort_by is not None:
kwargs['sort_by'] = sort_by
+ 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_safe', 'data_safe', ctx)
if all_pages:
@@ -20011,44 +19348,46 @@ def list_user_analytics(ctx, from_json, all_pages, page_size, user_assessment_id
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_user_analytics,
- user_assessment_id=user_assessment_id,
+ client.list_sdm_masking_policy_differences,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_user_analytics,
+ client.list_sdm_masking_policy_differences,
limit,
page_size,
- user_assessment_id=user_assessment_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_user_analytics(
- user_assessment_id=user_assessment_id,
+ result = client.list_sdm_masking_policy_differences(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.list_user_assessments.command_name', 'list'), help=u"""Gets a list of user assessments.
+@security_assessment_group.command(name=cli_util.override('data_safe.list_security_assessments.command_name', 'list'), help=u"""Gets a list of security assessments.
-The ListUserAssessments operation returns only the assessments in the specified `compartmentId`. The list does not include any subcompartments of the compartmentId passed.
+The ListSecurityAssessments operation returns only the assessments in the specified `compartmentId`. The list does not include any subcompartments of the compartmentId passed.
The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
-The parameter `compartmentIdInSubtree` applies when you perform ListUserAssessments on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listUserAssessments)""")
+The parameter `compartmentIdInSubtree` applies when you perform ListSecurityAssessments on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSecurityAssessments)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
-@cli_util.option('--schedule-user-assessment-id', help=u"""The OCID of the user assessment of type SAVE_SCHEDULE.""")
-@cli_util.option('--is-schedule-assessment', type=click.BOOL, help=u"""A filter to return only user assessments of type SAVE_SCHEDULE.""")
-@cli_util.option('--is-baseline', type=click.BOOL, help=u"""A filter to return only user assessments that are set as baseline.""")
+@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED", "SAVE_SCHEDULE", "COMPARTMENT", "TEMPLATE", "TEMPLATE_BASELINE"]), help=u"""A filter to return only items that match the specified security assessment type.""")
+@cli_util.option('--schedule-assessment-id', help=u"""The OCID of the security assessment of type SAVE_SCHEDULE.""")
+@cli_util.option('--is-schedule-assessment', type=click.BOOL, help=u"""A filter to return only security assessments of type save schedule.""")
+@cli_util.option('--triggered-by', type=custom_types.CliCaseInsensitiveChoice(["USER", "SYSTEM"]), help=u"""A filter to return only security assessments that were created by either user or system.""")
@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED", "COMPARTMENT", "SAVE_SCHEDULE"]), help=u"""A filter to return only items that match the specified assessment type.""")
-@cli_util.option('--triggered-by', type=custom_types.CliCaseInsensitiveChoice(["USER", "SYSTEM"]), help=u"""A filter to return user assessments that were created by either the system or by a user only.""")
-@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only user assessments that were created after the specified date and time, as defined by [RFC3339]. Using timeCreatedGreaterThanOrEqualTo parameter retrieves all assessments created after that date.
+@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('--is-baseline', type=click.BOOL, help=u"""A filter to return only the security assessments that are set as a baseline.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName", "timeLastAssessed", "timeUpdated"]), help=u"""The field to sort by. You can specify only one sort order(sortOrder). The default order for timeCreated is descending.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
@@ -20056,19 +19395,18 @@ def list_user_analytics(ctx, from_json, all_pages, page_size, user_assessment_id
**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "SUCCEEDED", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""The current state of the user assessment.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. You can specify only one sort order (sortOrder). The default order for timeCreated is descending.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "SUCCEEDED", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only resources that match the specified lifecycle state.""")
@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A filter to return only only target database resources or target database group resources.""")
@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--template-assessment-id', help=u"""The OCID of the security assessment of type TEMPLATE.""")
@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_safe', 'class': 'list[UserAssessmentSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[SecurityAssessmentSummary]'})
@cli_util.wrap_exceptions
-def list_user_assessments(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, schedule_user_assessment_id, is_schedule_assessment, is_baseline, target_id, type, triggered_by, time_created_greater_than_or_equal_to, time_created_less_than, limit, page, lifecycle_state, sort_order, sort_by, target_type, target_database_group_id):
+def list_security_assessments(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, type, schedule_assessment_id, is_schedule_assessment, triggered_by, target_id, sort_order, is_baseline, sort_by, time_created_greater_than_or_equal_to, time_created_less_than, limit, page, lifecycle_state, target_type, target_database_group_id, template_assessment_id):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
@@ -20080,18 +19418,22 @@ def list_user_assessments(ctx, from_json, all_pages, page_size, compartment_id,
kwargs['access_level'] = access_level
if display_name is not None:
kwargs['display_name'] = display_name
- if schedule_user_assessment_id is not None:
- kwargs['schedule_user_assessment_id'] = schedule_user_assessment_id
- if is_schedule_assessment is not None:
- kwargs['is_schedule_assessment'] = is_schedule_assessment
- if is_baseline is not None:
- kwargs['is_baseline'] = is_baseline
- if target_id is not None:
- kwargs['target_id'] = target_id
if type is not None:
kwargs['type'] = type
+ if schedule_assessment_id is not None:
+ kwargs['schedule_assessment_id'] = schedule_assessment_id
+ if is_schedule_assessment is not None:
+ kwargs['is_schedule_assessment'] = is_schedule_assessment
if triggered_by is not None:
kwargs['triggered_by'] = triggered_by
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if is_baseline is not None:
+ kwargs['is_baseline'] = is_baseline
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
if time_created_greater_than_or_equal_to is not None:
kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
if time_created_less_than is not None:
@@ -20102,14 +19444,12 @@ def list_user_assessments(ctx, from_json, all_pages, page_size, compartment_id,
kwargs['page'] = page
if lifecycle_state is not None:
kwargs['lifecycle_state'] = lifecycle_state
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
if target_type is not None:
kwargs['target_type'] = target_type
if target_database_group_id is not None:
kwargs['target_database_group_id'] = target_database_group_id
+ if template_assessment_id is not None:
+ kwargs['template_assessment_id'] = template_assessment_id
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -20117,128 +19457,126 @@ def list_user_assessments(ctx, from_json, all_pages, page_size, compartment_id,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_user_assessments,
+ client.list_security_assessments,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_user_assessments,
+ client.list_security_assessments,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_user_assessments(
+ result = client.list_security_assessments(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.list_users.command_name', 'list-users'), help=u"""Gets a list of users of the specified user assessment. The result contains the database user details for each user, such as user type, account status, last login time, user creation time, authentication type, user profile, and the date and time of the latest password change. It also contains the user category derived from these user details as well as privileges granted to each user. \n[Command Reference](listUsers)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@security_assessment_group.command(name=cli_util.override('data_safe.list_security_feature_analytics.command_name', 'list-security-feature-analytics'), help=u"""Gets a list of Database security feature usage aggregated details in the specified compartment. This provides information about the overall security controls, by returning the counting number of the target databases using the security features.
+
+When you perform the ListSecurityFeatureAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns statistics from the compartments in which the requestor has INSPECT permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned. \n[Command Reference](listSecurityFeatureAnalytics)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
-@cli_util.option('--user-category', help=u"""A filter to return only items that match the specified user category.""")
-@cli_util.option('--user-role', help=u"""A filter to return only items that match the specified user role.""")
-@cli_util.option('--user-profile', help=u"""A filter to return only items that match the specified user profile.""")
-@cli_util.option('--user-type', help=u"""A filter to return only items that match the specified user type. The possible values can be - ADMIN_PRIVILEGED - APPLICATION - PRIVILEGED - SCHEMA - NON_PRIVILEGED as specified by '#/definitions/userTypes'.""")
-@cli_util.option('--user-key', help=u"""A filter to return only items that match the specified user key.""")
-@cli_util.option('--account-status', help=u"""A filter to return only items that match the specified account status.""")
-@cli_util.option('--authentication-type', help=u"""A filter to return only items that match the specified authentication type.""")
-@cli_util.option('--user-name', help=u"""A filter to return only items that match the specified user name.""")
@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
-@cli_util.option('--time-last-login-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last login time in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339].
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified 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': 'data_safe', 'class': 'SecurityFeatureAnalyticsCollection'})
+@cli_util.wrap_exceptions
+def list_security_feature_analytics(ctx, from_json, all_pages, compartment_id, compartment_id_in_subtree, access_level, target_id, target_database_group_id):
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-last-login-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last login time in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-user-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose creation time in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-user-created-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose creation time in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-password-last-changed-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last password change in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339].
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.list_security_feature_analytics(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-password-last-changed-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last password change in the database is less than the date and time specified, in the format defined by [RFC3339].
-**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-password-expiry-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose password expiry date in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--time-password-expiry-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose password expiry date in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@security_assessment_group.command(name=cli_util.override('data_safe.list_security_features.command_name', 'list-security-features'), help=u"""Lists the usage of Database security features for a given compartment or a target level, based on the filters provided. \n[Command Reference](listSecurityFeatures)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--targets-with-unified-audit', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Unified Audit enabled/disabled.""")
+@cli_util.option('--targets-with-fine-grained-audit', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Fine Grained Audit enabled/disabled.""")
+@cli_util.option('--targets-with-traditional-audit', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Traditional Audit enabled/disabled.""")
+@cli_util.option('--targets-with-database-vault', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Database Vault enabled/disabled.""")
+@cli_util.option('--targets-with-privilege-analysis', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Privilege Analysis enabled/disabled.""")
+@cli_util.option('--targets-with-tablespace-encryption', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Tablespace Encryption enabled/disabled.""")
+@cli_util.option('--targets-with-column-encryption', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets that enable the DB security feature - Column Encryption enabled/disabled.""")
+@cli_util.option('--targets-with-network-encryption', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Network Encryption enabled/disabled.""")
+@cli_util.option('--targets-with-password-authentication', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Password Authentication enabled/disabled.""")
+@cli_util.option('--targets-with-global-authentication', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - Global Authentication enabled/disabled.""")
+@cli_util.option('--targets-with-external-authentication', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "NONE"]), help=u"""A filter to return only the targets with the DB security feature - External Authentication enabled/disabled.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--compartment-id', help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["userName", "userCategory", "accountStatus", "timeLastLogin", "targetId", "timeUserCreated", "authenticationType", "timePasswordChanged"]), help=u"""The field to sort by. You can specify only one sort order (sortOrder). The default order for userName is ascending.""")
-@cli_util.option('--schema-list', multiple=True, help=u"""A filter to return items that contain the specified schema list.""")
-@cli_util.option('--are-all-schemas-accessible', type=click.BOOL, help=u"""A filter to return only items that match the criteria that all schemas can be accessed by a user.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
@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({'schema-list': {'module': 'data_safe', 'class': 'list[string]'}})
+@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={'schema-list': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'list[UserSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityFeatureCollection'})
@cli_util.wrap_exceptions
-def list_users(ctx, from_json, all_pages, page_size, user_assessment_id, limit, compartment_id_in_subtree, access_level, user_category, user_role, user_profile, user_type, user_key, account_status, authentication_type, user_name, target_id, time_last_login_greater_than_or_equal_to, time_last_login_less_than, time_user_created_greater_than_or_equal_to, time_user_created_less_than, time_password_last_changed_greater_than_or_equal_to, time_password_last_changed_less_than, time_password_expiry_greater_than_or_equal_to, time_password_expiry_less_than, page, compartment_id, sort_order, sort_by, schema_list, are_all_schemas_accessible):
+def list_security_features(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, target_id, targets_with_unified_audit, targets_with_fine_grained_audit, targets_with_traditional_audit, targets_with_database_vault, targets_with_privilege_analysis, targets_with_tablespace_encryption, targets_with_column_encryption, targets_with_network_encryption, targets_with_password_authentication, targets_with_global_authentication, targets_with_external_authentication, limit, page, target_database_group_id):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
-
kwargs = {}
- if limit is not None:
- kwargs['limit'] = limit
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
kwargs['access_level'] = access_level
- if user_category is not None:
- kwargs['user_category'] = user_category
- if user_role is not None:
- kwargs['user_role'] = user_role
- if user_profile is not None:
- kwargs['user_profile'] = user_profile
- if user_type is not None:
- kwargs['user_type'] = user_type
- if user_key is not None:
- kwargs['user_key'] = user_key
- if account_status is not None:
- kwargs['account_status'] = account_status
- if authentication_type is not None:
- kwargs['authentication_type'] = authentication_type
- if user_name is not None:
- kwargs['user_name'] = user_name
if target_id is not None:
kwargs['target_id'] = target_id
- if time_last_login_greater_than_or_equal_to is not None:
- kwargs['time_last_login_greater_than_or_equal_to'] = time_last_login_greater_than_or_equal_to
- if time_last_login_less_than is not None:
- kwargs['time_last_login_less_than'] = time_last_login_less_than
- if time_user_created_greater_than_or_equal_to is not None:
- kwargs['time_user_created_greater_than_or_equal_to'] = time_user_created_greater_than_or_equal_to
- if time_user_created_less_than is not None:
- kwargs['time_user_created_less_than'] = time_user_created_less_than
- if time_password_last_changed_greater_than_or_equal_to is not None:
- kwargs['time_password_last_changed_greater_than_or_equal_to'] = time_password_last_changed_greater_than_or_equal_to
- if time_password_last_changed_less_than is not None:
- kwargs['time_password_last_changed_less_than'] = time_password_last_changed_less_than
- if time_password_expiry_greater_than_or_equal_to is not None:
- kwargs['time_password_expiry_greater_than_or_equal_to'] = time_password_expiry_greater_than_or_equal_to
- if time_password_expiry_less_than is not None:
- kwargs['time_password_expiry_less_than'] = time_password_expiry_less_than
+ if targets_with_unified_audit is not None:
+ kwargs['targets_with_unified_audit'] = targets_with_unified_audit
+ if targets_with_fine_grained_audit is not None:
+ kwargs['targets_with_fine_grained_audit'] = targets_with_fine_grained_audit
+ if targets_with_traditional_audit is not None:
+ kwargs['targets_with_traditional_audit'] = targets_with_traditional_audit
+ if targets_with_database_vault is not None:
+ kwargs['targets_with_database_vault'] = targets_with_database_vault
+ if targets_with_privilege_analysis is not None:
+ kwargs['targets_with_privilege_analysis'] = targets_with_privilege_analysis
+ if targets_with_tablespace_encryption is not None:
+ kwargs['targets_with_tablespace_encryption'] = targets_with_tablespace_encryption
+ if targets_with_column_encryption is not None:
+ kwargs['targets_with_column_encryption'] = targets_with_column_encryption
+ if targets_with_network_encryption is not None:
+ kwargs['targets_with_network_encryption'] = targets_with_network_encryption
+ if targets_with_password_authentication is not None:
+ kwargs['targets_with_password_authentication'] = targets_with_password_authentication
+ if targets_with_global_authentication is not None:
+ kwargs['targets_with_global_authentication'] = targets_with_global_authentication
+ if targets_with_external_authentication is not None:
+ kwargs['targets_with_external_authentication'] = targets_with_external_authentication
+ if limit is not None:
+ kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
- if compartment_id is not None:
- kwargs['compartment_id'] = compartment_id
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if schema_list is not None and len(schema_list) > 0:
- kwargs['schema_list'] = schema_list
- if are_all_schemas_accessible is not None:
- kwargs['are_all_schemas_accessible'] = are_all_schemas_accessible
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
if all_pages:
@@ -20246,50 +19584,77 @@ def list_users(ctx, from_json, all_pages, page_size, user_assessment_id, limit,
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_users,
- user_assessment_id=user_assessment_id,
+ client.list_security_features,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_users,
+ client.list_security_features,
limit,
page_size,
- user_assessment_id=user_assessment_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_users(
- user_assessment_id=user_assessment_id,
+ result = client.list_security_features(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@work_request_error_group.command(name=cli_util.override('data_safe.list_work_request_errors.command_name', 'list'), help=u"""Gets a list of errors for the specified work request. \n[Command Reference](listWorkRequestErrors)""")
-@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@security_policy_collection_group.command(name=cli_util.override('data_safe.list_security_policies.command_name', 'list-security-policies'), help=u"""Retrieves a list of all security policies in Data Safe.
+
+The ListSecurityPolicies operation returns only the security policies in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListSecurityPolicies on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSecurityPolicies)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "FAILED", "DELETING", "DELETED"]), help=u"""The current state of the security policy.""")
+@cli_util.option('--security-policy-type', type=custom_types.CliCaseInsensitiveChoice(["DATASAFE_MANAGED", "SEEDED_POLICY"]), help=u"""The type of the security policy.""")
+@cli_util.option('--security-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy resource.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'list[WorkRequestError]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicyCollection'})
@cli_util.wrap_exceptions
-def list_work_request_errors(ctx, from_json, all_pages, page_size, work_request_id, page, limit):
+def list_security_policies(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, security_policy_type, security_policy_id, sort_order, sort_by):
if all_pages and limit:
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
- if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
- raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
-
kwargs = {}
- if page is not None:
- kwargs['page'] = page
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
if limit is not None:
kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if security_policy_type is not None:
+ kwargs['security_policy_type'] = security_policy_type
+ if security_policy_id is not None:
+ kwargs['security_policy_id'] = security_policy_id
+ 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_safe', 'data_safe', ctx)
if all_pages:
@@ -20297,119 +19662,314 @@ def list_work_request_errors(ctx, from_json, all_pages, page_size, work_request_
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_work_request_errors,
- work_request_id=work_request_id,
+ client.list_security_policies,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_work_request_errors,
+ client.list_security_policies,
limit,
page_size,
- work_request_id=work_request_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_work_request_errors(
- work_request_id=work_request_id,
+ result = client.list_security_policies(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@work_request_log_entry_group.command(name=cli_util.override('data_safe.list_work_request_logs.command_name', 'list-work-request-logs'), help=u"""Gets a list of log entries for the specified work request. \n[Command Reference](listWorkRequestLogs)""")
-@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@security_policy_config_collection_group.command(name=cli_util.override('data_safe.list_security_policy_configs.command_name', 'list-security-policy-configs'), help=u"""Retrieves a list of all security policy configurations in Data Safe.
+
+The ListSecurityPolicyConfigs operation returns only the security policy configurations in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListSecurityPolicyConfigs on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSecurityPolicyConfigs)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--security-policy-config-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy configuration resource.""")
+@cli_util.option('--security-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy resource.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "FAILED", "NEEDS_ATTENTION", "DELETING", "DELETED"]), help=u"""The current state of the security policy configuration resource.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'list[WorkRequestLogEntry]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicyConfigCollection'})
@cli_util.wrap_exceptions
-def list_work_request_logs(ctx, from_json, all_pages, page_size, work_request_id, page, limit):
+def list_security_policy_configs(ctx, from_json, all_pages, page_size, compartment_id, security_policy_config_id, security_policy_id, compartment_id_in_subtree, access_level, display_name, lifecycle_state, time_created_greater_than_or_equal_to, time_created_less_than, 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')
- if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
- raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
-
kwargs = {}
- if page is not None:
- kwargs['page'] = page
- if limit is not None:
- kwargs['limit'] = limit
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- if all_pages:
+ if security_policy_config_id is not None:
+ kwargs['security_policy_config_id'] = security_policy_config_id
+ if security_policy_id is not None:
+ kwargs['security_policy_id'] = security_policy_id
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
if page_size:
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_work_request_logs,
- work_request_id=work_request_id,
+ client.list_security_policy_configs,
+ compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_work_request_logs,
+ client.list_security_policy_configs,
limit,
page_size,
- work_request_id=work_request_id,
+ compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_work_request_logs(
- work_request_id=work_request_id,
+ result = client.list_security_policy_configs(
+ compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@work_request_group.command(name=cli_util.override('data_safe.list_work_requests.command_name', 'list'), help=u"""Gets a list of work requests. \n[Command Reference](listWorkRequests)""")
+@security_policy_deployment_collection_group.command(name=cli_util.override('data_safe.list_security_policy_deployments.command_name', 'list-security-policy-deployments'), help=u"""Retrieves a list of all security policy deployments in Data Safe.
+
+The ListSecurityPolicyDeployments operation returns only the security policy deployments in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListSecurityPolicyDeployments on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSecurityPolicyDeployments)""")
@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
-@cli_util.option('--operation-type', help=u"""A filter to return only work requests that match the specific operation type.""")
-@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["STARTTIME", "FINISHTIME", "ACCEPTEDTIME"]), help=u"""The field used for sorting. Only one sorting parameter can be specified. The default order is descending.""")
-@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sorting order for the work requests, either ascending (ASC) or descending (DESC).""")
-@cli_util.option('--resource-id', help=u"""A filter to return only work requests that match the specified resource OCID.""")
-@cli_util.option('--target-database-id', help=u"""A filter to return only work requests that are associated to the specified target database OCID.""")
-@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
-@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "DEPLOYED", "PENDING_DEPLOYMENT", "NEEDS_ATTENTION", "FAILED", "DELETING", "DELETED"]), help=u"""The current state of the security policy deployment.""")
+@cli_util.option('--security-policy-deployment-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy deployment resource.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A optional filter to return only resources that belong to the specified target type.""")
+@cli_util.option('--security-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy resource.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'list[WorkRequestSummary]'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SecurityPolicyDeploymentCollection'})
@cli_util.wrap_exceptions
-def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, operation_type, sort_by, sort_order, resource_id, target_database_id, page, limit, compartment_id_in_subtree, access_level):
+def list_security_policy_deployments(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, security_policy_deployment_id, target_id, target_type, security_policy_id, 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 operation_type is not None:
- kwargs['operation_type'] = operation_type
- if sort_by is not None:
- kwargs['sort_by'] = sort_by
- if sort_order is not None:
- kwargs['sort_order'] = sort_order
- if resource_id is not None:
- kwargs['resource_id'] = resource_id
- if target_database_id is not None:
- kwargs['target_database_id'] = target_database_id
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if limit is not None:
+ kwargs['limit'] = limit
if page is not None:
kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if security_policy_deployment_id is not None:
+ kwargs['security_policy_deployment_id'] = security_policy_deployment_id
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_type is not None:
+ kwargs['target_type'] = target_type
+ if security_policy_id is not None:
+ kwargs['security_policy_id'] = security_policy_id
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_security_policy_deployments,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_security_policy_deployments,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_security_policy_deployments(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@security_policy_entry_state_collection_group.command(name=cli_util.override('data_safe.list_security_policy_entry_states.command_name', 'list-security-policy-entry-states'), help=u"""Retrieves a list of all security policy entry states in Data Safe.
+
+The ListSecurityPolicyEntryStates operation returns only the security policy entry states for the specified security policy entry. \n[Command Reference](listSecurityPolicyEntryStates)""")
+@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--deployment-status', type=custom_types.CliCaseInsensitiveChoice(["CREATED", "MODIFIED", "CONFLICT", "CONNECTIVITY_ISSUE", "UNSUPPORTED_SYNTAX", "UNKNOWN_ERROR", "UNAUTHORIZED", "DELETED"]), help=u"""The current state of the security policy deployment.""")
+@cli_util.option('--security-policy-entry-id', help=u"""An optional filter to return only resources that match the specified security policy entry OCID.""")
+@cli_util.option('--security-policy-entry-type', type=custom_types.CliCaseInsensitiveChoice(["FIREWALL_POLICY", "AUDIT_POLICY", "CONFIG"]), help=u"""The type of the security policy deployment.""")
+@cli_util.option('--target-id', help=u"""An optional filter to return only resources that match the specified target id.""")
+@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_safe', 'class': 'SecurityPolicyEntryStateCollection'})
+@cli_util.wrap_exceptions
+def list_security_policy_entry_states(ctx, from_json, all_pages, page_size, security_policy_deployment_id, limit, page, deployment_status, security_policy_entry_id, security_policy_entry_type, target_id):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-deployment-id cannot be whitespace or empty string')
+
+ kwargs = {}
if limit is not None:
kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if deployment_status is not None:
+ kwargs['deployment_status'] = deployment_status
+ if security_policy_entry_id is not None:
+ kwargs['security_policy_entry_id'] = security_policy_entry_id
+ if security_policy_entry_type is not None:
+ kwargs['security_policy_entry_type'] = security_policy_entry_type
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_security_policy_entry_states,
+ security_policy_deployment_id=security_policy_deployment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_security_policy_entry_states,
+ limit,
+ page_size,
+ security_policy_deployment_id=security_policy_deployment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_security_policy_entry_states(
+ security_policy_deployment_id=security_policy_deployment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@security_policy_report_collection_group.command(name=cli_util.override('data_safe.list_security_policy_reports.command_name', 'list-security-policy-reports'), help=u"""Retrieves a list of all security policy reports in Data Safe.
+
+The ListSecurityPolicyReports operation returns only the security policy reports in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListSecurityPolicyReports on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSecurityPolicyReports)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "SUCCEEDED", "UPDATING", "DELETING", "DELETED", "FAILED", "NEEDS_ATTENTION"]), help=u"""The current state of the security policy report.""")
+@cli_util.option('--security-policy-report-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy report resource.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'SecurityPolicyReportCollection'})
+@cli_util.wrap_exceptions
+def list_security_policy_reports(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, security_policy_report_id, target_id, sort_order, sort_by):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
if compartment_id_in_subtree is not None:
kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
if access_level is not None:
kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if security_policy_report_id is not None:
+ kwargs['security_policy_report_id'] = security_policy_report_id
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ 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_safe', 'data_safe', ctx)
if all_pages:
@@ -20417,114 +19977,4694 @@ def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, ope
kwargs['limit'] = page_size
result = cli_util.list_call_get_all_results(
- client.list_work_requests,
+ client.list_security_policy_reports,
compartment_id=compartment_id,
**kwargs
)
elif limit is not None:
result = cli_util.list_call_get_up_to_limit(
- client.list_work_requests,
+ client.list_security_policy_reports,
limit,
page_size,
compartment_id=compartment_id,
**kwargs
)
else:
- result = client.list_work_requests(
+ result = client.list_security_policy_reports(
compartment_id=compartment_id,
**kwargs
)
cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.mask_data.command_name', 'mask-data'), help=u"""Masks data using the specified masking policy. \n[Command Reference](maskData)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--target-id', help=u"""The OCID of the target database to be masked. If it's not provided, the value of the targetId attribute in the MaskingPolicy resource is used. The OCID of the target database to be masked. If it's not provided, the value of the targetId attribute in the MaskingPolicy resource is used.""")
-@cli_util.option('--is-decrypt', type=click.BOOL, help=u"""Indicates if the masking request is to decrypt the data values previously encrypted using Deterministic Encryption. Note that, to correctly decrypt the encrypted data values, it requires the same seed value that was provided to encrypt those data values.""")
-@cli_util.option('--is-rerun', type=click.BOOL, help=u"""Indicates if the masking request is to rerun the previously failed masking steps. If a masking request is submitted with the isIgnoreErrorsEnabled attribute set to true, the masking process tracks the failed masking steps. Another masking request can be submitted with the isRun attribute set to true to rerun those failed masking steps. It helps save time by executing only the failed masking steps and not doing the whole masking again.""")
-@cli_util.option('--re-run-from-step', type=custom_types.CliCaseInsensitiveChoice(["PRE_MASKING_SCRIPT", "POST_MASKING_SCRIPT"]), help=u"""Specifies the step from which masking needs to be rerun. This param will be used only when isRerun attribute is true. If PRE_MASKING_SCRIPT is passed, it will rerun the pre-masking script, followed by masking, and then the post-masking script. If POST_MASKING_SCRIPT is passed, it will rerun only the post-masking script. If this field is not set and isRerun is set to true, then it will default to the last failed step.""")
-@cli_util.option('--tablespace', help=u"""The tablespace that should be used to create the mapping tables, DMASK objects, and other temporary tables for data masking. If no tablespace is provided, the DEFAULT tablespace is used.""")
-@cli_util.option('--is-ignore-errors-enabled', type=click.BOOL, help=u"""Indicates if the masking process should continue on hitting an error. It provides fault tolerance support and is enabled by default. In fault-tolerant mode, the masking process saves the failed step and continues. You can then submit another masking request (with isRerun attribute set to true) to execute only the failed steps.""")
-@cli_util.option('--seed', help=u"""The seed value to be used in case of Deterministic Encryption and Deterministic Substitution masking formats.""")
-@cli_util.option('--user-defined-function-seed', help=u"""The seed value to be used in case of User Defined Function masking format. This is an optional parameter and needs to be passed only if any User Defined Function uses seed.""")
-@cli_util.option('--is-move-interim-tables-enabled', type=click.BOOL, help=u"""Indicates if the interim DMASK tables should be moved to the user-specified tablespace. As interim tables can be large in size, set it to false if moving them causes performance overhead during masking.""")
-@cli_util.option('--is-execute-saved-script-enabled', type=click.BOOL, help=u"""Indicates if data masking should be performed using a saved masking script. Setting this attribute to true skips masking script generation and executes the masking script stored in the Data Safe repository. It helps save time if there are no changes in the database tables and their dependencies.""")
-@cli_util.option('--is-drop-temp-tables-enabled', type=click.BOOL, help=u"""Indicates if the temporary tables created during a masking operation should be dropped after masking. Set this attribute to false to preserve the temporary tables. Masking creates temporary tables that map the original sensitive data values to mask values. These temporary tables are dropped after masking if this attribute is set as true. But, in some cases, you may want to preserve this information to track how masking changed your data. Note that doing so compromises security. These tables must be dropped before the database is available for unprivileged users. If it's not provided, the value of the isDropTempTablesEnabled attribute in the MaskingPolicy resource is used.""")
-@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a masking operation. Set this attribute to true to enable redo logging. If set as false, masking disables redo logging and flashback logging to purge any original unmasked data from logs. However, in certain circumstances when you only want to test masking, rollback changes, and retry masking, you could enable logging and use a flashback database to retrieve the original unmasked data after it has been masked. If it's not provided, the value of the isRedoLoggingEnabled attribute in the MaskingPolicy resource is used.""")
-@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. Set this attribute to false to disable statistics gathering. The masking process gathers statistics on masked database tables after masking completes. If it's not provided, the value of the isRefreshStatsEnabled attribute in the MaskingPolicy resource is used.""")
-@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data masking. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve masking performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism. https://www.oracle.com/pls/topic/lookup?ctx=dblatest&en/database/oracle/oracle-database&id=VLDBG-GUID-3E2AE088-2505-465E-A8B2-AC38813EA355 If it's not provided, the value of the parallelDegree attribute in the MaskingPolicy resource is used.""")
-@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data masking. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after masking completes. If it's not provided, the value of the parallelDegree attribute in the MaskingPolicy resource is used.""")
-@cli_util.option('--target-credentials', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@sensitive_data_model_group.command(name=cli_util.override('data_safe.list_sensitive_column_analytics.command_name', 'list-sensitive-column-analytics'), help=u"""Gets consolidated sensitive columns analytics data based on the specified query parameters.
+
+When you perform the ListSensitiveColumnAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns compartments in which the requestor has INSPECT permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned.
+
+To use ListSensitiveColumnAnalytics to get a full list of all compartments and subcompartments in the tenancy from the root compartment, set the parameter compartmentIdInSubtree to true and accessLevel to ACCESSIBLE. \n[Command Reference](listSensitiveColumnAnalytics)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--sensitive-type-id', multiple=True, help=u"""A filter to return only the sensitive columns that are associated with one of the sensitive types identified by the specified OCIDs.""")
+@cli_util.option('--sensitive-type-group-id', help=u"""An optional filter to return only resources that match the specified OCID of the sensitive type group resource.""")
+@cli_util.option('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "sensitiveTypeId", "sensitiveDataModelId"]), multiple=True, help=u"""The group by parameter to summarize the sensitive columns.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({'sensitive-type-id': {'module': 'data_safe', 'class': 'list[string]'}, 'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'sensitive-type-id': {'module': 'data_safe', 'class': 'list[string]'}, 'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SensitiveColumnAnalyticsCollection'})
+@cli_util.wrap_exceptions
+def list_sensitive_column_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, target_id, target_database_group_id, sensitive_type_id, sensitive_type_group_id, sensitive_data_model_id, group_by, schema_name, object_name, column_name, limit, page):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ if sensitive_type_id is not None and len(sensitive_type_id) > 0:
+ kwargs['sensitive_type_id'] = sensitive_type_id
+ if sensitive_type_group_id is not None:
+ kwargs['sensitive_type_group_id'] = sensitive_type_group_id
+ if sensitive_data_model_id is not None:
+ kwargs['sensitive_data_model_id'] = sensitive_data_model_id
+ if group_by is not None and len(group_by) > 0:
+ kwargs['group_by'] = group_by
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if column_name is not None and len(column_name) > 0:
+ kwargs['column_name'] = column_name
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sensitive_column_analytics,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sensitive_column_analytics,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sensitive_column_analytics(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sensitive_column_group.command(name=cli_util.override('data_safe.list_sensitive_columns.command_name', 'list'), help=u"""Gets a list of sensitive columns present in the specified sensitive data model based on the specified query parameters. \n[Command Reference](listSensitiveColumns)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-updated-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were updated after a specific date. Specifying this parameter corresponding `timeUpdatedGreaterThanOrEqualTo` parameter will retrieve all resources updated after the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-updated-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were updated before a specific date. Specifying this parameter corresponding `timeUpdatedLessThan` parameter will retrieve all resources updated before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--sensitive-column-lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "FAILED"]), help=u"""Filters the sensitive column resources with the given lifecycle state values.""")
+@cli_util.option('--column-data-count-filter', type=custom_types.CliCaseInsensitiveChoice(["SHOW_ALL_COLUMNS", "SHOW_COLUMNS_WITH_DATA", "SHOW_COLUMNS_WITHOUT_DATA"]), help=u"""Filters the sensitive columns with respect to the estimated row count.""")
+@cli_util.option('--confidence-level', type=custom_types.CliCaseInsensitiveChoice(["NONE", "HIGH", "MEDIUM", "LOW"]), multiple=True, help=u"""A filter to return the sensitive columns with the specified confidence level. Confidence level of sensitive column associated with a seeded sensitive type can either be HIGH or LOW. While the confidence level of sensitive column associated with a user defined sensitive will be NONE. For sensitive columns added manually the confidence level will also be NONE.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--column-name', multiple=True, help=u"""A filter to return only a specific column based on column name.""")
+@cli_util.option('--object-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "TABLE", "EDITIONING_VIEW"]), multiple=True, help=u"""A filter to return only items related to a specific object type.""")
+@cli_util.option('--data-type', multiple=True, help=u"""A filter to return only the resources that match the specified data types.""")
+@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["VALID", "INVALID"]), multiple=True, help=u"""A filter to return only the sensitive columns that match the specified status.""")
+@cli_util.option('--sensitive-type-id', multiple=True, help=u"""A filter to return only the sensitive columns that are associated with one of the sensitive types identified by the specified OCIDs.""")
+@cli_util.option('--parent-column-key', multiple=True, help=u"""A filter to return only the sensitive columns that are children of one of the columns identified by the specified keys.""")
+@cli_util.option('--relation-type', type=custom_types.CliCaseInsensitiveChoice(["NONE", "APP_DEFINED", "DB_DEFINED"]), multiple=True, help=u"""A filter to return sensitive columns based on their relationship with their parent columns. If set to NONE, it returns the sensitive columns that do not have any parent. The response includes the parent columns as well as the independent columns that are not in any relationship. If set to APP_DEFINED, it returns all the child columns that have application-level (non-dictionary) relationship with their parents. If set to DB_DEFINED, it returns all the child columns that have database-level (dictionary-defined) relationship with their parents.""")
+@cli_util.option('--column-group', help=u"""A filter to return only the sensitive columns that belong to the specified column group.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "schemaName", "objectName", "columnName", "dataType", "confidenceLevel"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for schemaName, objectName, and columnName is ascending.""")
+@cli_util.option('--is-case-in-sensitive', type=click.BOOL, help=u"""A boolean flag indicating whether the search should be case-insensitive. The search is case-sensitive by default. Set this parameter to true to do case-insensitive search.""")
+@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'data-type': {'module': 'data_safe', 'class': 'list[string]'}, 'sensitive-type-id': {'module': 'data_safe', 'class': 'list[string]'}, 'parent-column-key': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}, 'column-name': {'module': 'data_safe', 'class': 'list[string]'}, 'data-type': {'module': 'data_safe', 'class': 'list[string]'}, 'sensitive-type-id': {'module': 'data_safe', 'class': 'list[string]'}, 'parent-column-key': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SensitiveColumnCollection'})
+@cli_util.wrap_exceptions
+def list_sensitive_columns(ctx, from_json, all_pages, page_size, sensitive_data_model_id, time_created_greater_than_or_equal_to, time_created_less_than, time_updated_greater_than_or_equal_to, time_updated_less_than, sensitive_column_lifecycle_state, column_data_count_filter, confidence_level, schema_name, object_name, column_name, object_type, data_type, status, sensitive_type_id, parent_column_key, relation_type, column_group, limit, page, sort_order, sort_by, is_case_in_sensitive):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ if time_updated_greater_than_or_equal_to is not None:
+ kwargs['time_updated_greater_than_or_equal_to'] = time_updated_greater_than_or_equal_to
+ if time_updated_less_than is not None:
+ kwargs['time_updated_less_than'] = time_updated_less_than
+ if sensitive_column_lifecycle_state is not None:
+ kwargs['sensitive_column_lifecycle_state'] = sensitive_column_lifecycle_state
+ if column_data_count_filter is not None:
+ kwargs['column_data_count_filter'] = column_data_count_filter
+ if confidence_level is not None and len(confidence_level) > 0:
+ kwargs['confidence_level'] = confidence_level
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if column_name is not None and len(column_name) > 0:
+ kwargs['column_name'] = column_name
+ if object_type is not None and len(object_type) > 0:
+ kwargs['object_type'] = object_type
+ if data_type is not None and len(data_type) > 0:
+ kwargs['data_type'] = data_type
+ if status is not None and len(status) > 0:
+ kwargs['status'] = status
+ if sensitive_type_id is not None and len(sensitive_type_id) > 0:
+ kwargs['sensitive_type_id'] = sensitive_type_id
+ if parent_column_key is not None and len(parent_column_key) > 0:
+ kwargs['parent_column_key'] = parent_column_key
+ if relation_type is not None and len(relation_type) > 0:
+ kwargs['relation_type'] = relation_type
+ if column_group is not None:
+ kwargs['column_group'] = column_group
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if is_case_in_sensitive is not None:
+ kwargs['is_case_in_sensitive'] = is_case_in_sensitive
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sensitive_columns,
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sensitive_columns,
+ limit,
+ page_size,
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sensitive_columns(
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sensitive_data_model_sensitive_type_collection_group.command(name=cli_util.override('data_safe.list_sensitive_data_model_sensitive_types.command_name', 'list-sensitive-data-model-sensitive-types'), help=u"""Gets a list of sensitive type Ids present in the specified sensitive data model. \n[Command Reference](listSensitiveDataModelSensitiveTypes)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["count"]), help=u"""- The field to sort by. You can specify only one sorting parameter (sortorder). The default order is descending.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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_safe', 'class': 'SensitiveDataModelSensitiveTypeCollection'})
+@cli_util.wrap_exceptions
+def list_sensitive_data_model_sensitive_types(ctx, from_json, all_pages, page_size, sensitive_data_model_id, sensitive_type_id, sort_by, sort_order, limit, page):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if sensitive_type_id is not None:
+ kwargs['sensitive_type_id'] = sensitive_type_id
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sensitive_data_model_sensitive_types,
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sensitive_data_model_sensitive_types,
+ limit,
+ page_size,
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sensitive_data_model_sensitive_types(
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sensitive_data_model_group.command(name=cli_util.override('data_safe.list_sensitive_data_models.command_name', 'list'), help=u"""Gets a list of sensitive data models based on the specified query parameters. \n[Command Reference](listSensitiveDataModels)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for displayName is ascending.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle state.""")
+@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_safe', 'class': 'SensitiveDataModelCollection'})
+@cli_util.wrap_exceptions
+def list_sensitive_data_models(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, sensitive_data_model_id, time_created_greater_than_or_equal_to, time_created_less_than, target_id, sort_order, sort_by, limit, page, lifecycle_state):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if sensitive_data_model_id is not None:
+ kwargs['sensitive_data_model_id'] = sensitive_data_model_id
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sensitive_data_models,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sensitive_data_models,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sensitive_data_models(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sensitive_object_collection_group.command(name=cli_util.override('data_safe.list_sensitive_objects.command_name', 'list-sensitive-objects'), help=u"""Gets a list of sensitive objects present in the specified sensitive data model based on the specified query parameters. \n[Command Reference](listSensitiveObjects)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--object-type', type=custom_types.CliCaseInsensitiveChoice(["ALL", "TABLE", "EDITIONING_VIEW"]), multiple=True, help=u"""A filter to return only items related to a specific object type.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName", "objectName", "objectType"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order is ascending.""")
+@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
+@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SensitiveObjectCollection'})
+@cli_util.wrap_exceptions
+def list_sensitive_objects(ctx, from_json, all_pages, page_size, sensitive_data_model_id, schema_name, object_name, object_type, 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')
+
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if object_type is not None and len(object_type) > 0:
+ kwargs['object_type'] = object_type
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sensitive_objects,
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sensitive_objects,
+ limit,
+ page_size,
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sensitive_objects(
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sensitive_schema_collection_group.command(name=cli_util.override('data_safe.list_sensitive_schemas.command_name', 'list-sensitive-schemas'), help=u"""Gets a list of sensitive schemas present in the specified sensitive data model based on the specified query parameters. \n[Command Reference](listSensitiveSchemas)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order is ascending.""")
+@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
+@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SensitiveSchemaCollection'})
+@cli_util.wrap_exceptions
+def list_sensitive_schemas(ctx, from_json, all_pages, page_size, sensitive_data_model_id, schema_name, 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')
+
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sensitive_schemas,
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sensitive_schemas,
+ limit,
+ page_size,
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sensitive_schemas(
+ sensitive_data_model_id=sensitive_data_model_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sensitive_type_group_summary_group.command(name=cli_util.override('data_safe.list_sensitive_type_groups.command_name', 'list-sensitive-type-groups'), help=u"""Gets a list of sensitive type groups based on the specified query parameters. \n[Command Reference](listSensitiveTypeGroups)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle state.""")
+@cli_util.option('--sensitive-type-group-id', help=u"""An optional filter to return only resources that match the specified OCID of the sensitive type group resource.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for displayName is ascending.""")
+@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
+@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SensitiveTypeGroupCollection'})
+@cli_util.wrap_exceptions
+def list_sensitive_type_groups(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, sensitive_type_group_id, time_created_greater_than_or_equal_to, time_created_less_than, sort_order, sort_by):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if sensitive_type_group_id is not None:
+ kwargs['sensitive_type_group_id'] = sensitive_type_group_id
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sensitive_type_groups,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sensitive_type_groups,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sensitive_type_groups(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sensitive_type_group.command(name=cli_util.override('data_safe.list_sensitive_types.command_name', 'list'), help=u"""Gets a list of sensitive types based on the specified query parameters. \n[Command Reference](listSensitiveTypes)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--sensitive-type-id', help=u"""A filter to return only items related to a specific sensitive type OCID.""")
+@cli_util.option('--sensitive-type-source', type=custom_types.CliCaseInsensitiveChoice(["ORACLE", "USER"]), help=u"""A filter to return the sensitive type resources based on the value of their source attribute.""")
+@cli_util.option('--entity-type', type=custom_types.CliCaseInsensitiveChoice(["SENSITIVE_TYPE", "SENSITIVE_CATEGORY"]), help=u"""A filter to return the sensitive type resources based on the value of their entityType attribute.""")
+@cli_util.option('--parent-category-id', help=u"""A filter to return only the sensitive types that are children of the sensitive category identified by the specified OCID.""")
+@cli_util.option('--default-masking-format-id', help=u"""A filter to return only the sensitive types that have the default masking format identified by the specified OCID.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for displayName is ascending.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle state.""")
+@cli_util.option('--is-common', type=click.BOOL, help=u"""A filter to return only the common sensitive type resources. Common sensitive types belong to library sensitive types which are frequently used to perform sensitive data discovery.""")
+@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_safe', 'class': 'SensitiveTypeCollection'})
+@cli_util.wrap_exceptions
+def list_sensitive_types(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, sensitive_type_id, sensitive_type_source, entity_type, parent_category_id, default_masking_format_id, time_created_greater_than_or_equal_to, time_created_less_than, sort_order, sort_by, limit, page, lifecycle_state, is_common):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if sensitive_type_id is not None:
+ kwargs['sensitive_type_id'] = sensitive_type_id
+ if sensitive_type_source is not None:
+ kwargs['sensitive_type_source'] = sensitive_type_source
+ if entity_type is not None:
+ kwargs['entity_type'] = entity_type
+ if parent_category_id is not None:
+ kwargs['parent_category_id'] = parent_category_id
+ if default_masking_format_id is not None:
+ kwargs['default_masking_format_id'] = default_masking_format_id
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if is_common is not None:
+ kwargs['is_common'] = is_common
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sensitive_types,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sensitive_types,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sensitive_types(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sensitive_types_export_collection_group.command(name=cli_util.override('data_safe.list_sensitive_types_exports.command_name', 'list-sensitive-types-exports'), help=u"""Retrieves a list of all sensitive types export in Data Safe based on the specified query parameters. The ListSensitiveTypesExports operation returns only the sensitive types export in the specified `compartmentId`. \n[Command Reference](listSensitiveTypesExports)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle state.""")
+@cli_util.option('--sensitive-types-export-id', help=u"""An optional filter to return only resources that match the specified OCID of the sensitive types export resource.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'SensitiveTypesExportCollection'})
+@cli_util.wrap_exceptions
+def list_sensitive_types_exports(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, sensitive_types_export_id, time_created_greater_than_or_equal_to, time_created_less_than, sort_order, sort_by):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if sensitive_types_export_id is not None:
+ kwargs['sensitive_types_export_id'] = sensitive_types_export_id
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sensitive_types_exports,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sensitive_types_exports,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sensitive_types_exports(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sql_collection_analytics_collection_group.command(name=cli_util.override('data_safe.list_sql_collection_analytics.command_name', 'list-sql-collection-analytics'), help=u"""Retrieves a list of all SQL collection analytics in Data Safe.
+
+The ListSqlCollectionAnalytics operation returns only the analytics for the SQL collections in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListSqlCollections on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSqlCollectionAnalytics)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "COLLECTING", "COMPLETED", "INACTIVE", "FAILED", "DELETING", "DELETED", "NEEDS_ATTENTION"]), help=u"""The current state of the SQL collection.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "lifecycleState"]), multiple=True, help=u"""The group by parameter to summarize SQL collection aggregation.""")
+@cli_util.option('--time-started', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return the stats of the SQL collection logs collected after the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-ended', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return the stats of the SQL collection logs collected before the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@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_safe', 'class': 'SqlCollectionAnalyticsCollection'})
+@cli_util.wrap_exceptions
+def list_sql_collection_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, lifecycle_state, target_id, target_database_group_id, group_by, time_started, time_ended):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ if group_by is not None and len(group_by) > 0:
+ kwargs['group_by'] = group_by
+ if time_started is not None:
+ kwargs['time_started'] = time_started
+ if time_ended is not None:
+ kwargs['time_ended'] = time_ended
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sql_collection_analytics,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sql_collection_analytics,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sql_collection_analytics(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sql_collection_log_insights_collection_group.command(name=cli_util.override('data_safe.list_sql_collection_log_insights.command_name', 'list-sql-collection-log-insights'), help=u"""Retrieves a list of the SQL collection log analytics. \n[Command Reference](listSqlCollectionLogInsights)""")
+@cli_util.option('--time-started', required=True, type=custom_types.CLI_DATETIME, help=u"""An optional filter to return the stats of the SQL collection logs collected after the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-ended', required=True, type=custom_types.CLI_DATETIME, help=u"""An optional filter to return the stats of the SQL collection logs collected before the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["clientIp", "clientProgram", "clientOsUserName"]), help=u"""The group by parameter to summarize SQL collection log insights aggregation.""")
+@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_safe', 'class': 'SqlCollectionLogInsightsCollection'})
+@cli_util.wrap_exceptions
+def list_sql_collection_log_insights(ctx, from_json, all_pages, page_size, time_started, time_ended, sql_collection_id, limit, page, group_by):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if group_by is not None:
+ kwargs['group_by'] = group_by
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sql_collection_log_insights,
+ time_started=time_started,
+ time_ended=time_ended,
+ sql_collection_id=sql_collection_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sql_collection_log_insights,
+ limit,
+ page_size,
+ time_started=time_started,
+ time_ended=time_ended,
+ sql_collection_id=sql_collection_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sql_collection_log_insights(
+ time_started=time_started,
+ time_ended=time_ended,
+ sql_collection_id=sql_collection_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sql_collection_collection_group.command(name=cli_util.override('data_safe.list_sql_collections.command_name', 'list-sql-collections'), help=u"""Retrieves a list of all SQL collections in Data Safe.
+
+The ListSqlCollections operation returns only the SQL collections in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListSqlCollections on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSqlCollections)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "COLLECTING", "COMPLETED", "INACTIVE", "FAILED", "DELETING", "DELETED", "NEEDS_ATTENTION"]), help=u"""The current state of the SQL collection.""")
+@cli_util.option('--sql-collection-id', help=u"""An optional filter to return only resources that match the specified OCID of the SQL collection resource.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--db-user-name', help=u"""A filter to return only items that match the specified user name.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME", "TIMELASTSTARTED"]), help=u"""The field used for sorting. Only one sorting parameter order (sortOrder) can be specified. The DISPLAYNAME sort order 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_safe', 'class': 'SqlCollectionCollection'})
+@cli_util.wrap_exceptions
+def list_sql_collections(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, lifecycle_state, sql_collection_id, time_created_greater_than_or_equal_to, time_created_less_than, target_id, target_database_group_id, db_user_name, sort_order, sort_by):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if sql_collection_id is not None:
+ kwargs['sql_collection_id'] = sql_collection_id
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ if db_user_name is not None:
+ kwargs['db_user_name'] = db_user_name
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sql_collections,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sql_collections,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sql_collections(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sql_firewall_allowed_sql_analytics_collection_group.command(name=cli_util.override('data_safe.list_sql_firewall_allowed_sql_analytics.command_name', 'list-sql-firewall-allowed-sql-analytics'), help=u"""Returns the aggregation details of all SQL Firewall allowed SQL statements.
+
+The ListSqlFirewallAllowedSqlAnalytics operation returns the aggregates of the SQL Firewall allowed SQL statements in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListSqlFirewallAllowedSqlAnalytics on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSqlFirewallAllowedSqlAnalytics)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+
+**Example:** query=(currentUser eq \"SCOTT\") and (topLevel eq \"YES\")""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["dbUserName", "sqlLevel", "sqlFirewallPolicyId", "lifecycleState"]), multiple=True, help=u"""The group by parameter to summarize the allowed SQL aggregation.""")
+@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_safe', 'class': 'SqlFirewallAllowedSqlAnalyticsCollection'})
+@cli_util.wrap_exceptions
+def list_sql_firewall_allowed_sql_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, scim_query, group_by):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if scim_query is not None:
+ kwargs['scim_query'] = scim_query
+ if group_by is not None and len(group_by) > 0:
+ kwargs['group_by'] = group_by
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sql_firewall_allowed_sql_analytics,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sql_firewall_allowed_sql_analytics,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sql_firewall_allowed_sql_analytics(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sql_firewall_allowed_sql_collection_group.command(name=cli_util.override('data_safe.list_sql_firewall_allowed_sqls.command_name', 'list-sql-firewall-allowed-sqls'), help=u"""Retrieves a list of all SQL Firewall allowed SQL statements.
+
+The ListSqlFirewallAllowedSqls operation returns only the SQL Firewall allowed SQL statements in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListSqlFirewallPolicies on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSqlFirewallAllowedSqls)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+
+**Example:** query=(currentUser eq \"SCOTT\") and (topLevel eq \"YES\")""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCollected"]), help=u"""The field to sort by. Only one sort parameter should be provided.""")
+@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_safe', 'class': 'SqlFirewallAllowedSqlCollection'})
+@cli_util.wrap_exceptions
+def list_sql_firewall_allowed_sqls(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, scim_query, sort_order, sort_by):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if scim_query is not None:
+ kwargs['scim_query'] = scim_query
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sql_firewall_allowed_sqls,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sql_firewall_allowed_sqls,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sql_firewall_allowed_sqls(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sql_firewall_policy_collection_group.command(name=cli_util.override('data_safe.list_sql_firewall_policies.command_name', 'list-sql-firewall-policies'), help=u"""Retrieves a list of all SQL Firewall policies.
+
+The ListSqlFirewallPolicies operation returns only the SQL Firewall policies in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListSqlFirewallPolicies on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSqlFirewallPolicies)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--security-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy resource.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "FAILED", "DELETING", "DELETED", "NEEDS_ATTENTION"]), help=u"""The current state of the SQL Firewall policy.""")
+@cli_util.option('--sql-firewall-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the SQL Firewall policy resource.""")
+@cli_util.option('--db-user-name', help=u"""A filter to return only items that match the specified user name.""")
+@cli_util.option('--violation-action', type=custom_types.CliCaseInsensitiveChoice(["block", "observe"]), help=u"""An optional filter to return only resources that match the specified violation action.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'SqlFirewallPolicyCollection'})
+@cli_util.wrap_exceptions
+def list_sql_firewall_policies(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, limit, page, security_policy_id, lifecycle_state, sql_firewall_policy_id, db_user_name, violation_action, time_created_greater_than_or_equal_to, time_created_less_than, sort_order, sort_by):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if security_policy_id is not None:
+ kwargs['security_policy_id'] = security_policy_id
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if sql_firewall_policy_id is not None:
+ kwargs['sql_firewall_policy_id'] = sql_firewall_policy_id
+ if db_user_name is not None:
+ kwargs['db_user_name'] = db_user_name
+ if violation_action is not None:
+ kwargs['violation_action'] = violation_action
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sql_firewall_policies,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sql_firewall_policies,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sql_firewall_policies(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sql_firewall_policy_analytics_collection_group.command(name=cli_util.override('data_safe.list_sql_firewall_policy_analytics.command_name', 'list-sql-firewall-policy-analytics'), help=u"""Gets a list of aggregated SQL Firewall policy details.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform SummarizedSqlFirewallPolicyInfo on the specified `compartmentId` and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listSqlFirewallPolicyAnalytics)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["violationAction", "enforcementScope", "securityPolicyId", "lifecycleState"]), multiple=True, help=u"""The group by parameter to summarize SQL Firewall policy aggregation.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "FAILED", "DELETING", "DELETED", "NEEDS_ATTENTION"]), help=u"""The current state of the SQL Firewall policy.""")
+@cli_util.option('--security-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy resource.""")
+@cli_util.option('--time-started', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return the summary of the SQL Firewall policies created after the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-ended', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return the summary of the SQL Firewall policies created before the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@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_safe', 'class': 'SqlFirewallPolicyAnalyticsCollection'})
+@cli_util.wrap_exceptions
+def list_sql_firewall_policy_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, group_by, lifecycle_state, security_policy_id, time_started, time_ended):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if group_by is not None and len(group_by) > 0:
+ kwargs['group_by'] = group_by
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if security_policy_id is not None:
+ kwargs['security_policy_id'] = security_policy_id
+ if time_started is not None:
+ kwargs['time_started'] = time_started
+ if time_ended is not None:
+ kwargs['time_ended'] = time_ended
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sql_firewall_policy_analytics,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sql_firewall_policy_analytics,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sql_firewall_policy_analytics(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sql_firewall_violation_summary_group.command(name=cli_util.override('data_safe.list_sql_firewall_violation_analytics.command_name', 'list-sql-firewall-violation-analytics'), help=u"""Returns the aggregation details of the SQL Firewall violations. \n[Command Reference](listSqlFirewallViolationAnalytics)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--time-started', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is greater than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-ended', type=custom_types.CLI_DATETIME, help=u"""An optional filter to return audit events whose creation time in the database is less than and equal to the date-time specified, in the format defined by [RFC3339].""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--query-time-zone', help=u"""Default time zone is UTC if no time zone provided. The date-time considerations of the resource will be in accordance with the specified time zone.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["dbUserName", "targetId", "targetName", "operationTime", "timeCollected", "clientOsUserName", "operation", "currentDbUserName", "sqlLevel", "clientIp", "clientProgram", "violationCause", "violationAction", "violationCount"]), help=u"""If this query parameter is specified, the result is sorted by this query parameter value.""")
+@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+
+**Example:** query=(operationTime ge \"2021-06-04T01:00:26.000Z\") and (violationAction eq \"BLOCKED\")""")
+@cli_util.option('--summary-field', type=custom_types.CliCaseInsensitiveChoice(["dbUserName", "targetName", "clientOsUserName", "operation", "sqlText", "currentDbUserName", "sqlLevel", "clientIp", "clientProgram", "violationCause", "violationAction", "selects", "creates", "alters", "drops", "grants", "revokes"]), multiple=True, help=u"""Specifies a subset of summarized fields to be returned in the response.""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["dbUserName", "targetName", "operationTime", "timeCollected", "clientOsUserName", "operation", "sqlText", "currentDbUserName", "sqlLevel", "clientIp", "clientProgram", "violationCause", "violationAction"]), multiple=True, help=u"""A groupBy can only be used in combination with summaryField parameter. A groupBy value has to be a subset of the values mentioned in summaryField parameter.""")
+@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_safe', 'class': 'SqlFirewallViolationAnalyticsCollection'})
+@cli_util.wrap_exceptions
+def list_sql_firewall_violation_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, limit, page, time_started, time_ended, query_time_zone, sort_order, sort_by, scim_query, summary_field, group_by):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if time_started is not None:
+ kwargs['time_started'] = time_started
+ if time_ended is not None:
+ kwargs['time_ended'] = time_ended
+ if query_time_zone is not None:
+ kwargs['query_time_zone'] = query_time_zone
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if scim_query is not None:
+ kwargs['scim_query'] = scim_query
+ if summary_field is not None and len(summary_field) > 0:
+ kwargs['summary_field'] = summary_field
+ if group_by is not None and len(group_by) > 0:
+ kwargs['group_by'] = group_by
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sql_firewall_violation_analytics,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sql_firewall_violation_analytics,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sql_firewall_violation_analytics(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@sql_firewall_violation_summary_group.command(name=cli_util.override('data_safe.list_sql_firewall_violations.command_name', 'list-sql-firewall-violations'), help=u"""Gets a list of all the SQL Firewall violations captured by the firewall. \n[Command Reference](listSqlFirewallViolations)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["dbUserName", "targetId", "targetName", "operationTime", "timeCollected", "clientOsUserName", "operation", "currentDbUserName", "sqlLevel", "clientIp", "clientProgram", "violationCause", "violationAction"]), help=u"""If this query parameter is specified, the result is sorted by this query parameter value.""")
+@cli_util.option('--scim-query', help=u"""The scimQuery query parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.)
+
+**Example:** query=(operationTime ge \"2021-06-04T01:00:26.000Z\") and (violationAction eq \"BLOCKED\")""")
+@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_safe', 'class': 'SqlFirewallViolationsCollection'})
+@cli_util.wrap_exceptions
+def list_sql_firewall_violations(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, limit, page, access_level, sort_order, sort_by, scim_query):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if scim_query is not None:
+ kwargs['scim_query'] = scim_query
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_sql_firewall_violations,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_sql_firewall_violations,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_sql_firewall_violations(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetted_object_summary_group.command(name=cli_util.override('data_safe.list_subsetted_objects.command_name', 'list-subsetted-objects'), help=u"""Gets a list of subsetted tables present in the specified subsetting report and based on the specified query parameters. \n[Command Reference](listSubsettedObjects)""")
+@cli_util.option('--subsetting-report-id', required=True, help=u"""The OCID of the subsetting report.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName", "objectName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for all the fields is ascending.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SubsettedObjectCollection'})
+@cli_util.wrap_exceptions
+def list_subsetted_objects(ctx, from_json, all_pages, page_size, subsetting_report_id, limit, page, sort_order, sort_by, schema_name, object_name):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(subsetting_report_id, six.string_types) and len(subsetting_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-report-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_subsetted_objects,
+ subsetting_report_id=subsetting_report_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_subsetted_objects,
+ limit,
+ page_size,
+ subsetting_report_id=subsetting_report_id,
+ **kwargs
+ )
+ else:
+ result = client.list_subsetted_objects(
+ subsetting_report_id=subsetting_report_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_policy_group.command(name=cli_util.override('data_safe.list_subsetting_analytics.command_name', 'list-subsetting-analytics'), help=u"""Gets consolidated subsetting analytics data based on the specified query parameters. If CompartmentIdInSubtreeQueryParam is specified as true, the behaviour is equivalent to accessLevel \"ACCESSIBLE\" by default. \n[Command Reference](listSubsettingAnalytics)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--group-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "policyId", "targetIdAndPolicyId"]), help=u"""Attribute by which the subsetting analytics data should be grouped.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--subsetting-policy-id', help=u"""A filter to return only the resources that match the specified subsetting policy OCID.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeLastSubsetted"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for all the fields is ascending.""")
+@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('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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_safe', 'class': 'SubsettingAnalyticsCollection'})
+@cli_util.wrap_exceptions
+def list_subsetting_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, group_by, target_id, subsetting_policy_id, target_database_group_id, sort_by, sort_order, time_created_greater_than_or_equal_to, time_created_less_than, limit, page):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if group_by is not None:
+ kwargs['group_by'] = group_by
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if subsetting_policy_id is not None:
+ kwargs['subsetting_policy_id'] = subsetting_policy_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_subsetting_analytics,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_subsetting_analytics,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_subsetting_analytics(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_error_summary_group.command(name=cli_util.override('data_safe.list_subsetting_errors.command_name', 'list-subsetting-errors'), help=u"""Gets a list of subsetting errors in a subsetting run based on the specified query parameters. \n[Command Reference](listSubsettingErrors)""")
+@cli_util.option('--subsetting-report-id', required=True, help=u"""The OCID of the subsetting report.""")
+@cli_util.option('--step-name', type=custom_types.CliCaseInsensitiveChoice(["VALIDATE", "IDENTIFY_ROWS_FOR_SUBSET", "GENERATE_SCRIPT", "EXECUTE_SUBSETTING", "PRE_SUBSETTING", "POST_SUBSETTING"]), help=u"""A filter to return only subsetting errors that match the specified step name.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["stepName", "timeCreated"]), help=u"""The field to sort by. The default order will be ascending.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--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_safe', 'class': 'SubsettingErrorCollection'})
+@cli_util.wrap_exceptions
+def list_subsetting_errors(ctx, from_json, all_pages, page_size, subsetting_report_id, step_name, sort_by, limit, page, sort_order):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(subsetting_report_id, six.string_types) and len(subsetting_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-report-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if step_name is not None:
+ kwargs['step_name'] = step_name
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ 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
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_subsetting_errors,
+ subsetting_report_id=subsetting_report_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_subsetting_errors,
+ limit,
+ page_size,
+ subsetting_report_id=subsetting_report_id,
+ **kwargs
+ )
+ else:
+ result = client.list_subsetting_errors(
+ subsetting_report_id=subsetting_report_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_policy_group.command(name=cli_util.override('data_safe.list_subsetting_policies.command_name', 'list'), help=u"""Gets a list of subsetting policies based on the specified query parameters. \n[Command Reference](listSubsettingPolicies)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--subsetting-policy-id', help=u"""A filter to return only the resources that match the specified subsetting policy OCID.""")
+@cli_util.option('--masking-policy-id', help=u"""A filter to return only the resources that match the specified masking policy OCID.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle states.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for displayName is ascending. The displayName sort order is case sensitive.""")
+@cli_util.option('--sensitive-data-model-id', help=u"""A filter to return only the resources that match the specified sensitive data model OCID.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@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_safe', 'class': 'SubsettingPolicyCollection'})
+@cli_util.wrap_exceptions
+def list_subsetting_policies(ctx, from_json, all_pages, page_size, compartment_id, subsetting_policy_id, masking_policy_id, display_name, limit, page, lifecycle_state, sort_order, sort_by, sensitive_data_model_id, target_id, time_created_greater_than_or_equal_to, time_created_less_than, compartment_id_in_subtree, access_level):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if subsetting_policy_id is not None:
+ kwargs['subsetting_policy_id'] = subsetting_policy_id
+ if masking_policy_id is not None:
+ kwargs['masking_policy_id'] = masking_policy_id
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sensitive_data_model_id is not None:
+ kwargs['sensitive_data_model_id'] = sensitive_data_model_id
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_subsetting_policies,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_subsetting_policies,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_subsetting_policies(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_policy_health_report_group.command(name=cli_util.override('data_safe.list_subsetting_policy_health_report_logs.command_name', 'list-subsetting-policy-health-report-logs'), help=u"""Gets a list of errors and warnings from a subsetting policy health check. \n[Command Reference](listSubsettingPolicyHealthReportLogs)""")
+@cli_util.option('--subsetting-policy-health-report-id', required=True, help=u"""The OCID of the subsetting health report.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["messageType"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for messageType is ascending.""")
+@cli_util.option('--message-type', type=custom_types.CliCaseInsensitiveChoice(["PASS", "WARNING", "ERROR"]), help=u"""A filter to return only the resources that match the specified log message type.""")
+@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_safe', 'class': 'SubsettingPolicyHealthReportLogCollection'})
+@cli_util.wrap_exceptions
+def list_subsetting_policy_health_report_logs(ctx, from_json, all_pages, page_size, subsetting_policy_health_report_id, limit, page, sort_order, sort_by, message_type):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(subsetting_policy_health_report_id, six.string_types) and len(subsetting_policy_health_report_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-health-report-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if message_type is not None:
+ kwargs['message_type'] = message_type
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_subsetting_policy_health_report_logs,
+ subsetting_policy_health_report_id=subsetting_policy_health_report_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_subsetting_policy_health_report_logs,
+ limit,
+ page_size,
+ subsetting_policy_health_report_id=subsetting_policy_health_report_id,
+ **kwargs
+ )
+ else:
+ result = client.list_subsetting_policy_health_report_logs(
+ subsetting_policy_health_report_id=subsetting_policy_health_report_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_policy_health_report_group.command(name=cli_util.override('data_safe.list_subsetting_policy_health_reports.command_name', 'list'), help=u"""Gets a list of subsetting policy health reports based on the specified query parameters. \n[Command Reference](listSubsettingPolicyHealthReports)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--subsetting-policy-health-report-id', help=u"""A filter to return only the resources that match the specified subsetting policy health report OCID.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""sort by""")
+@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('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--subsetting-policy-id', help=u"""A filter to return only the resources that match the specified subsetting policy OCID.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only the resources that match the specified lifecycle states.""")
+@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_safe', 'class': 'SubsettingPolicyHealthReportCollection'})
+@cli_util.wrap_exceptions
+def list_subsetting_policy_health_reports(ctx, from_json, all_pages, page_size, compartment_id, subsetting_policy_health_report_id, limit, page, compartment_id_in_subtree, access_level, sort_by, sort_order, display_name, target_id, subsetting_policy_id, lifecycle_state):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if subsetting_policy_health_report_id is not None:
+ kwargs['subsetting_policy_health_report_id'] = subsetting_policy_health_report_id
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if subsetting_policy_id is not None:
+ kwargs['subsetting_policy_id'] = subsetting_policy_id
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_subsetting_policy_health_reports,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_subsetting_policy_health_reports,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_subsetting_policy_health_reports(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_report_group.command(name=cli_util.override('data_safe.list_subsetting_reports.command_name', 'list'), help=u"""Gets a list of subsetting reports based on the specified query parameters. \n[Command Reference](listSubsettingReports)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--subsetting-policy-id', help=u"""A filter to return only the resources that match the specified subsetting policy OCID.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeSubsettingFinished"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeSubsettingFinished is descending.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@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_safe', 'class': 'SubsettingReportCollection'})
+@cli_util.wrap_exceptions
+def list_subsetting_reports(ctx, from_json, all_pages, page_size, compartment_id, limit, page, subsetting_policy_id, target_id, target_database_group_id, sort_order, sort_by, compartment_id_in_subtree, access_level):
+
+ 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
+ if subsetting_policy_id is not None:
+ kwargs['subsetting_policy_id'] = subsetting_policy_id
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_subsetting_reports,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_subsetting_reports,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_subsetting_reports(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_rule_processing_chain_object_summary_group.command(name=cli_util.override('data_safe.list_subsetting_rule_processing_chain_objects.command_name', 'list-subsetting-rule-processing-chain-objects'), help=u"""Gets a list of objects of processing chain based on the specified query parameters generated for a subsetting rule. A processing chain is the relationship path that determines how a subsetting rule is applied across related tables. It is built from the selected subsetting table, subsetting rule, the chosen relatedTablesPropagation direction, and the referential relationships in the schema. \n[Command Reference](listSubsettingRuleProcessingChainObjects)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--subsetting-rule-key', required=True, help=u"""The unique key that identifies the subsetting rule. It's numeric and unique within a subsetting policy.""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["key"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for key is ascending. The default order for other fields is ascending.""")
+@cli_util.option('--is-enabled-for-processing', type=click.BOOL, help=u"""A filter to return the processing chain objects which are enabled for processing.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
+@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'SubsettingRuleProcessingChainObjectsCollection'})
+@cli_util.wrap_exceptions
+def list_subsetting_rule_processing_chain_objects(ctx, from_json, all_pages, page_size, subsetting_policy_id, subsetting_rule_key, page, limit, sort_by, is_enabled_for_processing, sort_order):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
+
+ if isinstance(subsetting_rule_key, six.string_types) and len(subsetting_rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-rule-key cannot be whitespace or empty string')
+
+ kwargs = {}
+ if page is not None:
+ kwargs['page'] = page
+ if limit is not None:
+ kwargs['limit'] = limit
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if is_enabled_for_processing is not None:
+ kwargs['is_enabled_for_processing'] = is_enabled_for_processing
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_subsetting_rule_processing_chain_objects,
+ subsetting_policy_id=subsetting_policy_id,
+ subsetting_rule_key=subsetting_rule_key,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_subsetting_rule_processing_chain_objects,
+ limit,
+ page_size,
+ subsetting_policy_id=subsetting_policy_id,
+ subsetting_rule_key=subsetting_rule_key,
+ **kwargs
+ )
+ else:
+ result = client.list_subsetting_rule_processing_chain_objects(
+ subsetting_policy_id=subsetting_policy_id,
+ subsetting_rule_key=subsetting_rule_key,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_rule_group.command(name=cli_util.override('data_safe.list_subsetting_rules.command_name', 'list'), help=u"""Gets a list of subsetting rules present in the specified subsetting policy and based on the specified query parameters. A subsetting rule is the criteria that tells Data Safe which rows to retain from the selected starting table for a subsetting operation. It is the entry point for the subset. Data Safe uses this rule, along with the propagation setting, to determine the related rows that must also be retained across parent and child tables. \n[Command Reference](listSubsettingRules)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "schemaName", "objectName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for other fields is ascending.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SubsettingRuleCollection'})
+@cli_util.wrap_exceptions
+def list_subsetting_rules(ctx, from_json, all_pages, page_size, subsetting_policy_id, limit, page, sort_order, sort_by, schema_name, object_name):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_subsetting_rules,
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_subsetting_rules,
+ limit,
+ page_size,
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ else:
+ result = client.list_subsetting_rules(
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_schema_object_summary_group.command(name=cli_util.override('data_safe.list_subsetting_schema_objects.command_name', 'list-subsetting-schema-objects'), help=u"""Gets a list of objects/tables present in the specified subsetting policy schemas based on the specified query parameters. \n[Command Reference](listSubsettingSchemaObjects)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "schemaName", "objectName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for timeCreated is descending. The default order for other fields is ascending.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
+@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+@json_skeleton_utils.get_cli_json_input_option({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SubsettingSchemaObjectCollection'})
+@cli_util.wrap_exceptions
+def list_subsetting_schema_objects(ctx, from_json, all_pages, page_size, subsetting_policy_id, schema_name, object_name, page, limit, sort_by, sort_order):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if page is not None:
+ kwargs['page'] = page
+ if limit is not None:
+ kwargs['limit'] = limit
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_subsetting_schema_objects,
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_subsetting_schema_objects,
+ limit,
+ page_size,
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ else:
+ result = client.list_subsetting_schema_objects(
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_schema_relation_summary_group.command(name=cli_util.override('data_safe.list_subsetting_schema_relations.command_name', 'list-subsetting-schema-relations'), help=u"""Gets a list of referential relations present in the specified subsetting policy schemas based on the specified query parameters. \n[Command Reference](listSubsettingSchemaRelations)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--relation-type', type=custom_types.CliCaseInsensitiveChoice(["APP_DEFINED", "DB_DEFINED"]), help=u"""A filter to return columns based on their relationship with their parent columns. If set to APP_DEFINED, it returns all the child columns that have application-level (non-dictionary) relationship with their parents. If set to DB_DEFINED, it returns all the child columns that have database-level (dictionary-defined) relationship with their parents.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["relationType", "schemaName", "objectName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder).""")
+@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SubsettingSchemaRelationCollection'})
+@cli_util.wrap_exceptions
+def list_subsetting_schema_relations(ctx, from_json, all_pages, page_size, subsetting_policy_id, schema_name, object_name, relation_type, 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')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if relation_type is not None:
+ kwargs['relation_type'] = relation_type
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_subsetting_schema_relations,
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_subsetting_schema_relations,
+ limit,
+ page_size,
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ else:
+ result = client.list_subsetting_schema_relations(
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@subsetting_schema_collection_group.command(name=cli_util.override('data_safe.list_subsetting_schemas.command_name', 'list-subsetting-schemas'), help=u"""Gets a list of subsetting schemas present in the specified subsetting policy and based on the specified query parameters. \n[Command Reference](listSubsettingSchemas)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order is ascending.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--is-derived-schema', type=click.BOOL, help=u"""A filter to return the schemas which are derived. A schema is derived if it is related to a input schema.""")
+@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'SubsettingSchemaCollection'})
+@cli_util.wrap_exceptions
+def list_subsetting_schemas(ctx, from_json, all_pages, page_size, subsetting_policy_id, limit, page, sort_order, sort_by, schema_name, is_derived_schema):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if is_derived_schema is not None:
+ kwargs['is_derived_schema'] = is_derived_schema
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_subsetting_schemas,
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_subsetting_schemas,
+ limit,
+ page_size,
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ else:
+ result = client.list_subsetting_schemas(
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@table_estimate_summary_group.command(name=cli_util.override('data_safe.list_table_estimates.command_name', 'list-table-estimates'), help=u"""Gets table size estimates for the specified subsetting policy. \n[Command Reference](listTableEstimates)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--object-name', multiple=True, help=u"""A filter to return only items related to a specific object name.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["schemaName", "tableName"]), help=u"""The field to sort by. You can specify only one sorting parameter (sortOrder). The default order for schemaName is ascending.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'object-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'TableEstimateCollection'})
+@cli_util.wrap_exceptions
+def list_table_estimates(ctx, from_json, all_pages, page_size, subsetting_policy_id, schema_name, object_name, target_id, sort_order, sort_by, limit, page):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if object_name is not None and len(object_name) > 0:
+ kwargs['object_name'] = object_name
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_table_estimates,
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_table_estimates,
+ limit,
+ page_size,
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ else:
+ result = client.list_table_estimates(
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@target_database_group.command(name=cli_util.override('data_safe.list_tables.command_name', 'list-tables'), help=u"""Returns a list of table metadata objects. \n[Command Reference](listTables)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--schema-name', multiple=True, help=u"""A filter to return only items related to specific schema name.""")
+@cli_util.option('--table-name', multiple=True, help=u"""A filter to return only items related to specific table name.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["SCHEMANAME", "TABLENAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified.""")
+@cli_util.option('--table-name-contains', help=u"""A filter to return only items if table name contains a specific string.""")
+@cli_util.option('--schema-name-contains', help=u"""A filter to return only items if schema name contains a specific string.""")
+@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({'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'table-name': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-name': {'module': 'data_safe', 'class': 'list[string]'}, 'table-name': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'list[TableSummary]'})
+@cli_util.wrap_exceptions
+def list_tables(ctx, from_json, all_pages, page_size, target_database_id, limit, page, schema_name, table_name, sort_order, sort_by, table_name_contains, schema_name_contains):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if schema_name is not None and len(schema_name) > 0:
+ kwargs['schema_name'] = schema_name
+ if table_name is not None and len(table_name) > 0:
+ kwargs['table_name'] = table_name
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if table_name_contains is not None:
+ kwargs['table_name_contains'] = table_name_contains
+ if schema_name_contains is not None:
+ kwargs['schema_name_contains'] = schema_name_contains
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_tables,
+ target_database_id=target_database_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_tables,
+ limit,
+ page_size,
+ target_database_id=target_database_id,
+ **kwargs
+ )
+ else:
+ result = client.list_tables(
+ target_database_id=target_database_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@target_alert_policy_association_summary_group.command(name=cli_util.override('data_safe.list_target_alert_policy_associations.command_name', 'list-target-alert-policy-associations'), help=u"""Gets a list of all target-alert policy associations. \n[Command Reference](listTargetAlertPolicyAssociations)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--target-alert-policy-association-id', help=u"""A filter to return only items related to a specific target-alert policy association ID.""")
+@cli_util.option('--alert-policy-id', help=u"""A filter to return policy by it's OCID.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""An optional filter to return only alert policies that have the given life-cycle state.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["DISPLAYNAME", "TIMECREATED", "TIMEUPDATED"]), help=u"""The field to sort by. Only one sort parameter may be provided.""")
+@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A optional filter to return only resources that belong to the specified alert policy association type.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@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_safe', 'class': 'TargetAlertPolicyAssociationCollection'})
+@cli_util.wrap_exceptions
+def list_target_alert_policy_associations(ctx, from_json, all_pages, page_size, compartment_id, target_alert_policy_association_id, alert_policy_id, target_id, lifecycle_state, limit, page, sort_order, sort_by, target_type, time_created_greater_than_or_equal_to, time_created_less_than, compartment_id_in_subtree, access_level):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if target_alert_policy_association_id is not None:
+ kwargs['target_alert_policy_association_id'] = target_alert_policy_association_id
+ if alert_policy_id is not None:
+ kwargs['alert_policy_id'] = alert_policy_id
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if target_type is not None:
+ kwargs['target_type'] = target_type
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_target_alert_policy_associations,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_target_alert_policy_associations,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_target_alert_policy_associations(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@target_alert_policy_association_group.command(name=cli_util.override('data_safe.list_target_alert_policy_unassociated_members.command_name', 'list-target-alert-policy-unassociated-members'), help=u"""Gets the details of target-alert policy association and its unassociated members by its ID. \n[Command Reference](listTargetAlertPolicyUnassociatedMembers)""")
+@cli_util.option('--target-alert-policy-association-id', required=True, help=u"""The OCID of the target-alert policy association.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["targetId", "notAppliedReason"]), help=u"""The field to sort by. Only one sort parameter may be provided.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
+@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'TargetAlertPolicyUnassociatedCollection'})
+@cli_util.wrap_exceptions
+def list_target_alert_policy_unassociated_members(ctx, from_json, all_pages, page_size, target_alert_policy_association_id, limit, page, sort_by, sort_order):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(target_alert_policy_association_id, six.string_types) and len(target_alert_policy_association_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-alert-policy-association-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_target_alert_policy_unassociated_members,
+ target_alert_policy_association_id=target_alert_policy_association_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_target_alert_policy_unassociated_members,
+ limit,
+ page_size,
+ target_alert_policy_association_id=target_alert_policy_association_id,
+ **kwargs
+ )
+ else:
+ result = client.list_target_alert_policy_unassociated_members(
+ target_alert_policy_association_id=target_alert_policy_association_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@target_database_group_summary_group.command(name=cli_util.override('data_safe.list_target_database_groups.command_name', 'list-target-database-groups'), help=u"""Retrieves a list of target database groups according to the specified query parameters. \n[Command Reference](listTargetDatabaseGroups)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--filter', help=u"""The scim query filter parameter accepts filter expressions that use the syntax described in Section 3.2.2.2 of the System for Cross-Domain Identity Management (SCIM) specification, which is available at [RFC3339]. In SCIM filtering expressions, text, date, and time values must be enclosed in quotation marks, with date and time values using ISO-8601 format. (Numeric and boolean values should not be quoted.) Ex:** filter=(targetDatabaseId eq 'ocid1.datasafetargetdatabase.oc1.iad.abuwcljr3u2va4ba5wek53idpe5qq5kkbigzclscc6mysfecxzjt5dgmxqza')""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName", "lifecycleState", "membershipUpdateTime"]), help=u"""The sorting field for your request. You can only specify a single sorting order (sortOrder). The default order for timeCreated is descending.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "NEEDS_ATTENTION"]), help=u"""A filter to retrieve resources that exclusively align with the designated lifecycle state.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@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('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@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_safe', 'class': 'TargetDatabaseGroupCollection'})
+@cli_util.wrap_exceptions
+def list_target_database_groups(ctx, from_json, all_pages, page_size, compartment_id, display_name, filter, sort_by, lifecycle_state, compartment_id_in_subtree, access_level, sort_order, time_created_greater_than_or_equal_to, time_created_less_than, limit, page, target_database_group_id):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if filter is not None:
+ kwargs['filter'] = filter
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_target_database_groups,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_target_database_groups,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_target_database_groups(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@target_database_group.command(name=cli_util.override('data_safe.list_target_databases.command_name', 'list'), help=u"""Returns the list of registered target databases in Data Safe. \n[Command Reference](listTargetDatabases)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--associated-resource-id', help=u"""A filter to return the target databases that are associated to the resource id passed in as a parameter value.""")
+@cli_util.option('--enablement-resource-ocid', help=u"""A filter to return target databases filtered by the enablementResourceOcid column (always a DbaasDatabase OCID).""")
+@cli_util.option('--target-database-id', help=u"""A filter to return the target database that matches the specified OCID.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", "NEEDS_ATTENTION", "FAILED"]), help=u"""A filter to return only target databases that match the specified lifecycle state.""")
+@cli_util.option('--database-type', type=custom_types.CliCaseInsensitiveChoice(["DATABASE_CLOUD_SERVICE", "AUTONOMOUS_DATABASE", "INSTALLED_DATABASE"]), help=u"""A filter to return only target databases that match the specified database type.""")
+@cli_util.option('--infrastructure-type', type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""A filter to return only target databases that match the specified infrastructure type.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'list[TargetDatabaseSummary]'})
+@cli_util.wrap_exceptions
+def list_target_databases(ctx, from_json, all_pages, page_size, compartment_id, associated_resource_id, enablement_resource_ocid, target_database_id, display_name, lifecycle_state, database_type, infrastructure_type, limit, page, compartment_id_in_subtree, access_level, 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 associated_resource_id is not None:
+ kwargs['associated_resource_id'] = associated_resource_id
+ if enablement_resource_ocid is not None:
+ kwargs['enablement_resource_ocid'] = enablement_resource_ocid
+ if target_database_id is not None:
+ kwargs['target_database_id'] = target_database_id
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if database_type is not None:
+ kwargs['database_type'] = database_type
+ if infrastructure_type is not None:
+ kwargs['infrastructure_type'] = infrastructure_type
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_target_databases,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_target_databases,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_target_databases(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@audit_profile_group.command(name=cli_util.override('data_safe.list_target_overrides.command_name', 'list-target-overrides'), help=u"""Gets a list of all targets whose audit settings override the target group setting. \n[Command Reference](listTargetOverrides)""")
+@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
+@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'TargetOverrideCollection'})
+@cli_util.wrap_exceptions
+def list_target_overrides(ctx, from_json, all_pages, page_size, audit_profile_id, limit, page, display_name, sort_by, sort_order):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-profile-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_target_overrides,
+ audit_profile_id=audit_profile_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_target_overrides,
+ limit,
+ page_size,
+ audit_profile_id=audit_profile_id,
+ **kwargs
+ )
+ else:
+ result = client.list_target_overrides(
+ audit_profile_id=audit_profile_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@security_assessment_group.command(name=cli_util.override('data_safe.list_template_analytics.command_name', 'list-template-analytics'), help=u"""Gets a list of template aggregated details in the specified compartment. This provides information about the overall template usage, by returning the count of the target databases/target groups using the templates. It also provides information about the statistics for the template baseline and the comparison related. If the comparison is done, it will show if there is any drift, and how many checks have drifts. The dimension field - isGroup identifies if the targetId belongs to a target group or a individual target. The dimension field - isCompared identifies if the comparison between the latest assessment and the template baseline assessment is done or not. The dimension field - isCompliant identifies if the latest assessment is compliant with the template baseline assessment or not. The dimension field - totalChecksFailed identifies how many checks in the template have drifts in the comparison.
+
+When you perform the ListTemplateAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns statistics from the compartments in which the requestor has INSPECT permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned. \n[Command Reference](listTemplateAnalytics)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--template-assessment-id', help=u"""The OCID of the security assessment of type TEMPLATE.""")
+@cli_util.option('--template-baseline-assessment-id', help=u"""The OCID of the security assessment of type TEMPLATE_BASELINE.""")
+@cli_util.option('--is-group', type=click.BOOL, help=u"""A filter to return only the target group related information if the OCID belongs to a target group.""")
+@cli_util.option('--is-compared', type=click.BOOL, help=u"""A filter to return only the statistics where the comparison between the latest assessment and the template baseline assessment is done.""")
+@cli_util.option('--is-compliant', type=click.BOOL, help=u"""A filter to return only the statistics where the latest assessment is compliant with the template baseline assessment.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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_safe', 'class': 'TemplateAnalyticsCollection'})
+@cli_util.wrap_exceptions
+def list_template_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, template_assessment_id, template_baseline_assessment_id, is_group, is_compared, is_compliant, target_id, target_database_group_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 compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if template_assessment_id is not None:
+ kwargs['template_assessment_id'] = template_assessment_id
+ if template_baseline_assessment_id is not None:
+ kwargs['template_baseline_assessment_id'] = template_baseline_assessment_id
+ if is_group is not None:
+ kwargs['is_group'] = is_group
+ if is_compared is not None:
+ kwargs['is_compared'] = is_compared
+ if is_compliant is not None:
+ kwargs['is_compliant'] = is_compliant
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_template_analytics,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_template_analytics,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_template_analytics(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@security_assessment_group.command(name=cli_util.override('data_safe.list_template_association_analytics.command_name', 'list-template-association-analytics'), help=u"""Gets a list of template association details in the specified compartment. This provides information about the overall template usage, by returning the count of the target databases/target groups using the templates.
+
+If the template baseline is created for a target group which contains several targets, we will have each individual target listed there as targetId field together with targetDatabaseGroupId. And if the template baseline is created for an individual target, it will have targetId field only.
+
+By leveraging the targetId filter, you will be able to know all the template or template baseline that this target has something to do with. No matter if they are directly applied or created for this target, or they are for the target group the target belongs to.
+
+When you perform the ListTemplateAssociationAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns statistics from the compartments in which the requestor has INSPECT permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned. \n[Command Reference](listTemplateAssociationAnalytics)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--template-assessment-id', help=u"""The OCID of the security assessment of type TEMPLATE.""")
+@cli_util.option('--template-baseline-assessment-id', help=u"""The OCID of the security assessment of type TEMPLATE_BASELINE.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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_safe', 'class': 'TemplateAssociationAnalyticsCollection'})
+@cli_util.wrap_exceptions
+def list_template_association_analytics(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, template_assessment_id, template_baseline_assessment_id, target_id, target_database_group_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 compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if template_assessment_id is not None:
+ kwargs['template_assessment_id'] = template_assessment_id
+ if template_baseline_assessment_id is not None:
+ kwargs['template_baseline_assessment_id'] = template_baseline_assessment_id
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_template_association_analytics,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_template_association_analytics,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_template_association_analytics(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@unified_audit_policy_collection_group.command(name=cli_util.override('data_safe.list_unified_audit_policies.command_name', 'list-unified-audit-policies'), help=u"""Retrieves a list of all Unified Audit policies.
+
+The ListUnifiedAuditPolicies operation returns only the Unified Audit policies in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requester has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a sub-compartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListUnifiedAuditPolicies on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and sub-compartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listUnifiedAuditPolicies)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--security-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the security policy resource.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "FAILED", "DELETING", "NEEDS_ATTENTION", "DELETED"]), help=u"""The current state of the Unified Audit policy.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--is-seeded', type=click.BOOL, help=u"""A boolean flag indicating to list seeded unified audit policies. Set this parameter to get list of seeded unified audit policies.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only the resources that were created after the specified date and time, as defined by [RFC3339]. Using TimeCreatedGreaterThanOrEqualToQueryParam parameter retrieves all resources created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--unified-audit-policy-definition-id', help=u"""An optional filter to return only resources that match the specified OCID of the unified audit policy definition resource.""")
+@cli_util.option('--unified-audit-policy-id', help=u"""An optional filter to return only resources that match the specified OCID of the Unified Audit policy resource.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@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_safe', 'class': 'UnifiedAuditPolicyCollection'})
+@cli_util.wrap_exceptions
+def list_unified_audit_policies(ctx, from_json, all_pages, page_size, compartment_id, security_policy_id, lifecycle_state, access_level, display_name, is_seeded, time_created_greater_than_or_equal_to, time_created_less_than, limit, page, unified_audit_policy_definition_id, unified_audit_policy_id, sort_order, sort_by, compartment_id_in_subtree):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if security_policy_id is not None:
+ kwargs['security_policy_id'] = security_policy_id
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if is_seeded is not None:
+ kwargs['is_seeded'] = is_seeded
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if unified_audit_policy_definition_id is not None:
+ kwargs['unified_audit_policy_definition_id'] = unified_audit_policy_definition_id
+ if unified_audit_policy_id is not None:
+ kwargs['unified_audit_policy_id'] = unified_audit_policy_id
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_unified_audit_policies,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_unified_audit_policies,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_unified_audit_policies(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@unified_audit_policy_definition_collection_group.command(name=cli_util.override('data_safe.list_unified_audit_policy_definitions.command_name', 'list-unified-audit-policy-definitions'), help=u"""Retrieves a list of all unified audit policy definitions in Data Safe.
+
+The ListUnifiedAuditPolicyDefinitions operation returns only the unified audit policy definitions in the specified `compartmentId`.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requester has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListUnifiedAuditPolicyDefinitions on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listUnifiedAuditPolicyDefinitions)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "FAILED", "DELETING", "NEEDS_ATTENTION"]), help=u"""The current state of the unified audit policy definition.""")
+@cli_util.option('--unified-audit-policy-definition-id', help=u"""An optional filter to return only resources that match the specified OCID of the unified audit policy definition resource.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--is-seeded', type=click.BOOL, help=u"""A boolean flag indicating to list seeded unified audit policy definitions. Set this parameter to get list of seeded unified audit policy definitions.""")
+@cli_util.option('--unified-audit-policy-category', type=custom_types.CliCaseInsensitiveChoice(["BASIC_ACTIVITY", "ADMIN_USER_ACTIVITY", "USER_ACTIVITY", "ORACLE_PREDEFINED", "COMPLIANCE_STANDARD", "SQL_FIREWALL_AUDITING", "CUSTOM"]), help=u"""The category to which the unified audit policy definition belongs to.""")
+@cli_util.option('--unified-audit-policy-name', help=u"""The name of the unified audit policy.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field used for sorting. Only one sorting order (sortOrder) can be specified. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order 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_safe', 'class': 'UnifiedAuditPolicyDefinitionCollection'})
+@cli_util.wrap_exceptions
+def list_unified_audit_policy_definitions(ctx, from_json, all_pages, page_size, compartment_id, lifecycle_state, unified_audit_policy_definition_id, access_level, display_name, is_seeded, unified_audit_policy_category, unified_audit_policy_name, limit, page, compartment_id_in_subtree, 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 lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if unified_audit_policy_definition_id is not None:
+ kwargs['unified_audit_policy_definition_id'] = unified_audit_policy_definition_id
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if is_seeded is not None:
+ kwargs['is_seeded'] = is_seeded
+ if unified_audit_policy_category is not None:
+ kwargs['unified_audit_policy_category'] = unified_audit_policy_category
+ if unified_audit_policy_name is not None:
+ kwargs['unified_audit_policy_name'] = unified_audit_policy_name
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_unified_audit_policy_definitions,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_unified_audit_policy_definitions,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_unified_audit_policy_definitions(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@user_assessment_group.command(name=cli_util.override('data_safe.list_user_access_analytics.command_name', 'list-user-access-analytics'), help=u"""Gets a list of aggregated user access analytics in the specified target in a compartment. \n[Command Reference](listUserAccessAnalytics)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["USERNAME", "COUNT"]), help=u"""The field to sort by. Only one sort parameter may be provided.""")
+@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('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, 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_safe', 'class': 'UserAccessAnalyticsCollection'})
+@cli_util.wrap_exceptions
+def list_user_access_analytics(ctx, from_json, all_pages, page_size, user_assessment_id, sort_by, sort_order, limit, page):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_user_access_analytics,
+ user_assessment_id=user_assessment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_user_access_analytics,
+ limit,
+ page_size,
+ user_assessment_id=user_assessment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_user_access_analytics(
+ user_assessment_id=user_assessment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@user_assessment_group.command(name=cli_util.override('data_safe.list_user_analytics.command_name', 'list-user-analytics'), help=u"""Gets a list of aggregated user details from the specified user assessment. This provides information about the overall state. of database user security. For example, the user details include how many users have the DBA role and how many users are in the critical category. This data is especially useful content for dashboards or to support analytics.
+
+When you perform the ListUserAnalytics operation, if the parameter compartmentIdInSubtree is set to \"true,\" and if the parameter accessLevel is set to ACCESSIBLE, then the operation returns compartments in which the requestor has READ permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by compartmentId, then \"Not Authorized\" is returned.
+
+The parameter compartmentIdInSubtree applies when you perform ListUserAnalytics on the compartmentId passed and when it is set to true, the entire hierarchy of compartments can be returned.
+
+To use ListUserAnalytics to get a full list of all compartments and subcompartments in the tenancy from the root compartment, set the parameter compartmentIdInSubtree to true and accessLevel to ACCESSIBLE. \n[Command Reference](listUserAnalytics)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--user-category', help=u"""A filter to return only items that match the specified user category.""")
+@cli_util.option('--user-key', help=u"""A filter to return only items that match the specified user key.""")
+@cli_util.option('--account-status', help=u"""A filter to return only items that match the specified account status.""")
+@cli_util.option('--authentication-type', help=u"""A filter to return only items that match the specified authentication type.""")
+@cli_util.option('--user-name', help=u"""A filter to return only items that match the specified user name.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--time-last-login-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last login time in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339].
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-last-login-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last login time in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-user-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose creation time in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-user-created-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose creation time in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-password-last-changed-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last password change in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339].
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-password-last-changed-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last password change in the database is less than the date and time specified, in the format defined by [RFC3339].
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-password-expiry-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose password expiry date in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-password-expiry-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose password expiry date in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["userName", "userCategory", "accountStatus", "timeLastLogin", "targetId", "timeUserCreated", "authenticationType", "timePasswordChanged"]), help=u"""The field to sort by. You can specify only one sort order (sortOrder). The default order for userName is ascending.""")
+@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
+@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
+@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_safe', 'class': 'list[UserAggregation]'})
+@cli_util.wrap_exceptions
+def list_user_analytics(ctx, from_json, all_pages, page_size, user_assessment_id, compartment_id_in_subtree, access_level, limit, user_category, user_key, account_status, authentication_type, user_name, target_id, time_last_login_greater_than_or_equal_to, time_last_login_less_than, time_user_created_greater_than_or_equal_to, time_user_created_less_than, time_password_last_changed_greater_than_or_equal_to, time_password_last_changed_less_than, time_password_expiry_greater_than_or_equal_to, time_password_expiry_less_than, 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')
+
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if limit is not None:
+ kwargs['limit'] = limit
+ if user_category is not None:
+ kwargs['user_category'] = user_category
+ if user_key is not None:
+ kwargs['user_key'] = user_key
+ if account_status is not None:
+ kwargs['account_status'] = account_status
+ if authentication_type is not None:
+ kwargs['authentication_type'] = authentication_type
+ if user_name is not None:
+ kwargs['user_name'] = user_name
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if time_last_login_greater_than_or_equal_to is not None:
+ kwargs['time_last_login_greater_than_or_equal_to'] = time_last_login_greater_than_or_equal_to
+ if time_last_login_less_than is not None:
+ kwargs['time_last_login_less_than'] = time_last_login_less_than
+ if time_user_created_greater_than_or_equal_to is not None:
+ kwargs['time_user_created_greater_than_or_equal_to'] = time_user_created_greater_than_or_equal_to
+ if time_user_created_less_than is not None:
+ kwargs['time_user_created_less_than'] = time_user_created_less_than
+ if time_password_last_changed_greater_than_or_equal_to is not None:
+ kwargs['time_password_last_changed_greater_than_or_equal_to'] = time_password_last_changed_greater_than_or_equal_to
+ if time_password_last_changed_less_than is not None:
+ kwargs['time_password_last_changed_less_than'] = time_password_last_changed_less_than
+ if time_password_expiry_greater_than_or_equal_to is not None:
+ kwargs['time_password_expiry_greater_than_or_equal_to'] = time_password_expiry_greater_than_or_equal_to
+ if time_password_expiry_less_than is not None:
+ kwargs['time_password_expiry_less_than'] = time_password_expiry_less_than
+ 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_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_user_analytics,
+ user_assessment_id=user_assessment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_user_analytics,
+ limit,
+ page_size,
+ user_assessment_id=user_assessment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_user_analytics(
+ user_assessment_id=user_assessment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@user_assessment_group.command(name=cli_util.override('data_safe.list_user_assessments.command_name', 'list'), help=u"""Gets a list of user assessments.
+
+The ListUserAssessments operation returns only the assessments in the specified `compartmentId`. The list does not include any subcompartments of the compartmentId passed.
+
+The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if Principal doesn't have access to even one of the child compartments. This is valid only when `compartmentIdInSubtree` is set to `true`.
+
+The parameter `compartmentIdInSubtree` applies when you perform ListUserAssessments on the `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE. \n[Command Reference](listUserAssessments)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--display-name', help=u"""A filter to return only resources that match the specified display name.""")
+@cli_util.option('--schedule-user-assessment-id', help=u"""The OCID of the user assessment of type SAVE_SCHEDULE.""")
+@cli_util.option('--is-schedule-assessment', type=click.BOOL, help=u"""A filter to return only user assessments of type SAVE_SCHEDULE.""")
+@cli_util.option('--is-baseline', type=click.BOOL, help=u"""A filter to return only user assessments that are set as baseline.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["LATEST", "SAVED", "COMPARTMENT", "SAVE_SCHEDULE"]), help=u"""A filter to return only items that match the specified assessment type.""")
+@cli_util.option('--triggered-by', type=custom_types.CliCaseInsensitiveChoice(["USER", "SYSTEM"]), help=u"""A filter to return user assessments that were created by either the system or by a user only.""")
+@cli_util.option('--time-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return only user assessments that were created after the specified date and time, as defined by [RFC3339]. Using timeCreatedGreaterThanOrEqualTo parameter retrieves all assessments created after that date.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-created-less-than', type=custom_types.CLI_DATETIME, help=u"""Search for resources that were created before a specific date. Specifying this parameter corresponding `timeCreatedLessThan` parameter will retrieve all resources created before the specified created date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as defined by RFC 3339.
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "SUCCEEDED", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""The current state of the user assessment.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. You can specify only one sort order (sortOrder). The default order for timeCreated is descending.""")
+@cli_util.option('--target-type', type=custom_types.CliCaseInsensitiveChoice(["TARGET_DATABASE", "TARGET_DATABASE_GROUP"]), help=u"""A filter to return only only target database resources or target database group resources.""")
+@cli_util.option('--target-database-group-id', help=u"""A filter to return the target database group that matches the specified OCID.""")
+@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_safe', 'class': 'list[UserAssessmentSummary]'})
+@cli_util.wrap_exceptions
+def list_user_assessments(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, access_level, display_name, schedule_user_assessment_id, is_schedule_assessment, is_baseline, target_id, type, triggered_by, time_created_greater_than_or_equal_to, time_created_less_than, limit, page, lifecycle_state, sort_order, sort_by, target_type, target_database_group_id):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if display_name is not None:
+ kwargs['display_name'] = display_name
+ if schedule_user_assessment_id is not None:
+ kwargs['schedule_user_assessment_id'] = schedule_user_assessment_id
+ if is_schedule_assessment is not None:
+ kwargs['is_schedule_assessment'] = is_schedule_assessment
+ if is_baseline is not None:
+ kwargs['is_baseline'] = is_baseline
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if type is not None:
+ kwargs['type'] = type
+ if triggered_by is not None:
+ kwargs['triggered_by'] = triggered_by
+ if time_created_greater_than_or_equal_to is not None:
+ kwargs['time_created_greater_than_or_equal_to'] = time_created_greater_than_or_equal_to
+ if time_created_less_than is not None:
+ kwargs['time_created_less_than'] = time_created_less_than
+ if limit is not None:
+ kwargs['limit'] = limit
+ if page is not None:
+ kwargs['page'] = page
+ if lifecycle_state is not None:
+ kwargs['lifecycle_state'] = lifecycle_state
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if target_type is not None:
+ kwargs['target_type'] = target_type
+ if target_database_group_id is not None:
+ kwargs['target_database_group_id'] = target_database_group_id
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_user_assessments,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_user_assessments,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_user_assessments(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@user_assessment_group.command(name=cli_util.override('data_safe.list_users.command_name', 'list-users'), help=u"""Gets a list of users of the specified user assessment. The result contains the database user details for each user, such as user type, account status, last login time, user creation time, authentication type, user profile, and the date and time of the latest password change. It also contains the user category derived from these user details as well as privileges granted to each user. \n[Command Reference](listUsers)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--user-category', help=u"""A filter to return only items that match the specified user category.""")
+@cli_util.option('--user-role', help=u"""A filter to return only items that match the specified user role.""")
+@cli_util.option('--user-profile', help=u"""A filter to return only items that match the specified user profile.""")
+@cli_util.option('--user-type', help=u"""A filter to return only items that match the specified user type. The possible values can be - ADMIN_PRIVILEGED - APPLICATION - PRIVILEGED - SCHEMA - NON_PRIVILEGED as specified by '#/definitions/userTypes'.""")
+@cli_util.option('--user-key', help=u"""A filter to return only items that match the specified user key.""")
+@cli_util.option('--account-status', help=u"""A filter to return only items that match the specified account status.""")
+@cli_util.option('--authentication-type', help=u"""A filter to return only items that match the specified authentication type.""")
+@cli_util.option('--user-name', help=u"""A filter to return only items that match the specified user name.""")
+@cli_util.option('--target-id', help=u"""A filter to return only items related to a specific target OCID.""")
+@cli_util.option('--time-last-login-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last login time in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339].
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-last-login-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last login time in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-user-created-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose creation time in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-user-created-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose creation time in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-password-last-changed-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last password change in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339].
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-password-last-changed-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose last password change in the database is less than the date and time specified, in the format defined by [RFC3339].
+
+**Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-password-expiry-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose password expiry date in the database is greater than or equal to the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--time-password-expiry-less-than', type=custom_types.CLI_DATETIME, help=u"""A filter to return users whose password expiry date in the database is less than the date and time specified, in the format defined by [RFC3339]. **Example:** 2016-12-19T16:39:57.600Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--compartment-id', help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["userName", "userCategory", "accountStatus", "timeLastLogin", "targetId", "timeUserCreated", "authenticationType", "timePasswordChanged"]), help=u"""The field to sort by. You can specify only one sort order (sortOrder). The default order for userName is ascending.""")
+@cli_util.option('--schema-list', multiple=True, help=u"""A filter to return items that contain the specified schema list.""")
+@cli_util.option('--are-all-schemas-accessible', type=click.BOOL, help=u"""A filter to return only items that match the criteria that all schemas can be accessed by a user.""")
+@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({'schema-list': {'module': 'data_safe', 'class': 'list[string]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-list': {'module': 'data_safe', 'class': 'list[string]'}}, output_type={'module': 'data_safe', 'class': 'list[UserSummary]'})
+@cli_util.wrap_exceptions
+def list_users(ctx, from_json, all_pages, page_size, user_assessment_id, limit, compartment_id_in_subtree, access_level, user_category, user_role, user_profile, user_type, user_key, account_status, authentication_type, user_name, target_id, time_last_login_greater_than_or_equal_to, time_last_login_less_than, time_user_created_greater_than_or_equal_to, time_user_created_less_than, time_password_last_changed_greater_than_or_equal_to, time_password_last_changed_less_than, time_password_expiry_greater_than_or_equal_to, time_password_expiry_less_than, page, compartment_id, sort_order, sort_by, schema_list, are_all_schemas_accessible):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if limit is not None:
+ kwargs['limit'] = limit
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ if user_category is not None:
+ kwargs['user_category'] = user_category
+ if user_role is not None:
+ kwargs['user_role'] = user_role
+ if user_profile is not None:
+ kwargs['user_profile'] = user_profile
+ if user_type is not None:
+ kwargs['user_type'] = user_type
+ if user_key is not None:
+ kwargs['user_key'] = user_key
+ if account_status is not None:
+ kwargs['account_status'] = account_status
+ if authentication_type is not None:
+ kwargs['authentication_type'] = authentication_type
+ if user_name is not None:
+ kwargs['user_name'] = user_name
+ if target_id is not None:
+ kwargs['target_id'] = target_id
+ if time_last_login_greater_than_or_equal_to is not None:
+ kwargs['time_last_login_greater_than_or_equal_to'] = time_last_login_greater_than_or_equal_to
+ if time_last_login_less_than is not None:
+ kwargs['time_last_login_less_than'] = time_last_login_less_than
+ if time_user_created_greater_than_or_equal_to is not None:
+ kwargs['time_user_created_greater_than_or_equal_to'] = time_user_created_greater_than_or_equal_to
+ if time_user_created_less_than is not None:
+ kwargs['time_user_created_less_than'] = time_user_created_less_than
+ if time_password_last_changed_greater_than_or_equal_to is not None:
+ kwargs['time_password_last_changed_greater_than_or_equal_to'] = time_password_last_changed_greater_than_or_equal_to
+ if time_password_last_changed_less_than is not None:
+ kwargs['time_password_last_changed_less_than'] = time_password_last_changed_less_than
+ if time_password_expiry_greater_than_or_equal_to is not None:
+ kwargs['time_password_expiry_greater_than_or_equal_to'] = time_password_expiry_greater_than_or_equal_to
+ if time_password_expiry_less_than is not None:
+ kwargs['time_password_expiry_less_than'] = time_password_expiry_less_than
+ if page is not None:
+ kwargs['page'] = page
+ if compartment_id is not None:
+ kwargs['compartment_id'] = compartment_id
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if schema_list is not None and len(schema_list) > 0:
+ kwargs['schema_list'] = schema_list
+ if are_all_schemas_accessible is not None:
+ kwargs['are_all_schemas_accessible'] = are_all_schemas_accessible
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_users,
+ user_assessment_id=user_assessment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_users,
+ limit,
+ page_size,
+ user_assessment_id=user_assessment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_users(
+ user_assessment_id=user_assessment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@work_request_error_group.command(name=cli_util.override('data_safe.list_work_request_errors.command_name', 'list'), help=u"""Gets a list of errors for the specified work request. \n[Command Reference](listWorkRequestErrors)""")
+@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, 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_safe', 'class': 'list[WorkRequestError]'})
+@cli_util.wrap_exceptions
+def list_work_request_errors(ctx, from_json, all_pages, page_size, work_request_id, page, limit):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
+ raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if page is not None:
+ kwargs['page'] = page
+ if limit is not None:
+ kwargs['limit'] = limit
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_work_request_errors,
+ work_request_id=work_request_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_work_request_errors,
+ limit,
+ page_size,
+ work_request_id=work_request_id,
+ **kwargs
+ )
+ else:
+ result = client.list_work_request_errors(
+ work_request_id=work_request_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@work_request_log_entry_group.command(name=cli_util.override('data_safe.list_work_request_logs.command_name', 'list-work-request-logs'), help=u"""Gets a list of log entries for the specified work request. \n[Command Reference](listWorkRequestLogs)""")
+@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, 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_safe', 'class': 'list[WorkRequestLogEntry]'})
+@cli_util.wrap_exceptions
+def list_work_request_logs(ctx, from_json, all_pages, page_size, work_request_id, page, limit):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
+ raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if page is not None:
+ kwargs['page'] = page
+ if limit is not None:
+ kwargs['limit'] = limit
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_work_request_logs,
+ work_request_id=work_request_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_work_request_logs,
+ limit,
+ page_size,
+ work_request_id=work_request_id,
+ **kwargs
+ )
+ else:
+ result = client.list_work_request_logs(
+ work_request_id=work_request_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@work_request_group.command(name=cli_util.override('data_safe.list_work_requests.command_name', 'list'), help=u"""Gets a list of work requests. \n[Command Reference](listWorkRequests)""")
+@cli_util.option('--compartment-id', required=True, help=u"""A filter to return only resources that match the specified compartment OCID.""")
+@cli_util.option('--operation-type', help=u"""A filter to return only work requests that match the specific operation type.""")
+@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["STARTTIME", "FINISHTIME", "ACCEPTEDTIME"]), help=u"""The field used for sorting. Only one sorting parameter can be specified. The default order is descending.""")
+@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sorting order for the work requests, either ascending (ASC) or descending (DESC).""")
+@cli_util.option('--resource-id', help=u"""A filter to return only work requests that match the specified resource OCID.""")
+@cli_util.option('--target-database-id', help=u"""A filter to return only work requests that are associated to the specified target database OCID.""")
+@cli_util.option('--page', help=u"""For list pagination. The page token representing the page at which to start retrieving results. It is usually retrieved from a previous \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of items to return per page in a paginated \"List\" call. For details about how pagination works, see [List Pagination].""")
+@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@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_safe', 'class': 'list[WorkRequestSummary]'})
+@cli_util.wrap_exceptions
+def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, operation_type, sort_by, sort_order, resource_id, target_database_id, page, limit, compartment_id_in_subtree, access_level):
+
+ if all_pages and limit:
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
+
+ kwargs = {}
+ if operation_type is not None:
+ kwargs['operation_type'] = operation_type
+ if sort_by is not None:
+ kwargs['sort_by'] = sort_by
+ if sort_order is not None:
+ kwargs['sort_order'] = sort_order
+ if resource_id is not None:
+ kwargs['resource_id'] = resource_id
+ if target_database_id is not None:
+ kwargs['target_database_id'] = target_database_id
+ if page is not None:
+ kwargs['page'] = page
+ if limit is not None:
+ kwargs['limit'] = limit
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ if all_pages:
+ if page_size:
+ kwargs['limit'] = page_size
+
+ result = cli_util.list_call_get_all_results(
+ client.list_work_requests,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ elif limit is not None:
+ result = cli_util.list_call_get_up_to_limit(
+ client.list_work_requests,
+ limit,
+ page_size,
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ else:
+ result = client.list_work_requests(
+ compartment_id=compartment_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@target_database_group.command(name=cli_util.override('data_safe.manage_privileges.command_name', 'manage-privileges'), help=u"""Updates the Data Safe target database Privileges. \n[Command Reference](managePrivileges)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@cli_util.option('--features', required=True, type=custom_types.CliCaseInsensitiveChoice(["ASSESSMENT", "AUDIT_COLLECTION", "AUDIT_SETTING", "DATA_DISCOVERY", "MASKING", "SQL_FIREWALL", "ALL"]), help=u"""The Data Safe features granted to the databases registering under the registration policy.""")
+@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 manage_privileges(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, features, if_match):
+
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+ _details['features'] = cli_util.parse_json_parameter("features", features)
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.manage_privileges(
+ target_database_id=target_database_id,
+ manage_privileges_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)
+
+
+@masking_policy_group.command(name=cli_util.override('data_safe.mask_data.command_name', 'mask-data'), help=u"""Masks data using the specified masking policy. \n[Command Reference](maskData)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--target-id', help=u"""The OCID of the target database to be masked. If it's not provided, the value of the targetId attribute in the MaskingPolicy resource is used. The OCID of the target database to be masked. If it's not provided, the value of the targetId attribute in the MaskingPolicy resource is used.""")
+@cli_util.option('--is-decrypt', type=click.BOOL, help=u"""Indicates if the masking request is to decrypt the data values previously encrypted using Deterministic Encryption. Note that, to correctly decrypt the encrypted data values, it requires the same seed value that was provided to encrypt those data values.""")
+@cli_util.option('--is-rerun', type=click.BOOL, help=u"""Indicates if the masking request is to rerun the previously failed masking steps. If a masking request is submitted with the isIgnoreErrorsEnabled attribute set to true, the masking process tracks the failed masking steps. Another masking request can be submitted with the isRun attribute set to true to rerun those failed masking steps. It helps save time by executing only the failed masking steps and not doing the whole masking again.""")
+@cli_util.option('--re-run-from-step', type=custom_types.CliCaseInsensitiveChoice(["PRE_MASKING_SCRIPT", "POST_MASKING_SCRIPT"]), help=u"""Specifies the step from which masking needs to be rerun. This param will be used only when isRerun attribute is true. If PRE_MASKING_SCRIPT is passed, it will rerun the pre-masking script, followed by masking, and then the post-masking script. If POST_MASKING_SCRIPT is passed, it will rerun only the post-masking script. If this field is not set and isRerun is set to true, then it will default to the last failed step.""")
+@cli_util.option('--tablespace', help=u"""The tablespace that should be used to create the mapping tables, DMASK objects, and other temporary tables for data masking. If no tablespace is provided, the DEFAULT tablespace is used.""")
+@cli_util.option('--is-ignore-errors-enabled', type=click.BOOL, help=u"""Indicates if the masking process should continue on hitting an error. It provides fault tolerance support and is enabled by default. In fault-tolerant mode, the masking process saves the failed step and continues. You can then submit another masking request (with isRerun attribute set to true) to execute only the failed steps.""")
+@cli_util.option('--seed', help=u"""The seed value to be used in case of Deterministic Encryption and Deterministic Substitution masking formats.""")
+@cli_util.option('--user-defined-function-seed', help=u"""The seed value to be used in case of User Defined Function masking format. This is an optional parameter and needs to be passed only if any User Defined Function uses seed.""")
+@cli_util.option('--is-move-interim-tables-enabled', type=click.BOOL, help=u"""Indicates if the interim DMASK tables should be moved to the user-specified tablespace. As interim tables can be large in size, set it to false if moving them causes performance overhead during masking.""")
+@cli_util.option('--is-execute-saved-script-enabled', type=click.BOOL, help=u"""Indicates if data masking should be performed using a saved masking script. Setting this attribute to true skips masking script generation and executes the masking script stored in the Data Safe repository. It helps save time if there are no changes in the database tables and their dependencies.""")
+@cli_util.option('--is-drop-temp-tables-enabled', type=click.BOOL, help=u"""Indicates if the temporary tables created during a masking operation should be dropped after masking. Set this attribute to false to preserve the temporary tables. Masking creates temporary tables that map the original sensitive data values to mask values. These temporary tables are dropped after masking if this attribute is set as true. But, in some cases, you may want to preserve this information to track how masking changed your data. Note that doing so compromises security. These tables must be dropped before the database is available for unprivileged users. If it's not provided, the value of the isDropTempTablesEnabled attribute in the MaskingPolicy resource is used.""")
+@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a masking operation. Set this attribute to true to enable redo logging. If set as false, masking disables redo logging and flashback logging to purge any original unmasked data from logs. However, in certain circumstances when you only want to test masking, rollback changes, and retry masking, you could enable logging and use a flashback database to retrieve the original unmasked data after it has been masked. If it's not provided, the value of the isRedoLoggingEnabled attribute in the MaskingPolicy resource is used.""")
+@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. Set this attribute to false to disable statistics gathering. The masking process gathers statistics on masked database tables after masking completes. If it's not provided, the value of the isRefreshStatsEnabled attribute in the MaskingPolicy resource is used.""")
+@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data masking. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve masking performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism. https://www.oracle.com/pls/topic/lookup?ctx=dblatest&en/database/oracle/oracle-database&id=VLDBG-GUID-3E2AE088-2505-465E-A8B2-AC38813EA355 If it's not provided, the value of the parallelDegree attribute in the MaskingPolicy resource is used.""")
+@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data masking. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after masking completes. If it's not provided, the value of the parallelDegree attribute in the MaskingPolicy resource is used.""")
+@cli_util.option('--target-credentials', 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
+@cli_util.wrap_exceptions
+def mask_data(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, target_id, is_decrypt, is_rerun, re_run_from_step, tablespace, is_ignore_errors_enabled, seed, user_defined_function_seed, is_move_interim_tables_enabled, is_execute_saved_script_enabled, is_drop_temp_tables_enabled, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, target_credentials):
+
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if target_id is not None:
+ _details['targetId'] = target_id
+
+ if is_decrypt is not None:
+ _details['isDecrypt'] = is_decrypt
+
+ if is_rerun is not None:
+ _details['isRerun'] = is_rerun
+
+ if re_run_from_step is not None:
+ _details['reRunFromStep'] = re_run_from_step
+
+ if tablespace is not None:
+ _details['tablespace'] = tablespace
+
+ if is_ignore_errors_enabled is not None:
+ _details['isIgnoreErrorsEnabled'] = is_ignore_errors_enabled
+
+ if seed is not None:
+ _details['seed'] = seed
+
+ if user_defined_function_seed is not None:
+ _details['userDefinedFunctionSeed'] = user_defined_function_seed
+
+ if is_move_interim_tables_enabled is not None:
+ _details['isMoveInterimTablesEnabled'] = is_move_interim_tables_enabled
+
+ if is_execute_saved_script_enabled is not None:
+ _details['isExecuteSavedScriptEnabled'] = is_execute_saved_script_enabled
+
+ if is_drop_temp_tables_enabled is not None:
+ _details['isDropTempTablesEnabled'] = is_drop_temp_tables_enabled
+
+ if is_redo_logging_enabled is not None:
+ _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
+
+ if is_refresh_stats_enabled is not None:
+ _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
+
+ if parallel_degree is not None:
+ _details['parallelDegree'] = parallel_degree
+
+ if recompile is not None:
+ _details['recompile'] = recompile
+
+ if target_credentials is not None:
+ _details['targetCredentials'] = cli_util.parse_json_parameter("target_credentials", target_credentials)
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.mask_data(
+ masking_policy_id=masking_policy_id,
+ mask_data_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_safe_configuration_group.command(name=cli_util.override('data_safe.modify_global_settings.command_name', 'modify-global-settings'), help=u"""Modifies Global Settings in Data Safe in the tenancy and region. \n[Command Reference](modifyGlobalSettings)""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment.""")
+@cli_util.option('--is-paid-usage', type=click.BOOL, help=u"""The paid usage option chosen by the customer admin.""")
+@cli_util.option('--online-retention-period', type=click.INT, help=u"""The online retention period in months.""")
+@cli_util.option('--offline-retention-period', type=click.INT, help=u"""The offline retention period in months.""")
+@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 modify_global_settings(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, is_paid_usage, online_retention_period, offline_retention_period, if_match):
+
+ if isinstance(compartment_id, six.string_types) and len(compartment_id.strip()) == 0:
+ raise click.UsageError('Parameter --compartment-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if is_paid_usage is not None:
+ _details['isPaidUsage'] = is_paid_usage
+
+ if online_retention_period is not None:
+ _details['onlineRetentionPeriod'] = online_retention_period
+
+ if offline_retention_period is not None:
+ _details['offlineRetentionPeriod'] = offline_retention_period
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.modify_global_settings(
+ compartment_id=compartment_id,
+ modify_global_settings_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)
+
+
+@alert_group.command(name=cli_util.override('data_safe.patch_alerts.command_name', 'patch'), help=u"""Updates the status of one or more alert specified by the alert IDs. \n[Command Reference](patchAlerts)""")
+@cli_util.option('--items', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Array of alert detail to update the status of the alert specified by the alert ID.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment that contains the alerts.""")
+@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('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
+@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.wrap_exceptions
+def patch_alerts(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, items, compartment_id, if_match, compartment_id_in_subtree, access_level):
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ if compartment_id_in_subtree is not None:
+ kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
+ if access_level is not None:
+ kwargs['access_level'] = access_level
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+ _details['items'] = cli_util.parse_json_parameter("items", items)
+ _details['compartmentId'] = compartment_id
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.patch_alerts(
+ patch_alerts_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)
+
+
+@security_assessment_group.command(name=cli_util.override('data_safe.patch_checks.command_name', 'patch-checks'), help=u"""Patches one or more checks in the specified template type security assessment. Use it to add or delete checks. To add check, use CreateCheckDetails as the patch value. \n[Command Reference](patchChecks)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
+@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
+
+This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.wrap_exceptions
+def patch_checks(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, items, if_match):
+
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if items is not None:
+ _details['items'] = cli_util.parse_json_parameter("items", items)
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.patch_checks(
+ security_assessment_id=security_assessment_id,
+ patch_checks_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)
+
+
+@discovery_job_group.command(name=cli_util.override('data_safe.patch_discovery_job_results.command_name', 'patch-discovery-job-results'), help=u"""Patches one or more discovery results. You can use this operation to set the plannedAction attribute before using ApplyDiscoveryJobResults to process the results based on this attribute. \n[Command Reference](patchDiscoveryJobResults)""")
+@cli_util.option('--discovery-job-id', required=True, help=u"""The OCID of the discovery job.""")
+@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
+
+This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.wrap_exceptions
+def patch_discovery_job_results(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, discovery_job_id, items, if_match):
+
+ if isinstance(discovery_job_id, six.string_types) and len(discovery_job_id.strip()) == 0:
+ raise click.UsageError('Parameter --discovery-job-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if items is not None:
+ _details['items'] = cli_util.parse_json_parameter("items", items)
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.patch_discovery_job_results(
+ discovery_job_id=discovery_job_id,
+ patch_discovery_job_result_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)
+
+
+@security_assessment_group.command(name=cli_util.override('data_safe.patch_findings.command_name', 'patch-findings'), help=u"""Patches one or more findings in the specified template baseline type security assessment. Use it to modify max allowed risk level in template baseline. \n[Command Reference](patchFindings)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
+@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
+
+This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.wrap_exceptions
+def patch_findings(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, items, if_match):
+
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if items is not None:
+ _details['items'] = cli_util.parse_json_parameter("items", items)
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.patch_findings(
+ security_assessment_id=security_assessment_id,
+ patch_findings_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)
+
+
+@sensitive_type_group_group.command(name=cli_util.override('data_safe.patch_grouped_sensitive_types.command_name', 'patch-grouped-sensitive-types'), help=u"""Patches one or more sensitive types in a sensitive type group. You can use this operation to add or remove sensitive type ids in a sensitive type group. \n[Command Reference](patchGroupedSensitiveTypes)""")
+@cli_util.option('--sensitive-type-group-id', required=True, help=u"""The OCID of the sensitive type group.""")
+@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
+
+This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.wrap_exceptions
+def patch_grouped_sensitive_types(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_group_id, items, if_match):
+
+ if isinstance(sensitive_type_group_id, six.string_types) and len(sensitive_type_group_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-type-group-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if items is not None:
+ _details['items'] = cli_util.parse_json_parameter("items", items)
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.patch_grouped_sensitive_types(
+ sensitive_type_group_id=sensitive_type_group_id,
+ patch_grouped_sensitive_types_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)
+
+
+@masking_column_group.command(name=cli_util.override('data_safe.patch_masking_columns.command_name', 'patch'), help=u"""Patches one or more columns in the specified masking policy. Use it to create, or update masking columns. To create masking columns, use CreateMaskingColumnDetails as the patch value. And to update masking columns, use UpdateMaskingColumnDetails as the patch value. \n[Command Reference](patchMaskingColumns)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
+
+This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.wrap_exceptions
+def patch_masking_columns(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, items, if_match):
+
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if items is not None:
+ _details['items'] = cli_util.parse_json_parameter("items", items)
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.patch_masking_columns(
+ masking_policy_id=masking_policy_id,
+ patch_masking_columns_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)
+
+
+@sdm_masking_policy_difference_group.command(name=cli_util.override('data_safe.patch_sdm_masking_policy_difference_columns.command_name', 'patch-sdm-masking-policy-difference-columns'), help=u"""Patches one or more SDM masking policy difference columns. You can use this operation to set the plannedAction attribute before using ApplySdmMaskingPolicyDifference to process the difference based on this attribute. \n[Command Reference](patchSdmMaskingPolicyDifferenceColumns)""")
+@cli_util.option('--sdm-masking-policy-difference-id', required=True, help=u"""The OCID of the SDM masking policy difference.""")
+@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
+
+This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.wrap_exceptions
+def patch_sdm_masking_policy_difference_columns(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sdm_masking_policy_difference_id, items, if_match):
+
+ if isinstance(sdm_masking_policy_difference_id, six.string_types) and len(sdm_masking_policy_difference_id.strip()) == 0:
+ raise click.UsageError('Parameter --sdm-masking-policy-difference-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if items is not None:
+ _details['items'] = cli_util.parse_json_parameter("items", items)
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.patch_sdm_masking_policy_difference_columns(
+ sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
+ patch_sdm_masking_policy_difference_columns_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)
+
+
+@sensitive_column_group.command(name=cli_util.override('data_safe.patch_sensitive_columns.command_name', 'patch'), help=u"""Patches one or more columns in the specified sensitive data model. Use it to create, update, or delete sensitive columns. To create sensitive columns, use CreateSensitiveColumnDetails as the patch value. And to update sensitive columns, use UpdateSensitiveColumnDetails as the patch value. \n[Command Reference](patchSensitiveColumns)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
+
+This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.wrap_exceptions
+def patch_sensitive_columns(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_data_model_id, items, if_match):
+
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if items is not None:
+ _details['items'] = cli_util.parse_json_parameter("items", items)
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.patch_sensitive_columns(
+ sensitive_data_model_id=sensitive_data_model_id,
+ patch_sensitive_column_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)
+
+
+@sql_firewall_allowed_sql_group.command(name=cli_util.override('data_safe.patch_sql_firewall_allowed_sql.command_name', 'patch'), help=u"""Delete multiple allowed sqls. You can use this operation to delete one or more allowed sqls. Create and update of multiple allowed sqls is not supported. \n[Command Reference](patchSqlFirewallAllowedSql)""")
+@cli_util.option('--items', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--sql-firewall-policy-id', required=True, help=u"""The OCID of the SQL firewall policy whose allowed SQL needs to be deleted.""")
+@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.wrap_exceptions
+def patch_sql_firewall_allowed_sql(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, items, sql_firewall_policy_id, if_match):
+
+ 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['items'] = cli_util.parse_json_parameter("items", items)
+ _details['sqlFirewallPolicyId'] = sql_firewall_policy_id
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.patch_sql_firewall_allowed_sql(
+ patch_sql_firewall_allowed_sql_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)
+
+
+@subsetting_rule_group.command(name=cli_util.override('data_safe.patch_subsetting_rules.command_name', 'patch'), help=u"""Patches one or more subsetting rules in the specified subsetting policy. Use INSERT to add a new rule with CreateSubsettingRuleDetails as the patch value, and MERGE to update an existing rule with UpdateSubsettingRuleDetails as the patch value. To delete a rule, use the existing DeleteSubsettingRule API. \n[Command Reference](patchSubsettingRules)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
+
+This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@cli_util.wrap_exceptions
+def patch_subsetting_rules(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_policy_id, items, if_match):
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if items is not None:
+ _details['items'] = cli_util.parse_json_parameter("items", items)
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.patch_subsetting_rules(
+ subsetting_policy_id=subsetting_policy_id,
+ patch_subsetting_rules_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)
+
+
+@target_alert_policy_association_group.command(name=cli_util.override('data_safe.patch_target_alert_policy_association.command_name', 'patch'), help=u"""Creates new target-alert policy associations that will be applied on the target database. \n[Command Reference](patchTargetAlertPolicyAssociation)""")
+@cli_util.option('--items', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment that contains the alerts.""")
+@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
+@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
@cli_util.wrap_exceptions
-def mask_data(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, target_id, is_decrypt, is_rerun, re_run_from_step, tablespace, is_ignore_errors_enabled, seed, user_defined_function_seed, is_move_interim_tables_enabled, is_execute_saved_script_enabled, is_drop_temp_tables_enabled, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, target_credentials):
-
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+def patch_target_alert_policy_association(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, items, compartment_id, if_match):
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['items'] = cli_util.parse_json_parameter("items", items)
+ _details['compartmentId'] = compartment_id
- if target_id is not None:
- _details['targetId'] = target_id
-
- if is_decrypt is not None:
- _details['isDecrypt'] = is_decrypt
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.patch_target_alert_policy_association(
+ patch_target_alert_policy_association_details=_details,
+ **kwargs
+ )
+ if wait_for_state:
- if is_rerun is not None:
- _details['isRerun'] = is_rerun
+ 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
- if re_run_from_step is not None:
- _details['reRunFromStep'] = re_run_from_step
+ 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)
- if tablespace is not None:
- _details['tablespace'] = tablespace
- if is_ignore_errors_enabled is not None:
- _details['isIgnoreErrorsEnabled'] = is_ignore_errors_enabled
+@audit_policy_group.command(name=cli_util.override('data_safe.provision_audit_policy.command_name', 'provision'), help=u"""Provision audit policy. \n[Command Reference](provisionAuditPolicy)""")
+@cli_util.option('--provision-audit-conditions', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The audit policy details for provisioning.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--audit-policy-id', required=True, help=u"""Unique audit policy identifier.""")
+@cli_util.option('--is-data-safe-service-account-excluded', type=click.BOOL, help=u"""Option provided to users at the target to indicate whether the Data Safe service account has to be excluded while provisioning the audit policies.""")
+@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'provision-audit-conditions': {'module': 'data_safe', 'class': 'list[ProvisionAuditConditions]'}})
+@cli_util.help_option
+@click.pass_context
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'provision-audit-conditions': {'module': 'data_safe', 'class': 'list[ProvisionAuditConditions]'}})
+@cli_util.wrap_exceptions
+def provision_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, provision_audit_conditions, audit_policy_id, is_data_safe_service_account_excluded, if_match):
- if seed is not None:
- _details['seed'] = seed
+ if isinstance(audit_policy_id, six.string_types) and len(audit_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-policy-id cannot be whitespace or empty string')
- if user_defined_function_seed is not None:
- _details['userDefinedFunctionSeed'] = user_defined_function_seed
+ 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'])
- if is_move_interim_tables_enabled is not None:
- _details['isMoveInterimTablesEnabled'] = is_move_interim_tables_enabled
+ _details = {}
+ _details['provisionAuditConditions'] = cli_util.parse_json_parameter("provision_audit_conditions", provision_audit_conditions)
- if is_execute_saved_script_enabled is not None:
- _details['isExecuteSavedScriptEnabled'] = is_execute_saved_script_enabled
+ if is_data_safe_service_account_excluded is not None:
+ _details['isDataSafeServiceAccountExcluded'] = is_data_safe_service_account_excluded
- if is_drop_temp_tables_enabled is not None:
- _details['isDropTempTablesEnabled'] = is_drop_temp_tables_enabled
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.provision_audit_policy(
+ audit_policy_id=audit_policy_id,
+ provision_audit_policy_details=_details,
+ **kwargs
+ )
+ if wait_for_state:
- if is_redo_logging_enabled is not None:
- _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
+ 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
- if is_refresh_stats_enabled is not None:
- _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
+ 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)
- if parallel_degree is not None:
- _details['parallelDegree'] = parallel_degree
- if recompile is not None:
- _details['recompile'] = recompile
+@sql_collection_group.command(name=cli_util.override('data_safe.purge_sql_collection_logs.command_name', 'purge-sql-collection-logs'), help=u"""Purge the SQL collection logs for the specified SqlCollection. \n[Command Reference](purgeSqlCollectionLogs)""")
+@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 purge_sql_collection_logs(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, if_match):
- if target_credentials is not None:
- _details['targetCredentials'] = cli_util.parse_json_parameter("target_credentials", target_credentials)
+ if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-collection-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_safe', 'data_safe', ctx)
- result = client.mask_data(
- masking_policy_id=masking_policy_id,
- mask_data_details=_details,
+ result = client.purge_sql_collection_logs(
+ sql_collection_id=sql_collection_id,
**kwargs
)
if wait_for_state:
@@ -20557,24 +24697,28 @@ def mask_data(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_se
cli_util.render_response(result, ctx)
-@data_safe_configuration_group.command(name=cli_util.override('data_safe.modify_global_settings.command_name', 'modify-global-settings'), help=u"""Modifies Global Settings in Data Safe in the tenancy and region. \n[Command Reference](modifyGlobalSettings)""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment.""")
-@cli_util.option('--is-paid-usage', type=click.BOOL, help=u"""The paid usage option chosen by the customer admin.""")
-@cli_util.option('--online-retention-period', type=click.INT, help=u"""The online retention period in months.""")
-@cli_util.option('--offline-retention-period', type=click.INT, help=u"""The offline retention period in months.""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.refresh_crypto_assessment.command_name', 'refresh'), help=u"""Runs a crypto assessment, refreshes the latest assessment, and saves it for future reference. This operation runs with a cryptoAssessmentId of type LATEST. Before you start, first call the ListCryptoAssessments operation with filter \"type = latest\" to get the crypto assessment ID for the target's latest assessment. \n[Command Reference](refreshCryptoAssessment)""")
+@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
+@cli_util.option('--compartment-id', help=u"""This field is ignored when refreshing a crypto assessment.""")
+@cli_util.option('--display-name', help=u"""The display name of the crypto assessment.""")
+@cli_util.option('--description', help=u"""The description of the crypto assessment.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def modify_global_settings(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, is_paid_usage, online_retention_period, offline_retention_period, if_match):
+def refresh_crypto_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, crypto_assessment_id, compartment_id, display_name, description, freeform_tags, defined_tags, if_match):
- if isinstance(compartment_id, six.string_types) and len(compartment_id.strip()) == 0:
- raise click.UsageError('Parameter --compartment-id cannot be whitespace or empty string')
+ if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
@@ -20583,19 +24727,25 @@ def modify_global_settings(ctx, from_json, wait_for_state, max_wait_seconds, wai
_details = {}
- if is_paid_usage is not None:
- _details['isPaidUsage'] = is_paid_usage
+ if compartment_id is not None:
+ _details['compartmentId'] = compartment_id
- if online_retention_period is not None:
- _details['onlineRetentionPeriod'] = online_retention_period
+ if display_name is not None:
+ _details['displayName'] = display_name
- if offline_retention_period is not None:
- _details['offlineRetentionPeriod'] = offline_retention_period
+ if description is not None:
+ _details['description'] = description
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.modify_global_settings(
- compartment_id=compartment_id,
- modify_global_settings_details=_details,
+ result = client.refresh_crypto_assessment(
+ crypto_assessment_id=crypto_assessment_id,
+ run_crypto_assessment_details=_details,
**kwargs
)
if wait_for_state:
@@ -20628,38 +24778,29 @@ def modify_global_settings(ctx, from_json, wait_for_state, max_wait_seconds, wai
cli_util.render_response(result, ctx)
-@alert_group.command(name=cli_util.override('data_safe.patch_alerts.command_name', 'patch'), help=u"""Updates the status of one or more alert specified by the alert IDs. \n[Command Reference](patchAlerts)""")
-@cli_util.option('--items', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Array of alert detail to update the status of the alert specified by the alert ID.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment that contains the alerts.""")
+@database_security_config_group.command(name=cli_util.override('data_safe.refresh_database_security_configuration.command_name', 'refresh'), help=u"""Refreshes the specified database security configuration. \n[Command Reference](refreshDatabaseSecurityConfiguration)""")
+@cli_util.option('--database-security-config-id', required=True, help=u"""The OCID of the database security configuration resource.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.""")
-@cli_util.option('--access-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "ACCESSIBLE"]), help=u"""Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@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={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def patch_alerts(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, items, compartment_id, if_match, compartment_id_in_subtree, access_level):
+def refresh_database_security_configuration(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, database_security_config_id, if_match):
+
+ if isinstance(database_security_config_id, six.string_types) and len(database_security_config_id.strip()) == 0:
+ raise click.UsageError('Parameter --database-security-config-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
- if compartment_id_in_subtree is not None:
- kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree
- if access_level is not None:
- kwargs['access_level'] = access_level
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
- _details['items'] = cli_util.parse_json_parameter("items", items)
- _details['compartmentId'] = compartment_id
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.patch_alerts(
- patch_alerts_details=_details,
+ result = client.refresh_database_security_configuration(
+ database_security_config_id=database_security_config_id,
**kwargs
)
if wait_for_state:
@@ -20692,21 +24833,24 @@ def patch_alerts(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.patch_checks.command_name', 'patch-checks'), help=u"""Patches one or more checks in the specified template type security assessment. Use it to add or delete checks. To add check, use CreateCheckDetails as the patch value. \n[Command Reference](patchChecks)""")
+@security_assessment_group.command(name=cli_util.override('data_safe.refresh_security_assessment.command_name', 'refresh'), help=u"""Runs a security assessment, refreshes the latest assessment, and saves it for future reference. The assessment runs with a securityAssessmentId of type LATEST. Before you start, first call the ListSecurityAssessments operation with filter \"type = latest\" to get the security assessment id for the target's latest assessment. \n[Command Reference](refreshSecurityAssessment)""")
@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
+@cli_util.option('--compartment-id', help=u"""This field is ignored when refreshing a security assessment.""")
+@cli_util.option('--display-name', help=u"""The display name of the security assessment.""")
+@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]
-This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def patch_checks(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, items, if_match):
+def refresh_security_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, compartment_id, display_name, freeform_tags, defined_tags, if_match):
if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
@@ -20718,13 +24862,22 @@ def patch_checks(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval
_details = {}
- if items is not None:
- _details['items'] = cli_util.parse_json_parameter("items", items)
+ if compartment_id is not None:
+ _details['compartmentId'] = compartment_id
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.patch_checks(
+ result = client.refresh_security_assessment(
security_assessment_id=security_assessment_id,
- patch_checks_details=_details,
+ run_security_assessment_details=_details,
**kwargs
)
if wait_for_state:
@@ -20757,39 +24910,29 @@ def patch_checks(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval
cli_util.render_response(result, ctx)
-@discovery_job_group.command(name=cli_util.override('data_safe.patch_discovery_job_results.command_name', 'patch-discovery-job-results'), help=u"""Patches one or more discovery results. You can use this operation to set the plannedAction attribute before using ApplyDiscoveryJobResults to process the results based on this attribute. \n[Command Reference](patchDiscoveryJobResults)""")
-@cli_util.option('--discovery-job-id', required=True, help=u"""The OCID of the discovery job.""")
-@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
-
-This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@security_policy_deployment_group.command(name=cli_util.override('data_safe.refresh_security_policy_deployment.command_name', 'refresh'), help=u"""Retrieve all the security policies from the associated target or target group and refresh the same on Data safe. \n[Command Reference](refreshSecurityPolicyDeployment)""")
+@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@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={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def patch_discovery_job_results(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, discovery_job_id, items, if_match):
+def refresh_security_policy_deployment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_deployment_id, if_match):
- if isinstance(discovery_job_id, six.string_types) and len(discovery_job_id.strip()) == 0:
- raise click.UsageError('Parameter --discovery-job-id cannot be whitespace or empty string')
+ if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-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 = {}
-
- if items is not None:
- _details['items'] = cli_util.parse_json_parameter("items", items)
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.patch_discovery_job_results(
- discovery_job_id=discovery_job_id,
- patch_discovery_job_result_details=_details,
+ result = client.refresh_security_policy_deployment(
+ security_policy_deployment_id=security_policy_deployment_id,
**kwargs
)
if wait_for_state:
@@ -20822,39 +24965,29 @@ def patch_discovery_job_results(ctx, from_json, wait_for_state, max_wait_seconds
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.patch_findings.command_name', 'patch-findings'), help=u"""Patches one or more findings in the specified template baseline type security assessment. Use it to modify max allowed risk level in template baseline. \n[Command Reference](patchFindings)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
-
-This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@sql_collection_group.command(name=cli_util.override('data_safe.refresh_sql_collection_log_insights.command_name', 'refresh-sql-collection-log-insights'), help=u"""Refresh the specified SQL collection Log Insights. \n[Command Reference](refreshSqlCollectionLogInsights)""")
+@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@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={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def patch_findings(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, items, if_match):
+def refresh_sql_collection_log_insights(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, if_match):
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+ if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
-
- if items is not None:
- _details['items'] = cli_util.parse_json_parameter("items", items)
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.patch_findings(
- security_assessment_id=security_assessment_id,
- patch_findings_details=_details,
+ result = client.refresh_sql_collection_log_insights(
+ sql_collection_id=sql_collection_id,
**kwargs
)
if wait_for_state:
@@ -20887,39 +25020,29 @@ def patch_findings(ctx, from_json, wait_for_state, max_wait_seconds, wait_interv
cli_util.render_response(result, ctx)
-@sensitive_type_group_group.command(name=cli_util.override('data_safe.patch_grouped_sensitive_types.command_name', 'patch-grouped-sensitive-types'), help=u"""Patches one or more sensitive types in a sensitive type group. You can use this operation to add or remove sensitive type ids in a sensitive type group. \n[Command Reference](patchGroupedSensitiveTypes)""")
-@cli_util.option('--sensitive-type-group-id', required=True, help=u"""The OCID of the sensitive type group.""")
-@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
-
-This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@target_database_group.command(name=cli_util.override('data_safe.refresh_target_database.command_name', 'refresh'), help=u"""Refreshes the Data Safe target database to update it's state. \n[Command Reference](refreshTargetDatabase)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@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={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def patch_grouped_sensitive_types(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_group_id, items, if_match):
+def refresh_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, if_match):
- if isinstance(sensitive_type_group_id, six.string_types) and len(sensitive_type_group_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-type-group-id cannot be whitespace or empty string')
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
-
- if items is not None:
- _details['items'] = cli_util.parse_json_parameter("items", items)
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.patch_grouped_sensitive_types(
- sensitive_type_group_id=sensitive_type_group_id,
- patch_grouped_sensitive_types_details=_details,
+ result = client.refresh_target_database(
+ target_database_id=target_database_id,
**kwargs
)
if wait_for_state:
@@ -20952,24 +25075,28 @@ def patch_grouped_sensitive_types(ctx, from_json, wait_for_state, max_wait_secon
cli_util.render_response(result, ctx)
-@masking_column_group.command(name=cli_util.override('data_safe.patch_masking_columns.command_name', 'patch'), help=u"""Patches one or more columns in the specified masking policy. Use it to create, or update masking columns. To create masking columns, use CreateMaskingColumnDetails as the patch value. And to update masking columns, use UpdateMaskingColumnDetails as the patch value. \n[Command Reference](patchMaskingColumns)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
+@user_assessment_group.command(name=cli_util.override('data_safe.refresh_user_assessment.command_name', 'refresh'), help=u"""Refreshes the latest assessment and saves it for future reference. This operation runs with a userAssessmentId of type LATEST. Before you start, first call the ListUserAssessments operation with filter \"type = latest\" to get the user assessment ID for the target's latest assessment. \n[Command Reference](refreshUserAssessment)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@cli_util.option('--compartment-id', help=u"""This field is ignored when refreshing a user assessment.""")
+@cli_util.option('--description', help=u"""The description of the user assessment.""")
+@cli_util.option('--display-name', help=u"""The display name of the user assessment.""")
+@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]
-This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def patch_masking_columns(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, items, if_match):
+def refresh_user_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, user_assessment_id, compartment_id, description, display_name, freeform_tags, defined_tags, if_match):
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
@@ -20978,13 +25105,25 @@ def patch_masking_columns(ctx, from_json, wait_for_state, max_wait_seconds, wait
_details = {}
- if items is not None:
- _details['items'] = cli_util.parse_json_parameter("items", items)
+ if compartment_id is not None:
+ _details['compartmentId'] = compartment_id
+
+ if description is not None:
+ _details['description'] = description
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.patch_masking_columns(
- masking_policy_id=masking_policy_id,
- patch_masking_columns_details=_details,
+ result = client.refresh_user_assessment(
+ user_assessment_id=user_assessment_id,
+ run_user_assessment_details=_details,
**kwargs
)
if wait_for_state:
@@ -21017,39 +25156,29 @@ def patch_masking_columns(ctx, from_json, wait_for_state, max_wait_seconds, wait
cli_util.render_response(result, ctx)
-@sdm_masking_policy_difference_group.command(name=cli_util.override('data_safe.patch_sdm_masking_policy_difference_columns.command_name', 'patch-sdm-masking-policy-difference-columns'), help=u"""Patches one or more SDM masking policy difference columns. You can use this operation to set the plannedAction attribute before using ApplySdmMaskingPolicyDifference to process the difference based on this attribute. \n[Command Reference](patchSdmMaskingPolicyDifferenceColumns)""")
-@cli_util.option('--sdm-masking-policy-difference-id', required=True, help=u"""The OCID of the SDM masking policy difference.""")
-@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
-
-This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@report_definition_group.command(name=cli_util.override('data_safe.remove_schedule_report.command_name', 'remove'), help=u"""Deletes the schedule of a .xls or .pdf report. \n[Command Reference](removeScheduleReport)""")
+@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@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={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def patch_sdm_masking_policy_difference_columns(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sdm_masking_policy_difference_id, items, if_match):
+def remove_schedule_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, report_definition_id, if_match):
- if isinstance(sdm_masking_policy_difference_id, six.string_types) and len(sdm_masking_policy_difference_id.strip()) == 0:
- raise click.UsageError('Parameter --sdm-masking-policy-difference-id cannot be whitespace or empty string')
+ if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
+ raise click.UsageError('Parameter --report-definition-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
-
- if items is not None:
- _details['items'] = cli_util.parse_json_parameter("items", items)
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.patch_sdm_masking_policy_difference_columns(
- sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
- patch_sdm_masking_policy_difference_columns_details=_details,
+ result = client.remove_schedule_report(
+ report_definition_id=report_definition_id,
**kwargs
)
if wait_for_state:
@@ -21082,39 +25211,29 @@ def patch_sdm_masking_policy_difference_columns(ctx, from_json, wait_for_state,
cli_util.render_response(result, ctx)
-@sensitive_column_group.command(name=cli_util.override('data_safe.patch_sensitive_columns.command_name', 'patch'), help=u"""Patches one or more columns in the specified sensitive data model. Use it to create, update, or delete sensitive columns. To create sensitive columns, use CreateSensitiveColumnDetails as the patch value. And to update sensitive columns, use UpdateSensitiveColumnDetails as the patch value. \n[Command Reference](patchSensitiveColumns)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.
-
-This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@security_assessment_group.command(name=cli_util.override('data_safe.remove_security_assessment_template.command_name', 'remove'), help=u"""Remove the checks from the template to the specified security assessment.The security assessment provided in the path needs to be of type 'LATEST'. \n[Command Reference](removeSecurityAssessmentTemplate)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@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={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def patch_sensitive_columns(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_data_model_id, items, if_match):
+def remove_security_assessment_template(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, if_match):
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
-
- _details = {}
-
- if items is not None:
- _details['items'] = cli_util.parse_json_parameter("items", items)
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.patch_sensitive_columns(
- sensitive_data_model_id=sensitive_data_model_id,
- patch_sensitive_column_details=_details,
+ result = client.remove_security_assessment_template(
+ security_assessment_id=security_assessment_id,
**kwargs
)
if wait_for_state:
@@ -21147,32 +25266,29 @@ def patch_sensitive_columns(ctx, from_json, wait_for_state, max_wait_seconds, wa
cli_util.render_response(result, ctx)
-@sql_firewall_allowed_sql_group.command(name=cli_util.override('data_safe.patch_sql_firewall_allowed_sql.command_name', 'patch'), help=u"""Delete multiple allowed sqls. You can use this operation to delete one or more allowed sqls. Create and update of multiple allowed sqls is not supported. \n[Command Reference](patchSqlFirewallAllowedSql)""")
-@cli_util.option('--items', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--sql-firewall-policy-id', required=True, help=u"""The OCID of the SQL firewall policy whose allowed SQL needs to be deleted.""")
+@audit_trail_group.command(name=cli_util.override('data_safe.resume_audit_trail.command_name', 'resume'), help=u"""Resumes the specified audit trail once it got stopped. \n[Command Reference](resumeAuditTrail)""")
+@cli_util.option('--audit-trail-id', required=True, help=u"""The OCID of the audit trail.""")
@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@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={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def patch_sql_firewall_allowed_sql(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, items, sql_firewall_policy_id, if_match):
+def resume_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_trail_id, if_match):
+
+ if isinstance(audit_trail_id, six.string_types) and len(audit_trail_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-trail-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['items'] = cli_util.parse_json_parameter("items", items)
- _details['sqlFirewallPolicyId'] = sql_firewall_policy_id
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.patch_sql_firewall_allowed_sql(
- patch_sql_firewall_allowed_sql_details=_details,
+ result = client.resume_audit_trail(
+ audit_trail_id=audit_trail_id,
**kwargs
)
if wait_for_state:
@@ -21205,32 +25321,54 @@ def patch_sql_firewall_allowed_sql(ctx, from_json, wait_for_state, max_wait_seco
cli_util.render_response(result, ctx)
-@target_alert_policy_association_group.command(name=cli_util.override('data_safe.patch_target_alert_policy_association.command_name', 'patch'), help=u"""Creates new target-alert policy associations that will be applied on the target database. \n[Command Reference](patchTargetAlertPolicyAssociation)""")
-@cli_util.option('--items', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of patch instructions.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment that contains the alerts.""")
+@work_request_group.command(name=cli_util.override('data_safe.resume_work_request.command_name', 'resume'), help=u"""Resume the given work request. Issuing a resume does not guarantee of immediate resume of the work request. \n[Command Reference](resumeWorkRequest)""")
+@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@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 resume_work_request(ctx, from_json, work_request_id, if_match):
+
+ if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
+ raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
+
+ kwargs = {}
+ if if_match is not None:
+ kwargs['if_match'] = if_match
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.resume_work_request(
+ work_request_id=work_request_id,
+ **kwargs
+ )
+ cli_util.render_response(result, ctx)
+
+
+@audit_policy_group.command(name=cli_util.override('data_safe.retrieve_audit_policies.command_name', 'retrieve'), help=u"""Retrieves the audit policy details from the source target database. \n[Command Reference](retrieveAuditPolicies)""")
+@cli_util.option('--audit-policy-id', required=True, help=u"""Unique audit policy identifier.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@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={'items': {'module': 'data_safe', 'class': 'list[PatchInstruction]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def patch_target_alert_policy_association(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, items, compartment_id, if_match):
+def retrieve_audit_policies(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_policy_id, if_match):
+
+ if isinstance(audit_policy_id, six.string_types) and len(audit_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-policy-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['items'] = cli_util.parse_json_parameter("items", items)
- _details['compartmentId'] = compartment_id
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.patch_target_alert_policy_association(
- patch_target_alert_policy_association_details=_details,
+ result = client.retrieve_audit_policies(
+ audit_policy_id=audit_policy_id,
**kwargs
)
if wait_for_state:
@@ -21263,23 +25401,29 @@ def patch_target_alert_policy_association(ctx, from_json, wait_for_state, max_wa
cli_util.render_response(result, ctx)
-@audit_policy_group.command(name=cli_util.override('data_safe.provision_audit_policy.command_name', 'provision'), help=u"""Provision audit policy. \n[Command Reference](provisionAuditPolicy)""")
-@cli_util.option('--provision-audit-conditions', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The audit policy details for provisioning.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--audit-policy-id', required=True, help=u"""Unique audit policy identifier.""")
-@cli_util.option('--is-data-safe-service-account-excluded', type=click.BOOL, help=u"""Option provided to users at the target to indicate whether the Data Safe service account has to be excluded while provisioning the audit policies.""")
+@report_definition_group.command(name=cli_util.override('data_safe.schedule_report.command_name', 'schedule-report'), help=u"""Schedules a .xls or .pdf report based on parameters and report definition. \n[Command Reference](scheduleReport)""")
+@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
+@cli_util.option('--schedule', required=True, help=u"""The schedule to generate the report periodically in the specified format: ;
+
+Allowed version strings - \"v1\" v1's version specific schedule - Each of the above fields potentially introduce constraints. A workrequest is created only when clock time satisfies all the constraints. Constraints introduced: 1. seconds = (So, the allowed range for is [0, 59]) 2. minutes = (So, the allowed range for is [0, 59]) 3. hours = (So, the allowed range for is [0, 23]) 4. can be either '*' (without quotes or a number between 1(Monday) and 7(Sunday)) No constraint introduced when it is '*'. When not, day of week must equal the given value 5. can be either '*' (without quotes or a number between 1 and 28) No constraint introduced when it is '*'. When not, day of month must equal the given value""")
+@cli_util.option('--mime-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS", "JSON"]), help=u"""Specifies if the report will be in .xls or .pdf or .json format""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which the resource should be created.""")
+@cli_util.option('--report-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"""The name of the report to be scheduled""")
+@cli_util.option('--is-pagination-enabled', type=click.BOOL, help=u"""Indicates if the reports being generated should be paginated. If set to true, multiple reports can be generated and the details of next and previous report are present in Report. Values can either be 'true' or 'false'.""")
@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'provision-audit-conditions': {'module': 'data_safe', 'class': 'list[ProvisionAuditConditions]'}})
+@json_skeleton_utils.get_cli_json_input_option({'report-details': {'module': 'data_safe', 'class': 'ReportDetails'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'provision-audit-conditions': {'module': 'data_safe', 'class': 'list[ProvisionAuditConditions]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'report-details': {'module': 'data_safe', 'class': 'ReportDetails'}})
@cli_util.wrap_exceptions
-def provision_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, provision_audit_conditions, audit_policy_id, is_data_safe_service_account_excluded, if_match):
+def schedule_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, report_definition_id, schedule, mime_type, compartment_id, report_details, display_name, is_pagination_enabled, if_match):
- if isinstance(audit_policy_id, six.string_types) and len(audit_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-policy-id cannot be whitespace or empty string')
+ if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
+ raise click.UsageError('Parameter --report-definition-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
@@ -21287,15 +25431,21 @@ def provision_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds, wai
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['provisionAuditConditions'] = cli_util.parse_json_parameter("provision_audit_conditions", provision_audit_conditions)
+ _details['schedule'] = schedule
+ _details['mimeType'] = mime_type
+ _details['compartmentId'] = compartment_id
+ _details['reportDetails'] = cli_util.parse_json_parameter("report_details", report_details)
- if is_data_safe_service_account_excluded is not None:
- _details['isDataSafeServiceAccountExcluded'] = is_data_safe_service_account_excluded
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if is_pagination_enabled is not None:
+ _details['isPaginationEnabled'] = is_pagination_enabled
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.provision_audit_policy(
- audit_policy_id=audit_policy_id,
- provision_audit_policy_details=_details,
+ result = client.schedule_report(
+ report_definition_id=report_definition_id,
+ schedule_report_details=_details,
**kwargs
)
if wait_for_state:
@@ -21328,9 +25478,18 @@ def provision_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds, wai
cli_util.render_response(result, ctx)
-@sql_collection_group.command(name=cli_util.override('data_safe.purge_sql_collection_logs.command_name', 'purge-sql-collection-logs'), help=u"""Purge the SQL collection logs for the specified SqlCollection. \n[Command Reference](purgeSqlCollectionLogs)""")
-@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
+@report_definition_group.command(name=cli_util.override('data_safe.schedule_report_schedule_audit_report_details.command_name', 'schedule-report-schedule-audit-report-details'), help=u"""Schedules a .xls or .pdf report based on parameters and report definition. \n[Command Reference](scheduleReport)""")
+@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
+@cli_util.option('--schedule', required=True, help=u"""The schedule to generate the report periodically in the specified format: ;
+
+Allowed version strings - \"v1\" v1's version specific schedule - Each of the above fields potentially introduce constraints. A workrequest is created only when clock time satisfies all the constraints. Constraints introduced: 1. seconds = (So, the allowed range for is [0, 59]) 2. minutes = (So, the allowed range for is [0, 59]) 3. hours = (So, the allowed range for is [0, 23]) 4. can be either '*' (without quotes or a number between 1(Monday) and 7(Sunday)) No constraint introduced when it is '*'. When not, day of week must equal the given value 5. can be either '*' (without quotes or a number between 1 and 28) No constraint introduced when it is '*'. When not, day of month must equal the given value""")
+@cli_util.option('--mime-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS", "JSON"]), help=u"""Specifies if the report will be in .xls or .pdf or .json format""")
+@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which the resource should be created.""")
+@cli_util.option('--report-details-record-time-span', required=True, help=u"""The time span of records in report to be scheduled. Allowed period strings - \"H\",\"D\",\"M\",\"Y\" Each of the above fields potentially introduce constraints. A workRequest is created only when period-value satisfies all the constraints. Constraints introduced: 1. period = H (The allowed range for period-value is [1, 23]) 2. period = D (The allowed range for period-value is [1, 30]) 3. period = M (The allowed range for period-value is [1, 11]) 4. period = Y (The minimum period-value is 1)""")
+@cli_util.option('--display-name', help=u"""The name of the report to be scheduled""")
+@cli_util.option('--is-pagination-enabled', type=click.BOOL, help=u"""Indicates if the reports being generated should be paginated. If set to true, multiple reports can be generated and the details of next and previous report are present in Report. Values can either be 'true' or 'false'.""")
@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('--report-details-row-limit', type=click.INT, help=u"""Specifies the limit on the number of rows in the report.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -21339,18 +25498,38 @@ def provision_audit_policy(ctx, from_json, wait_for_state, max_wait_seconds, wai
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def purge_sql_collection_logs(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, if_match):
+def schedule_report_schedule_audit_report_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, report_definition_id, schedule, mime_type, compartment_id, report_details_record_time_span, display_name, is_pagination_enabled, if_match, report_details_row_limit):
- if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
+ if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
+ raise click.UsageError('Parameter --report-definition-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['reportDetails'] = {}
+ _details['schedule'] = schedule
+ _details['mimeType'] = mime_type
+ _details['compartmentId'] = compartment_id
+ _details['reportDetails']['recordTimeSpan'] = report_details_record_time_span
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if is_pagination_enabled is not None:
+ _details['isPaginationEnabled'] = is_pagination_enabled
+
+ if report_details_row_limit is not None:
+ _details['reportDetails']['rowLimit'] = report_details_row_limit
+
+ _details['reportDetails']['reportType'] = 'AUDIT'
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.purge_sql_collection_logs(
- sql_collection_id=sql_collection_id,
+ result = client.schedule_report(
+ report_definition_id=report_definition_id,
+ schedule_report_details=_details,
**kwargs
)
if wait_for_state:
@@ -21383,28 +25562,22 @@ def purge_sql_collection_logs(ctx, from_json, wait_for_state, max_wait_seconds,
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.refresh_crypto_assessment.command_name', 'refresh'), help=u"""Runs a crypto assessment, refreshes the latest assessment, and saves it for future reference. This operation runs with a cryptoAssessmentId of type LATEST. Before you start, first call the ListCryptoAssessments operation with filter \"type = latest\" to get the crypto assessment ID for the target's latest assessment. \n[Command Reference](refreshCryptoAssessment)""")
-@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
-@cli_util.option('--compartment-id', help=u"""This field is ignored when refreshing a crypto assessment.""")
-@cli_util.option('--display-name', help=u"""The display name of the crypto assessment.""")
-@cli_util.option('--description', help=u"""The description of the crypto assessment.""")
-@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)
+@security_assessment_group.command(name=cli_util.override('data_safe.set_security_assessment_baseline.command_name', 'set-security-assessment-baseline'), help=u"""Sets the saved security assessment as the baseline in the compartment where the the specified assessment resides. The security assessment needs to be of type 'SAVED'. \n[Command Reference](setSecurityAssessmentBaseline)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
@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('--assessment-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of OCIDs for the security assessments that need to be updated while setting the baseline.""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'assessment-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'assessment-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.wrap_exceptions
-def refresh_crypto_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, crypto_assessment_id, compartment_id, display_name, description, freeform_tags, defined_tags, if_match):
+def set_security_assessment_baseline(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, if_match, assessment_ids):
- if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
@@ -21413,25 +25586,13 @@ def refresh_crypto_assessment(ctx, from_json, wait_for_state, max_wait_seconds,
_details = {}
- if compartment_id is not None:
- _details['compartmentId'] = compartment_id
-
- if display_name is not None:
- _details['displayName'] = display_name
-
- if description is not None:
- _details['description'] = description
-
- if freeform_tags is not None:
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
-
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if assessment_ids is not None:
+ _details['assessmentIds'] = cli_util.parse_json_parameter("assessment_ids", assessment_ids)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.refresh_crypto_assessment(
- crypto_assessment_id=crypto_assessment_id,
- run_crypto_assessment_details=_details,
+ result = client.set_security_assessment_baseline(
+ security_assessment_id=security_assessment_id,
+ base_line_details=_details,
**kwargs
)
if wait_for_state:
@@ -21464,29 +25625,37 @@ def refresh_crypto_assessment(ctx, from_json, wait_for_state, max_wait_seconds,
cli_util.render_response(result, ctx)
-@database_security_config_group.command(name=cli_util.override('data_safe.refresh_database_security_configuration.command_name', 'refresh'), help=u"""Refreshes the specified database security configuration. \n[Command Reference](refreshDatabaseSecurityConfiguration)""")
-@cli_util.option('--database-security-config-id', required=True, help=u"""The OCID of the database security configuration resource.""")
+@user_assessment_group.command(name=cli_util.override('data_safe.set_user_assessment_baseline.command_name', 'set-user-assessment-baseline'), help=u"""Sets the saved user assessment as the baseline in the compartment where the specified assessment resides. The user assessment needs to be of type 'SAVED'. \n[Command Reference](setUserAssessmentBaseline)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
@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('--assessment-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of OCIDs for the user assessments that need to be updated while setting the baseline.""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'assessment-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@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={'assessment-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.wrap_exceptions
-def refresh_database_security_configuration(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, database_security_config_id, if_match):
+def set_user_assessment_baseline(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, user_assessment_id, if_match, assessment_ids):
- if isinstance(database_security_config_id, six.string_types) and len(database_security_config_id.strip()) == 0:
- raise click.UsageError('Parameter --database-security-config-id cannot be whitespace or empty string')
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if assessment_ids is not None:
+ _details['assessmentIds'] = cli_util.parse_json_parameter("assessment_ids", assessment_ids)
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.refresh_database_security_configuration(
- database_security_config_id=database_security_config_id,
+ result = client.set_user_assessment_baseline(
+ user_assessment_id=user_assessment_id,
+ base_line_details=_details,
**kwargs
)
if wait_for_state:
@@ -21519,27 +25688,24 @@ def refresh_database_security_configuration(ctx, from_json, wait_for_state, max_
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.refresh_security_assessment.command_name', 'refresh'), help=u"""Runs a security assessment, refreshes the latest assessment, and saves it for future reference. The assessment runs with a securityAssessmentId of type LATEST. Before you start, first call the ListSecurityAssessments operation with filter \"type = latest\" to get the security assessment id for the target's latest assessment. \n[Command Reference](refreshSecurityAssessment)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@cli_util.option('--compartment-id', help=u"""This field is ignored when refreshing a security assessment.""")
-@cli_util.option('--display-name', help=u"""The display name of the security assessment.""")
-@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)
+@audit_trail_group.command(name=cli_util.override('data_safe.start_audit_trail.command_name', 'start'), help=u"""Starts collection of audit records on the specified audit trail. \n[Command Reference](startAuditTrail)""")
+@cli_util.option('--audit-collection-start-time', required=True, type=custom_types.CLI_DATETIME, help=u"""The date from which the audit trail must start collecting data, in the format defined by RFC3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@cli_util.option('--audit-trail-id', required=True, help=u"""The OCID of the audit trail.""")
+@cli_util.option('--is-auto-purge-enabled', type=click.BOOL, help=u"""Indicates if auto purge is enabled on the target database, which helps delete audit data in the target database every seven days so that the database's audit trail does not become too large.""")
+@cli_util.option('--can-update-last-archive-time-on-target', type=click.BOOL, help=u"""Indicates if the Datasafe updates last archive time on target database. If isAutoPurgeEnabled field is enabled, this field must be true.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@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={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def refresh_security_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, compartment_id, display_name, freeform_tags, defined_tags, if_match):
+def start_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_collection_start_time, audit_trail_id, is_auto_purge_enabled, can_update_last_archive_time_on_target, if_match):
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+ if isinstance(audit_trail_id, six.string_types) and len(audit_trail_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-trail-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
@@ -21547,23 +25713,18 @@ def refresh_security_assessment(ctx, from_json, wait_for_state, max_wait_seconds
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['auditCollectionStartTime'] = audit_collection_start_time
- if compartment_id is not None:
- _details['compartmentId'] = compartment_id
-
- if display_name is not None:
- _details['displayName'] = display_name
-
- if freeform_tags is not None:
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+ if is_auto_purge_enabled is not None:
+ _details['isAutoPurgeEnabled'] = is_auto_purge_enabled
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if can_update_last_archive_time_on_target is not None:
+ _details['canUpdateLastArchiveTimeOnTarget'] = can_update_last_archive_time_on_target
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.refresh_security_assessment(
- security_assessment_id=security_assessment_id,
- run_security_assessment_details=_details,
+ result = client.start_audit_trail(
+ audit_trail_id=audit_trail_id,
+ start_audit_trail_details=_details,
**kwargs
)
if wait_for_state:
@@ -21596,8 +25757,8 @@ def refresh_security_assessment(ctx, from_json, wait_for_state, max_wait_seconds
cli_util.render_response(result, ctx)
-@security_policy_deployment_group.command(name=cli_util.override('data_safe.refresh_security_policy_deployment.command_name', 'refresh'), help=u"""Retrieve all the security policies from the associated target or target group and refresh the same on Data safe. \n[Command Reference](refreshSecurityPolicyDeployment)""")
-@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
+@sql_collection_group.command(name=cli_util.override('data_safe.start_sql_collection.command_name', 'start'), help=u"""Start the specified SQL collection. \n[Command Reference](startSqlCollection)""")
+@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -21607,18 +25768,18 @@ def refresh_security_assessment(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 refresh_security_policy_deployment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_deployment_id, if_match):
+def start_sql_collection(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, if_match):
- if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-deployment-id cannot be whitespace or empty string')
+ if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-collection-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_safe', 'data_safe', ctx)
- result = client.refresh_security_policy_deployment(
- security_policy_deployment_id=security_policy_deployment_id,
+ result = client.start_sql_collection(
+ sql_collection_id=sql_collection_id,
**kwargs
)
if wait_for_state:
@@ -21651,8 +25812,8 @@ def refresh_security_policy_deployment(ctx, from_json, wait_for_state, max_wait_
cli_util.render_response(result, ctx)
-@sql_collection_group.command(name=cli_util.override('data_safe.refresh_sql_collection_log_insights.command_name', 'refresh-sql-collection-log-insights'), help=u"""Refresh the specified SQL collection Log Insights. \n[Command Reference](refreshSqlCollectionLogInsights)""")
-@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
+@audit_trail_group.command(name=cli_util.override('data_safe.stop_audit_trail.command_name', 'stop'), help=u"""Stops the specified audit trail. \n[Command Reference](stopAuditTrail)""")
+@cli_util.option('--audit-trail-id', required=True, help=u"""The OCID of the audit trail.""")
@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -21662,18 +25823,18 @@ def refresh_security_policy_deployment(ctx, from_json, wait_for_state, max_wait_
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def refresh_sql_collection_log_insights(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, if_match):
+def stop_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_trail_id, if_match):
- if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
+ if isinstance(audit_trail_id, six.string_types) and len(audit_trail_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-trail-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_safe', 'data_safe', ctx)
- result = client.refresh_sql_collection_log_insights(
- sql_collection_id=sql_collection_id,
+ result = client.stop_audit_trail(
+ audit_trail_id=audit_trail_id,
**kwargs
)
if wait_for_state:
@@ -21706,8 +25867,8 @@ def refresh_sql_collection_log_insights(ctx, from_json, wait_for_state, max_wait
cli_util.render_response(result, ctx)
-@target_database_group.command(name=cli_util.override('data_safe.refresh_target_database.command_name', 'refresh'), help=u"""Refreshes the Data Safe target database to update it's state. \n[Command Reference](refreshTargetDatabase)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@sql_collection_group.command(name=cli_util.override('data_safe.stop_sql_collection.command_name', 'stop'), help=u"""Stops the specified SQL collection. \n[Command Reference](stopSqlCollection)""")
+@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -21717,18 +25878,18 @@ def refresh_sql_collection_log_insights(ctx, from_json, wait_for_state, max_wait
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def refresh_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, if_match):
+def stop_sql_collection(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, if_match):
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+ if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-collection-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_safe', 'data_safe', ctx)
- result = client.refresh_target_database(
- target_database_id=target_database_id,
+ result = client.stop_sql_collection(
+ sql_collection_id=sql_collection_id,
**kwargs
)
if wait_for_state:
@@ -21761,55 +25922,68 @@ def refresh_target_database(ctx, from_json, wait_for_state, max_wait_seconds, wa
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.refresh_user_assessment.command_name', 'refresh'), help=u"""Refreshes the latest assessment and saves it for future reference. This operation runs with a userAssessmentId of type LATEST. Before you start, first call the ListUserAssessments operation with filter \"type = latest\" to get the user assessment ID for the target's latest assessment. \n[Command Reference](refreshUserAssessment)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
-@cli_util.option('--compartment-id', help=u"""This field is ignored when refreshing a user assessment.""")
-@cli_util.option('--description', help=u"""The description of the user assessment.""")
-@cli_util.option('--display-name', help=u"""The display name of the user assessment.""")
-@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
-
-Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@subsetting_policy_group.command(name=cli_util.override('data_safe.subset_data.command_name', 'subset-data'), help=u"""Subsets data using the specified subsetting policy. \n[Command Reference](subsetData)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--target-credentials', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--target-id', help=u"""The OCID of the target database to be subsetted. If it's not provided, the value of the targetId attribute in the SubsettingPolicy resource is used""")
+@cli_util.option('--masking', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Indicates whether masking should be triggered after successful subsetting""")
+@cli_util.option('--is-rerun', type=click.BOOL, help=u"""Indicates if the request is to rerun the previously failed subsetting job""")
+@cli_util.option('--re-run-from-step', type=custom_types.CliCaseInsensitiveChoice(["PRE_SUBSETTING_SCRIPT", "POST_SUBSETTING_SCRIPT"]), help=u"""Specifies the step from which subsetting needs to be rerun. This param will be used only when isRerun attribute is true. If PRE_SUBSETTING_SCRIPT is passed, it will rerun the pre-subsetting script, followed by subsetting, and then the post-subsetting script. If POST_SUBSETTING_SCRIPT is passed, it will rerun only the post-subsetting script. If this field is not set and isRerun is set to true, then it will default to the last failed step.""")
+@cli_util.option('--tablespace', help=u"""The tablespace that should be used to create the temporary tables for data subsetting. If no tablespace is provided, the DEFAULT tablespace is used.""")
+@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a subsetting operation. Set this attribute to true to enable redo logging. If set as false, subsetting disables redo logging and flashback logging to purge any original data from logs. However, in certain circumstances when you only want to test subsetting, rollback changes, and retry, you could enable logging and use a flashback database to retrieve the original data after it has been subsetted. If it's not provided, the value of the isRedoLoggingEnabled attribute in the SubsettingPolicy resource is used.""")
+@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. Set this attribute to false to disable statistics gathering. The subsetting process gathers statistics on subset database tables after subsetting completes. If it's not provided, the value of the isRefreshStatsEnabled attribute in the SubsettingPolicy resource is used.""")
+@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data subsetting. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve subsetting performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism. https://www.oracle.com/pls/topic/lookup?ctx=dblatest&en/database/oracle/oracle-database&id=VLDBG-GUID-3E2AE088-2505-465E-A8B2-AC38813EA355 If it's not provided, the value of the parallelDegree attribute in the SubsettingPolicy resource is used.""")
+@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data subsetting. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after subsetting completes. If it's not provided, the value of the recompile attribute in the SubsettingPolicy resource is used.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'target-credentials': {'module': 'data_safe', 'class': 'Credentials'}})
@cli_util.wrap_exceptions
-def refresh_user_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, user_assessment_id, compartment_id, description, display_name, freeform_tags, defined_tags, if_match):
+def subset_data(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_policy_id, target_credentials, target_id, masking, is_rerun, re_run_from_step, tablespace, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile):
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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['targetCredentials'] = cli_util.parse_json_parameter("target_credentials", target_credentials)
- if compartment_id is not None:
- _details['compartmentId'] = compartment_id
+ if target_id is not None:
+ _details['targetId'] = target_id
- if description is not None:
- _details['description'] = description
+ if masking is not None:
+ _details['masking'] = masking
- if display_name is not None:
- _details['displayName'] = display_name
+ if is_rerun is not None:
+ _details['isRerun'] = is_rerun
- if freeform_tags is not None:
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+ if re_run_from_step is not None:
+ _details['reRunFromStep'] = re_run_from_step
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if tablespace is not None:
+ _details['tablespace'] = tablespace
+
+ if is_redo_logging_enabled is not None:
+ _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
+
+ if is_refresh_stats_enabled is not None:
+ _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
+
+ if parallel_degree is not None:
+ _details['parallelDegree'] = parallel_degree
+
+ if recompile is not None:
+ _details['recompile'] = recompile
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.refresh_user_assessment(
- user_assessment_id=user_assessment_id,
- run_user_assessment_details=_details,
+ result = client.subset_data(
+ subsetting_policy_id=subsetting_policy_id,
+ subset_data_details=_details,
**kwargs
)
if wait_for_state:
@@ -21842,73 +26016,44 @@ def refresh_user_assessment(ctx, from_json, wait_for_state, max_wait_seconds, wa
cli_util.render_response(result, ctx)
-@report_definition_group.command(name=cli_util.override('data_safe.remove_schedule_report.command_name', 'remove'), help=u"""Deletes the schedule of a .xls or .pdf report. \n[Command Reference](removeScheduleReport)""")
-@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
+@work_request_group.command(name=cli_util.override('data_safe.suspend_work_request.command_name', 'suspend'), help=u"""Suspend the given work request. Issuing a suspend does not guarantee of a immediate suspend of the work request. \n[Command Reference](suspendWorkRequest)""")
+@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 remove_schedule_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, report_definition_id, if_match):
+def suspend_work_request(ctx, from_json, work_request_id, if_match):
- if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
- raise click.UsageError('Parameter --report-definition-id cannot be whitespace or empty string')
+ if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
+ raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.remove_schedule_report(
- report_definition_id=report_definition_id,
+ result = client.suspend_work_request(
+ work_request_id=work_request_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)
-@security_assessment_group.command(name=cli_util.override('data_safe.remove_security_assessment_template.command_name', 'remove'), help=u"""Remove the checks from the template to the specified security assessment.The security assessment provided in the path needs to be of type 'LATEST'. \n[Command Reference](removeSecurityAssessmentTemplate)""")
+@security_assessment_group.command(name=cli_util.override('data_safe.unset_security_assessment_baseline.command_name', 'unset-security-assessment-baseline'), help=u"""Removes the baseline setting for the saved security assessment associated with the targetId passed via body. If no body or empty body is passed then the baseline settings of all the saved security assessments pertaining to the baseline assessment OCID provided in the path will be removed. Sets the if-match parameter to the value of the etag from a previous GET or POST response for that resource. \n[Command Reference](unsetSecurityAssessmentBaseline)""")
@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
@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('--target-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database target OCIDs for which the user intends to unset the baseline.""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.wrap_exceptions
-def remove_security_assessment_template(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, if_match):
+def unset_security_assessment_baseline(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, if_match, target_ids):
if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
@@ -21917,9 +26062,16 @@ def remove_security_assessment_template(ctx, from_json, wait_for_state, max_wait
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if target_ids is not None:
+ _details['targetIds'] = cli_util.parse_json_parameter("target_ids", target_ids)
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.remove_security_assessment_template(
+ result = client.unset_security_assessment_baseline(
security_assessment_id=security_assessment_id,
+ unset_security_assessment_baseline_details=_details,
**kwargs
)
if wait_for_state:
@@ -21952,29 +26104,37 @@ def remove_security_assessment_template(ctx, from_json, wait_for_state, max_wait
cli_util.render_response(result, ctx)
-@audit_trail_group.command(name=cli_util.override('data_safe.resume_audit_trail.command_name', 'resume'), help=u"""Resumes the specified audit trail once it got stopped. \n[Command Reference](resumeAuditTrail)""")
-@cli_util.option('--audit-trail-id', required=True, help=u"""The OCID of the audit trail.""")
+@user_assessment_group.command(name=cli_util.override('data_safe.unset_user_assessment_baseline.command_name', 'unset-user-assessment-baseline'), help=u"""Removes the baseline setting for the saved user assessment associated with the targetId passed via body. If no body or empty body is passed then the baseline settings of all the saved user assessments pertaining to the baseline assessment OCID provided in the path will be removed. Sets the if-match parameter to the value of the etag from a previous GET or POST response for that resource. \n[Command Reference](unsetUserAssessmentBaseline)""")
+@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
@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('--target-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database target OCIDs for which the user intends to unset the baseline.""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.wrap_exceptions
-def resume_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_trail_id, if_match):
+def unset_user_assessment_baseline(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, user_assessment_id, if_match, target_ids):
- if isinstance(audit_trail_id, six.string_types) and len(audit_trail_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-trail-id cannot be whitespace or empty string')
+ if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if target_ids is not None:
+ _details['targetIds'] = cli_util.parse_json_parameter("target_ids", target_ids)
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.resume_audit_trail(
- audit_trail_id=audit_trail_id,
+ result = client.unset_user_assessment_baseline(
+ user_assessment_id=user_assessment_id,
+ unset_user_assessment_baseline_details=_details,
**kwargs
)
if wait_for_state:
@@ -22007,109 +26167,111 @@ def resume_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_in
cli_util.render_response(result, ctx)
-@work_request_group.command(name=cli_util.override('data_safe.resume_work_request.command_name', 'resume'), help=u"""Resume the given work request. Issuing a resume does not guarantee of immediate resume of the work request. \n[Command Reference](resumeWorkRequest)""")
-@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
+@alert_group.command(name=cli_util.override('data_safe.update_alert.command_name', 'update'), help=u"""Updates the status of the specified alert. \n[Command Reference](updateAlert)""")
+@cli_util.option('--alert-id', required=True, help=u"""The OCID of alert.""")
+@cli_util.option('--comment', help=u"""A comment can be entered to track the alert changes done by the user.""")
+@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["OPEN", "CLOSED"]), help=u"""The status of the alert.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@json_skeleton_utils.get_cli_json_input_option({})
+@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["UPDATING", "SUCCEEDED", "FAILED"]), 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 UPDATING --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
+@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
+@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'Alert'})
@cli_util.wrap_exceptions
-def resume_work_request(ctx, from_json, work_request_id, if_match):
+def update_alert(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, alert_id, comment, status, freeform_tags, defined_tags, if_match):
- if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
- raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
+ if isinstance(alert_id, six.string_types) and len(alert_id.strip()) == 0:
+ raise click.UsageError('Parameter --alert-id cannot be whitespace or empty string')
+ if not force:
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.resume_work_request(
- work_request_id=work_request_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
+ _details = {}
-@audit_policy_group.command(name=cli_util.override('data_safe.retrieve_audit_policies.command_name', 'retrieve'), help=u"""Retrieves the audit policy details from the source target database. \n[Command Reference](retrieveAuditPolicies)""")
-@cli_util.option('--audit-policy-id', required=True, help=u"""Unique audit policy identifier.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 retrieve_audit_policies(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_policy_id, if_match):
+ if comment is not None:
+ _details['comment'] = comment
- if isinstance(audit_policy_id, six.string_types) and len(audit_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-policy-id cannot be whitespace or empty string')
+ if status is not None:
+ _details['status'] = status
+
+ 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)
- 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_safe', 'data_safe', ctx)
- result = client.retrieve_audit_policies(
- audit_policy_id=audit_policy_id,
+ result = client.update_alert(
+ alert_id=alert_id,
+ update_alert_details=_details,
**kwargs
)
if wait_for_state:
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
+ if hasattr(client, 'get_alert') and callable(getattr(client, 'get_alert')):
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)
+ 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_alert(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 work request entered the specified state. Outputting last known resource state', file=sys.stderr)
+ 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 work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ 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 work request to enter the specified state', file=sys.stderr)
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
cli_util.render_response(result, ctx)
-@report_definition_group.command(name=cli_util.override('data_safe.schedule_report.command_name', 'schedule-report'), help=u"""Schedules a .xls or .pdf report based on parameters and report definition. \n[Command Reference](scheduleReport)""")
-@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
-@cli_util.option('--schedule', required=True, help=u"""The schedule to generate the report periodically in the specified format: ;
+@alert_policy_group.command(name=cli_util.override('data_safe.update_alert_policy.command_name', 'update'), help=u"""Updates the specified alert policy . \n[Command Reference](updateAlertPolicy)""")
+@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the alert policy. The name does not have to be unique, and it's changeable.""")
+@cli_util.option('--description', help=u"""The description of the alert policy.""")
+@cli_util.option('--severity', type=custom_types.CliCaseInsensitiveChoice(["CRITICAL", "HIGH", "MEDIUM", "LOW", "EVALUATE"]), help=u"""Severity level of the alert raised by this policy.""")
+@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]
-Allowed version strings - \"v1\" v1's version specific schedule - Each of the above fields potentially introduce constraints. A workrequest is created only when clock time satisfies all the constraints. Constraints introduced: 1. seconds = (So, the allowed range for is [0, 59]) 2. minutes = (So, the allowed range for is [0, 59]) 3. hours = (So, the allowed range for is [0, 23]) 4. can be either '*' (without quotes or a number between 1(Monday) and 7(Sunday)) No constraint introduced when it is '*'. When not, day of week must equal the given value 5. can be either '*' (without quotes or a number between 1 and 28) No constraint introduced when it is '*'. When not, day of month must equal the given value""")
-@cli_util.option('--mime-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS", "JSON"]), help=u"""Specifies if the report will be in .xls or .pdf or .json format""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which the resource should be created.""")
-@cli_util.option('--report-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"""The name of the report to be scheduled""")
-@cli_util.option('--is-pagination-enabled', type=click.BOOL, help=u"""Indicates if the reports being generated should be paginated. If set to true, multiple reports can be generated and the details of next and previous report are present in Report. Values can either be 'true' or 'false'.""")
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'report-details': {'module': 'data_safe', 'class': 'ReportDetails'}})
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'report-details': {'module': 'data_safe', 'class': 'ReportDetails'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def schedule_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, report_definition_id, schedule, mime_type, compartment_id, report_details, display_name, is_pagination_enabled, if_match):
+def update_alert_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, alert_policy_id, display_name, description, severity, freeform_tags, defined_tags, if_match):
- if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
- raise click.UsageError('Parameter --report-definition-id cannot be whitespace or empty string')
+ if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --alert-policy-id cannot be whitespace or empty string')
+ if not force:
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
kwargs = {}
if if_match is not None:
@@ -22117,21 +26279,26 @@ def schedule_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_inter
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['schedule'] = schedule
- _details['mimeType'] = mime_type
- _details['compartmentId'] = compartment_id
- _details['reportDetails'] = cli_util.parse_json_parameter("report_details", report_details)
if display_name is not None:
_details['displayName'] = display_name
- if is_pagination_enabled is not None:
- _details['isPaginationEnabled'] = is_pagination_enabled
+ if description is not None:
+ _details['description'] = description
+
+ if severity is not None:
+ _details['severity'] = severity
+
+ 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_safe', 'data_safe', ctx)
- result = client.schedule_report(
- report_definition_id=report_definition_id,
- schedule_report_details=_details,
+ result = client.update_alert_policy(
+ alert_policy_id=alert_policy_id,
+ update_alert_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -22164,18 +26331,13 @@ def schedule_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_inter
cli_util.render_response(result, ctx)
-@report_definition_group.command(name=cli_util.override('data_safe.schedule_report_schedule_audit_report_details.command_name', 'schedule-report-schedule-audit-report-details'), help=u"""Schedules a .xls or .pdf report based on parameters and report definition. \n[Command Reference](scheduleReport)""")
-@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
-@cli_util.option('--schedule', required=True, help=u"""The schedule to generate the report periodically in the specified format: ;
-
-Allowed version strings - \"v1\" v1's version specific schedule - Each of the above fields potentially introduce constraints. A workrequest is created only when clock time satisfies all the constraints. Constraints introduced: 1. seconds = (So, the allowed range for is [0, 59]) 2. minutes = (So, the allowed range for is [0, 59]) 3. hours = (So, the allowed range for is [0, 23]) 4. can be either '*' (without quotes or a number between 1(Monday) and 7(Sunday)) No constraint introduced when it is '*'. When not, day of week must equal the given value 5. can be either '*' (without quotes or a number between 1 and 28) No constraint introduced when it is '*'. When not, day of month must equal the given value""")
-@cli_util.option('--mime-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["PDF", "XLS", "JSON"]), help=u"""Specifies if the report will be in .xls or .pdf or .json format""")
-@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment in which the resource should be created.""")
-@cli_util.option('--report-details-record-time-span', required=True, help=u"""The time span of records in report to be scheduled. Allowed period strings - \"H\",\"D\",\"M\",\"Y\" Each of the above fields potentially introduce constraints. A workRequest is created only when period-value satisfies all the constraints. Constraints introduced: 1. period = H (The allowed range for period-value is [1, 23]) 2. period = D (The allowed range for period-value is [1, 30]) 3. period = M (The allowed range for period-value is [1, 11]) 4. period = Y (The minimum period-value is 1)""")
-@cli_util.option('--display-name', help=u"""The name of the report to be scheduled""")
-@cli_util.option('--is-pagination-enabled', type=click.BOOL, help=u"""Indicates if the reports being generated should be paginated. If set to true, multiple reports can be generated and the details of next and previous report are present in Report. Values can either be 'true' or 'false'.""")
+@alert_policy_rule_group.command(name=cli_util.override('data_safe.update_alert_policy_rule.command_name', 'update'), help=u"""Updates the specified alert policy rule. \n[Command Reference](updateAlertPolicyRule)""")
+@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
+@cli_util.option('--rule-key', required=True, help=u"""The key of the alert policy rule.""")
+@cli_util.option('--description', help=u"""Describes the alert policy rule.""")
+@cli_util.option('--expression', help=u"""The conditional expression of the alert policy rule which evaluates to boolean value.""")
+@cli_util.option('--display-name', help=u"""The display name of the alert policy rule.""")
@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('--report-details-row-limit', type=click.INT, help=u"""Specifies the limit on the number of rows in the report.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -22184,10 +26346,13 @@ def schedule_report(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={})
@cli_util.wrap_exceptions
-def schedule_report_schedule_audit_report_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, report_definition_id, schedule, mime_type, compartment_id, report_details_record_time_span, display_name, is_pagination_enabled, if_match, report_details_row_limit):
+def update_alert_policy_rule(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, alert_policy_id, rule_key, description, expression, display_name, if_match):
- if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
- raise click.UsageError('Parameter --report-definition-id cannot be whitespace or empty string')
+ if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --alert-policy-id cannot be whitespace or empty string')
+
+ if isinstance(rule_key, six.string_types) and len(rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --rule-key cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
@@ -22195,27 +26360,21 @@ def schedule_report_schedule_audit_report_details(ctx, from_json, wait_for_state
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['reportDetails'] = {}
- _details['schedule'] = schedule
- _details['mimeType'] = mime_type
- _details['compartmentId'] = compartment_id
- _details['reportDetails']['recordTimeSpan'] = report_details_record_time_span
-
- if display_name is not None:
- _details['displayName'] = display_name
- if is_pagination_enabled is not None:
- _details['isPaginationEnabled'] = is_pagination_enabled
+ if description is not None:
+ _details['description'] = description
- if report_details_row_limit is not None:
- _details['reportDetails']['rowLimit'] = report_details_row_limit
+ if expression is not None:
+ _details['expression'] = expression
- _details['reportDetails']['reportType'] = 'AUDIT'
+ if display_name is not None:
+ _details['displayName'] = display_name
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.schedule_report(
- report_definition_id=report_definition_id,
- schedule_report_details=_details,
+ result = client.update_alert_policy_rule(
+ alert_policy_id=alert_policy_id,
+ rule_key=rule_key,
+ update_alert_policy_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -22248,22 +26407,33 @@ def schedule_report_schedule_audit_report_details(ctx, from_json, wait_for_state
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.set_security_assessment_baseline.command_name', 'set-security-assessment-baseline'), help=u"""Sets the saved security assessment as the baseline in the compartment where the the specified assessment resides. The security assessment needs to be of type 'SAVED'. \n[Command Reference](setSecurityAssessmentBaseline)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
+@attribute_set_group.command(name=cli_util.override('data_safe.update_attribute_set.command_name', 'update'), help=u"""Updates an attribute set. \n[Command Reference](updateAttributeSet)""")
+@cli_util.option('--attribute-set-id', required=True, help=u"""OCID of an attribute set.""")
+@cli_util.option('--display-name', help=u"""The display name of an attribute set. The name does not have to be unique, and is changeable.""")
+@cli_util.option('--description', help=u"""The description of an attribute set.""")
+@cli_util.option('--attribute-set-values', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of attribute set values that will replace existing values.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.option('--assessment-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of OCIDs for the security assessments that need to be updated while setting the baseline.""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'assessment-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.get_cli_json_input_option({'attribute-set-values': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'assessment-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'attribute-set-values': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def set_security_assessment_baseline(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, if_match, assessment_ids):
+def update_attribute_set(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, attribute_set_id, display_name, description, attribute_set_values, freeform_tags, defined_tags, if_match):
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+ if isinstance(attribute_set_id, six.string_types) and len(attribute_set_id.strip()) == 0:
+ raise click.UsageError('Parameter --attribute-set-id cannot be whitespace or empty string')
+ if not force:
+ if attribute_set_values or freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to attribute-set-values 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:
@@ -22272,13 +26442,25 @@ def set_security_assessment_baseline(ctx, from_json, wait_for_state, max_wait_se
_details = {}
- if assessment_ids is not None:
- _details['assessmentIds'] = cli_util.parse_json_parameter("assessment_ids", assessment_ids)
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if attribute_set_values is not None:
+ _details['attributeSetValues'] = cli_util.parse_json_parameter("attribute_set_values", attribute_set_values)
+
+ 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_safe', 'data_safe', ctx)
- result = client.set_security_assessment_baseline(
- security_assessment_id=security_assessment_id,
- base_line_details=_details,
+ result = client.update_attribute_set(
+ attribute_set_id=attribute_set_id,
+ update_attribute_set_details=_details,
**kwargs
)
if wait_for_state:
@@ -22311,22 +26493,32 @@ def set_security_assessment_baseline(ctx, from_json, wait_for_state, max_wait_se
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.set_user_assessment_baseline.command_name', 'set-user-assessment-baseline'), help=u"""Sets the saved user assessment as the baseline in the compartment where the specified assessment resides. The user assessment needs to be of type 'SAVED'. \n[Command Reference](setUserAssessmentBaseline)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@audit_archive_retrieval_group.command(name=cli_util.override('data_safe.update_audit_archive_retrieval.command_name', 'update'), help=u"""Updates the audit archive retrieval. \n[Command Reference](updateAuditArchiveRetrieval)""")
+@cli_util.option('--audit-archive-retrieval-id', required=True, help=u"""OCID of the archive retrieval.""")
+@cli_util.option('--display-name', help=u"""The display name of the archive retrieval. The name does not have to be unique, and is changeable.""")
+@cli_util.option('--description', help=u"""Description of the archive retrieval.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.option('--assessment-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of OCIDs for the user assessments that need to be updated while setting the baseline.""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'assessment-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'assessment-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def set_user_assessment_baseline(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, user_assessment_id, if_match, assessment_ids):
+def update_audit_archive_retrieval(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_archive_retrieval_id, display_name, description, freeform_tags, defined_tags, if_match):
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+ if isinstance(audit_archive_retrieval_id, six.string_types) and len(audit_archive_retrieval_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-archive-retrieval-id cannot be whitespace or empty string')
+ if not force:
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
kwargs = {}
if if_match is not None:
@@ -22335,13 +26527,22 @@ def set_user_assessment_baseline(ctx, from_json, wait_for_state, max_wait_second
_details = {}
- if assessment_ids is not None:
- _details['assessmentIds'] = cli_util.parse_json_parameter("assessment_ids", assessment_ids)
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.set_user_assessment_baseline(
- user_assessment_id=user_assessment_id,
- base_line_details=_details,
+ result = client.update_audit_archive_retrieval(
+ audit_archive_retrieval_id=audit_archive_retrieval_id,
+ update_audit_archive_retrieval_details=_details,
**kwargs
)
if wait_for_state:
@@ -22374,24 +26575,32 @@ def set_user_assessment_baseline(ctx, from_json, wait_for_state, max_wait_second
cli_util.render_response(result, ctx)
-@audit_trail_group.command(name=cli_util.override('data_safe.start_audit_trail.command_name', 'start'), help=u"""Starts collection of audit records on the specified audit trail. \n[Command Reference](startAuditTrail)""")
-@cli_util.option('--audit-collection-start-time', required=True, type=custom_types.CLI_DATETIME, help=u"""The date from which the audit trail must start collecting data, in the format defined by RFC3339.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
-@cli_util.option('--audit-trail-id', required=True, help=u"""The OCID of the audit trail.""")
-@cli_util.option('--is-auto-purge-enabled', type=click.BOOL, help=u"""Indicates if auto purge is enabled on the target database, which helps delete audit data in the target database every seven days so that the database's audit trail does not become too large.""")
-@cli_util.option('--can-update-last-archive-time-on-target', type=click.BOOL, help=u"""Indicates if the Datasafe updates last archive time on target database. If isAutoPurgeEnabled field is enabled, this field must be true.""")
+@audit_policy_group.command(name=cli_util.override('data_safe.update_audit_policy.command_name', 'update'), help=u"""Updates the audit policy. \n[Command Reference](updateAuditPolicy)""")
+@cli_util.option('--audit-policy-id', required=True, help=u"""Unique audit policy identifier.""")
+@cli_util.option('--display-name', help=u"""The display name of the audit policy. The name does not have to be unique, and it is changeable.""")
+@cli_util.option('--description', help=u"""The description of the audit policy.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def start_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_collection_start_time, audit_trail_id, is_auto_purge_enabled, can_update_last_archive_time_on_target, if_match):
+def update_audit_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_policy_id, display_name, description, freeform_tags, defined_tags, if_match):
- if isinstance(audit_trail_id, six.string_types) and len(audit_trail_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-trail-id cannot be whitespace or empty string')
+ if isinstance(audit_policy_id, six.string_types) and len(audit_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-policy-id cannot be whitespace or empty string')
+ if not force:
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
kwargs = {}
if if_match is not None:
@@ -22399,18 +26608,23 @@ def start_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_int
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['auditCollectionStartTime'] = audit_collection_start_time
- if is_auto_purge_enabled is not None:
- _details['isAutoPurgeEnabled'] = is_auto_purge_enabled
+ if display_name is not None:
+ _details['displayName'] = display_name
- if can_update_last_archive_time_on_target is not None:
- _details['canUpdateLastArchiveTimeOnTarget'] = can_update_last_archive_time_on_target
+ if description is not None:
+ _details['description'] = description
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.start_audit_trail(
- audit_trail_id=audit_trail_id,
- start_audit_trail_details=_details,
+ result = client.update_audit_policy(
+ audit_policy_id=audit_policy_id,
+ update_audit_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -22443,29 +26657,64 @@ def start_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_int
cli_util.render_response(result, ctx)
-@sql_collection_group.command(name=cli_util.override('data_safe.start_sql_collection.command_name', 'start'), help=u"""Start the specified SQL collection. \n[Command Reference](startSqlCollection)""")
-@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
+@audit_profile_group.command(name=cli_util.override('data_safe.update_audit_profile.command_name', 'update'), help=u"""Updates one or more attributes of the specified audit profile. \n[Command Reference](updateAuditProfile)""")
+@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
+@cli_util.option('--description', help=u"""The description of the audit profile.""")
+@cli_util.option('--display-name', help=u"""The display name of the audit profile. The name does not have to be unique, and it's updatable.""")
+@cli_util.option('--is-paid-usage-enabled', type=click.BOOL, help=u"""Indicates if you want to continue collecting audit records beyond the free limit of one million audit records per month per target database, potentially incurring additional charges. The default value is inherited from the global settings. You can change at the global level or at the target level.""")
+@cli_util.option('--is-override-global-paid-usage', type=click.BOOL, help=u"""Indicates whether audit paid usage settings specified at the target database level override both the global settings and the target group level paid usage settings. Enabling paid usage continues the collection of audit records beyond the free limit of one million audit records per month per target database, potentially incurring additional charges. For more information, see [Data Safe Price List].""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def start_sql_collection(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, if_match):
+def update_audit_profile(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_profile_id, description, display_name, is_paid_usage_enabled, is_override_global_paid_usage, freeform_tags, defined_tags, if_match):
- if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
+ if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
+ raise click.UsageError('Parameter --audit-profile-id cannot be whitespace or empty string')
+ if not force:
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if description is not None:
+ _details['description'] = description
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if is_paid_usage_enabled is not None:
+ _details['isPaidUsageEnabled'] = is_paid_usage_enabled
+
+ if is_override_global_paid_usage is not None:
+ _details['isOverrideGlobalPaidUsage'] = is_override_global_paid_usage
+
+ 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_safe', 'data_safe', ctx)
- result = client.start_sql_collection(
- sql_collection_id=sql_collection_id,
+ result = client.update_audit_profile(
+ audit_profile_id=audit_profile_id,
+ update_audit_profile_details=_details,
**kwargs
)
if wait_for_state:
@@ -22498,29 +26747,64 @@ def start_sql_collection(ctx, from_json, wait_for_state, max_wait_seconds, wait_
cli_util.render_response(result, ctx)
-@audit_trail_group.command(name=cli_util.override('data_safe.stop_audit_trail.command_name', 'stop'), help=u"""Stops the specified audit trail. \n[Command Reference](stopAuditTrail)""")
+@audit_trail_group.command(name=cli_util.override('data_safe.update_audit_trail.command_name', 'update'), help=u"""Updates one or more attributes of the specified audit trail. \n[Command Reference](updateAuditTrail)""")
@cli_util.option('--audit-trail-id', required=True, help=u"""The OCID of the audit trail.""")
+@cli_util.option('--description', help=u"""The description of the audit trail.""")
+@cli_util.option('--display-name', help=u"""The display name of the audit trail. The name does not have to be unique, and it's updatable.""")
+@cli_util.option('--is-auto-purge-enabled', type=click.BOOL, help=u"""Indicates if auto purge is enabled on the target database, which helps delete audit data in the target database every seven days so that the database's audit trail does not become too large.""")
+@cli_util.option('--can-update-last-archive-time-on-target', type=click.BOOL, help=u"""Indicates if the Datasafe updates last archive time on target database. If isAutoPurgeEnabled field is enabled, this field must be true.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def stop_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_trail_id, if_match):
+def update_audit_trail(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_trail_id, description, display_name, is_auto_purge_enabled, can_update_last_archive_time_on_target, freeform_tags, defined_tags, if_match):
if isinstance(audit_trail_id, six.string_types) and len(audit_trail_id.strip()) == 0:
raise click.UsageError('Parameter --audit-trail-id cannot be whitespace or empty string')
+ if not force:
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if description is not None:
+ _details['description'] = description
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if is_auto_purge_enabled is not None:
+ _details['isAutoPurgeEnabled'] = is_auto_purge_enabled
+
+ if can_update_last_archive_time_on_target is not None:
+ _details['canUpdateLastArchiveTimeOnTarget'] = can_update_last_archive_time_on_target
+
+ 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_safe', 'data_safe', ctx)
- result = client.stop_audit_trail(
+ result = client.update_audit_trail(
audit_trail_id=audit_trail_id,
+ update_audit_trail_details=_details,
**kwargs
)
if wait_for_state:
@@ -22553,29 +26837,64 @@ def stop_audit_trail(ctx, from_json, wait_for_state, max_wait_seconds, wait_inte
cli_util.render_response(result, ctx)
-@sql_collection_group.command(name=cli_util.override('data_safe.stop_sql_collection.command_name', 'stop'), help=u"""Stops the specified SQL collection. \n[Command Reference](stopSqlCollection)""")
-@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
+@crypto_assessment_group.command(name=cli_util.override('data_safe.update_crypto_assessment.command_name', 'update'), help=u"""Updates one or more attributes of the specified crypto assessment. \n[Command Reference](updateCryptoAssessment)""")
+@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
+@cli_util.option('--display-name', help=u"""The display name of the crypto assessment.""")
+@cli_util.option('--schedule', help=u"""Updates the schedule associated with this latest crypto assessment. The schedule uses the format: ;
+
+For v1, the version-specific schedule format is:
+
+Specify either day-of-week for weekly schedules or day-of-month for monthly schedules. Do not specify both. For monthly schedules, day-of-month must be between 1 and 28. If the service generates a default monthly schedule for an assessment created on day 29, 30, or 31 of a month, it uses day 28. Schedule updates are supported only for assessments of type LATEST.""")
+@cli_util.option('--is-assessment-scheduled', type=click.BOOL, help=u"""Indicates whether scheduled execution is active for this latest crypto assessment. When set to true, the existing schedule is used unless a new schedule is provided. When set to false, the schedule value is retained but scheduled execution is paused. Schedule state updates are supported only for assessments of type LATEST.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def stop_sql_collection(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, if_match):
+def update_crypto_assessment(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, crypto_assessment_id, display_name, schedule, is_assessment_scheduled, freeform_tags, defined_tags, if_match):
- if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
+ if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
+ if not force:
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
kwargs = {}
if if_match is not None:
kwargs['if_match'] = if_match
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
+
+ _details = {}
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if schedule is not None:
+ _details['schedule'] = schedule
+
+ if is_assessment_scheduled is not None:
+ _details['isAssessmentScheduled'] = is_assessment_scheduled
+
+ 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_safe', 'data_safe', ctx)
- result = client.stop_sql_collection(
- sql_collection_id=sql_collection_id,
+ result = client.update_crypto_assessment(
+ crypto_assessment_id=crypto_assessment_id,
+ update_crypto_assessment_details=_details,
**kwargs
)
if wait_for_state:
@@ -22608,47 +26927,34 @@ def stop_sql_collection(ctx, from_json, wait_for_state, max_wait_seconds, wait_i
cli_util.render_response(result, ctx)
-@work_request_group.command(name=cli_util.override('data_safe.suspend_work_request.command_name', 'suspend'), help=u"""Suspend the given work request. Issuing a suspend does not guarantee of a immediate suspend of the work request. \n[Command Reference](suspendWorkRequest)""")
-@cli_util.option('--work-request-id', required=True, help=u"""The OCID of the work request.""")
-@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@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 suspend_work_request(ctx, from_json, work_request_id, if_match):
-
- if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
- raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
-
- kwargs = {}
- if if_match is not None:
- kwargs['if_match'] = if_match
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
- client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.suspend_work_request(
- work_request_id=work_request_id,
- **kwargs
- )
- cli_util.render_response(result, ctx)
-
+@data_safe_private_endpoint_group.command(name=cli_util.override('data_safe.update_data_safe_private_endpoint.command_name', 'update'), help=u"""Updates one or more attributes of the specified Data Safe private endpoint. \n[Command Reference](updateDataSafePrivateEndpoint)""")
+@cli_util.option('--data-safe-private-endpoint-id', required=True, help=u"""The OCID of the private endpoint.""")
+@cli_util.option('--display-name', help=u"""The display name of the private endpoint.""")
+@cli_util.option('--description', help=u"""The description of the private endpoint.""")
+@cli_util.option('--nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The OCIDs of the network security groups that the private endpoint belongs to.""" + 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]
-@security_assessment_group.command(name=cli_util.override('data_safe.unset_security_assessment_baseline.command_name', 'unset-security-assessment-baseline'), help=u"""Removes the baseline setting for the saved security assessment associated with the targetId passed via body. If no body or empty body is passed then the baseline settings of all the saved security assessments pertaining to the baseline assessment OCID provided in the path will be removed. Sets the if-match parameter to the value of the etag from a previous GET or POST response for that resource. \n[Command Reference](unsetSecurityAssessmentBaseline)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
+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('--target-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database target OCIDs for which the user intends to unset the baseline.""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.get_cli_json_input_option({'nsg-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'data_safe', '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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'nsg-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def unset_security_assessment_baseline(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, if_match, target_ids):
+def update_data_safe_private_endpoint(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, data_safe_private_endpoint_id, display_name, description, nsg_ids, freeform_tags, defined_tags, security_attributes, if_match):
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+ if isinstance(data_safe_private_endpoint_id, six.string_types) and len(data_safe_private_endpoint_id.strip()) == 0:
+ raise click.UsageError('Parameter --data-safe-private-endpoint-id cannot be whitespace or empty string')
+ if not force:
+ if nsg_ids or freeform_tags or defined_tags or security_attributes:
+ if not click.confirm("WARNING: Updates to nsg-ids and freeform-tags and defined-tags and security-attributes will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
kwargs = {}
if if_match is not None:
@@ -22657,13 +26963,28 @@ def unset_security_assessment_baseline(ctx, from_json, wait_for_state, max_wait_
_details = {}
- if target_ids is not None:
- _details['targetIds'] = cli_util.parse_json_parameter("target_ids", target_ids)
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if nsg_ids is not None:
+ _details['nsgIds'] = cli_util.parse_json_parameter("nsg_ids", nsg_ids)
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+
+ if security_attributes is not None:
+ _details['securityAttributes'] = cli_util.parse_json_parameter("security_attributes", security_attributes)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.unset_security_assessment_baseline(
- security_assessment_id=security_assessment_id,
- unset_security_assessment_baseline_details=_details,
+ result = client.update_data_safe_private_endpoint(
+ data_safe_private_endpoint_id=data_safe_private_endpoint_id,
+ update_data_safe_private_endpoint_details=_details,
**kwargs
)
if wait_for_state:
@@ -22696,22 +27017,33 @@ def unset_security_assessment_baseline(ctx, from_json, wait_for_state, max_wait_
cli_util.render_response(result, ctx)
-@user_assessment_group.command(name=cli_util.override('data_safe.unset_user_assessment_baseline.command_name', 'unset-user-assessment-baseline'), help=u"""Removes the baseline setting for the saved user assessment associated with the targetId passed via body. If no body or empty body is passed then the baseline settings of all the saved user assessments pertaining to the baseline assessment OCID provided in the path will be removed. Sets the if-match parameter to the value of the etag from a previous GET or POST response for that resource. \n[Command Reference](unsetUserAssessmentBaseline)""")
-@cli_util.option('--user-assessment-id', required=True, help=u"""The OCID of the user assessment.""")
+@database_security_config_group.command(name=cli_util.override('data_safe.update_database_security_config.command_name', 'update'), help=u"""Updates the database security configuration. \n[Command Reference](updateDatabaseSecurityConfig)""")
+@cli_util.option('--database-security-config-id', required=True, help=u"""The OCID of the database security configuration resource.""")
+@cli_util.option('--display-name', help=u"""The display name of the database security config. The name does not have to be unique, and it is changeable.""")
+@cli_util.option('--description', help=u"""The description of the security policy.""")
+@cli_util.option('--sql-firewall-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.option('--target-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database target OCIDs for which the user intends to unset the baseline.""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.get_cli_json_input_option({'sql-firewall-config': {'module': 'data_safe', 'class': 'UpdateSqlFirewallConfigDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'target-ids': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'sql-firewall-config': {'module': 'data_safe', 'class': 'UpdateSqlFirewallConfigDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def unset_user_assessment_baseline(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, user_assessment_id, if_match, target_ids):
+def update_database_security_config(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, database_security_config_id, display_name, description, sql_firewall_config, freeform_tags, defined_tags, if_match):
- if isinstance(user_assessment_id, six.string_types) and len(user_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --user-assessment-id cannot be whitespace or empty string')
+ if isinstance(database_security_config_id, six.string_types) and len(database_security_config_id.strip()) == 0:
+ raise click.UsageError('Parameter --database-security-config-id cannot be whitespace or empty string')
+ if not force:
+ if sql_firewall_config or freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to sql-firewall-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
kwargs = {}
if if_match is not None:
@@ -22720,13 +27052,25 @@ def unset_user_assessment_baseline(ctx, from_json, wait_for_state, max_wait_seco
_details = {}
- if target_ids is not None:
- _details['targetIds'] = cli_util.parse_json_parameter("target_ids", target_ids)
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if sql_firewall_config is not None:
+ _details['sqlFirewallConfig'] = cli_util.parse_json_parameter("sql_firewall_config", sql_firewall_config)
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.unset_user_assessment_baseline(
- user_assessment_id=user_assessment_id,
- unset_user_assessment_baseline_details=_details,
+ result = client.update_database_security_config(
+ database_security_config_id=database_security_config_id,
+ update_database_security_config_details=_details,
**kwargs
)
if wait_for_state:
@@ -22759,32 +27103,28 @@ def unset_user_assessment_baseline(ctx, from_json, wait_for_state, max_wait_seco
cli_util.render_response(result, ctx)
-@alert_group.command(name=cli_util.override('data_safe.update_alert.command_name', 'update'), help=u"""Updates the status of the specified alert. \n[Command Reference](updateAlert)""")
-@cli_util.option('--alert-id', required=True, help=u"""The OCID of alert.""")
-@cli_util.option('--comment', help=u"""A comment can be entered to track the alert changes done by the user.""")
-@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["OPEN", "CLOSED"]), help=u"""The status of the alert.""")
-@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)
+@finding_group.command(name=cli_util.override('data_safe.update_finding.command_name', 'update'), help=u"""Updates one or more attributes of the specified finding. \n[Command Reference](updateFinding)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
+@cli_util.option('--finding-key', required=True, help=u"""The unique key that identifies the finding. It is a string and unique within a security assessment.""")
+@cli_util.option('--severity', help=u"""The severity of the finding as defined or changed by the user.""")
+@cli_util.option('--justification', help=u"""User provided reason for accepting or modifying this finding if they choose to do so.""")
+@cli_util.option('--time-valid-until', type=custom_types.CLI_DATETIME, help=u"""The time until which the change in severity (deferred / modified) got the given finding is valid.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@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(["UPDATING", "SUCCEEDED", "FAILED"]), 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 UPDATING --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
-@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
-@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_safe', 'class': 'Alert'})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def update_alert(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, alert_id, comment, status, freeform_tags, defined_tags, if_match):
+def update_finding(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, finding_key, severity, justification, time_valid_until, if_match):
- if isinstance(alert_id, six.string_types) and len(alert_id.strip()) == 0:
- raise click.UsageError('Parameter --alert-id cannot be whitespace or empty string')
- if not force:
- if freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
- ctx.abort()
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+
+ if isinstance(finding_key, six.string_types) and len(finding_key.strip()) == 0:
+ raise click.UsageError('Parameter --finding-key cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
@@ -22793,55 +27133,60 @@ def update_alert(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_i
_details = {}
- if comment is not None:
- _details['comment'] = comment
-
- if status is not None:
- _details['status'] = status
+ if severity is not None:
+ _details['severity'] = severity
- if freeform_tags is not None:
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+ if justification is not None:
+ _details['justification'] = justification
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if time_valid_until is not None:
+ _details['timeValidUntil'] = time_valid_until
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_alert(
- alert_id=alert_id,
- update_alert_details=_details,
+ result = client.update_finding(
+ security_assessment_id=security_assessment_id,
+ finding_key=finding_key,
+ update_finding_details=_details,
**kwargs
)
if wait_for_state:
- if hasattr(client, 'get_alert') and callable(getattr(client, 'get_alert')):
+ 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 resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
- result = oci.wait_until(client, client.get_alert(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
+ 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 resource 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. 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)
+ 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 resource to enter the specified state', file=sys.stderr)
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
cli_util.render_response(result, ctx)
-@alert_policy_group.command(name=cli_util.override('data_safe.update_alert_policy.command_name', 'update'), help=u"""Updates the specified alert policy . \n[Command Reference](updateAlertPolicy)""")
-@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
-@cli_util.option('--display-name', help=u"""The display name of the alert policy. The name does not have to be unique, and it's changeable.""")
-@cli_util.option('--description', help=u"""The description of the alert policy.""")
-@cli_util.option('--severity', type=custom_types.CliCaseInsensitiveChoice(["CRITICAL", "HIGH", "MEDIUM", "LOW", "EVALUATE"]), help=u"""Severity level of the alert raised by this policy.""")
+@library_masking_format_group.command(name=cli_util.override('data_safe.update_library_masking_format.command_name', 'update'), help=u"""Updates one or more attributes of the specified library masking format. Note that updating the formatEntries attribute replaces all the existing masking format entries with the specified format entries. \n[Command Reference](updateLibraryMaskingFormat)""")
+@cli_util.option('--library-masking-format-id', required=True, help=u"""The OCID of the library masking format.""")
+@cli_util.option('--display-name', help=u"""The display name of the library masking format. The name does not have to be unique, and it's changeable.""")
+@cli_util.option('--description', help=u"""The description of the library masking format.""")
+@cli_util.option('--sensitive-type-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of OCIDs of the sensitive types compatible with the library masking format.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--format-entries', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of format entries. The combined output of all the format entries is used for masking.
+
+This option is a JSON list with items of type FormatEntry. For documentation on FormatEntry please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/FormatEntry.""" + 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)
@@ -22851,18 +27196,18 @@ def update_alert(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_i
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'sensitive-type-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'format-entries': {'module': 'data_safe', 'class': 'list[FormatEntry]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'sensitive-type-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'format-entries': {'module': 'data_safe', 'class': 'list[FormatEntry]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_alert_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, alert_policy_id, display_name, description, severity, freeform_tags, defined_tags, if_match):
+def update_library_masking_format(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, library_masking_format_id, display_name, description, sensitive_type_ids, format_entries, freeform_tags, defined_tags, if_match):
- if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --alert-policy-id cannot be whitespace or empty string')
+ if isinstance(library_masking_format_id, six.string_types) and len(library_masking_format_id.strip()) == 0:
+ raise click.UsageError('Parameter --library-masking-format-id cannot be whitespace or empty string')
if not force:
- if freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if sensitive_type_ids or format_entries or freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to sensitive-type-ids and format-entries and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -22878,8 +27223,11 @@ def update_alert_policy(ctx, from_json, force, wait_for_state, max_wait_seconds,
if description is not None:
_details['description'] = description
- if severity is not None:
- _details['severity'] = severity
+ if sensitive_type_ids is not None:
+ _details['sensitiveTypeIds'] = cli_util.parse_json_parameter("sensitive_type_ids", sensitive_type_ids)
+
+ if format_entries is not None:
+ _details['formatEntries'] = cli_util.parse_json_parameter("format_entries", format_entries)
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -22888,9 +27236,9 @@ def update_alert_policy(ctx, from_json, force, wait_for_state, max_wait_seconds,
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_alert_policy(
- alert_policy_id=alert_policy_id,
- update_alert_policy_details=_details,
+ result = client.update_library_masking_format(
+ library_masking_format_id=library_masking_format_id,
+ update_library_masking_format_details=_details,
**kwargs
)
if wait_for_state:
@@ -22923,28 +27271,37 @@ def update_alert_policy(ctx, from_json, force, wait_for_state, max_wait_seconds,
cli_util.render_response(result, ctx)
-@alert_policy_rule_group.command(name=cli_util.override('data_safe.update_alert_policy_rule.command_name', 'update'), help=u"""Updates the specified alert policy rule. \n[Command Reference](updateAlertPolicyRule)""")
-@cli_util.option('--alert-policy-id', required=True, help=u"""The OCID of the alert policy.""")
-@cli_util.option('--rule-key', required=True, help=u"""The key of the alert policy rule.""")
-@cli_util.option('--description', help=u"""Describes the alert policy rule.""")
-@cli_util.option('--expression', help=u"""The conditional expression of the alert policy rule which evaluates to boolean value.""")
-@cli_util.option('--display-name', help=u"""The display name of the alert policy rule.""")
+@masking_column_group.command(name=cli_util.override('data_safe.update_masking_column.command_name', 'update'), help=u"""Updates one or more attributes of the specified masking column. Note that updating the maskingFormats attribute replaces the currently assigned masking formats with the specified masking formats. \n[Command Reference](updateMaskingColumn)""")
+@cli_util.option('--masking-column-key', required=True, help=u"""The unique key that identifies the masking column. It's numeric and unique within a masking policy.""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--object-type', type=custom_types.CliCaseInsensitiveChoice(["TABLE", "EDITIONING_VIEW"]), help=u"""The type of the object that contains the database column.""")
+@cli_util.option('--masking-column-group', help=u"""The group of the masking column. It's a masking group identifier and can be any string of acceptable length. All the columns in a group are masked together to ensure that the masked data across these columns continue to retain the same logical relationship. For more details, check Group Masking in the Data Safe documentation.""")
+@cli_util.option('--sensitive-type-id', help=u"""The OCID of the sensitive type to be associated with the masking column. Note that there will be no change in assigned masking format when sensitive type is changed.""")
+@cli_util.option('--is-masking-enabled', type=click.BOOL, help=u"""Indicates whether data masking is enabled for the masking column. Set it to false if you don't want to mask the column.""")
+@cli_util.option('--masking-formats', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The masking formats to be assigned to the masking column. You can specify a condition as part of each masking format. It enables you to do conditional masking so that you can mask the column data values differently using different masking formats and the associated conditions. A masking format can have one or more format entries. The combined output of all the format entries is used for masking. It provides the flexibility to define a masking format that can generate different parts of a data value separately and then combine them to get the final data value for masking.
+
+This option is a JSON list with items of type MaskingFormat. For documentation on MaskingFormat please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/MaskingFormat.""" + 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", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'masking-formats': {'module': 'data_safe', 'class': 'list[MaskingFormat]'}})
@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={'masking-formats': {'module': 'data_safe', 'class': 'list[MaskingFormat]'}})
@cli_util.wrap_exceptions
-def update_alert_policy_rule(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, alert_policy_id, rule_key, description, expression, display_name, if_match):
+def update_masking_column(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_column_key, masking_policy_id, object_type, masking_column_group, sensitive_type_id, is_masking_enabled, masking_formats, if_match):
- if isinstance(alert_policy_id, six.string_types) and len(alert_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --alert-policy-id cannot be whitespace or empty string')
+ if isinstance(masking_column_key, six.string_types) and len(masking_column_key.strip()) == 0:
+ raise click.UsageError('Parameter --masking-column-key cannot be whitespace or empty string')
- if isinstance(rule_key, six.string_types) and len(rule_key.strip()) == 0:
- raise click.UsageError('Parameter --rule-key cannot be whitespace or empty string')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if not force:
+ if masking_formats:
+ if not click.confirm("WARNING: Updates to masking-formats will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
kwargs = {}
if if_match is not None:
@@ -22953,20 +27310,26 @@ def update_alert_policy_rule(ctx, from_json, wait_for_state, max_wait_seconds, w
_details = {}
- if description is not None:
- _details['description'] = description
+ if object_type is not None:
+ _details['objectType'] = object_type
- if expression is not None:
- _details['expression'] = expression
+ if masking_column_group is not None:
+ _details['maskingColumnGroup'] = masking_column_group
- if display_name is not None:
- _details['displayName'] = display_name
+ if sensitive_type_id is not None:
+ _details['sensitiveTypeId'] = sensitive_type_id
+
+ if is_masking_enabled is not None:
+ _details['isMaskingEnabled'] = is_masking_enabled
+
+ if masking_formats is not None:
+ _details['maskingFormats'] = cli_util.parse_json_parameter("masking_formats", masking_formats)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_alert_policy_rule(
- alert_policy_id=alert_policy_id,
- rule_key=rule_key,
- update_alert_policy_rule_details=_details,
+ result = client.update_masking_column(
+ masking_column_key=masking_column_key,
+ masking_policy_id=masking_policy_id,
+ update_masking_column_details=_details,
**kwargs
)
if wait_for_state:
@@ -22999,11 +27362,18 @@ def update_alert_policy_rule(ctx, from_json, wait_for_state, max_wait_seconds, w
cli_util.render_response(result, ctx)
-@attribute_set_group.command(name=cli_util.override('data_safe.update_attribute_set.command_name', 'update'), help=u"""Updates an attribute set. \n[Command Reference](updateAttributeSet)""")
-@cli_util.option('--attribute-set-id', required=True, help=u"""OCID of an attribute set.""")
-@cli_util.option('--display-name', help=u"""The display name of an attribute set. The name does not have to be unique, and is changeable.""")
-@cli_util.option('--description', help=u"""The description of an attribute set.""")
-@cli_util.option('--attribute-set-values', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of attribute set values that will replace existing values.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@masking_policy_group.command(name=cli_util.override('data_safe.update_masking_policy.command_name', 'update'), help=u"""Updates one or more attributes of the specified masking policy. \n[Command Reference](updateMaskingPolicy)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the masking policy. The name does not have to be unique, and it's changeable.""")
+@cli_util.option('--description', help=u"""The description of the masking policy.""")
+@cli_util.option('--is-drop-temp-tables-enabled', type=click.BOOL, help=u"""Indicates if the temporary tables created during a masking operation should be dropped after masking. It's enabled by default. Set this attribute to false to preserve the temporary tables. Masking creates temporary tables that map the original sensitive data values to mask values. By default, these temporary tables are dropped after masking. But, in some cases, you may want to preserve this information to track how masking changed your data. Note that doing so compromises security. These tables must be dropped before the database is available for unprivileged users.""")
+@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a masking operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, masking disables redo logging and flashback logging to purge any original unmasked data from logs. However, in certain circumstances when you only want to test masking, rollback changes, and retry masking, you could enable logging and use a flashback database to retrieve the original unmasked data after it has been masked.""")
+@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The masking process gathers statistics on masked database tables after masking completes.""")
+@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data masking. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve masking performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism.""")
+@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data masking. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after masking completes.""")
+@cli_util.option('--pre-masking-script', help=u"""A pre-masking script, which can contain SQL and PL/SQL statements. It's executed before the core masking script generated using the masking policy. It's usually used to perform any preparation or prerequisite work before masking data.""")
+@cli_util.option('--post-masking-script', help=u"""A post-masking script, which can contain SQL and PL/SQL statements. It's executed after the core masking script generated using the masking policy. It's usually used to perform additional transformation or cleanup work after masking.""")
+@cli_util.option('--column-source', 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)
@@ -23013,18 +27383,18 @@ def update_alert_policy_rule(ctx, from_json, wait_for_state, max_wait_seconds, w
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'attribute-set-values': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'column-source': {'module': 'data_safe', 'class': 'UpdateColumnSourceDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'attribute-set-values': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'column-source': {'module': 'data_safe', 'class': 'UpdateColumnSourceDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_attribute_set(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, attribute_set_id, display_name, description, attribute_set_values, freeform_tags, defined_tags, if_match):
+def update_masking_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, display_name, description, is_drop_temp_tables_enabled, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, pre_masking_script, post_masking_script, column_source, freeform_tags, defined_tags, if_match):
- if isinstance(attribute_set_id, six.string_types) and len(attribute_set_id.strip()) == 0:
- raise click.UsageError('Parameter --attribute-set-id cannot be whitespace or empty string')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
if not force:
- if attribute_set_values or freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to attribute-set-values and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if column_source or freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to column-source and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -23040,8 +27410,29 @@ def update_attribute_set(ctx, from_json, force, wait_for_state, max_wait_seconds
if description is not None:
_details['description'] = description
- if attribute_set_values is not None:
- _details['attributeSetValues'] = cli_util.parse_json_parameter("attribute_set_values", attribute_set_values)
+ if is_drop_temp_tables_enabled is not None:
+ _details['isDropTempTablesEnabled'] = is_drop_temp_tables_enabled
+
+ if is_redo_logging_enabled is not None:
+ _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
+
+ if is_refresh_stats_enabled is not None:
+ _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
+
+ if parallel_degree is not None:
+ _details['parallelDegree'] = parallel_degree
+
+ if recompile is not None:
+ _details['recompile'] = recompile
+
+ if pre_masking_script is not None:
+ _details['preMaskingScript'] = pre_masking_script
+
+ if post_masking_script is not None:
+ _details['postMaskingScript'] = post_masking_script
+
+ if column_source is not None:
+ _details['columnSource'] = cli_util.parse_json_parameter("column_source", column_source)
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -23050,9 +27441,9 @@ def update_attribute_set(ctx, from_json, force, wait_for_state, max_wait_seconds
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_attribute_set(
- attribute_set_id=attribute_set_id,
- update_attribute_set_details=_details,
+ result = client.update_masking_policy(
+ masking_policy_id=masking_policy_id,
+ update_masking_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -23083,12 +27474,20 @@ def update_attribute_set(ctx, from_json, force, wait_for_state, max_wait_seconds
else:
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
cli_util.render_response(result, ctx)
-
-
-@audit_archive_retrieval_group.command(name=cli_util.override('data_safe.update_audit_archive_retrieval.command_name', 'update'), help=u"""Updates the audit archive retrieval. \n[Command Reference](updateAuditArchiveRetrieval)""")
-@cli_util.option('--audit-archive-retrieval-id', required=True, help=u"""OCID of the archive retrieval.""")
-@cli_util.option('--display-name', help=u"""The display name of the archive retrieval. The name does not have to be unique, and is changeable.""")
-@cli_util.option('--description', help=u"""Description of the archive retrieval.""")
+
+
+@masking_policy_group.command(name=cli_util.override('data_safe.update_masking_policy_update_column_source_sdm_details.command_name', 'update-masking-policy-update-column-source-sdm-details'), help=u"""Updates one or more attributes of the specified masking policy. \n[Command Reference](updateMaskingPolicy)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--column-source-sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model to be associated as the column source with the masking policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the masking policy. The name does not have to be unique, and it's changeable.""")
+@cli_util.option('--description', help=u"""The description of the masking policy.""")
+@cli_util.option('--is-drop-temp-tables-enabled', type=click.BOOL, help=u"""Indicates if the temporary tables created during a masking operation should be dropped after masking. It's enabled by default. Set this attribute to false to preserve the temporary tables. Masking creates temporary tables that map the original sensitive data values to mask values. By default, these temporary tables are dropped after masking. But, in some cases, you may want to preserve this information to track how masking changed your data. Note that doing so compromises security. These tables must be dropped before the database is available for unprivileged users.""")
+@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a masking operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, masking disables redo logging and flashback logging to purge any original unmasked data from logs. However, in certain circumstances when you only want to test masking, rollback changes, and retry masking, you could enable logging and use a flashback database to retrieve the original unmasked data after it has been masked.""")
+@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The masking process gathers statistics on masked database tables after masking completes.""")
+@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data masking. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve masking performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism.""")
+@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data masking. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after masking completes.""")
+@cli_util.option('--pre-masking-script', help=u"""A pre-masking script, which can contain SQL and PL/SQL statements. It's executed before the core masking script generated using the masking policy. It's usually used to perform any preparation or prerequisite work before masking data.""")
+@cli_util.option('--post-masking-script', help=u"""A post-masking script, which can contain SQL and PL/SQL statements. It's executed after the core masking script generated using the masking policy. It's usually used to perform additional transformation or cleanup work after masking.""")
@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)
@@ -23103,10 +27502,10 @@ def update_attribute_set(ctx, from_json, force, wait_for_state, max_wait_seconds
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_audit_archive_retrieval(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_archive_retrieval_id, display_name, description, freeform_tags, defined_tags, if_match):
+def update_masking_policy_update_column_source_sdm_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, column_source_sensitive_data_model_id, display_name, description, is_drop_temp_tables_enabled, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, pre_masking_script, post_masking_script, freeform_tags, defined_tags, if_match):
- if isinstance(audit_archive_retrieval_id, six.string_types) and len(audit_archive_retrieval_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-archive-retrieval-id cannot be whitespace or empty string')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
if not force:
if freeform_tags or defined_tags:
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
@@ -23118,6 +27517,8 @@ def update_audit_archive_retrieval(ctx, from_json, force, wait_for_state, max_wa
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['columnSource'] = {}
+ _details['columnSource']['sensitiveDataModelId'] = column_source_sensitive_data_model_id
if display_name is not None:
_details['displayName'] = display_name
@@ -23125,16 +27526,39 @@ def update_audit_archive_retrieval(ctx, from_json, force, wait_for_state, max_wa
if description is not None:
_details['description'] = description
+ if is_drop_temp_tables_enabled is not None:
+ _details['isDropTempTablesEnabled'] = is_drop_temp_tables_enabled
+
+ if is_redo_logging_enabled is not None:
+ _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
+
+ if is_refresh_stats_enabled is not None:
+ _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
+
+ if parallel_degree is not None:
+ _details['parallelDegree'] = parallel_degree
+
+ if recompile is not None:
+ _details['recompile'] = recompile
+
+ if pre_masking_script is not None:
+ _details['preMaskingScript'] = pre_masking_script
+
+ if post_masking_script is not None:
+ _details['postMaskingScript'] = post_masking_script
+
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['columnSource']['columnSource'] = 'SENSITIVE_DATA_MODEL'
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_audit_archive_retrieval(
- audit_archive_retrieval_id=audit_archive_retrieval_id,
- update_audit_archive_retrieval_details=_details,
+ result = client.update_masking_policy(
+ masking_policy_id=masking_policy_id,
+ update_masking_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -23167,10 +27591,18 @@ def update_audit_archive_retrieval(ctx, from_json, force, wait_for_state, max_wa
cli_util.render_response(result, ctx)
-@audit_policy_group.command(name=cli_util.override('data_safe.update_audit_policy.command_name', 'update'), help=u"""Updates the audit policy. \n[Command Reference](updateAuditPolicy)""")
-@cli_util.option('--audit-policy-id', required=True, help=u"""Unique audit policy identifier.""")
-@cli_util.option('--display-name', help=u"""The display name of the audit policy. The name does not have to be unique, and it is changeable.""")
-@cli_util.option('--description', help=u"""The description of the audit policy.""")
+@masking_policy_group.command(name=cli_util.override('data_safe.update_masking_policy_update_column_source_target_details.command_name', 'update-masking-policy-update-column-source-target-details'), help=u"""Updates one or more attributes of the specified masking policy. \n[Command Reference](updateMaskingPolicy)""")
+@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
+@cli_util.option('--column-source-target-id', required=True, help=u"""The OCID of the target database to be associated as the column source with the masking policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the masking policy. The name does not have to be unique, and it's changeable.""")
+@cli_util.option('--description', help=u"""The description of the masking policy.""")
+@cli_util.option('--is-drop-temp-tables-enabled', type=click.BOOL, help=u"""Indicates if the temporary tables created during a masking operation should be dropped after masking. It's enabled by default. Set this attribute to false to preserve the temporary tables. Masking creates temporary tables that map the original sensitive data values to mask values. By default, these temporary tables are dropped after masking. But, in some cases, you may want to preserve this information to track how masking changed your data. Note that doing so compromises security. These tables must be dropped before the database is available for unprivileged users.""")
+@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a masking operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, masking disables redo logging and flashback logging to purge any original unmasked data from logs. However, in certain circumstances when you only want to test masking, rollback changes, and retry masking, you could enable logging and use a flashback database to retrieve the original unmasked data after it has been masked.""")
+@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The masking process gathers statistics on masked database tables after masking completes.""")
+@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data masking. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve masking performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism.""")
+@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data masking. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after masking completes.""")
+@cli_util.option('--pre-masking-script', help=u"""A pre-masking script, which can contain SQL and PL/SQL statements. It's executed before the core masking script generated using the masking policy. It's usually used to perform any preparation or prerequisite work before masking data.""")
+@cli_util.option('--post-masking-script', help=u"""A post-masking script, which can contain SQL and PL/SQL statements. It's executed after the core masking script generated using the masking policy. It's usually used to perform additional transformation or cleanup work after masking.""")
@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)
@@ -23185,10 +27617,10 @@ def update_audit_archive_retrieval(ctx, from_json, force, wait_for_state, max_wa
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_audit_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_policy_id, display_name, description, freeform_tags, defined_tags, if_match):
+def update_masking_policy_update_column_source_target_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, column_source_target_id, display_name, description, is_drop_temp_tables_enabled, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, pre_masking_script, post_masking_script, freeform_tags, defined_tags, if_match):
- if isinstance(audit_policy_id, six.string_types) and len(audit_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-policy-id cannot be whitespace or empty string')
+ if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
if not force:
if freeform_tags or defined_tags:
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
@@ -23200,6 +27632,8 @@ def update_audit_policy(ctx, from_json, force, wait_for_state, max_wait_seconds,
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['columnSource'] = {}
+ _details['columnSource']['targetId'] = column_source_target_id
if display_name is not None:
_details['displayName'] = display_name
@@ -23207,16 +27641,39 @@ def update_audit_policy(ctx, from_json, force, wait_for_state, max_wait_seconds,
if description is not None:
_details['description'] = description
+ if is_drop_temp_tables_enabled is not None:
+ _details['isDropTempTablesEnabled'] = is_drop_temp_tables_enabled
+
+ if is_redo_logging_enabled is not None:
+ _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
+
+ if is_refresh_stats_enabled is not None:
+ _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
+
+ if parallel_degree is not None:
+ _details['parallelDegree'] = parallel_degree
+
+ if recompile is not None:
+ _details['recompile'] = recompile
+
+ if pre_masking_script is not None:
+ _details['preMaskingScript'] = pre_masking_script
+
+ if post_masking_script is not None:
+ _details['postMaskingScript'] = post_masking_script
+
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['columnSource']['columnSource'] = 'TARGET'
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_audit_policy(
- audit_policy_id=audit_policy_id,
- update_audit_policy_details=_details,
+ result = client.update_masking_policy(
+ masking_policy_id=masking_policy_id,
+ update_masking_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -23249,12 +27706,10 @@ def update_audit_policy(ctx, from_json, force, wait_for_state, max_wait_seconds,
cli_util.render_response(result, ctx)
-@audit_profile_group.command(name=cli_util.override('data_safe.update_audit_profile.command_name', 'update'), help=u"""Updates one or more attributes of the specified audit profile. \n[Command Reference](updateAuditProfile)""")
-@cli_util.option('--audit-profile-id', required=True, help=u"""The OCID of the audit.""")
-@cli_util.option('--description', help=u"""The description of the audit profile.""")
-@cli_util.option('--display-name', help=u"""The display name of the audit profile. The name does not have to be unique, and it's updatable.""")
-@cli_util.option('--is-paid-usage-enabled', type=click.BOOL, help=u"""Indicates if you want to continue collecting audit records beyond the free limit of one million audit records per month per target database, potentially incurring additional charges. The default value is inherited from the global settings. You can change at the global level or at the target level.""")
-@cli_util.option('--is-override-global-paid-usage', type=click.BOOL, help=u"""Indicates whether audit paid usage settings specified at the target database level override both the global settings and the target group level paid usage settings. Enabling paid usage continues the collection of audit records beyond the free limit of one million audit records per month per target database, potentially incurring additional charges. For more information, see [Data Safe Price List].""")
+@on_prem_connector_group.command(name=cli_util.override('data_safe.update_on_prem_connector.command_name', 'update'), help=u"""Updates one or more attributes of the specified on-premises connector. \n[Command Reference](updateOnPremConnector)""")
+@cli_util.option('--on-prem-connector-id', required=True, help=u"""The OCID of the on-premises connector.""")
+@cli_util.option('--display-name', help=u"""The display name of the on-premises connector. The name does not have to be unique, and it's changeable.""")
+@cli_util.option('--description', help=u"""The description of the on-premises connector.""")
@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)
@@ -23269,10 +27724,10 @@ def update_audit_policy(ctx, from_json, force, wait_for_state, max_wait_seconds,
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_audit_profile(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_profile_id, description, display_name, is_paid_usage_enabled, is_override_global_paid_usage, freeform_tags, defined_tags, if_match):
+def update_on_prem_connector(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, on_prem_connector_id, display_name, description, freeform_tags, defined_tags, if_match):
- if isinstance(audit_profile_id, six.string_types) and len(audit_profile_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-profile-id cannot be whitespace or empty string')
+ if isinstance(on_prem_connector_id, six.string_types) and len(on_prem_connector_id.strip()) == 0:
+ raise click.UsageError('Parameter --on-prem-connector-id cannot be whitespace or empty string')
if not force:
if freeform_tags or defined_tags:
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
@@ -23285,17 +27740,11 @@ def update_audit_profile(ctx, from_json, force, wait_for_state, max_wait_seconds
_details = {}
- if description is not None:
- _details['description'] = description
-
if display_name is not None:
_details['displayName'] = display_name
- if is_paid_usage_enabled is not None:
- _details['isPaidUsageEnabled'] = is_paid_usage_enabled
-
- if is_override_global_paid_usage is not None:
- _details['isOverrideGlobalPaidUsage'] = is_override_global_paid_usage
+ 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)
@@ -23304,9 +27753,9 @@ def update_audit_profile(ctx, from_json, force, wait_for_state, max_wait_seconds
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_audit_profile(
- audit_profile_id=audit_profile_id,
- update_audit_profile_details=_details,
+ result = client.update_on_prem_connector(
+ on_prem_connector_id=on_prem_connector_id,
+ update_on_prem_connector_details=_details,
**kwargs
)
if wait_for_state:
@@ -23339,34 +27788,22 @@ def update_audit_profile(ctx, from_json, force, wait_for_state, max_wait_seconds
cli_util.render_response(result, ctx)
-@audit_trail_group.command(name=cli_util.override('data_safe.update_audit_trail.command_name', 'update'), help=u"""Updates one or more attributes of the specified audit trail. \n[Command Reference](updateAuditTrail)""")
-@cli_util.option('--audit-trail-id', required=True, help=u"""The OCID of the audit trail.""")
-@cli_util.option('--description', help=u"""The description of the audit trail.""")
-@cli_util.option('--display-name', help=u"""The display name of the audit trail. The name does not have to be unique, and it's updatable.""")
-@cli_util.option('--is-auto-purge-enabled', type=click.BOOL, help=u"""Indicates if auto purge is enabled on the target database, which helps delete audit data in the target database every seven days so that the database's audit trail does not become too large.""")
-@cli_util.option('--can-update-last-archive-time-on-target', type=click.BOOL, help=u"""Indicates if the Datasafe updates last archive time on target database. If isAutoPurgeEnabled field is enabled, this field must be true.""")
-@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)
+@on_prem_connector_group.command(name=cli_util.override('data_safe.update_on_prem_connector_wallet.command_name', 'update-on-prem-connector-wallet'), help=u"""Updates the wallet for the specified on-premises connector to a new version. \n[Command Reference](updateOnPremConnectorWallet)""")
+@cli_util.option('--on-prem-connector-id', required=True, help=u"""The OCID of the on-premises connector.""")
+@cli_util.option('--is-update', type=click.BOOL, help=u"""Indicates whether to update or not. If false, the wallet will not be updated. Default is false.""")
@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", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@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={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def update_audit_trail(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, audit_trail_id, description, display_name, is_auto_purge_enabled, can_update_last_archive_time_on_target, freeform_tags, defined_tags, if_match):
+def update_on_prem_connector_wallet(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, on_prem_connector_id, is_update, if_match):
- if isinstance(audit_trail_id, six.string_types) and len(audit_trail_id.strip()) == 0:
- raise click.UsageError('Parameter --audit-trail-id cannot be whitespace or empty string')
- if not force:
- if freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
- ctx.abort()
+ if isinstance(on_prem_connector_id, six.string_types) and len(on_prem_connector_id.strip()) == 0:
+ raise click.UsageError('Parameter --on-prem-connector-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
@@ -23375,28 +27812,13 @@ def update_audit_trail(ctx, from_json, force, wait_for_state, max_wait_seconds,
_details = {}
- if description is not None:
- _details['description'] = description
-
- if display_name is not None:
- _details['displayName'] = display_name
-
- if is_auto_purge_enabled is not None:
- _details['isAutoPurgeEnabled'] = is_auto_purge_enabled
-
- if can_update_last_archive_time_on_target is not None:
- _details['canUpdateLastArchiveTimeOnTarget'] = can_update_last_archive_time_on_target
-
- 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 is_update is not None:
+ _details['isUpdate'] = is_update
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_audit_trail(
- audit_trail_id=audit_trail_id,
- update_audit_trail_details=_details,
+ result = client.update_on_prem_connector_wallet(
+ on_prem_connector_id=on_prem_connector_id,
+ update_on_prem_connector_wallet_details=_details,
**kwargs
)
if wait_for_state:
@@ -23429,36 +27851,33 @@ def update_audit_trail(ctx, from_json, force, wait_for_state, max_wait_seconds,
cli_util.render_response(result, ctx)
-@crypto_assessment_group.command(name=cli_util.override('data_safe.update_crypto_assessment.command_name', 'update'), help=u"""Updates one or more attributes of the specified crypto assessment. \n[Command Reference](updateCryptoAssessment)""")
-@cli_util.option('--crypto-assessment-id', required=True, help=u"""The OCID of the crypto assessment.""")
-@cli_util.option('--display-name', help=u"""The display name of the crypto assessment.""")
-@cli_util.option('--schedule', help=u"""Updates the schedule associated with this latest crypto assessment. The schedule uses the format: ;
-
-For v1, the version-specific schedule format is:
-
-Specify either day-of-week for weekly schedules or day-of-month for monthly schedules. Do not specify both. For monthly schedules, day-of-month must be between 1 and 28. If the service generates a default monthly schedule for an assessment created on day 29, 30, or 31 of a month, it uses day 28. Schedule updates are supported only for assessments of type LATEST.""")
-@cli_util.option('--is-assessment-scheduled', type=click.BOOL, help=u"""Indicates whether scheduled execution is active for this latest crypto assessment. When set to true, the existing schedule is used unless a new schedule is provided. When set to false, the schedule value is retained but scheduled execution is paused. Schedule state updates are supported only for assessments of type LATEST.""")
-@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)
+@peer_target_database_group.command(name=cli_util.override('data_safe.update_peer_target_database.command_name', 'update'), help=u"""Updates one or more attributes of the specified Data Safe peer target database. \n[Command Reference](updatePeerTargetDatabase)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@cli_util.option('--peer-target-database-id', required=True, type=click.INT, help=u"""The unique id of the peer target database.""")
+@cli_util.option('--display-name', help=u"""The display name of the peer target database in Data Safe.""")
+@cli_util.option('--description', help=u"""The description of the peer target database in Data Safe.""")
+@cli_util.option('--database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--tls-config', 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)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}})
@cli_util.wrap_exceptions
-def update_crypto_assessment(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, crypto_assessment_id, display_name, schedule, is_assessment_scheduled, freeform_tags, defined_tags, if_match):
+def update_peer_target_database(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, peer_target_database_id, display_name, description, database_details, tls_config, if_match):
- if isinstance(crypto_assessment_id, six.string_types) and len(crypto_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --crypto-assessment-id cannot be whitespace or empty string')
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+
+ if isinstance(peer_target_database_id, six.string_types) and len(peer_target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --peer-target-database-id cannot be whitespace or empty string')
if not force:
- if freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if database_details or tls_config:
+ if not click.confirm("WARNING: Updates to database-details and tls-config will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -23471,22 +27890,20 @@ def update_crypto_assessment(ctx, from_json, force, wait_for_state, max_wait_sec
if display_name is not None:
_details['displayName'] = display_name
- if schedule is not None:
- _details['schedule'] = schedule
-
- if is_assessment_scheduled is not None:
- _details['isAssessmentScheduled'] = is_assessment_scheduled
+ 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 database_details is not None:
+ _details['databaseDetails'] = cli_util.parse_json_parameter("database_details", database_details)
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if tls_config is not None:
+ _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_crypto_assessment(
- crypto_assessment_id=crypto_assessment_id,
- update_crypto_assessment_details=_details,
+ result = client.update_peer_target_database(
+ target_database_id=target_database_id,
+ peer_target_database_id=peer_target_database_id,
+ update_peer_target_database_details=_details,
**kwargs
)
if wait_for_state:
@@ -23518,34 +27935,38 @@ def update_crypto_assessment(ctx, from_json, force, wait_for_state, max_wait_sec
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
cli_util.render_response(result, ctx)
-
-@data_safe_private_endpoint_group.command(name=cli_util.override('data_safe.update_data_safe_private_endpoint.command_name', 'update'), help=u"""Updates one or more attributes of the specified Data Safe private endpoint. \n[Command Reference](updateDataSafePrivateEndpoint)""")
-@cli_util.option('--data-safe-private-endpoint-id', required=True, help=u"""The OCID of the private endpoint.""")
-@cli_util.option('--display-name', help=u"""The display name of the private endpoint.""")
-@cli_util.option('--description', help=u"""The description of the private endpoint.""")
-@cli_util.option('--nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The OCIDs of the network security groups that the private endpoint belongs to.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
-
-Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--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)
+
+@peer_target_database_group.command(name=cli_util.override('data_safe.update_peer_target_database_installed_database_details.command_name', 'update-peer-target-database-installed-database-details'), help=u"""Updates one or more attributes of the specified Data Safe peer target database. \n[Command Reference](updatePeerTargetDatabase)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@cli_util.option('--peer-target-database-id', required=True, type=click.INT, help=u"""The unique id of the peer target database.""")
+@cli_util.option('--database-details-infrastructure-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""The infrastructure type the database is running on.""")
+@cli_util.option('--database-details-listener-port', required=True, type=click.INT, help=u"""The port number of the database listener.""")
+@cli_util.option('--database-details-service-name', required=True, help=u"""The service name of the database registered as target database.""")
+@cli_util.option('--display-name', help=u"""The display name of the peer target database in Data Safe.""")
+@cli_util.option('--description', help=u"""The description of the peer target database in Data Safe.""")
+@cli_util.option('--tls-config', 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('--database-details-instance-id', help=u"""The OCID of the compute instance on which the database is running.""")
+@cli_util.option('--database-details-ip-addresses', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database host IP Addresses. Fully qualified domain names can be used if connectionType is 'ONPREM_CONNECTOR'.""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'database-details-ip-addresses': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'nsg-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'database-details-ip-addresses': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.wrap_exceptions
-def update_data_safe_private_endpoint(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, data_safe_private_endpoint_id, display_name, description, nsg_ids, freeform_tags, defined_tags, security_attributes, if_match):
+def update_peer_target_database_installed_database_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, peer_target_database_id, database_details_infrastructure_type, database_details_listener_port, database_details_service_name, display_name, description, tls_config, if_match, database_details_instance_id, database_details_ip_addresses):
- if isinstance(data_safe_private_endpoint_id, six.string_types) and len(data_safe_private_endpoint_id.strip()) == 0:
- raise click.UsageError('Parameter --data-safe-private-endpoint-id cannot be whitespace or empty string')
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+
+ if isinstance(peer_target_database_id, six.string_types) and len(peer_target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --peer-target-database-id cannot be whitespace or empty string')
if not force:
- if nsg_ids or freeform_tags or defined_tags or security_attributes:
- if not click.confirm("WARNING: Updates to nsg-ids and freeform-tags and defined-tags and security-attributes will replace any existing values. Are you sure you want to continue?"):
+ if tls_config:
+ if not click.confirm("WARNING: Updates to tls-config will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -23554,6 +27975,10 @@ def update_data_safe_private_endpoint(ctx, from_json, force, wait_for_state, max
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['databaseDetails'] = {}
+ _details['databaseDetails']['infrastructureType'] = database_details_infrastructure_type
+ _details['databaseDetails']['listenerPort'] = database_details_listener_port
+ _details['databaseDetails']['serviceName'] = database_details_service_name
if display_name is not None:
_details['displayName'] = display_name
@@ -23561,22 +27986,22 @@ def update_data_safe_private_endpoint(ctx, from_json, force, wait_for_state, max
if description is not None:
_details['description'] = description
- if nsg_ids is not None:
- _details['nsgIds'] = cli_util.parse_json_parameter("nsg_ids", nsg_ids)
+ if tls_config is not None:
+ _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
- if freeform_tags is not None:
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+ if database_details_instance_id is not None:
+ _details['databaseDetails']['instanceId'] = database_details_instance_id
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if database_details_ip_addresses is not None:
+ _details['databaseDetails']['ipAddresses'] = cli_util.parse_json_parameter("database_details_ip_addresses", database_details_ip_addresses)
- if security_attributes is not None:
- _details['securityAttributes'] = cli_util.parse_json_parameter("security_attributes", security_attributes)
+ _details['databaseDetails']['databaseType'] = 'INSTALLED_DATABASE'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_data_safe_private_endpoint(
- data_safe_private_endpoint_id=data_safe_private_endpoint_id,
- update_data_safe_private_endpoint_details=_details,
+ result = client.update_peer_target_database(
+ target_database_id=target_database_id,
+ peer_target_database_id=peer_target_database_id,
+ update_peer_target_database_details=_details,
**kwargs
)
if wait_for_state:
@@ -23609,32 +28034,34 @@ def update_data_safe_private_endpoint(ctx, from_json, force, wait_for_state, max
cli_util.render_response(result, ctx)
-@database_security_config_group.command(name=cli_util.override('data_safe.update_database_security_config.command_name', 'update'), help=u"""Updates the database security configuration. \n[Command Reference](updateDatabaseSecurityConfig)""")
-@cli_util.option('--database-security-config-id', required=True, help=u"""The OCID of the database security configuration resource.""")
-@cli_util.option('--display-name', help=u"""The display name of the database security config. The name does not have to be unique, and it is changeable.""")
-@cli_util.option('--description', help=u"""The description of the security policy.""")
-@cli_util.option('--sql-firewall-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
-
-Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@peer_target_database_group.command(name=cli_util.override('data_safe.update_peer_target_database_autonomous_database_details.command_name', 'update-peer-target-database-autonomous-database-details'), help=u"""Updates one or more attributes of the specified Data Safe peer target database. \n[Command Reference](updatePeerTargetDatabase)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@cli_util.option('--peer-target-database-id', required=True, type=click.INT, help=u"""The unique id of the peer target database.""")
+@cli_util.option('--database-details-infrastructure-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""The infrastructure type the database is running on.""")
+@cli_util.option('--database-details-autonomous-database-id', required=True, help=u"""The OCID of the Autonomous Database registered as a target database in Data Safe.""")
+@cli_util.option('--display-name', help=u"""The display name of the peer target database in Data Safe.""")
+@cli_util.option('--description', help=u"""The description of the peer target database in Data Safe.""")
+@cli_util.option('--tls-config', 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)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'sql-firewall-config': {'module': 'data_safe', 'class': 'UpdateSqlFirewallConfigDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'sql-firewall-config': {'module': 'data_safe', 'class': 'UpdateSqlFirewallConfigDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}})
@cli_util.wrap_exceptions
-def update_database_security_config(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, database_security_config_id, display_name, description, sql_firewall_config, freeform_tags, defined_tags, if_match):
+def update_peer_target_database_autonomous_database_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, peer_target_database_id, database_details_infrastructure_type, database_details_autonomous_database_id, display_name, description, tls_config, if_match):
- if isinstance(database_security_config_id, six.string_types) and len(database_security_config_id.strip()) == 0:
- raise click.UsageError('Parameter --database-security-config-id cannot be whitespace or empty string')
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+
+ if isinstance(peer_target_database_id, six.string_types) and len(peer_target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --peer-target-database-id cannot be whitespace or empty string')
if not force:
- if sql_firewall_config or freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to sql-firewall-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if tls_config:
+ if not click.confirm("WARNING: Updates to tls-config will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -23643,6 +28070,9 @@ def update_database_security_config(ctx, from_json, force, wait_for_state, max_w
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['databaseDetails'] = {}
+ _details['databaseDetails']['infrastructureType'] = database_details_infrastructure_type
+ _details['databaseDetails']['autonomousDatabaseId'] = database_details_autonomous_database_id
if display_name is not None:
_details['displayName'] = display_name
@@ -23650,19 +28080,16 @@ def update_database_security_config(ctx, from_json, force, wait_for_state, max_w
if description is not None:
_details['description'] = description
- if sql_firewall_config is not None:
- _details['sqlFirewallConfig'] = cli_util.parse_json_parameter("sql_firewall_config", sql_firewall_config)
-
- if freeform_tags is not None:
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+ if tls_config is not None:
+ _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ _details['databaseDetails']['databaseType'] = 'AUTONOMOUS_DATABASE'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_database_security_config(
- database_security_config_id=database_security_config_id,
- update_database_security_config_details=_details,
+ result = client.update_peer_target_database(
+ target_database_id=target_database_id,
+ peer_target_database_id=peer_target_database_id,
+ update_peer_target_database_details=_details,
**kwargs
)
if wait_for_state:
@@ -23695,28 +28122,39 @@ def update_database_security_config(ctx, from_json, force, wait_for_state, max_w
cli_util.render_response(result, ctx)
-@finding_group.command(name=cli_util.override('data_safe.update_finding.command_name', 'update'), help=u"""Updates one or more attributes of the specified finding. \n[Command Reference](updateFinding)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@cli_util.option('--finding-key', required=True, help=u"""The unique key that identifies the finding. It is a string and unique within a security assessment.""")
-@cli_util.option('--severity', help=u"""The severity of the finding as defined or changed by the user.""")
-@cli_util.option('--justification', help=u"""User provided reason for accepting or modifying this finding if they choose to do so.""")
-@cli_util.option('--time-valid-until', type=custom_types.CLI_DATETIME, help=u"""The time until which the change in severity (deferred / modified) got the given finding is valid.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
+@peer_target_database_group.command(name=cli_util.override('data_safe.update_peer_target_database_database_cloud_service_details.command_name', 'update-peer-target-database-database-cloud-service-details'), help=u"""Updates one or more attributes of the specified Data Safe peer target database. \n[Command Reference](updatePeerTargetDatabase)""")
+@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
+@cli_util.option('--peer-target-database-id', required=True, type=click.INT, help=u"""The unique id of the peer target database.""")
+@cli_util.option('--database-details-infrastructure-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""The infrastructure type the database is running on.""")
+@cli_util.option('--display-name', help=u"""The display name of the peer target database in Data Safe.""")
+@cli_util.option('--description', help=u"""The description of the peer target database in Data Safe.""")
+@cli_util.option('--tls-config', 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('--database-details-vm-cluster-id', help=u"""The OCID of the VM cluster in which the database is running.""")
+@cli_util.option('--database-details-db-system-id', help=u"""The OCID of the cloud database registered as a target database in Data Safe.""")
+@cli_util.option('--database-details-pluggable-database-id', help=u"""The OCID of the pluggable database registered as a target database in Data Safe.""")
+@cli_util.option('--database-details-listener-port', type=click.INT, help=u"""The port number of the database listener.""")
+@cli_util.option('--database-details-service-name', help=u"""The database service name.""")
+@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}})
@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={'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}})
@cli_util.wrap_exceptions
-def update_finding(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, finding_key, severity, justification, time_valid_until, if_match):
+def update_peer_target_database_database_cloud_service_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, peer_target_database_id, database_details_infrastructure_type, display_name, description, tls_config, if_match, database_details_vm_cluster_id, database_details_db_system_id, database_details_pluggable_database_id, database_details_listener_port, database_details_service_name):
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+ if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
- if isinstance(finding_key, six.string_types) and len(finding_key.strip()) == 0:
- raise click.UsageError('Parameter --finding-key cannot be whitespace or empty string')
+ if isinstance(peer_target_database_id, six.string_types) and len(peer_target_database_id.strip()) == 0:
+ raise click.UsageError('Parameter --peer-target-database-id cannot be whitespace or empty string')
+ if not force:
+ if tls_config:
+ if not click.confirm("WARNING: Updates to tls-config will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
kwargs = {}
if if_match is not None:
@@ -23724,21 +28162,40 @@ def update_finding(ctx, from_json, wait_for_state, max_wait_seconds, wait_interv
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['databaseDetails'] = {}
+ _details['databaseDetails']['infrastructureType'] = database_details_infrastructure_type
- if severity is not None:
- _details['severity'] = severity
+ if display_name is not None:
+ _details['displayName'] = display_name
- if justification is not None:
- _details['justification'] = justification
+ if description is not None:
+ _details['description'] = description
- if time_valid_until is not None:
- _details['timeValidUntil'] = time_valid_until
+ if tls_config is not None:
+ _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+
+ if database_details_vm_cluster_id is not None:
+ _details['databaseDetails']['vmClusterId'] = database_details_vm_cluster_id
+
+ if database_details_db_system_id is not None:
+ _details['databaseDetails']['dbSystemId'] = database_details_db_system_id
+
+ if database_details_pluggable_database_id is not None:
+ _details['databaseDetails']['pluggableDatabaseId'] = database_details_pluggable_database_id
+
+ if database_details_listener_port is not None:
+ _details['databaseDetails']['listenerPort'] = database_details_listener_port
+
+ if database_details_service_name is not None:
+ _details['databaseDetails']['serviceName'] = database_details_service_name
+
+ _details['databaseDetails']['databaseType'] = 'DATABASE_CLOUD_SERVICE'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_finding(
- security_assessment_id=security_assessment_id,
- finding_key=finding_key,
- update_finding_details=_details,
+ result = client.update_peer_target_database(
+ target_database_id=target_database_id,
+ peer_target_database_id=peer_target_database_id,
+ update_peer_target_database_details=_details,
**kwargs
)
if wait_for_state:
@@ -23771,36 +28228,30 @@ def update_finding(ctx, from_json, wait_for_state, max_wait_seconds, wait_interv
cli_util.render_response(result, ctx)
-@library_masking_format_group.command(name=cli_util.override('data_safe.update_library_masking_format.command_name', 'update'), help=u"""Updates one or more attributes of the specified library masking format. Note that updating the formatEntries attribute replaces all the existing masking format entries with the specified format entries. \n[Command Reference](updateLibraryMaskingFormat)""")
-@cli_util.option('--library-masking-format-id', required=True, help=u"""The OCID of the library masking format.""")
-@cli_util.option('--display-name', help=u"""The display name of the library masking format. The name does not have to be unique, and it's changeable.""")
-@cli_util.option('--description', help=u"""The description of the library masking format.""")
-@cli_util.option('--sensitive-type-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of OCIDs of the sensitive types compatible with the library masking format.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--format-entries', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of format entries. The combined output of all the format entries is used for masking.
-
-This option is a JSON list with items of type FormatEntry. For documentation on FormatEntry please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/FormatEntry.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
-
-Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@subsetting_rule_processing_chain_object_summary_group.command(name=cli_util.override('data_safe.update_processing_chain_object.command_name', 'update-processing-chain-object'), help=u"""Updates one or more attributes of the specified processing chain object. \n[Command Reference](updateProcessingChainObject)""")
+@cli_util.option('--processing-chain-object-key', required=True, help=u"""The unique key that identifies the processing chain object. It's numeric and unique within a processing chain.""")
+@cli_util.option('--subsetting-rule-key', required=True, help=u"""The unique key that identifies the subsetting rule. It's numeric and unique within a subsetting policy.""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--is-enabled-for-processing', type=click.BOOL, help=u"""Indicates if this object/edge is enabled for processing""")
@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", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'sensitive-type-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'format-entries': {'module': 'data_safe', 'class': 'list[FormatEntry]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@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={'sensitive-type-ids': {'module': 'data_safe', 'class': 'list[string]'}, 'format-entries': {'module': 'data_safe', 'class': 'list[FormatEntry]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
-def update_library_masking_format(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, library_masking_format_id, display_name, description, sensitive_type_ids, format_entries, freeform_tags, defined_tags, if_match):
+def update_processing_chain_object(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, processing_chain_object_key, subsetting_rule_key, subsetting_policy_id, is_enabled_for_processing, if_match):
- if isinstance(library_masking_format_id, six.string_types) and len(library_masking_format_id.strip()) == 0:
- raise click.UsageError('Parameter --library-masking-format-id cannot be whitespace or empty string')
- if not force:
- if sensitive_type_ids or format_entries or freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to sensitive-type-ids and format-entries and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
- ctx.abort()
+ if isinstance(processing_chain_object_key, six.string_types) and len(processing_chain_object_key.strip()) == 0:
+ raise click.UsageError('Parameter --processing-chain-object-key cannot be whitespace or empty string')
+
+ if isinstance(subsetting_rule_key, six.string_types) and len(subsetting_rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-rule-key cannot be whitespace or empty string')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
kwargs = {}
if if_match is not None:
@@ -23809,28 +28260,15 @@ def update_library_masking_format(ctx, from_json, force, wait_for_state, max_wai
_details = {}
- if display_name is not None:
- _details['displayName'] = display_name
-
- if description is not None:
- _details['description'] = description
-
- if sensitive_type_ids is not None:
- _details['sensitiveTypeIds'] = cli_util.parse_json_parameter("sensitive_type_ids", sensitive_type_ids)
-
- if format_entries is not None:
- _details['formatEntries'] = cli_util.parse_json_parameter("format_entries", format_entries)
-
- 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 is_enabled_for_processing is not None:
+ _details['isEnabledForProcessing'] = is_enabled_for_processing
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_library_masking_format(
- library_masking_format_id=library_masking_format_id,
- update_library_masking_format_details=_details,
+ result = client.update_processing_chain_object(
+ processing_chain_object_key=processing_chain_object_key,
+ subsetting_rule_key=subsetting_rule_key,
+ subsetting_policy_id=subsetting_policy_id,
+ update_processing_chain_object_details=_details,
**kwargs
)
if wait_for_state:
@@ -23863,36 +28301,34 @@ def update_library_masking_format(ctx, from_json, force, wait_for_state, max_wai
cli_util.render_response(result, ctx)
-@masking_column_group.command(name=cli_util.override('data_safe.update_masking_column.command_name', 'update'), help=u"""Updates one or more attributes of the specified masking column. Note that updating the maskingFormats attribute replaces the currently assigned masking formats with the specified masking formats. \n[Command Reference](updateMaskingColumn)""")
-@cli_util.option('--masking-column-key', required=True, help=u"""The unique key that identifies the masking column. It's numeric and unique within a masking policy.""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--object-type', type=custom_types.CliCaseInsensitiveChoice(["TABLE", "EDITIONING_VIEW"]), help=u"""The type of the object that contains the database column.""")
-@cli_util.option('--masking-column-group', help=u"""The group of the masking column. It's a masking group identifier and can be any string of acceptable length. All the columns in a group are masked together to ensure that the masked data across these columns continue to retain the same logical relationship. For more details, check Group Masking in the Data Safe documentation.""")
-@cli_util.option('--sensitive-type-id', help=u"""The OCID of the sensitive type to be associated with the masking column. Note that there will be no change in assigned masking format when sensitive type is changed.""")
-@cli_util.option('--is-masking-enabled', type=click.BOOL, help=u"""Indicates whether data masking is enabled for the masking column. Set it to false if you don't want to mask the column.""")
-@cli_util.option('--masking-formats', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The masking formats to be assigned to the masking column. You can specify a condition as part of each masking format. It enables you to do conditional masking so that you can mask the column data values differently using different masking formats and the associated conditions. A masking format can have one or more format entries. The combined output of all the format entries is used for masking. It provides the flexibility to define a masking format that can generate different parts of a data value separately and then combine them to get the final data value for masking.
+@registration_policy_group.command(name=cli_util.override('data_safe.update_registration_policy.command_name', 'update'), help=u"""Updates one or more attributes of the specified registration policy. \n[Command Reference](updateRegistrationPolicy)""")
+@cli_util.option('--registration-policy-id', required=True, help=u"""The OCID of the registration policy to be used for identification""")
+@cli_util.option('--display-name', help=u"""The display name of the registration policy.""")
+@cli_util.option('--description', help=u"""A description of the registration policy.""")
+@cli_util.option('--can-override-features', type=click.BOOL, help=u"""Indicates whether features will be overridden for all targets.""")
+@cli_util.option('--features', type=custom_types.CliCaseInsensitiveChoice(["ASSESSMENT", "AUDIT_COLLECTION", "AUDIT_SETTING", "DATA_DISCOVERY", "MASKING", "SQL_FIREWALL", "ALL"]), help=u"""The Data Safe features granted to the databases registering under the registration policy.""")
+@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]
-This option is a JSON list with items of type MaskingFormat. For documentation on MaskingFormat please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/MaskingFormat.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+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('--connection-option', 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)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'masking-formats': {'module': 'data_safe', 'class': 'list[MaskingFormat]'}})
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'connection-option': {'module': 'data_safe', 'class': 'PolicyConnectionOption'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'masking-formats': {'module': 'data_safe', 'class': 'list[MaskingFormat]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'connection-option': {'module': 'data_safe', 'class': 'PolicyConnectionOption'}}, output_type={'module': 'data_safe', 'class': 'RegistrationPolicy'})
@cli_util.wrap_exceptions
-def update_masking_column(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_column_key, masking_policy_id, object_type, masking_column_group, sensitive_type_id, is_masking_enabled, masking_formats, if_match):
-
- if isinstance(masking_column_key, six.string_types) and len(masking_column_key.strip()) == 0:
- raise click.UsageError('Parameter --masking-column-key cannot be whitespace or empty string')
-
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+def update_registration_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, registration_policy_id, display_name, description, can_override_features, features, freeform_tags, defined_tags, connection_option, if_match):
+
+ if isinstance(registration_policy_id, six.string_types) and len(registration_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --registration-policy-id cannot be whitespace or empty string')
if not force:
- if masking_formats:
- if not click.confirm("WARNING: Updates to masking-formats will replace any existing values. Are you sure you want to continue?"):
+ if features or freeform_tags or defined_tags or connection_option:
+ if not click.confirm("WARNING: Updates to features and freeform-tags and defined-tags and connection-option will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -23902,26 +28338,31 @@ def update_masking_column(ctx, from_json, force, wait_for_state, max_wait_second
_details = {}
- if object_type is not None:
- _details['objectType'] = object_type
+ if display_name is not None:
+ _details['displayName'] = display_name
- if masking_column_group is not None:
- _details['maskingColumnGroup'] = masking_column_group
+ if description is not None:
+ _details['description'] = description
- if sensitive_type_id is not None:
- _details['sensitiveTypeId'] = sensitive_type_id
+ if can_override_features is not None:
+ _details['canOverrideFeatures'] = can_override_features
- if is_masking_enabled is not None:
- _details['isMaskingEnabled'] = is_masking_enabled
+ if features is not None:
+ _details['features'] = cli_util.parse_json_parameter("features", features)
- if masking_formats is not None:
- _details['maskingFormats'] = cli_util.parse_json_parameter("masking_formats", masking_formats)
+ 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 connection_option is not None:
+ _details['connectionOption'] = cli_util.parse_json_parameter("connection_option", connection_option)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_masking_column(
- masking_column_key=masking_column_key,
- masking_policy_id=masking_policy_id,
- update_masking_column_details=_details,
+ result = client.update_registration_policy(
+ registration_policy_id=registration_policy_id,
+ update_registration_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -23954,18 +28395,8 @@ def update_masking_column(ctx, from_json, force, wait_for_state, max_wait_second
cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.update_masking_policy.command_name', 'update'), help=u"""Updates one or more attributes of the specified masking policy. \n[Command Reference](updateMaskingPolicy)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--display-name', help=u"""The display name of the masking policy. The name does not have to be unique, and it's changeable.""")
-@cli_util.option('--description', help=u"""The description of the masking policy.""")
-@cli_util.option('--is-drop-temp-tables-enabled', type=click.BOOL, help=u"""Indicates if the temporary tables created during a masking operation should be dropped after masking. It's enabled by default. Set this attribute to false to preserve the temporary tables. Masking creates temporary tables that map the original sensitive data values to mask values. By default, these temporary tables are dropped after masking. But, in some cases, you may want to preserve this information to track how masking changed your data. Note that doing so compromises security. These tables must be dropped before the database is available for unprivileged users.""")
-@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a masking operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, masking disables redo logging and flashback logging to purge any original unmasked data from logs. However, in certain circumstances when you only want to test masking, rollback changes, and retry masking, you could enable logging and use a flashback database to retrieve the original unmasked data after it has been masked.""")
-@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The masking process gathers statistics on masked database tables after masking completes.""")
-@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data masking. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve masking performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism.""")
-@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data masking. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after masking completes.""")
-@cli_util.option('--pre-masking-script', help=u"""A pre-masking script, which can contain SQL and PL/SQL statements. It's executed before the core masking script generated using the masking policy. It's usually used to perform any preparation or prerequisite work before masking data.""")
-@cli_util.option('--post-masking-script', help=u"""A post-masking script, which can contain SQL and PL/SQL statements. It's executed after the core masking script generated using the masking policy. It's usually used to perform additional transformation or cleanup work after masking.""")
-@cli_util.option('--column-source', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@report_group.command(name=cli_util.override('data_safe.update_report.command_name', 'update'), help=u"""Updates the specified report. Only tags can be updated. \n[Command Reference](updateReport)""")
+@cli_util.option('--report-id', required=True, help=u"""Unique report identifier""")
@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)
@@ -23975,18 +28406,18 @@ def update_masking_column(ctx, from_json, force, wait_for_state, max_wait_second
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'column-source': {'module': 'data_safe', 'class': 'UpdateColumnSourceDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'column-source': {'module': 'data_safe', 'class': 'UpdateColumnSourceDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_masking_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, display_name, description, is_drop_temp_tables_enabled, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, pre_masking_script, post_masking_script, column_source, freeform_tags, defined_tags, if_match):
+def update_report(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, report_id, freeform_tags, defined_tags, if_match):
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if isinstance(report_id, six.string_types) and len(report_id.strip()) == 0:
+ raise click.UsageError('Parameter --report-id cannot be whitespace or empty string')
if not force:
- if column_source or freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to column-source and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -23996,36 +28427,6 @@ def update_masking_policy(ctx, from_json, force, wait_for_state, max_wait_second
_details = {}
- if display_name is not None:
- _details['displayName'] = display_name
-
- if description is not None:
- _details['description'] = description
-
- if is_drop_temp_tables_enabled is not None:
- _details['isDropTempTablesEnabled'] = is_drop_temp_tables_enabled
-
- if is_redo_logging_enabled is not None:
- _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
-
- if is_refresh_stats_enabled is not None:
- _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
-
- if parallel_degree is not None:
- _details['parallelDegree'] = parallel_degree
-
- if recompile is not None:
- _details['recompile'] = recompile
-
- if pre_masking_script is not None:
- _details['preMaskingScript'] = pre_masking_script
-
- if post_masking_script is not None:
- _details['postMaskingScript'] = post_masking_script
-
- if column_source is not None:
- _details['columnSource'] = cli_util.parse_json_parameter("column_source", column_source)
-
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -24033,9 +28434,9 @@ def update_masking_policy(ctx, from_json, force, wait_for_state, max_wait_second
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_masking_policy(
- masking_policy_id=masking_policy_id,
- update_masking_policy_details=_details,
+ result = client.update_report(
+ report_id=report_id,
+ update_report_details=_details,
**kwargs
)
if wait_for_state:
@@ -24068,18 +28469,14 @@ def update_masking_policy(ctx, from_json, force, wait_for_state, max_wait_second
cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.update_masking_policy_update_column_source_sdm_details.command_name', 'update-masking-policy-update-column-source-sdm-details'), help=u"""Updates one or more attributes of the specified masking policy. \n[Command Reference](updateMaskingPolicy)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--column-source-sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model to be associated as the column source with the masking policy.""")
-@cli_util.option('--display-name', help=u"""The display name of the masking policy. The name does not have to be unique, and it's changeable.""")
-@cli_util.option('--description', help=u"""The description of the masking policy.""")
-@cli_util.option('--is-drop-temp-tables-enabled', type=click.BOOL, help=u"""Indicates if the temporary tables created during a masking operation should be dropped after masking. It's enabled by default. Set this attribute to false to preserve the temporary tables. Masking creates temporary tables that map the original sensitive data values to mask values. By default, these temporary tables are dropped after masking. But, in some cases, you may want to preserve this information to track how masking changed your data. Note that doing so compromises security. These tables must be dropped before the database is available for unprivileged users.""")
-@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a masking operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, masking disables redo logging and flashback logging to purge any original unmasked data from logs. However, in certain circumstances when you only want to test masking, rollback changes, and retry masking, you could enable logging and use a flashback database to retrieve the original unmasked data after it has been masked.""")
-@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The masking process gathers statistics on masked database tables after masking completes.""")
-@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data masking. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve masking performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism.""")
-@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data masking. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after masking completes.""")
-@cli_util.option('--pre-masking-script', help=u"""A pre-masking script, which can contain SQL and PL/SQL statements. It's executed before the core masking script generated using the masking policy. It's usually used to perform any preparation or prerequisite work before masking data.""")
-@cli_util.option('--post-masking-script', help=u"""A post-masking script, which can contain SQL and PL/SQL statements. It's executed after the core masking script generated using the masking policy. It's usually used to perform additional transformation or cleanup work after masking.""")
+@report_definition_group.command(name=cli_util.override('data_safe.update_report_definition.command_name', 'update'), help=u"""Updates the specified report definition. Only user created report definition can be updated. Seeded report definitions need to be saved as new report definition first. \n[Command Reference](updateReportDefinition)""")
+@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
+@cli_util.option('--display-name', required=True, help=u"""Specifies the name of the report definition.""")
+@cli_util.option('--column-info', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of column objects in the order (left to right) displayed in the report. A column object stores all information about a column, including the name displayed on the UI, corresponding field name in the data source, data type of the column, and column visibility (if the column is visible to the user).""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--column-filters', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of column filter objects. A column Filter object stores all information about a column filter including field name, an operator, one or more expressions, if the filter is enabled, or if the filter is hidden.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--column-sortings', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of column sorting objects. Each column sorting object stores the column name to be sorted and if the sorting is in ascending order; sorting is done by the first column in the array, then by the second column in the array, etc.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--summary', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of report summary objects in the order (left to right) displayed in the report. A report summary object stores all information about summary of report to be displayed, including the name displayed on UI, the display order, corresponding group by and count of values, summary visibility (if the summary is visible to user).""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--description', help=u"""The description of the report definition.""")
@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)
@@ -24089,18 +28486,18 @@ def update_masking_policy(ctx, from_json, force, wait_for_state, max_wait_second
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'column-info': {'module': 'data_safe', 'class': 'list[Column]'}, 'column-filters': {'module': 'data_safe', 'class': 'list[ColumnFilter]'}, 'column-sortings': {'module': 'data_safe', 'class': 'list[ColumnSorting]'}, 'summary': {'module': 'data_safe', 'class': 'list[Summary]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'column-info': {'module': 'data_safe', 'class': 'list[Column]'}, 'column-filters': {'module': 'data_safe', 'class': 'list[ColumnFilter]'}, 'column-sortings': {'module': 'data_safe', 'class': 'list[ColumnSorting]'}, 'summary': {'module': 'data_safe', 'class': 'list[Summary]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_masking_policy_update_column_source_sdm_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, column_source_sensitive_data_model_id, display_name, description, is_drop_temp_tables_enabled, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, pre_masking_script, post_masking_script, freeform_tags, defined_tags, if_match):
+def update_report_definition(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, report_definition_id, display_name, column_info, column_filters, column_sortings, summary, description, freeform_tags, defined_tags, if_match):
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
+ raise click.UsageError('Parameter --report-definition-id cannot be whitespace or empty string')
if not force:
- if freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if column_info or column_filters or column_sortings or summary or freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to column-info and column-filters and column-sortings and summary and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -24109,48 +28506,25 @@ def update_masking_policy_update_column_source_sdm_details(ctx, from_json, force
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['columnSource'] = {}
- _details['columnSource']['sensitiveDataModelId'] = column_source_sensitive_data_model_id
-
- if display_name is not None:
- _details['displayName'] = display_name
+ _details['displayName'] = display_name
+ _details['columnInfo'] = cli_util.parse_json_parameter("column_info", column_info)
+ _details['columnFilters'] = cli_util.parse_json_parameter("column_filters", column_filters)
+ _details['columnSortings'] = cli_util.parse_json_parameter("column_sortings", column_sortings)
+ _details['summary'] = cli_util.parse_json_parameter("summary", summary)
if description is not None:
_details['description'] = description
- if is_drop_temp_tables_enabled is not None:
- _details['isDropTempTablesEnabled'] = is_drop_temp_tables_enabled
-
- if is_redo_logging_enabled is not None:
- _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
-
- if is_refresh_stats_enabled is not None:
- _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
-
- if parallel_degree is not None:
- _details['parallelDegree'] = parallel_degree
-
- if recompile is not None:
- _details['recompile'] = recompile
-
- if pre_masking_script is not None:
- _details['preMaskingScript'] = pre_masking_script
-
- if post_masking_script is not None:
- _details['postMaskingScript'] = post_masking_script
-
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['columnSource']['columnSource'] = 'SENSITIVE_DATA_MODEL'
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_masking_policy(
- masking_policy_id=masking_policy_id,
- update_masking_policy_details=_details,
+ result = client.update_report_definition(
+ report_definition_id=report_definition_id,
+ update_report_definition_details=_details,
**kwargs
)
if wait_for_state:
@@ -24183,18 +28557,9 @@ def update_masking_policy_update_column_source_sdm_details(ctx, from_json, force
cli_util.render_response(result, ctx)
-@masking_policy_group.command(name=cli_util.override('data_safe.update_masking_policy_update_column_source_target_details.command_name', 'update-masking-policy-update-column-source-target-details'), help=u"""Updates one or more attributes of the specified masking policy. \n[Command Reference](updateMaskingPolicy)""")
-@cli_util.option('--masking-policy-id', required=True, help=u"""The OCID of the masking policy.""")
-@cli_util.option('--column-source-target-id', required=True, help=u"""The OCID of the target database to be associated as the column source with the masking policy.""")
-@cli_util.option('--display-name', help=u"""The display name of the masking policy. The name does not have to be unique, and it's changeable.""")
-@cli_util.option('--description', help=u"""The description of the masking policy.""")
-@cli_util.option('--is-drop-temp-tables-enabled', type=click.BOOL, help=u"""Indicates if the temporary tables created during a masking operation should be dropped after masking. It's enabled by default. Set this attribute to false to preserve the temporary tables. Masking creates temporary tables that map the original sensitive data values to mask values. By default, these temporary tables are dropped after masking. But, in some cases, you may want to preserve this information to track how masking changed your data. Note that doing so compromises security. These tables must be dropped before the database is available for unprivileged users.""")
-@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a masking operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, masking disables redo logging and flashback logging to purge any original unmasked data from logs. However, in certain circumstances when you only want to test masking, rollback changes, and retry masking, you could enable logging and use a flashback database to retrieve the original unmasked data after it has been masked.""")
-@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The masking process gathers statistics on masked database tables after masking completes.""")
-@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data masking. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve masking performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism.""")
-@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data masking. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after masking completes.""")
-@cli_util.option('--pre-masking-script', help=u"""A pre-masking script, which can contain SQL and PL/SQL statements. It's executed before the core masking script generated using the masking policy. It's usually used to perform any preparation or prerequisite work before masking data.""")
-@cli_util.option('--post-masking-script', help=u"""A post-masking script, which can contain SQL and PL/SQL statements. It's executed after the core masking script generated using the masking policy. It's usually used to perform additional transformation or cleanup work after masking.""")
+@sdm_masking_policy_difference_group.command(name=cli_util.override('data_safe.update_sdm_masking_policy_difference.command_name', 'update'), help=u"""Updates one or more attributes of the specified sdm masking policy difference. \n[Command Reference](updateSdmMaskingPolicyDifference)""")
+@cli_util.option('--sdm-masking-policy-difference-id', required=True, help=u"""The OCID of the SDM masking policy difference.""")
+@cli_util.option('--display-name', help=u"""The display name of the sdm masking policy difference. The name does not have to be unique, and it's changeable.""")
@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)
@@ -24209,10 +28574,10 @@ def update_masking_policy_update_column_source_sdm_details(ctx, from_json, force
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_masking_policy_update_column_source_target_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, masking_policy_id, column_source_target_id, display_name, description, is_drop_temp_tables_enabled, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, pre_masking_script, post_masking_script, freeform_tags, defined_tags, if_match):
+def update_sdm_masking_policy_difference(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sdm_masking_policy_difference_id, display_name, freeform_tags, defined_tags, if_match):
- if isinstance(masking_policy_id, six.string_types) and len(masking_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --masking-policy-id cannot be whitespace or empty string')
+ if isinstance(sdm_masking_policy_difference_id, six.string_types) and len(sdm_masking_policy_difference_id.strip()) == 0:
+ raise click.UsageError('Parameter --sdm-masking-policy-difference-id cannot be whitespace or empty string')
if not force:
if freeform_tags or defined_tags:
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
@@ -24224,48 +28589,20 @@ def update_masking_policy_update_column_source_target_details(ctx, from_json, fo
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['columnSource'] = {}
- _details['columnSource']['targetId'] = column_source_target_id
if display_name is not None:
_details['displayName'] = display_name
- if description is not None:
- _details['description'] = description
-
- if is_drop_temp_tables_enabled is not None:
- _details['isDropTempTablesEnabled'] = is_drop_temp_tables_enabled
-
- if is_redo_logging_enabled is not None:
- _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
-
- if is_refresh_stats_enabled is not None:
- _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
-
- if parallel_degree is not None:
- _details['parallelDegree'] = parallel_degree
-
- if recompile is not None:
- _details['recompile'] = recompile
-
- if pre_masking_script is not None:
- _details['preMaskingScript'] = pre_masking_script
-
- if post_masking_script is not None:
- _details['postMaskingScript'] = post_masking_script
-
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['columnSource']['columnSource'] = 'TARGET'
-
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_masking_policy(
- masking_policy_id=masking_policy_id,
- update_masking_policy_details=_details,
+ result = client.update_sdm_masking_policy_difference(
+ sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
+ update_sdm_masking_policy_difference_details=_details,
**kwargs
)
if wait_for_state:
@@ -24298,10 +28635,14 @@ def update_masking_policy_update_column_source_target_details(ctx, from_json, fo
cli_util.render_response(result, ctx)
-@on_prem_connector_group.command(name=cli_util.override('data_safe.update_on_prem_connector.command_name', 'update'), help=u"""Updates one or more attributes of the specified on-premises connector. \n[Command Reference](updateOnPremConnector)""")
-@cli_util.option('--on-prem-connector-id', required=True, help=u"""The OCID of the on-premises connector.""")
-@cli_util.option('--display-name', help=u"""The display name of the on-premises connector. The name does not have to be unique, and it's changeable.""")
-@cli_util.option('--description', help=u"""The description of the on-premises connector.""")
+@security_assessment_group.command(name=cli_util.override('data_safe.update_security_assessment.command_name', 'update'), help=u"""Updates one or more attributes of the specified security assessment. This operation allows to update the security assessment displayName, description, or schedule. \n[Command Reference](updateSecurityAssessment)""")
+@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
+@cli_util.option('--display-name', help=u"""The display name of the security assessment.""")
+@cli_util.option('--description', help=u"""The description of the security assessment.""")
+@cli_util.option('--is-assessment-scheduled', type=click.BOOL, help=u"""Indicates whether the assessment is scheduled to run.""")
+@cli_util.option('--schedule', help=u"""This is applicable only for save schedule and latest assessment. It updates the existing schedule in a specified format: ;
+
+Allowed version strings - \"v1\" v1's version specific schedule - Each of the above fields potentially introduce constraints. A workrequest is created only when clock time satisfies all the constraints. Constraints introduced: 1. seconds = (So, the allowed range for is [0, 59]) 2. minutes = (So, the allowed range for is [0, 59]) 3. hours = (So, the allowed range for is [0, 23]) can be either '*' (without quotes or a number between 1(Monday) and 7(Sunday)) 4. No constraint introduced when it is '*'. When not, day of week must equal the given value can be either '*' (without quotes or a number between 1 and 28) 5. No constraint introduced when it is '*'. When not, day of month must equal the given value""")
@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)
@@ -24316,10 +28657,10 @@ def update_masking_policy_update_column_source_target_details(ctx, from_json, fo
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_on_prem_connector(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, on_prem_connector_id, display_name, description, freeform_tags, defined_tags, if_match):
+def update_security_assessment(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, display_name, description, is_assessment_scheduled, schedule, freeform_tags, defined_tags, if_match):
- if isinstance(on_prem_connector_id, six.string_types) and len(on_prem_connector_id.strip()) == 0:
- raise click.UsageError('Parameter --on-prem-connector-id cannot be whitespace or empty string')
+ if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
if not force:
if freeform_tags or defined_tags:
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
@@ -24338,6 +28679,12 @@ def update_on_prem_connector(ctx, from_json, force, wait_for_state, max_wait_sec
if description is not None:
_details['description'] = description
+ if is_assessment_scheduled is not None:
+ _details['isAssessmentScheduled'] = is_assessment_scheduled
+
+ if schedule is not None:
+ _details['schedule'] = schedule
+
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -24345,9 +28692,9 @@ def update_on_prem_connector(ctx, from_json, force, wait_for_state, max_wait_sec
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_on_prem_connector(
- on_prem_connector_id=on_prem_connector_id,
- update_on_prem_connector_details=_details,
+ result = client.update_security_assessment(
+ security_assessment_id=security_assessment_id,
+ update_security_assessment_details=_details,
**kwargs
)
if wait_for_state:
@@ -24380,22 +28727,32 @@ def update_on_prem_connector(ctx, from_json, force, wait_for_state, max_wait_sec
cli_util.render_response(result, ctx)
-@on_prem_connector_group.command(name=cli_util.override('data_safe.update_on_prem_connector_wallet.command_name', 'update-on-prem-connector-wallet'), help=u"""Updates the wallet for the specified on-premises connector to a new version. \n[Command Reference](updateOnPremConnectorWallet)""")
-@cli_util.option('--on-prem-connector-id', required=True, help=u"""The OCID of the on-premises connector.""")
-@cli_util.option('--is-update', type=click.BOOL, help=u"""Indicates whether to update or not. If false, the wallet will not be updated. Default is false.""")
+@security_policy_group.command(name=cli_util.override('data_safe.update_security_policy.command_name', 'update'), help=u"""Updates the security policy. \n[Command Reference](updateSecurityPolicy)""")
+@cli_util.option('--security-policy-id', required=True, help=u"""The OCID of the security policy resource.""")
+@cli_util.option('--display-name', help=u"""The display name of the security policy. The name does not have to be unique, and it is changeable.""")
+@cli_util.option('--description', help=u"""The description of the security policy.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_on_prem_connector_wallet(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, on_prem_connector_id, is_update, if_match):
+def update_security_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_id, display_name, description, freeform_tags, defined_tags, if_match):
- if isinstance(on_prem_connector_id, six.string_types) and len(on_prem_connector_id.strip()) == 0:
- raise click.UsageError('Parameter --on-prem-connector-id cannot be whitespace or empty string')
+ if isinstance(security_policy_id, six.string_types) and len(security_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-id cannot be whitespace or empty string')
+ if not force:
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ ctx.abort()
kwargs = {}
if if_match is not None:
@@ -24404,13 +28761,22 @@ def update_on_prem_connector_wallet(ctx, from_json, wait_for_state, max_wait_sec
_details = {}
- if is_update is not None:
- _details['isUpdate'] = is_update
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_on_prem_connector_wallet(
- on_prem_connector_id=on_prem_connector_id,
- update_on_prem_connector_wallet_details=_details,
+ result = client.update_security_policy(
+ security_policy_id=security_policy_id,
+ update_security_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -24443,33 +28809,33 @@ def update_on_prem_connector_wallet(ctx, from_json, wait_for_state, max_wait_sec
cli_util.render_response(result, ctx)
-@peer_target_database_group.command(name=cli_util.override('data_safe.update_peer_target_database.command_name', 'update'), help=u"""Updates one or more attributes of the specified Data Safe peer target database. \n[Command Reference](updatePeerTargetDatabase)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
-@cli_util.option('--peer-target-database-id', required=True, type=click.INT, help=u"""The unique id of the peer target database.""")
-@cli_util.option('--display-name', help=u"""The display name of the peer target database in Data Safe.""")
-@cli_util.option('--description', help=u"""The description of the peer target database in Data Safe.""")
-@cli_util.option('--database-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@security_policy_config_group.command(name=cli_util.override('data_safe.update_security_policy_config.command_name', 'update'), help=u"""Updates the security policy configuration. \n[Command Reference](updateSecurityPolicyConfig)""")
+@cli_util.option('--security-policy-config-id', required=True, help=u"""The OCID of the security policy configuration resource.""")
+@cli_util.option('--display-name', help=u"""The display name of the security policy configuration. The name does not have to be unique, and it is changeable.""")
+@cli_util.option('--description', help=u"""The description of the security policy configuration.""")
+@cli_util.option('--firewall-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--unified-audit-policy-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
-@json_skeleton_utils.get_cli_json_input_option({'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}})
+@json_skeleton_utils.get_cli_json_input_option({'firewall-config': {'module': 'data_safe', 'class': 'FirewallConfigDetails'}, 'unified-audit-policy-config': {'module': 'data_safe', 'class': 'UnifiedAuditPolicyConfigDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'database-details': {'module': 'data_safe', 'class': 'DatabaseDetails'}, 'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'firewall-config': {'module': 'data_safe', 'class': 'FirewallConfigDetails'}, 'unified-audit-policy-config': {'module': 'data_safe', 'class': 'UnifiedAuditPolicyConfigDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_peer_target_database(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, peer_target_database_id, display_name, description, database_details, tls_config, if_match):
-
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+def update_security_policy_config(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_config_id, display_name, description, firewall_config, unified_audit_policy_config, freeform_tags, defined_tags, if_match):
- if isinstance(peer_target_database_id, six.string_types) and len(peer_target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --peer-target-database-id cannot be whitespace or empty string')
+ if isinstance(security_policy_config_id, six.string_types) and len(security_policy_config_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-config-id cannot be whitespace or empty string')
if not force:
- if database_details or tls_config:
- if not click.confirm("WARNING: Updates to database-details and tls-config will replace any existing values. Are you sure you want to continue?"):
+ if firewall_config or unified_audit_policy_config or freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to firewall-config and unified-audit-policy-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -24485,17 +28851,22 @@ def update_peer_target_database(ctx, from_json, force, wait_for_state, max_wait_
if description is not None:
_details['description'] = description
- if database_details is not None:
- _details['databaseDetails'] = cli_util.parse_json_parameter("database_details", database_details)
+ if firewall_config is not None:
+ _details['firewallConfig'] = cli_util.parse_json_parameter("firewall_config", firewall_config)
- if tls_config is not None:
- _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+ if unified_audit_policy_config is not None:
+ _details['unifiedAuditPolicyConfig'] = cli_util.parse_json_parameter("unified_audit_policy_config", unified_audit_policy_config)
+
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_peer_target_database(
- target_database_id=target_database_id,
- peer_target_database_id=peer_target_database_id,
- update_peer_target_database_details=_details,
+ result = client.update_security_policy_config(
+ security_policy_config_id=security_policy_config_id,
+ update_security_policy_config_details=_details,
**kwargs
)
if wait_for_state:
@@ -24528,37 +28899,31 @@ def update_peer_target_database(ctx, from_json, force, wait_for_state, max_wait_
cli_util.render_response(result, ctx)
-@peer_target_database_group.command(name=cli_util.override('data_safe.update_peer_target_database_installed_database_details.command_name', 'update-peer-target-database-installed-database-details'), help=u"""Updates one or more attributes of the specified Data Safe peer target database. \n[Command Reference](updatePeerTargetDatabase)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
-@cli_util.option('--peer-target-database-id', required=True, type=click.INT, help=u"""The unique id of the peer target database.""")
-@cli_util.option('--database-details-infrastructure-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""The infrastructure type the database is running on.""")
-@cli_util.option('--database-details-listener-port', required=True, type=click.INT, help=u"""The port number of the database listener.""")
-@cli_util.option('--database-details-service-name', required=True, help=u"""The service name of the database registered as target database.""")
-@cli_util.option('--display-name', help=u"""The display name of the peer target database in Data Safe.""")
-@cli_util.option('--description', help=u"""The description of the peer target database in Data Safe.""")
-@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@security_policy_deployment_group.command(name=cli_util.override('data_safe.update_security_policy_deployment.command_name', 'update'), help=u"""Updates the security policy deployment. \n[Command Reference](updateSecurityPolicyDeployment)""")
+@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
+@cli_util.option('--display-name', help=u"""The display name of the security policy deployment. The name does not have to be unique, and it is changeable.""")
+@cli_util.option('--description', help=u"""The description of the security policy deployment.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
-@cli_util.option('--database-details-instance-id', help=u"""The OCID of the compute instance on which the database is running.""")
-@cli_util.option('--database-details-ip-addresses', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database host IP Addresses. Fully qualified domain names can be used if connectionType is 'ONPREM_CONNECTOR'.""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'database-details-ip-addresses': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}, 'database-details-ip-addresses': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_peer_target_database_installed_database_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, peer_target_database_id, database_details_infrastructure_type, database_details_listener_port, database_details_service_name, display_name, description, tls_config, if_match, database_details_instance_id, database_details_ip_addresses):
-
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+def update_security_policy_deployment(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_deployment_id, display_name, description, freeform_tags, defined_tags, if_match):
- if isinstance(peer_target_database_id, six.string_types) and len(peer_target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --peer-target-database-id cannot be whitespace or empty string')
+ if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
+ raise click.UsageError('Parameter --security-policy-deployment-id cannot be whitespace or empty string')
if not force:
- if tls_config:
- if not click.confirm("WARNING: Updates to tls-config will replace any existing values. Are you sure you want to continue?"):
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -24567,10 +28932,6 @@ def update_peer_target_database_installed_database_details(ctx, from_json, force
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['databaseDetails'] = {}
- _details['databaseDetails']['infrastructureType'] = database_details_infrastructure_type
- _details['databaseDetails']['listenerPort'] = database_details_listener_port
- _details['databaseDetails']['serviceName'] = database_details_service_name
if display_name is not None:
_details['displayName'] = display_name
@@ -24578,22 +28939,16 @@ def update_peer_target_database_installed_database_details(ctx, from_json, force
if description is not None:
_details['description'] = description
- if tls_config is not None:
- _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
-
- if database_details_instance_id is not None:
- _details['databaseDetails']['instanceId'] = database_details_instance_id
-
- if database_details_ip_addresses is not None:
- _details['databaseDetails']['ipAddresses'] = cli_util.parse_json_parameter("database_details_ip_addresses", database_details_ip_addresses)
+ if freeform_tags is not None:
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
- _details['databaseDetails']['databaseType'] = 'INSTALLED_DATABASE'
+ if defined_tags is not None:
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_peer_target_database(
- target_database_id=target_database_id,
- peer_target_database_id=peer_target_database_id,
- update_peer_target_database_details=_details,
+ result = client.update_security_policy_deployment(
+ security_policy_deployment_id=security_policy_deployment_id,
+ update_security_policy_deployment_details=_details,
**kwargs
)
if wait_for_state:
@@ -24626,34 +28981,36 @@ def update_peer_target_database_installed_database_details(ctx, from_json, force
cli_util.render_response(result, ctx)
-@peer_target_database_group.command(name=cli_util.override('data_safe.update_peer_target_database_autonomous_database_details.command_name', 'update-peer-target-database-autonomous-database-details'), help=u"""Updates one or more attributes of the specified Data Safe peer target database. \n[Command Reference](updatePeerTargetDatabase)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
-@cli_util.option('--peer-target-database-id', required=True, type=click.INT, help=u"""The unique id of the peer target database.""")
-@cli_util.option('--database-details-infrastructure-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""The infrastructure type the database is running on.""")
-@cli_util.option('--database-details-autonomous-database-id', required=True, help=u"""The OCID of the Autonomous Database registered as a target database in Data Safe.""")
-@cli_util.option('--display-name', help=u"""The display name of the peer target database in Data Safe.""")
-@cli_util.option('--description', help=u"""The description of the peer target database in Data Safe.""")
-@cli_util.option('--tls-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@sensitive_column_group.command(name=cli_util.override('data_safe.update_sensitive_column.command_name', 'update'), help=u"""Updates one or more attributes of the specified sensitive column. \n[Command Reference](updateSensitiveColumn)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--sensitive-column-key', required=True, help=u"""The unique key that identifies the sensitive column. It's numeric and unique within a sensitive data model.""")
+@cli_util.option('--data-type', help=u"""The data type of the sensitive column.""")
+@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["VALID", "INVALID"]), help=u"""The status of the sensitive column. VALID means the column is considered sensitive. INVALID means the column is not considered sensitive. Tracking invalid columns in a sensitive data model helps ensure that an incremental data discovery job does not identify these columns as sensitive.""")
+@cli_util.option('--sensitive-type-id', help=u"""The OCID of the sensitive type to be associated with the sensitive column.""")
+@cli_util.option('--parent-column-keys', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Unique keys identifying the columns that are parents of the sensitive column. At present, it accepts only one parent column key. This attribute can be used to establish relationship between columns in a sensitive data model. Note that the parent column must be added to the sensitive data model before its key can be specified here. If this attribute is provided, the appDefinedChildColumnKeys or dbDefinedChildColumnKeys attribute of the parent column is automatically updated to reflect the relationship.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--relation-type', type=custom_types.CliCaseInsensitiveChoice(["NONE", "APP_DEFINED", "DB_DEFINED"]), help=u"""The type of referential relationship the sensitive column has with its parent. NONE indicates that the sensitive column does not have a parent. DB_DEFINED indicates that the relationship is defined in the database dictionary. APP_DEFINED indicates that the relationship is defined at the application level and not in the database dictionary.""")
+@cli_util.option('--app-defined-child-column-keys', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Unique keys identifying the columns that are application-level (non-dictionary) children of the sensitive column. This attribute can be used to establish relationship between columns in a sensitive data model. Note that the child columns must be added to the sensitive data model before their keys can be specified here. If this attribute is provided, the parentColumnKeys and relationType attributes of the child columns are automatically updated to reflect the relationship.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--db-defined-child-column-keys', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Unique keys identifying the columns that are database-level (dictionary-defined) children of the sensitive column. This attribute can be used to establish relationship between columns in a sensitive data model. Note that the child columns must be added to the sensitive data model before their keys can be specified here. If this attribute is provided, the parentColumnKeys and relationType attributes of the child columns are automatically updated to reflect the relationship.""" + 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", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}})
+@json_skeleton_utils.get_cli_json_input_option({'parent-column-keys': {'module': 'data_safe', 'class': 'list[string]'}, 'app-defined-child-column-keys': {'module': 'data_safe', 'class': 'list[string]'}, 'db-defined-child-column-keys': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'parent-column-keys': {'module': 'data_safe', 'class': 'list[string]'}, 'app-defined-child-column-keys': {'module': 'data_safe', 'class': 'list[string]'}, 'db-defined-child-column-keys': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.wrap_exceptions
-def update_peer_target_database_autonomous_database_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, peer_target_database_id, database_details_infrastructure_type, database_details_autonomous_database_id, display_name, description, tls_config, if_match):
+def update_sensitive_column(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_data_model_id, sensitive_column_key, data_type, status, sensitive_type_id, parent_column_keys, relation_type, app_defined_child_column_keys, db_defined_child_column_keys, if_match):
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
- if isinstance(peer_target_database_id, six.string_types) and len(peer_target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --peer-target-database-id cannot be whitespace or empty string')
+ if isinstance(sensitive_column_key, six.string_types) and len(sensitive_column_key.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-column-key cannot be whitespace or empty string')
if not force:
- if tls_config:
- if not click.confirm("WARNING: Updates to tls-config will replace any existing values. Are you sure you want to continue?"):
+ if parent_column_keys or app_defined_child_column_keys or db_defined_child_column_keys:
+ if not click.confirm("WARNING: Updates to parent-column-keys and app-defined-child-column-keys and db-defined-child-column-keys will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -24662,26 +29019,33 @@ def update_peer_target_database_autonomous_database_details(ctx, from_json, forc
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['databaseDetails'] = {}
- _details['databaseDetails']['infrastructureType'] = database_details_infrastructure_type
- _details['databaseDetails']['autonomousDatabaseId'] = database_details_autonomous_database_id
- if display_name is not None:
- _details['displayName'] = display_name
+ if data_type is not None:
+ _details['dataType'] = data_type
- if description is not None:
- _details['description'] = description
+ if status is not None:
+ _details['status'] = status
- if tls_config is not None:
- _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+ if sensitive_type_id is not None:
+ _details['sensitiveTypeId'] = sensitive_type_id
- _details['databaseDetails']['databaseType'] = 'AUTONOMOUS_DATABASE'
+ if parent_column_keys is not None:
+ _details['parentColumnKeys'] = cli_util.parse_json_parameter("parent_column_keys", parent_column_keys)
+
+ if relation_type is not None:
+ _details['relationType'] = relation_type
+
+ if app_defined_child_column_keys is not None:
+ _details['appDefinedChildColumnKeys'] = cli_util.parse_json_parameter("app_defined_child_column_keys", app_defined_child_column_keys)
+
+ if db_defined_child_column_keys is not None:
+ _details['dbDefinedChildColumnKeys'] = cli_util.parse_json_parameter("db_defined_child_column_keys", db_defined_child_column_keys)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_peer_target_database(
- target_database_id=target_database_id,
- peer_target_database_id=peer_target_database_id,
- update_peer_target_database_details=_details,
+ result = client.update_sensitive_column(
+ sensitive_data_model_id=sensitive_data_model_id,
+ sensitive_column_key=sensitive_column_key,
+ update_sensitive_column_details=_details,
**kwargs
)
if wait_for_state:
@@ -24714,38 +29078,41 @@ def update_peer_target_database_autonomous_database_details(ctx, from_json, forc
cli_util.render_response(result, ctx)
-@peer_target_database_group.command(name=cli_util.override('data_safe.update_peer_target_database_database_cloud_service_details.command_name', 'update-peer-target-database-database-cloud-service-details'), help=u"""Updates one or more attributes of the specified Data Safe peer target database. \n[Command Reference](updatePeerTargetDatabase)""")
-@cli_util.option('--target-database-id', required=True, help=u"""The OCID of the Data Safe target database.""")
-@cli_util.option('--peer-target-database-id', required=True, type=click.INT, help=u"""The unique id of the peer target database.""")
-@cli_util.option('--database-details-infrastructure-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_CLOUD", "CLOUD_AT_CUSTOMER", "ON_PREMISES", "NON_ORACLE_CLOUD"]), help=u"""The infrastructure type the database is running on.""")
-@cli_util.option('--display-name', help=u"""The display name of the peer target database in Data Safe.""")
-@cli_util.option('--description', help=u"""The description of the peer target database in Data Safe.""")
-@cli_util.option('--tls-config', 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('--database-details-vm-cluster-id', help=u"""The OCID of the VM cluster in which the database is running.""")
-@cli_util.option('--database-details-db-system-id', help=u"""The OCID of the cloud database registered as a target database in Data Safe.""")
-@cli_util.option('--database-details-pluggable-database-id', help=u"""The OCID of the pluggable database registered as a target database in Data Safe.""")
-@cli_util.option('--database-details-listener-port', type=click.INT, help=u"""The port number of the database listener.""")
-@cli_util.option('--database-details-service-name', help=u"""The database service name.""")
+@sensitive_data_model_group.command(name=cli_util.override('data_safe.update_sensitive_data_model.command_name', 'update'), help=u"""Updates one or more attributes of the specified sensitive data model. Note that updating any attribute of a sensitive data model does not perform data discovery. \n[Command Reference](updateSensitiveDataModel)""")
+@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
+@cli_util.option('--display-name', help=u"""The display name of the sensitive data model. The name does not have to be unique, and it's changeable.""")
+@cli_util.option('--target-id', help=u"""The OCID of the reference target database to be associated with the sensitive data model. All operations such as performing data discovery and adding columns manually are done in the context of the associated target database. Note that updating the targetId attribute does not perform data discovery automatically.""")
+@cli_util.option('--app-suite-name', help=u"""The application suite name identifying a collection of applications. It's useful only if maintaining a sensitive data model for a suite of applications.""")
+@cli_util.option('--description', help=u"""The description of the sensitive data model.""")
+@cli_util.option('--schemas-for-discovery', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The schemas to be used for future data discovery jobs.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--tables-for-discovery', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The data discovery jobs will scan the tables specified here, including both schemas and tables. For instance, the input could be in the format: [{schemaName: \"HR\", tableName: [\"T1\", \"T2\"]}, {schemaName: \"OE\", tableName : [\"T3\", \"T4\"]}].
+
+This option is a JSON list with items of type TablesForDiscovery. For documentation on TablesForDiscovery please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/TablesForDiscovery.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--sensitive-type-ids-for-discovery', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The OCIDs of the sensitive types to be used for future data discovery jobs. If OCID of a sensitive category is provided, all its child sensitive types are used for data discovery.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--sensitive-type-group-ids-for-discovery', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The OCIDs of the sensitive type groups to be used by data discovery jobs.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--is-sample-data-collection-enabled', type=click.BOOL, help=u"""Indicates if data discovery jobs should collect and store sample data values for the discovered columns. Sample data helps review the discovered columns and ensure that they actually contain sensitive data. As it collects original data from the target database, it's disabled by default and should be used only if it's acceptable to store sample data in Data Safe's repository in Oracle Cloud. Note that sample data values are not collected for columns with the following data types: LONG, LOB, RAW, XMLTYPE and BFILE.""")
+@cli_util.option('--is-app-defined-relation-discovery-enabled', type=click.BOOL, help=u"""Indicates if data discovery jobs should identify potential application-level (non-dictionary) referential relationships between columns. Note that data discovery automatically identifies and adds database-level (dictionary-defined) relationships. This option helps identify application-level relationships that are not defined in the database dictionary, which in turn, helps identify additional sensitive columns and preserve referential integrity during data masking. It's disabled by default and should be used only if there is a need to identify application-level relationships.""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}})
+@json_skeleton_utils.get_cli_json_input_option({'schemas-for-discovery': {'module': 'data_safe', 'class': 'list[string]'}, 'tables-for-discovery': {'module': 'data_safe', 'class': 'list[TablesForDiscovery]'}, 'sensitive-type-ids-for-discovery': {'module': 'data_safe', 'class': 'list[string]'}, 'sensitive-type-group-ids-for-discovery': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'tls-config': {'module': 'data_safe', 'class': 'TlsConfig'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schemas-for-discovery': {'module': 'data_safe', 'class': 'list[string]'}, 'tables-for-discovery': {'module': 'data_safe', 'class': 'list[TablesForDiscovery]'}, 'sensitive-type-ids-for-discovery': {'module': 'data_safe', 'class': 'list[string]'}, 'sensitive-type-group-ids-for-discovery': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_peer_target_database_database_cloud_service_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, target_database_id, peer_target_database_id, database_details_infrastructure_type, display_name, description, tls_config, if_match, database_details_vm_cluster_id, database_details_db_system_id, database_details_pluggable_database_id, database_details_listener_port, database_details_service_name):
-
- if isinstance(target_database_id, six.string_types) and len(target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --target-database-id cannot be whitespace or empty string')
+def update_sensitive_data_model(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_data_model_id, display_name, target_id, app_suite_name, description, schemas_for_discovery, tables_for_discovery, sensitive_type_ids_for_discovery, sensitive_type_group_ids_for_discovery, is_sample_data_collection_enabled, is_app_defined_relation_discovery_enabled, freeform_tags, defined_tags, if_match):
- if isinstance(peer_target_database_id, six.string_types) and len(peer_target_database_id.strip()) == 0:
- raise click.UsageError('Parameter --peer-target-database-id cannot be whitespace or empty string')
+ if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
if not force:
- if tls_config:
- if not click.confirm("WARNING: Updates to tls-config will replace any existing values. Are you sure you want to continue?"):
+ if schemas_for_discovery or tables_for_discovery or sensitive_type_ids_for_discovery or sensitive_type_group_ids_for_discovery or freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to schemas-for-discovery and tables-for-discovery and sensitive-type-ids-for-discovery and sensitive-type-group-ids-for-discovery and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -24754,40 +29121,47 @@ def update_peer_target_database_database_cloud_service_details(ctx, from_json, f
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['databaseDetails'] = {}
- _details['databaseDetails']['infrastructureType'] = database_details_infrastructure_type
if display_name is not None:
_details['displayName'] = display_name
+ if target_id is not None:
+ _details['targetId'] = target_id
+
+ if app_suite_name is not None:
+ _details['appSuiteName'] = app_suite_name
+
if description is not None:
_details['description'] = description
- if tls_config is not None:
- _details['tlsConfig'] = cli_util.parse_json_parameter("tls_config", tls_config)
+ if schemas_for_discovery is not None:
+ _details['schemasForDiscovery'] = cli_util.parse_json_parameter("schemas_for_discovery", schemas_for_discovery)
- if database_details_vm_cluster_id is not None:
- _details['databaseDetails']['vmClusterId'] = database_details_vm_cluster_id
+ if tables_for_discovery is not None:
+ _details['tablesForDiscovery'] = cli_util.parse_json_parameter("tables_for_discovery", tables_for_discovery)
- if database_details_db_system_id is not None:
- _details['databaseDetails']['dbSystemId'] = database_details_db_system_id
+ if sensitive_type_ids_for_discovery is not None:
+ _details['sensitiveTypeIdsForDiscovery'] = cli_util.parse_json_parameter("sensitive_type_ids_for_discovery", sensitive_type_ids_for_discovery)
- if database_details_pluggable_database_id is not None:
- _details['databaseDetails']['pluggableDatabaseId'] = database_details_pluggable_database_id
+ if sensitive_type_group_ids_for_discovery is not None:
+ _details['sensitiveTypeGroupIdsForDiscovery'] = cli_util.parse_json_parameter("sensitive_type_group_ids_for_discovery", sensitive_type_group_ids_for_discovery)
- if database_details_listener_port is not None:
- _details['databaseDetails']['listenerPort'] = database_details_listener_port
+ if is_sample_data_collection_enabled is not None:
+ _details['isSampleDataCollectionEnabled'] = is_sample_data_collection_enabled
- if database_details_service_name is not None:
- _details['databaseDetails']['serviceName'] = database_details_service_name
+ if is_app_defined_relation_discovery_enabled is not None:
+ _details['isAppDefinedRelationDiscoveryEnabled'] = is_app_defined_relation_discovery_enabled
- _details['databaseDetails']['databaseType'] = 'DATABASE_CLOUD_SERVICE'
+ 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_safe', 'data_safe', ctx)
- result = client.update_peer_target_database(
- target_database_id=target_database_id,
- peer_target_database_id=peer_target_database_id,
- update_peer_target_database_details=_details,
+ result = client.update_sensitive_data_model(
+ sensitive_data_model_id=sensitive_data_model_id,
+ update_sensitive_data_model_details=_details,
**kwargs
)
if wait_for_state:
@@ -24820,8 +29194,13 @@ def update_peer_target_database_database_cloud_service_details(ctx, from_json, f
cli_util.render_response(result, ctx)
-@report_group.command(name=cli_util.override('data_safe.update_report.command_name', 'update'), help=u"""Updates the specified report. Only tags can be updated. \n[Command Reference](updateReport)""")
-@cli_util.option('--report-id', required=True, help=u"""Unique report identifier""")
+@sensitive_type_group.command(name=cli_util.override('data_safe.update_sensitive_type.command_name', 'update'), help=u"""Updates one or more attributes of the specified sensitive type. \n[Command Reference](updateSensitiveType)""")
+@cli_util.option('--sensitive-type-id', required=True, help=u"""The OCID of the sensitive type.""")
+@cli_util.option('--entity-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["SENSITIVE_TYPE", "SENSITIVE_CATEGORY"]), help=u"""The entity type. It can be either a sensitive type with regular expressions or a sensitive category used for grouping similar sensitive types.""")
+@cli_util.option('--display-name', help=u"""The display name of the sensitive type. The name does not have to be unique, and it's changeable.""")
+@cli_util.option('--short-name', help=u"""The short name of the sensitive type.""")
+@cli_util.option('--description', help=u"""The description of the sensitive type.""")
+@cli_util.option('--parent-category-id', help=u"""The OCID of the parent sensitive category.""")
@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)
@@ -24836,10 +29215,10 @@ def update_peer_target_database_database_cloud_service_details(ctx, from_json, f
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_report(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, report_id, freeform_tags, defined_tags, if_match):
+def update_sensitive_type(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_id, entity_type, display_name, short_name, description, parent_category_id, freeform_tags, defined_tags, if_match):
- if isinstance(report_id, six.string_types) and len(report_id.strip()) == 0:
- raise click.UsageError('Parameter --report-id cannot be whitespace or empty string')
+ if isinstance(sensitive_type_id, six.string_types) and len(sensitive_type_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-type-id cannot be whitespace or empty string')
if not force:
if freeform_tags or defined_tags:
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
@@ -24851,6 +29230,19 @@ def update_report(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['entityType'] = entity_type
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if short_name is not None:
+ _details['shortName'] = short_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if parent_category_id is not None:
+ _details['parentCategoryId'] = parent_category_id
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -24859,9 +29251,9 @@ def update_report(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_report(
- report_id=report_id,
- update_report_details=_details,
+ result = client.update_sensitive_type(
+ sensitive_type_id=sensitive_type_id,
+ update_sensitive_type_details=_details,
**kwargs
)
if wait_for_state:
@@ -24894,14 +29286,12 @@ def update_report(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_
cli_util.render_response(result, ctx)
-@report_definition_group.command(name=cli_util.override('data_safe.update_report_definition.command_name', 'update'), help=u"""Updates the specified report definition. Only user created report definition can be updated. Seeded report definitions need to be saved as new report definition first. \n[Command Reference](updateReportDefinition)""")
-@cli_util.option('--report-definition-id', required=True, help=u"""Unique report definition identifier""")
-@cli_util.option('--display-name', required=True, help=u"""Specifies the name of the report definition.""")
-@cli_util.option('--column-info', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of column objects in the order (left to right) displayed in the report. A column object stores all information about a column, including the name displayed on the UI, corresponding field name in the data source, data type of the column, and column visibility (if the column is visible to the user).""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--column-filters', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of column filter objects. A column Filter object stores all information about a column filter including field name, an operator, one or more expressions, if the filter is enabled, or if the filter is hidden.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--column-sortings', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of column sorting objects. Each column sorting object stores the column name to be sorted and if the sorting is in ascending order; sorting is done by the first column in the array, then by the second column in the array, etc.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--summary', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of report summary objects in the order (left to right) displayed in the report. A report summary object stores all information about summary of report to be displayed, including the name displayed on UI, the display order, corresponding group by and count of values, summary visibility (if the summary is visible to user).""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--description', help=u"""The description of the report definition.""")
+@sensitive_type_group.command(name=cli_util.override('data_safe.update_sensitive_type_update_sensitive_category_details.command_name', 'update-sensitive-type-update-sensitive-category-details'), help=u"""Updates one or more attributes of the specified sensitive type. \n[Command Reference](updateSensitiveType)""")
+@cli_util.option('--sensitive-type-id', required=True, help=u"""The OCID of the sensitive type.""")
+@cli_util.option('--display-name', help=u"""The display name of the sensitive type. The name does not have to be unique, and it's changeable.""")
+@cli_util.option('--short-name', help=u"""The short name of the sensitive type.""")
+@cli_util.option('--description', help=u"""The description of the sensitive type.""")
+@cli_util.option('--parent-category-id', help=u"""The OCID of the parent sensitive category.""")
@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)
@@ -24911,18 +29301,18 @@ def update_report(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'column-info': {'module': 'data_safe', 'class': 'list[Column]'}, 'column-filters': {'module': 'data_safe', 'class': 'list[ColumnFilter]'}, 'column-sortings': {'module': 'data_safe', 'class': 'list[ColumnSorting]'}, 'summary': {'module': 'data_safe', 'class': 'list[Summary]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'column-info': {'module': 'data_safe', 'class': 'list[Column]'}, 'column-filters': {'module': 'data_safe', 'class': 'list[ColumnFilter]'}, 'column-sortings': {'module': 'data_safe', 'class': 'list[ColumnSorting]'}, 'summary': {'module': 'data_safe', 'class': 'list[Summary]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_report_definition(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, report_definition_id, display_name, column_info, column_filters, column_sortings, summary, description, freeform_tags, defined_tags, if_match):
+def update_sensitive_type_update_sensitive_category_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_id, display_name, short_name, description, parent_category_id, freeform_tags, defined_tags, if_match):
- if isinstance(report_definition_id, six.string_types) and len(report_definition_id.strip()) == 0:
- raise click.UsageError('Parameter --report-definition-id cannot be whitespace or empty string')
+ if isinstance(sensitive_type_id, six.string_types) and len(sensitive_type_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-type-id cannot be whitespace or empty string')
if not force:
- if column_info or column_filters or column_sortings or summary or freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to column-info and column-filters and column-sortings and summary and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -24931,25 +29321,31 @@ def update_report_definition(ctx, from_json, force, wait_for_state, max_wait_sec
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['displayName'] = display_name
- _details['columnInfo'] = cli_util.parse_json_parameter("column_info", column_info)
- _details['columnFilters'] = cli_util.parse_json_parameter("column_filters", column_filters)
- _details['columnSortings'] = cli_util.parse_json_parameter("column_sortings", column_sortings)
- _details['summary'] = cli_util.parse_json_parameter("summary", summary)
+
+ if display_name is not None:
+ _details['displayName'] = display_name
+
+ if short_name is not None:
+ _details['shortName'] = short_name
if description is not None:
_details['description'] = description
+ if parent_category_id is not None:
+ _details['parentCategoryId'] = parent_category_id
+
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['entityType'] = 'SENSITIVE_CATEGORY'
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_report_definition(
- report_definition_id=report_definition_id,
- update_report_definition_details=_details,
+ result = client.update_sensitive_type(
+ sensitive_type_id=sensitive_type_id,
+ update_sensitive_type_details=_details,
**kwargs
)
if wait_for_state:
@@ -24982,13 +29378,21 @@ def update_report_definition(ctx, from_json, force, wait_for_state, max_wait_sec
cli_util.render_response(result, ctx)
-@sdm_masking_policy_difference_group.command(name=cli_util.override('data_safe.update_sdm_masking_policy_difference.command_name', 'update'), help=u"""Updates one or more attributes of the specified sdm masking policy difference. \n[Command Reference](updateSdmMaskingPolicyDifference)""")
-@cli_util.option('--sdm-masking-policy-difference-id', required=True, help=u"""The OCID of the SDM masking policy difference.""")
-@cli_util.option('--display-name', help=u"""The display name of the sdm masking policy difference. The name does not have to be unique, and it's changeable.""")
+@sensitive_type_group.command(name=cli_util.override('data_safe.update_sensitive_type_update_sensitive_type_pattern_details.command_name', 'update-sensitive-type-update-sensitive-type-pattern-details'), help=u"""Updates one or more attributes of the specified sensitive type. \n[Command Reference](updateSensitiveType)""")
+@cli_util.option('--sensitive-type-id', required=True, help=u"""The OCID of the sensitive type.""")
+@cli_util.option('--display-name', help=u"""The display name of the sensitive type. The name does not have to be unique, and it's changeable.""")
+@cli_util.option('--short-name', help=u"""The short name of the sensitive type.""")
+@cli_util.option('--description', help=u"""The description of the sensitive type.""")
+@cli_util.option('--parent-category-id', help=u"""The OCID of the parent sensitive category.""")
@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('--name-pattern', help=u"""A regular expression to be used by data discovery for matching column names.""")
+@cli_util.option('--comment-pattern', help=u"""A regular expression to be used by data discovery for matching column comments.""")
+@cli_util.option('--data-pattern', help=u"""A regular expression to be used by data discovery for matching column data values.""")
+@cli_util.option('--search-type', help=u"""The search type indicating how the column name, comment and data patterns should be used by data discovery. [Learn more].""")
+@cli_util.option('--default-masking-format-id', help=u"""The OCID of the library masking format that should be used to mask the sensitive columns associated with the sensitive type.""")
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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.""")
@@ -24999,10 +29403,10 @@ def update_report_definition(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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_sdm_masking_policy_difference(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sdm_masking_policy_difference_id, display_name, freeform_tags, defined_tags, if_match):
+def update_sensitive_type_update_sensitive_type_pattern_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_id, display_name, short_name, description, parent_category_id, freeform_tags, defined_tags, name_pattern, comment_pattern, data_pattern, search_type, default_masking_format_id, if_match):
- if isinstance(sdm_masking_policy_difference_id, six.string_types) and len(sdm_masking_policy_difference_id.strip()) == 0:
- raise click.UsageError('Parameter --sdm-masking-policy-difference-id cannot be whitespace or empty string')
+ if isinstance(sensitive_type_id, six.string_types) and len(sensitive_type_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-type-id cannot be whitespace or empty string')
if not force:
if freeform_tags or defined_tags:
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
@@ -25018,16 +29422,42 @@ def update_sdm_masking_policy_difference(ctx, from_json, force, wait_for_state,
if display_name is not None:
_details['displayName'] = display_name
+ if short_name is not None:
+ _details['shortName'] = short_name
+
+ if description is not None:
+ _details['description'] = description
+
+ if parent_category_id is not None:
+ _details['parentCategoryId'] = parent_category_id
+
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 name_pattern is not None:
+ _details['namePattern'] = name_pattern
+
+ if comment_pattern is not None:
+ _details['commentPattern'] = comment_pattern
+
+ if data_pattern is not None:
+ _details['dataPattern'] = data_pattern
+
+ if search_type is not None:
+ _details['searchType'] = search_type
+
+ if default_masking_format_id is not None:
+ _details['defaultMaskingFormatId'] = default_masking_format_id
+
+ _details['entityType'] = 'SENSITIVE_TYPE'
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_sdm_masking_policy_difference(
- sdm_masking_policy_difference_id=sdm_masking_policy_difference_id,
- update_sdm_masking_policy_difference_details=_details,
+ result = client.update_sensitive_type(
+ sensitive_type_id=sensitive_type_id,
+ update_sensitive_type_details=_details,
**kwargs
)
if wait_for_state:
@@ -25060,14 +29490,10 @@ def update_sdm_masking_policy_difference(ctx, from_json, force, wait_for_state,
cli_util.render_response(result, ctx)
-@security_assessment_group.command(name=cli_util.override('data_safe.update_security_assessment.command_name', 'update'), help=u"""Updates one or more attributes of the specified security assessment. This operation allows to update the security assessment displayName, description, or schedule. \n[Command Reference](updateSecurityAssessment)""")
-@cli_util.option('--security-assessment-id', required=True, help=u"""The OCID of the security assessment.""")
-@cli_util.option('--display-name', help=u"""The display name of the security assessment.""")
-@cli_util.option('--description', help=u"""The description of the security assessment.""")
-@cli_util.option('--is-assessment-scheduled', type=click.BOOL, help=u"""Indicates whether the assessment is scheduled to run.""")
-@cli_util.option('--schedule', help=u"""This is applicable only for save schedule and latest assessment. It updates the existing schedule in a specified format: ;
-
-Allowed version strings - \"v1\" v1's version specific schedule - Each of the above fields potentially introduce constraints. A workrequest is created only when clock time satisfies all the constraints. Constraints introduced: 1. seconds = (So, the allowed range for is [0, 59]) 2. minutes = (So, the allowed range for is [0, 59]) 3. hours = (So, the allowed range for is [0, 23]) can be either '*' (without quotes or a number between 1(Monday) and 7(Sunday)) 4. No constraint introduced when it is '*'. When not, day of week must equal the given value can be either '*' (without quotes or a number between 1 and 28) 5. No constraint introduced when it is '*'. When not, day of month must equal the given value""")
+@sensitive_type_group_group.command(name=cli_util.override('data_safe.update_sensitive_type_group.command_name', 'update'), help=u"""Updates one or more attributes of the specified sensitive type group. \n[Command Reference](updateSensitiveTypeGroup)""")
+@cli_util.option('--sensitive-type-group-id', required=True, help=u"""The OCID of the sensitive type group.""")
+@cli_util.option('--display-name', help=u"""The display name of the sensitive type group. The name does not have to be unique, and it's changeable.""")
+@cli_util.option('--description', help=u"""The description of the sensitive type group.""")
@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)
@@ -25082,10 +29508,10 @@ def update_sdm_masking_policy_difference(ctx, from_json, force, wait_for_state,
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_security_assessment(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, security_assessment_id, display_name, description, is_assessment_scheduled, schedule, freeform_tags, defined_tags, if_match):
+def update_sensitive_type_group(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_group_id, display_name, description, freeform_tags, defined_tags, if_match):
- if isinstance(security_assessment_id, six.string_types) and len(security_assessment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-assessment-id cannot be whitespace or empty string')
+ if isinstance(sensitive_type_group_id, six.string_types) and len(sensitive_type_group_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-type-group-id cannot be whitespace or empty string')
if not force:
if freeform_tags or defined_tags:
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
@@ -25104,12 +29530,6 @@ def update_security_assessment(ctx, from_json, force, wait_for_state, max_wait_s
if description is not None:
_details['description'] = description
- if is_assessment_scheduled is not None:
- _details['isAssessmentScheduled'] = is_assessment_scheduled
-
- if schedule is not None:
- _details['schedule'] = schedule
-
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -25117,9 +29537,9 @@ def update_security_assessment(ctx, from_json, force, wait_for_state, max_wait_s
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_security_assessment(
- security_assessment_id=security_assessment_id,
- update_security_assessment_details=_details,
+ result = client.update_sensitive_type_group(
+ sensitive_type_group_id=sensitive_type_group_id,
+ update_sensitive_type_group_details=_details,
**kwargs
)
if wait_for_state:
@@ -25152,10 +29572,10 @@ def update_security_assessment(ctx, from_json, force, wait_for_state, max_wait_s
cli_util.render_response(result, ctx)
-@security_policy_group.command(name=cli_util.override('data_safe.update_security_policy.command_name', 'update'), help=u"""Updates the security policy. \n[Command Reference](updateSecurityPolicy)""")
-@cli_util.option('--security-policy-id', required=True, help=u"""The OCID of the security policy resource.""")
-@cli_util.option('--display-name', help=u"""The display name of the security policy. The name does not have to be unique, and it is changeable.""")
-@cli_util.option('--description', help=u"""The description of the security policy.""")
+@sensitive_types_export_group.command(name=cli_util.override('data_safe.update_sensitive_types_export.command_name', 'update'), help=u"""Updates one or more attributes of the specified sensitive types export. \n[Command Reference](updateSensitiveTypesExport)""")
+@cli_util.option('--sensitive-types-export-id', required=True, help=u"""The OCID of the sensitive types export.""")
+@cli_util.option('--display-name', help=u"""The display name of the sensitive types export. The name does not have to be unique, and it's changeable.""")
+@cli_util.option('--description', help=u"""The description of the sensitive types export.""")
@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)
@@ -25170,10 +29590,10 @@ def update_security_assessment(ctx, from_json, force, wait_for_state, max_wait_s
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_security_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_id, display_name, description, freeform_tags, defined_tags, if_match):
+def update_sensitive_types_export(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_types_export_id, display_name, description, freeform_tags, defined_tags, if_match):
- if isinstance(security_policy_id, six.string_types) and len(security_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-id cannot be whitespace or empty string')
+ if isinstance(sensitive_types_export_id, six.string_types) and len(sensitive_types_export_id.strip()) == 0:
+ raise click.UsageError('Parameter --sensitive-types-export-id cannot be whitespace or empty string')
if not force:
if freeform_tags or defined_tags:
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
@@ -25199,9 +29619,9 @@ def update_security_policy(ctx, from_json, force, wait_for_state, max_wait_secon
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_security_policy(
- security_policy_id=security_policy_id,
- update_security_policy_details=_details,
+ result = client.update_sensitive_types_export(
+ sensitive_types_export_id=sensitive_types_export_id,
+ update_sensitive_types_export_details=_details,
**kwargs
)
if wait_for_state:
@@ -25234,12 +29654,10 @@ def update_security_policy(ctx, from_json, force, wait_for_state, max_wait_secon
cli_util.render_response(result, ctx)
-@security_policy_config_group.command(name=cli_util.override('data_safe.update_security_policy_config.command_name', 'update'), help=u"""Updates the security policy configuration. \n[Command Reference](updateSecurityPolicyConfig)""")
-@cli_util.option('--security-policy-config-id', required=True, help=u"""The OCID of the security policy configuration resource.""")
-@cli_util.option('--display-name', help=u"""The display name of the security policy configuration. The name does not have to be unique, and it is changeable.""")
-@cli_util.option('--description', help=u"""The description of the security policy configuration.""")
-@cli_util.option('--firewall-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--unified-audit-policy-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@sql_collection_group.command(name=cli_util.override('data_safe.update_sql_collection.command_name', 'update'), help=u"""Updates the SQL collection. \n[Command Reference](updateSqlCollection)""")
+@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
+@cli_util.option('--display-name', help=u"""The display name of the SQL collection. The name does not have to be unique, and it is changeable.""")
+@cli_util.option('--description', help=u"""The description of the SQL collection.""")
@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)
@@ -25249,18 +29667,18 @@ def update_security_policy(ctx, from_json, force, wait_for_state, max_wait_secon
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'firewall-config': {'module': 'data_safe', 'class': 'FirewallConfigDetails'}, 'unified-audit-policy-config': {'module': 'data_safe', 'class': 'UnifiedAuditPolicyConfigDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'firewall-config': {'module': 'data_safe', 'class': 'FirewallConfigDetails'}, 'unified-audit-policy-config': {'module': 'data_safe', 'class': 'UnifiedAuditPolicyConfigDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_security_policy_config(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_config_id, display_name, description, firewall_config, unified_audit_policy_config, freeform_tags, defined_tags, if_match):
+def update_sql_collection(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, display_name, description, freeform_tags, defined_tags, if_match):
- if isinstance(security_policy_config_id, six.string_types) and len(security_policy_config_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-config-id cannot be whitespace or empty string')
+ if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
if not force:
- if firewall_config or unified_audit_policy_config or freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to firewall-config and unified-audit-policy-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -25276,12 +29694,6 @@ def update_security_policy_config(ctx, from_json, force, wait_for_state, max_wai
if description is not None:
_details['description'] = description
- if firewall_config is not None:
- _details['firewallConfig'] = cli_util.parse_json_parameter("firewall_config", firewall_config)
-
- if unified_audit_policy_config is not None:
- _details['unifiedAuditPolicyConfig'] = cli_util.parse_json_parameter("unified_audit_policy_config", unified_audit_policy_config)
-
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -25289,9 +29701,9 @@ def update_security_policy_config(ctx, from_json, force, wait_for_state, max_wai
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_security_policy_config(
- security_policy_config_id=security_policy_config_id,
- update_security_policy_config_details=_details,
+ result = client.update_sql_collection(
+ sql_collection_id=sql_collection_id,
+ update_sql_collection_details=_details,
**kwargs
)
if wait_for_state:
@@ -25324,10 +29736,17 @@ def update_security_policy_config(ctx, from_json, force, wait_for_state, max_wai
cli_util.render_response(result, ctx)
-@security_policy_deployment_group.command(name=cli_util.override('data_safe.update_security_policy_deployment.command_name', 'update'), help=u"""Updates the security policy deployment. \n[Command Reference](updateSecurityPolicyDeployment)""")
-@cli_util.option('--security-policy-deployment-id', required=True, help=u"""The OCID of the security policy deployment resource.""")
-@cli_util.option('--display-name', help=u"""The display name of the security policy deployment. The name does not have to be unique, and it is changeable.""")
-@cli_util.option('--description', help=u"""The description of the security policy deployment.""")
+@sql_firewall_policy_group.command(name=cli_util.override('data_safe.update_sql_firewall_policy.command_name', 'update'), help=u"""Updates the SQL Firewall policy. \n[Command Reference](updateSqlFirewallPolicy)""")
+@cli_util.option('--sql-firewall-policy-id', required=True, help=u"""The OCID of the SQL Firewall policy resource.""")
+@cli_util.option('--display-name', help=u"""The display name of the SQL Firewall policy. The name does not have to be unique, and it is changeable.""")
+@cli_util.option('--description', help=u"""The description of the SQL Firewall policy.""")
+@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Specifies whether the SQL Firewall policy is enabled or disabled.""")
+@cli_util.option('--enforcement-scope', type=custom_types.CliCaseInsensitiveChoice(["ENFORCE_CONTEXT", "ENFORCE_SQL", "ENFORCE_ALL"]), help=u"""Specifies the SQL Firewall policy enforcement option.""")
+@cli_util.option('--violation-action', type=custom_types.CliCaseInsensitiveChoice(["BLOCK", "OBSERVE"]), help=u"""Specifies the SQL Firewall action based on detection of SQL Firewall violations.""")
+@cli_util.option('--violation-audit', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Specifies whether a unified audit policy should be enabled for auditing the SQL Firewall policy violations.""")
+@cli_util.option('--allowed-client-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of allowed ip addresses for the SQL Firewall policy.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--allowed-client-os-usernames', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of allowed operating system user names for the SQL Firewall policy.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--allowed-client-programs', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of allowed client programs for the SQL Firewall policy.""" + 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)
@@ -25337,18 +29756,18 @@ def update_security_policy_config(ctx, from_json, force, wait_for_state, max_wai
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'allowed-client-ips': {'module': 'data_safe', 'class': 'list[string]'}, 'allowed-client-os-usernames': {'module': 'data_safe', 'class': 'list[string]'}, 'allowed-client-programs': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'allowed-client-ips': {'module': 'data_safe', 'class': 'list[string]'}, 'allowed-client-os-usernames': {'module': 'data_safe', 'class': 'list[string]'}, 'allowed-client-programs': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_security_policy_deployment(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, security_policy_deployment_id, display_name, description, freeform_tags, defined_tags, if_match):
+def update_sql_firewall_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_firewall_policy_id, display_name, description, status, enforcement_scope, violation_action, violation_audit, allowed_client_ips, allowed_client_os_usernames, allowed_client_programs, freeform_tags, defined_tags, if_match):
- if isinstance(security_policy_deployment_id, six.string_types) and len(security_policy_deployment_id.strip()) == 0:
- raise click.UsageError('Parameter --security-policy-deployment-id cannot be whitespace or empty string')
+ if isinstance(sql_firewall_policy_id, six.string_types) and len(sql_firewall_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --sql-firewall-policy-id cannot be whitespace or empty string')
if not force:
- if freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if allowed_client_ips or allowed_client_os_usernames or allowed_client_programs or freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to allowed-client-ips and allowed-client-os-usernames and allowed-client-programs and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -25364,6 +29783,27 @@ def update_security_policy_deployment(ctx, from_json, force, wait_for_state, max
if description is not None:
_details['description'] = description
+ if status is not None:
+ _details['status'] = status
+
+ if enforcement_scope is not None:
+ _details['enforcementScope'] = enforcement_scope
+
+ if violation_action is not None:
+ _details['violationAction'] = violation_action
+
+ if violation_audit is not None:
+ _details['violationAudit'] = violation_audit
+
+ if allowed_client_ips is not None:
+ _details['allowedClientIps'] = cli_util.parse_json_parameter("allowed_client_ips", allowed_client_ips)
+
+ if allowed_client_os_usernames is not None:
+ _details['allowedClientOsUsernames'] = cli_util.parse_json_parameter("allowed_client_os_usernames", allowed_client_os_usernames)
+
+ if allowed_client_programs is not None:
+ _details['allowedClientPrograms'] = cli_util.parse_json_parameter("allowed_client_programs", allowed_client_programs)
+
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -25371,9 +29811,9 @@ def update_security_policy_deployment(ctx, from_json, force, wait_for_state, max
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_security_policy_deployment(
- security_policy_deployment_id=security_policy_deployment_id,
- update_security_policy_deployment_details=_details,
+ result = client.update_sql_firewall_policy(
+ sql_firewall_policy_id=sql_firewall_policy_id,
+ update_sql_firewall_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -25406,36 +29846,40 @@ def update_security_policy_deployment(ctx, from_json, force, wait_for_state, max
cli_util.render_response(result, ctx)
-@sensitive_column_group.command(name=cli_util.override('data_safe.update_sensitive_column.command_name', 'update'), help=u"""Updates one or more attributes of the specified sensitive column. \n[Command Reference](updateSensitiveColumn)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--sensitive-column-key', required=True, help=u"""The unique key that identifies the sensitive column. It's numeric and unique within a sensitive data model.""")
-@cli_util.option('--data-type', help=u"""The data type of the sensitive column.""")
-@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["VALID", "INVALID"]), help=u"""The status of the sensitive column. VALID means the column is considered sensitive. INVALID means the column is not considered sensitive. Tracking invalid columns in a sensitive data model helps ensure that an incremental data discovery job does not identify these columns as sensitive.""")
-@cli_util.option('--sensitive-type-id', help=u"""The OCID of the sensitive type to be associated with the sensitive column.""")
-@cli_util.option('--parent-column-keys', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Unique keys identifying the columns that are parents of the sensitive column. At present, it accepts only one parent column key. This attribute can be used to establish relationship between columns in a sensitive data model. Note that the parent column must be added to the sensitive data model before its key can be specified here. If this attribute is provided, the appDefinedChildColumnKeys or dbDefinedChildColumnKeys attribute of the parent column is automatically updated to reflect the relationship.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--relation-type', type=custom_types.CliCaseInsensitiveChoice(["NONE", "APP_DEFINED", "DB_DEFINED"]), help=u"""The type of referential relationship the sensitive column has with its parent. NONE indicates that the sensitive column does not have a parent. DB_DEFINED indicates that the relationship is defined in the database dictionary. APP_DEFINED indicates that the relationship is defined at the application level and not in the database dictionary.""")
-@cli_util.option('--app-defined-child-column-keys', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Unique keys identifying the columns that are application-level (non-dictionary) children of the sensitive column. This attribute can be used to establish relationship between columns in a sensitive data model. Note that the child columns must be added to the sensitive data model before their keys can be specified here. If this attribute is provided, the parentColumnKeys and relationType attributes of the child columns are automatically updated to reflect the relationship.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--db-defined-child-column-keys', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Unique keys identifying the columns that are database-level (dictionary-defined) children of the sensitive column. This attribute can be used to establish relationship between columns in a sensitive data model. Note that the child columns must be added to the sensitive data model before their keys can be specified here. If this attribute is provided, the parentColumnKeys and relationType attributes of the child columns are automatically updated to reflect the relationship.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@subsetting_policy_group.command(name=cli_util.override('data_safe.update_subsetting_policy.command_name', 'update'), help=u"""Updates one or more attributes of the specified subsetting policy. \n[Command Reference](updateSubsettingPolicy)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the subsetting policy. The name does not have to be unique, and it's changeable""")
+@cli_util.option('--description', help=u"""The description of the subsetting policy""")
+@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a subsetting operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, subsetting disables redo logging and flashback logging to purge any original data from logs. However, in certain circumstances when you only want to test subsetting, rollback changes, and retry subsetting, you could enable logging and use a flashback database to retrieve the original data after it has been subsetted""")
+@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The subsetting process gathers statistics on subsetted database tables after subsetting completes""")
+@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data subsetting. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve subsetting performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism""")
+@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data subsetting. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after subsetting completes""")
+@cli_util.option('--unrelated-tables-action', help=u"""Strategy to be applied for tables which are not impacted by any of the subsetting rules""")
+@cli_util.option('--pre-subsetting-script', help=u"""A pre-subsetting script, which can contain SQL and PL/SQL statements. It's executed before the subsetting process. It's usually used to perform any preparation or prerequisite work before subsetting data""")
+@cli_util.option('--post-subsetting-script', help=u"""A post-subsetting script, which can contain SQL and PL/SQL statements. It's executed after the subsetting process. It's usually used to perform additional transformation or cleanup work after subsetting data""")
+@cli_util.option('--schema-source', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--masking-policy-id', help=u"""The OCID of the masking policy to associate with this subsetting policy""")
+@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
+
+Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'parent-column-keys': {'module': 'data_safe', 'class': 'list[string]'}, 'app-defined-child-column-keys': {'module': 'data_safe', 'class': 'list[string]'}, 'db-defined-child-column-keys': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.get_cli_json_input_option({'schema-source': {'module': 'data_safe', 'class': 'UpdateSchemaSourceDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', '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={'parent-column-keys': {'module': 'data_safe', 'class': 'list[string]'}, 'app-defined-child-column-keys': {'module': 'data_safe', 'class': 'list[string]'}, 'db-defined-child-column-keys': {'module': 'data_safe', 'class': 'list[string]'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schema-source': {'module': 'data_safe', 'class': 'UpdateSchemaSourceDetails'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_sensitive_column(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_data_model_id, sensitive_column_key, data_type, status, sensitive_type_id, parent_column_keys, relation_type, app_defined_child_column_keys, db_defined_child_column_keys, if_match):
-
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+def update_subsetting_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_policy_id, display_name, description, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, unrelated_tables_action, pre_subsetting_script, post_subsetting_script, schema_source, masking_policy_id, freeform_tags, defined_tags, if_match):
- if isinstance(sensitive_column_key, six.string_types) and len(sensitive_column_key.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-column-key cannot be whitespace or empty string')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
if not force:
- if parent_column_keys or app_defined_child_column_keys or db_defined_child_column_keys:
- if not click.confirm("WARNING: Updates to parent-column-keys and app-defined-child-column-keys and db-defined-child-column-keys will replace any existing values. Are you sure you want to continue?"):
+ if schema_source or freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to schema-source and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -25445,32 +29889,49 @@ def update_sensitive_column(ctx, from_json, force, wait_for_state, max_wait_seco
_details = {}
- if data_type is not None:
- _details['dataType'] = data_type
+ if display_name is not None:
+ _details['displayName'] = display_name
- if status is not None:
- _details['status'] = status
+ if description is not None:
+ _details['description'] = description
- if sensitive_type_id is not None:
- _details['sensitiveTypeId'] = sensitive_type_id
+ if is_redo_logging_enabled is not None:
+ _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
- if parent_column_keys is not None:
- _details['parentColumnKeys'] = cli_util.parse_json_parameter("parent_column_keys", parent_column_keys)
+ if is_refresh_stats_enabled is not None:
+ _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
- if relation_type is not None:
- _details['relationType'] = relation_type
+ if parallel_degree is not None:
+ _details['parallelDegree'] = parallel_degree
- if app_defined_child_column_keys is not None:
- _details['appDefinedChildColumnKeys'] = cli_util.parse_json_parameter("app_defined_child_column_keys", app_defined_child_column_keys)
+ if recompile is not None:
+ _details['recompile'] = recompile
- if db_defined_child_column_keys is not None:
- _details['dbDefinedChildColumnKeys'] = cli_util.parse_json_parameter("db_defined_child_column_keys", db_defined_child_column_keys)
+ if unrelated_tables_action is not None:
+ _details['unrelatedTablesAction'] = unrelated_tables_action
+
+ if pre_subsetting_script is not None:
+ _details['preSubsettingScript'] = pre_subsetting_script
+
+ if post_subsetting_script is not None:
+ _details['postSubsettingScript'] = post_subsetting_script
+
+ if schema_source is not None:
+ _details['schemaSource'] = cli_util.parse_json_parameter("schema_source", schema_source)
+
+ if masking_policy_id is not None:
+ _details['maskingPolicyId'] = masking_policy_id
+
+ 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_safe', 'data_safe', ctx)
- result = client.update_sensitive_column(
- sensitive_data_model_id=sensitive_data_model_id,
- sensitive_column_key=sensitive_column_key,
- update_sensitive_column_details=_details,
+ result = client.update_subsetting_policy(
+ subsetting_policy_id=subsetting_policy_id,
+ update_subsetting_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -25503,41 +29964,41 @@ def update_sensitive_column(ctx, from_json, force, wait_for_state, max_wait_seco
cli_util.render_response(result, ctx)
-@sensitive_data_model_group.command(name=cli_util.override('data_safe.update_sensitive_data_model.command_name', 'update'), help=u"""Updates one or more attributes of the specified sensitive data model. Note that updating any attribute of a sensitive data model does not perform data discovery. \n[Command Reference](updateSensitiveDataModel)""")
-@cli_util.option('--sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model.""")
-@cli_util.option('--display-name', help=u"""The display name of the sensitive data model. The name does not have to be unique, and it's changeable.""")
-@cli_util.option('--target-id', help=u"""The OCID of the reference target database to be associated with the sensitive data model. All operations such as performing data discovery and adding columns manually are done in the context of the associated target database. Note that updating the targetId attribute does not perform data discovery automatically.""")
-@cli_util.option('--app-suite-name', help=u"""The application suite name identifying a collection of applications. It's useful only if maintaining a sensitive data model for a suite of applications.""")
-@cli_util.option('--description', help=u"""The description of the sensitive data model.""")
-@cli_util.option('--schemas-for-discovery', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The schemas to be used for future data discovery jobs.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--tables-for-discovery', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The data discovery jobs will scan the tables specified here, including both schemas and tables. For instance, the input could be in the format: [{schemaName: \"HR\", tableName: [\"T1\", \"T2\"]}, {schemaName: \"OE\", tableName : [\"T3\", \"T4\"]}].
-
-This option is a JSON list with items of type TablesForDiscovery. For documentation on TablesForDiscovery please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datasafe/20181201/datatypes/TablesForDiscovery.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--sensitive-type-ids-for-discovery', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The OCIDs of the sensitive types to be used for future data discovery jobs. If OCID of a sensitive category is provided, all its child sensitive types are used for data discovery.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--sensitive-type-group-ids-for-discovery', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The OCIDs of the sensitive type groups to be used by data discovery jobs.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--is-sample-data-collection-enabled', type=click.BOOL, help=u"""Indicates if data discovery jobs should collect and store sample data values for the discovered columns. Sample data helps review the discovered columns and ensure that they actually contain sensitive data. As it collects original data from the target database, it's disabled by default and should be used only if it's acceptable to store sample data in Data Safe's repository in Oracle Cloud. Note that sample data values are not collected for columns with the following data types: LONG, LOB, RAW, XMLTYPE and BFILE.""")
-@cli_util.option('--is-app-defined-relation-discovery-enabled', type=click.BOOL, help=u"""Indicates if data discovery jobs should identify potential application-level (non-dictionary) referential relationships between columns. Note that data discovery automatically identifies and adds database-level (dictionary-defined) relationships. This option helps identify application-level relationships that are not defined in the database dictionary, which in turn, helps identify additional sensitive columns and preserve referential integrity during data masking. It's disabled by default and should be used only if there is a need to identify application-level relationships.""")
+@subsetting_policy_group.command(name=cli_util.override('data_safe.update_subsetting_policy_update_schema_source_from_target_details.command_name', 'update-subsetting-policy-update-schema-source-from-target-details'), help=u"""Updates one or more attributes of the specified subsetting policy. \n[Command Reference](updateSubsettingPolicy)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the subsetting policy. The name does not have to be unique, and it's changeable""")
+@cli_util.option('--description', help=u"""The description of the subsetting policy""")
+@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a subsetting operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, subsetting disables redo logging and flashback logging to purge any original data from logs. However, in certain circumstances when you only want to test subsetting, rollback changes, and retry subsetting, you could enable logging and use a flashback database to retrieve the original data after it has been subsetted""")
+@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The subsetting process gathers statistics on subsetted database tables after subsetting completes""")
+@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data subsetting. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve subsetting performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism""")
+@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data subsetting. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after subsetting completes""")
+@cli_util.option('--unrelated-tables-action', help=u"""Strategy to be applied for tables which are not impacted by any of the subsetting rules""")
+@cli_util.option('--pre-subsetting-script', help=u"""A pre-subsetting script, which can contain SQL and PL/SQL statements. It's executed before the subsetting process. It's usually used to perform any preparation or prerequisite work before subsetting data""")
+@cli_util.option('--post-subsetting-script', help=u"""A post-subsetting script, which can contain SQL and PL/SQL statements. It's executed after the subsetting process. It's usually used to perform additional transformation or cleanup work after subsetting data""")
+@cli_util.option('--masking-policy-id', help=u"""The OCID of the masking policy to associate with this subsetting policy""")
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
+@cli_util.option('--schema-source-target-id', help=u"""The OCID of the target database that's used as the source of subsetting schemas""")
+@cli_util.option('--schema-source-schemas-for-subsetting', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The schemas to be subsetted""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'schemas-for-discovery': {'module': 'data_safe', 'class': 'list[string]'}, 'tables-for-discovery': {'module': 'data_safe', 'class': 'list[TablesForDiscovery]'}, 'sensitive-type-ids-for-discovery': {'module': 'data_safe', 'class': 'list[string]'}, 'sensitive-type-group-ids-for-discovery': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'schema-source-schemas-for-subsetting': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'schemas-for-discovery': {'module': 'data_safe', 'class': 'list[string]'}, 'tables-for-discovery': {'module': 'data_safe', 'class': 'list[TablesForDiscovery]'}, 'sensitive-type-ids-for-discovery': {'module': 'data_safe', 'class': 'list[string]'}, 'sensitive-type-group-ids-for-discovery': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}, 'schema-source-schemas-for-subsetting': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.wrap_exceptions
-def update_sensitive_data_model(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_data_model_id, display_name, target_id, app_suite_name, description, schemas_for_discovery, tables_for_discovery, sensitive_type_ids_for_discovery, sensitive_type_group_ids_for_discovery, is_sample_data_collection_enabled, is_app_defined_relation_discovery_enabled, freeform_tags, defined_tags, if_match):
+def update_subsetting_policy_update_schema_source_from_target_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_policy_id, display_name, description, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, unrelated_tables_action, pre_subsetting_script, post_subsetting_script, masking_policy_id, freeform_tags, defined_tags, if_match, schema_source_target_id, schema_source_schemas_for_subsetting):
- if isinstance(sensitive_data_model_id, six.string_types) and len(sensitive_data_model_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-data-model-id cannot be whitespace or empty string')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
if not force:
- if schemas_for_discovery or tables_for_discovery or sensitive_type_ids_for_discovery or sensitive_type_group_ids_for_discovery or freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to schemas-for-discovery and tables-for-discovery and sensitive-type-ids-for-discovery and sensitive-type-group-ids-for-discovery and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if freeform_tags or defined_tags:
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -25546,36 +30007,37 @@ def update_sensitive_data_model(ctx, from_json, force, wait_for_state, max_wait_
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['schemaSource'] = {}
if display_name is not None:
_details['displayName'] = display_name
- if target_id is not None:
- _details['targetId'] = target_id
-
- if app_suite_name is not None:
- _details['appSuiteName'] = app_suite_name
-
if description is not None:
_details['description'] = description
- if schemas_for_discovery is not None:
- _details['schemasForDiscovery'] = cli_util.parse_json_parameter("schemas_for_discovery", schemas_for_discovery)
+ if is_redo_logging_enabled is not None:
+ _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
- if tables_for_discovery is not None:
- _details['tablesForDiscovery'] = cli_util.parse_json_parameter("tables_for_discovery", tables_for_discovery)
+ if is_refresh_stats_enabled is not None:
+ _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
- if sensitive_type_ids_for_discovery is not None:
- _details['sensitiveTypeIdsForDiscovery'] = cli_util.parse_json_parameter("sensitive_type_ids_for_discovery", sensitive_type_ids_for_discovery)
+ if parallel_degree is not None:
+ _details['parallelDegree'] = parallel_degree
- if sensitive_type_group_ids_for_discovery is not None:
- _details['sensitiveTypeGroupIdsForDiscovery'] = cli_util.parse_json_parameter("sensitive_type_group_ids_for_discovery", sensitive_type_group_ids_for_discovery)
+ if recompile is not None:
+ _details['recompile'] = recompile
- if is_sample_data_collection_enabled is not None:
- _details['isSampleDataCollectionEnabled'] = is_sample_data_collection_enabled
+ if unrelated_tables_action is not None:
+ _details['unrelatedTablesAction'] = unrelated_tables_action
- if is_app_defined_relation_discovery_enabled is not None:
- _details['isAppDefinedRelationDiscoveryEnabled'] = is_app_defined_relation_discovery_enabled
+ if pre_subsetting_script is not None:
+ _details['preSubsettingScript'] = pre_subsetting_script
+
+ if post_subsetting_script is not None:
+ _details['postSubsettingScript'] = post_subsetting_script
+
+ if masking_policy_id is not None:
+ _details['maskingPolicyId'] = masking_policy_id
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -25583,10 +30045,18 @@ def update_sensitive_data_model(ctx, from_json, force, wait_for_state, max_wait_
if defined_tags is not None:
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if schema_source_target_id is not None:
+ _details['schemaSource']['targetId'] = schema_source_target_id
+
+ if schema_source_schemas_for_subsetting is not None:
+ _details['schemaSource']['schemasForSubsetting'] = cli_util.parse_json_parameter("schema_source_schemas_for_subsetting", schema_source_schemas_for_subsetting)
+
+ _details['schemaSource']['schemaSource'] = 'TARGET'
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_sensitive_data_model(
- sensitive_data_model_id=sensitive_data_model_id,
- update_sensitive_data_model_details=_details,
+ result = client.update_subsetting_policy(
+ subsetting_policy_id=subsetting_policy_id,
+ update_subsetting_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -25619,13 +30089,19 @@ def update_sensitive_data_model(ctx, from_json, force, wait_for_state, max_wait_
cli_util.render_response(result, ctx)
-@sensitive_type_group.command(name=cli_util.override('data_safe.update_sensitive_type.command_name', 'update'), help=u"""Updates one or more attributes of the specified sensitive type. \n[Command Reference](updateSensitiveType)""")
-@cli_util.option('--sensitive-type-id', required=True, help=u"""The OCID of the sensitive type.""")
-@cli_util.option('--entity-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["SENSITIVE_TYPE", "SENSITIVE_CATEGORY"]), help=u"""The entity type. It can be either a sensitive type with regular expressions or a sensitive category used for grouping similar sensitive types.""")
-@cli_util.option('--display-name', help=u"""The display name of the sensitive type. The name does not have to be unique, and it's changeable.""")
-@cli_util.option('--short-name', help=u"""The short name of the sensitive type.""")
-@cli_util.option('--description', help=u"""The description of the sensitive type.""")
-@cli_util.option('--parent-category-id', help=u"""The OCID of the parent sensitive category.""")
+@subsetting_policy_group.command(name=cli_util.override('data_safe.update_subsetting_policy_update_schema_source_from_sdm_details.command_name', 'update-subsetting-policy-update-schema-source-from-sdm-details'), help=u"""Updates one or more attributes of the specified subsetting policy. \n[Command Reference](updateSubsettingPolicy)""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--schema-source-sensitive-data-model-id', required=True, help=u"""The OCID of the sensitive data model that's used as the source of subsetting schemas""")
+@cli_util.option('--display-name', help=u"""The display name of the subsetting policy. The name does not have to be unique, and it's changeable""")
+@cli_util.option('--description', help=u"""The description of the subsetting policy""")
+@cli_util.option('--is-redo-logging-enabled', type=click.BOOL, help=u"""Indicates if redo logging is enabled during a subsetting operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, subsetting disables redo logging and flashback logging to purge any original data from logs. However, in certain circumstances when you only want to test subsetting, rollback changes, and retry subsetting, you could enable logging and use a flashback database to retrieve the original data after it has been subsetted""")
+@cli_util.option('--is-refresh-stats-enabled', type=click.BOOL, help=u"""Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The subsetting process gathers statistics on subsetted database tables after subsetting completes""")
+@cli_util.option('--parallel-degree', help=u"""Specifies options to enable parallel execution when running data subsetting. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve subsetting performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism""")
+@cli_util.option('--recompile', help=u"""Specifies how to recompile invalid objects post data subsetting. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after subsetting completes""")
+@cli_util.option('--unrelated-tables-action', help=u"""Strategy to be applied for tables which are not impacted by any of the subsetting rules""")
+@cli_util.option('--pre-subsetting-script', help=u"""A pre-subsetting script, which can contain SQL and PL/SQL statements. It's executed before the subsetting process. It's usually used to perform any preparation or prerequisite work before subsetting data""")
+@cli_util.option('--post-subsetting-script', help=u"""A post-subsetting script, which can contain SQL and PL/SQL statements. It's executed after the subsetting process. It's usually used to perform additional transformation or cleanup work after subsetting data""")
+@cli_util.option('--masking-policy-id', help=u"""The OCID of the masking policy to associate with this subsetting policy""")
@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)
@@ -25640,10 +30116,10 @@ def update_sensitive_data_model(ctx, from_json, force, wait_for_state, max_wait_
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
@cli_util.wrap_exceptions
-def update_sensitive_type(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_id, entity_type, display_name, short_name, description, parent_category_id, freeform_tags, defined_tags, if_match):
+def update_subsetting_policy_update_schema_source_from_sdm_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_policy_id, schema_source_sensitive_data_model_id, display_name, description, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, unrelated_tables_action, pre_subsetting_script, post_subsetting_script, masking_policy_id, freeform_tags, defined_tags, if_match):
- if isinstance(sensitive_type_id, six.string_types) and len(sensitive_type_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-type-id cannot be whitespace or empty string')
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
if not force:
if freeform_tags or defined_tags:
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
@@ -25655,19 +30131,38 @@ def update_sensitive_type(ctx, from_json, force, wait_for_state, max_wait_second
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
- _details['entityType'] = entity_type
+ _details['schemaSource'] = {}
+ _details['schemaSource']['sensitiveDataModelId'] = schema_source_sensitive_data_model_id
if display_name is not None:
_details['displayName'] = display_name
- if short_name is not None:
- _details['shortName'] = short_name
-
if description is not None:
_details['description'] = description
- if parent_category_id is not None:
- _details['parentCategoryId'] = parent_category_id
+ if is_redo_logging_enabled is not None:
+ _details['isRedoLoggingEnabled'] = is_redo_logging_enabled
+
+ if is_refresh_stats_enabled is not None:
+ _details['isRefreshStatsEnabled'] = is_refresh_stats_enabled
+
+ if parallel_degree is not None:
+ _details['parallelDegree'] = parallel_degree
+
+ if recompile is not None:
+ _details['recompile'] = recompile
+
+ if unrelated_tables_action is not None:
+ _details['unrelatedTablesAction'] = unrelated_tables_action
+
+ if pre_subsetting_script is not None:
+ _details['preSubsettingScript'] = pre_subsetting_script
+
+ if post_subsetting_script is not None:
+ _details['postSubsettingScript'] = post_subsetting_script
+
+ if masking_policy_id is not None:
+ _details['maskingPolicyId'] = masking_policy_id
if freeform_tags is not None:
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
@@ -25675,10 +30170,12 @@ def update_sensitive_type(ctx, from_json, force, wait_for_state, max_wait_second
if defined_tags is not None:
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ _details['schemaSource']['schemaSource'] = 'SENSITIVE_DATA_MODEL'
+
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_sensitive_type(
- sensitive_type_id=sensitive_type_id,
- update_sensitive_type_details=_details,
+ result = client.update_subsetting_policy(
+ subsetting_policy_id=subsetting_policy_id,
+ update_subsetting_policy_details=_details,
**kwargs
)
if wait_for_state:
@@ -25707,37 +30204,40 @@ def update_sensitive_type(ctx, from_json, force, wait_for_state, max_wait_second
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)
-
-
-@sensitive_type_group.command(name=cli_util.override('data_safe.update_sensitive_type_update_sensitive_category_details.command_name', 'update-sensitive-type-update-sensitive-category-details'), help=u"""Updates one or more attributes of the specified sensitive type. \n[Command Reference](updateSensitiveType)""")
-@cli_util.option('--sensitive-type-id', required=True, help=u"""The OCID of the sensitive type.""")
-@cli_util.option('--display-name', help=u"""The display name of the sensitive type. The name does not have to be unique, and it's changeable.""")
-@cli_util.option('--short-name', help=u"""The short name of the sensitive type.""")
-@cli_util.option('--description', help=u"""The description of the sensitive type.""")
-@cli_util.option('--parent-category-id', help=u"""The OCID of the parent sensitive category.""")
-@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]
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
-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)
+
+@subsetting_rule_group.command(name=cli_util.override('data_safe.update_subsetting_rule.command_name', 'update'), help=u"""Updates one or more attributes of the specified subsetting rule. Note that updating the subsettingRuleEntry attribute replaces the currently assigned subsettingRuleEntry \n[Command Reference](updateSubsettingRule)""")
+@cli_util.option('--subsetting-rule-key', required=True, help=u"""The unique key that identifies the subsetting rule. It's numeric and unique within a subsetting policy.""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the subset rule""")
+@cli_util.option('--description', help=u"""The description of the subset rule""")
+@cli_util.option('--scope', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--subset-rule-entry', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--rule-combination-mode', type=custom_types.CliCaseInsensitiveChoice(["UNION", "SERIAL"]), help=u"""Specifies how this rule combines with other rules. UNION evaluates this rule independently and adds matching rows to the result set. SERIAL applies this rule sequentially to filter rows selected by a compatible preceding rule.""")
+@cli_util.option('--related-tables-propagation', type=custom_types.CliCaseInsensitiveChoice(["ANCESTORS_AND_DESCENDANTS", "ANCESTORS", "DESCENDANTS", "NONE"]), help=u"""Strategy to be applied while propagating subsetting rule to related tables""")
+@cli_util.option('--peer-tables-action', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_ROWS", "SUBSET", "MAXIMUM_ROWS"]), help=u"""Strategy to be applied while processing peer tables""")
@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", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'scope': {'module': 'data_safe', 'class': 'SubsetScope'}, 'subset-rule-entry': {'module': 'data_safe', 'class': 'SubsetRuleEntry'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'scope': {'module': 'data_safe', 'class': 'SubsetScope'}, 'subset-rule-entry': {'module': 'data_safe', 'class': 'SubsetRuleEntry'}})
@cli_util.wrap_exceptions
-def update_sensitive_type_update_sensitive_category_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_id, display_name, short_name, description, parent_category_id, freeform_tags, defined_tags, if_match):
+def update_subsetting_rule(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_rule_key, subsetting_policy_id, display_name, description, scope, subset_rule_entry, rule_combination_mode, related_tables_propagation, peer_tables_action, if_match):
- if isinstance(sensitive_type_id, six.string_types) and len(sensitive_type_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-type-id cannot be whitespace or empty string')
+ if isinstance(subsetting_rule_key, six.string_types) and len(subsetting_rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-rule-key cannot be whitespace or empty string')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
if not force:
- if freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if scope or subset_rule_entry:
+ if not click.confirm("WARNING: Updates to scope and subset-rule-entry will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -25750,27 +30250,29 @@ def update_sensitive_type_update_sensitive_category_details(ctx, from_json, forc
if display_name is not None:
_details['displayName'] = display_name
- if short_name is not None:
- _details['shortName'] = short_name
-
if description is not None:
_details['description'] = description
- if parent_category_id is not None:
- _details['parentCategoryId'] = parent_category_id
+ if scope is not None:
+ _details['scope'] = cli_util.parse_json_parameter("scope", scope)
- if freeform_tags is not None:
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+ if subset_rule_entry is not None:
+ _details['subsetRuleEntry'] = cli_util.parse_json_parameter("subset_rule_entry", subset_rule_entry)
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if rule_combination_mode is not None:
+ _details['ruleCombinationMode'] = rule_combination_mode
- _details['entityType'] = 'SENSITIVE_CATEGORY'
+ if related_tables_propagation is not None:
+ _details['relatedTablesPropagation'] = related_tables_propagation
+
+ if peer_tables_action is not None:
+ _details['peerTablesAction'] = peer_tables_action
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_sensitive_type(
- sensitive_type_id=sensitive_type_id,
- update_sensitive_type_details=_details,
+ result = client.update_subsetting_rule(
+ subsetting_rule_key=subsetting_rule_key,
+ subsetting_policy_id=subsetting_policy_id,
+ update_subsetting_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -25803,38 +30305,36 @@ def update_sensitive_type_update_sensitive_category_details(ctx, from_json, forc
cli_util.render_response(result, ctx)
-@sensitive_type_group.command(name=cli_util.override('data_safe.update_sensitive_type_update_sensitive_type_pattern_details.command_name', 'update-sensitive-type-update-sensitive-type-pattern-details'), help=u"""Updates one or more attributes of the specified sensitive type. \n[Command Reference](updateSensitiveType)""")
-@cli_util.option('--sensitive-type-id', required=True, help=u"""The OCID of the sensitive type.""")
-@cli_util.option('--display-name', help=u"""The display name of the sensitive type. The name does not have to be unique, and it's changeable.""")
-@cli_util.option('--short-name', help=u"""The short name of the sensitive type.""")
-@cli_util.option('--description', help=u"""The description of the sensitive type.""")
-@cli_util.option('--parent-category-id', help=u"""The OCID of the parent sensitive category.""")
-@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('--name-pattern', help=u"""A regular expression to be used by data discovery for matching column names.""")
-@cli_util.option('--comment-pattern', help=u"""A regular expression to be used by data discovery for matching column comments.""")
-@cli_util.option('--data-pattern', help=u"""A regular expression to be used by data discovery for matching column data values.""")
-@cli_util.option('--search-type', help=u"""The search type indicating how the column name, comment and data patterns should be used by data discovery. [Learn more].""")
-@cli_util.option('--default-masking-format-id', help=u"""The OCID of the library masking format that should be used to mask the sensitive columns associated with the sensitive type.""")
+@subsetting_rule_group.command(name=cli_util.override('data_safe.update_subsetting_rule_subset_scope_for_all_objects.command_name', 'update-subsetting-rule-subset-scope-for-all-objects'), help=u"""Updates one or more attributes of the specified subsetting rule. Note that updating the subsettingRuleEntry attribute replaces the currently assigned subsettingRuleEntry \n[Command Reference](updateSubsettingRule)""")
+@cli_util.option('--subsetting-rule-key', required=True, help=u"""The unique key that identifies the subsetting rule. It's numeric and unique within a subsetting policy.""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the subset rule""")
+@cli_util.option('--description', help=u"""The description of the subset rule""")
+@cli_util.option('--subset-rule-entry', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--rule-combination-mode', type=custom_types.CliCaseInsensitiveChoice(["UNION", "SERIAL"]), help=u"""Specifies how this rule combines with other rules. UNION evaluates this rule independently and adds matching rows to the result set. SERIAL applies this rule sequentially to filter rows selected by a compatible preceding rule.""")
+@cli_util.option('--related-tables-propagation', type=custom_types.CliCaseInsensitiveChoice(["ANCESTORS_AND_DESCENDANTS", "ANCESTORS", "DESCENDANTS", "NONE"]), help=u"""Strategy to be applied while propagating subsetting rule to related tables""")
+@cli_util.option('--peer-tables-action', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_ROWS", "SUBSET", "MAXIMUM_ROWS"]), help=u"""Strategy to be applied while processing peer tables""")
@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('--scope-schema-name', help=u"""The name of the schema containing the objects to be subsetted""")
@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'subset-rule-entry': {'module': 'data_safe', 'class': 'SubsetRuleEntry'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'subset-rule-entry': {'module': 'data_safe', 'class': 'SubsetRuleEntry'}})
@cli_util.wrap_exceptions
-def update_sensitive_type_update_sensitive_type_pattern_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_id, display_name, short_name, description, parent_category_id, freeform_tags, defined_tags, name_pattern, comment_pattern, data_pattern, search_type, default_masking_format_id, if_match):
+def update_subsetting_rule_subset_scope_for_all_objects(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_rule_key, subsetting_policy_id, display_name, description, subset_rule_entry, rule_combination_mode, related_tables_propagation, peer_tables_action, if_match, scope_schema_name):
- if isinstance(sensitive_type_id, six.string_types) and len(sensitive_type_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-type-id cannot be whitespace or empty string')
+ if isinstance(subsetting_rule_key, six.string_types) and len(subsetting_rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-rule-key cannot be whitespace or empty string')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
if not force:
- if freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if subset_rule_entry:
+ if not click.confirm("WARNING: Updates to subset-rule-entry will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -25843,46 +30343,36 @@ def update_sensitive_type_update_sensitive_type_pattern_details(ctx, from_json,
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['scope'] = {}
if display_name is not None:
_details['displayName'] = display_name
- if short_name is not None:
- _details['shortName'] = short_name
-
if description is not None:
_details['description'] = description
- if parent_category_id is not None:
- _details['parentCategoryId'] = parent_category_id
-
- 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 name_pattern is not None:
- _details['namePattern'] = name_pattern
+ if subset_rule_entry is not None:
+ _details['subsetRuleEntry'] = cli_util.parse_json_parameter("subset_rule_entry", subset_rule_entry)
- if comment_pattern is not None:
- _details['commentPattern'] = comment_pattern
+ if rule_combination_mode is not None:
+ _details['ruleCombinationMode'] = rule_combination_mode
- if data_pattern is not None:
- _details['dataPattern'] = data_pattern
+ if related_tables_propagation is not None:
+ _details['relatedTablesPropagation'] = related_tables_propagation
- if search_type is not None:
- _details['searchType'] = search_type
+ if peer_tables_action is not None:
+ _details['peerTablesAction'] = peer_tables_action
- if default_masking_format_id is not None:
- _details['defaultMaskingFormatId'] = default_masking_format_id
+ if scope_schema_name is not None:
+ _details['scope']['schemaName'] = scope_schema_name
- _details['entityType'] = 'SENSITIVE_TYPE'
+ _details['scope']['scopeType'] = 'ALL'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_sensitive_type(
- sensitive_type_id=sensitive_type_id,
- update_sensitive_type_details=_details,
+ result = client.update_subsetting_rule(
+ subsetting_rule_key=subsetting_rule_key,
+ subsetting_policy_id=subsetting_policy_id,
+ update_subsetting_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -25915,31 +30405,37 @@ def update_sensitive_type_update_sensitive_type_pattern_details(ctx, from_json,
cli_util.render_response(result, ctx)
-@sensitive_type_group_group.command(name=cli_util.override('data_safe.update_sensitive_type_group.command_name', 'update'), help=u"""Updates one or more attributes of the specified sensitive type group. \n[Command Reference](updateSensitiveTypeGroup)""")
-@cli_util.option('--sensitive-type-group-id', required=True, help=u"""The OCID of the sensitive type group.""")
-@cli_util.option('--display-name', help=u"""The display name of the sensitive type group. The name does not have to be unique, and it's changeable.""")
-@cli_util.option('--description', help=u"""The description of the sensitive type group.""")
-@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)
+@subsetting_rule_group.command(name=cli_util.override('data_safe.update_subsetting_rule_subset_scope_for_specific_objects.command_name', 'update-subsetting-rule-subset-scope-for-specific-objects'), help=u"""Updates one or more attributes of the specified subsetting rule. Note that updating the subsettingRuleEntry attribute replaces the currently assigned subsettingRuleEntry \n[Command Reference](updateSubsettingRule)""")
+@cli_util.option('--subsetting-rule-key', required=True, help=u"""The unique key that identifies the subsetting rule. It's numeric and unique within a subsetting policy.""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--scope-schema-name', required=True, help=u"""The name of the schema containing the specific object to be subsetted""")
+@cli_util.option('--scope-object-name', required=True, help=u"""The name of the specific object (e.g., table) to be subsetted""")
+@cli_util.option('--display-name', help=u"""The display name of the subset rule""")
+@cli_util.option('--description', help=u"""The description of the subset rule""")
+@cli_util.option('--subset-rule-entry', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--rule-combination-mode', type=custom_types.CliCaseInsensitiveChoice(["UNION", "SERIAL"]), help=u"""Specifies how this rule combines with other rules. UNION evaluates this rule independently and adds matching rows to the result set. SERIAL applies this rule sequentially to filter rows selected by a compatible preceding rule.""")
+@cli_util.option('--related-tables-propagation', type=custom_types.CliCaseInsensitiveChoice(["ANCESTORS_AND_DESCENDANTS", "ANCESTORS", "DESCENDANTS", "NONE"]), help=u"""Strategy to be applied while propagating subsetting rule to related tables""")
+@cli_util.option('--peer-tables-action', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_ROWS", "SUBSET", "MAXIMUM_ROWS"]), help=u"""Strategy to be applied while processing peer tables""")
@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", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'subset-rule-entry': {'module': 'data_safe', 'class': 'SubsetRuleEntry'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'subset-rule-entry': {'module': 'data_safe', 'class': 'SubsetRuleEntry'}})
@cli_util.wrap_exceptions
-def update_sensitive_type_group(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_type_group_id, display_name, description, freeform_tags, defined_tags, if_match):
+def update_subsetting_rule_subset_scope_for_specific_objects(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_rule_key, subsetting_policy_id, scope_schema_name, scope_object_name, display_name, description, subset_rule_entry, rule_combination_mode, related_tables_propagation, peer_tables_action, if_match):
- if isinstance(sensitive_type_group_id, six.string_types) and len(sensitive_type_group_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-type-group-id cannot be whitespace or empty string')
+ if isinstance(subsetting_rule_key, six.string_types) and len(subsetting_rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-rule-key cannot be whitespace or empty string')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
if not force:
- if freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if subset_rule_entry:
+ if not click.confirm("WARNING: Updates to subset-rule-entry will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -25948,6 +30444,9 @@ def update_sensitive_type_group(ctx, from_json, force, wait_for_state, max_wait_
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['scope'] = {}
+ _details['scope']['schemaName'] = scope_schema_name
+ _details['scope']['objectName'] = scope_object_name
if display_name is not None:
_details['displayName'] = display_name
@@ -25955,16 +30454,25 @@ def update_sensitive_type_group(ctx, from_json, force, wait_for_state, max_wait_
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 subset_rule_entry is not None:
+ _details['subsetRuleEntry'] = cli_util.parse_json_parameter("subset_rule_entry", subset_rule_entry)
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if rule_combination_mode is not None:
+ _details['ruleCombinationMode'] = rule_combination_mode
+
+ if related_tables_propagation is not None:
+ _details['relatedTablesPropagation'] = related_tables_propagation
+
+ if peer_tables_action is not None:
+ _details['peerTablesAction'] = peer_tables_action
+
+ _details['scope']['scopeType'] = 'SPECIFIC'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_sensitive_type_group(
- sensitive_type_group_id=sensitive_type_group_id,
- update_sensitive_type_group_details=_details,
+ result = client.update_subsetting_rule(
+ subsetting_rule_key=subsetting_rule_key,
+ subsetting_policy_id=subsetting_policy_id,
+ update_subsetting_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -25997,31 +30505,37 @@ def update_sensitive_type_group(ctx, from_json, force, wait_for_state, max_wait_
cli_util.render_response(result, ctx)
-@sensitive_types_export_group.command(name=cli_util.override('data_safe.update_sensitive_types_export.command_name', 'update'), help=u"""Updates one or more attributes of the specified sensitive types export. \n[Command Reference](updateSensitiveTypesExport)""")
-@cli_util.option('--sensitive-types-export-id', required=True, help=u"""The OCID of the sensitive types export.""")
-@cli_util.option('--display-name', help=u"""The display name of the sensitive types export. The name does not have to be unique, and it's changeable.""")
-@cli_util.option('--description', help=u"""The description of the sensitive types export.""")
-@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)
+@subsetting_rule_group.command(name=cli_util.override('data_safe.update_subsetting_rule_partition_subset_rule_entry.command_name', 'update-subsetting-rule-partition-subset-rule-entry'), help=u"""Updates one or more attributes of the specified subsetting rule. Note that updating the subsettingRuleEntry attribute replaces the currently assigned subsettingRuleEntry \n[Command Reference](updateSubsettingRule)""")
+@cli_util.option('--subsetting-rule-key', required=True, help=u"""The unique key that identifies the subsetting rule. It's numeric and unique within a subsetting policy.""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--display-name', help=u"""The display name of the subset rule""")
+@cli_util.option('--description', help=u"""The description of the subset rule""")
+@cli_util.option('--scope', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--rule-combination-mode', type=custom_types.CliCaseInsensitiveChoice(["UNION", "SERIAL"]), help=u"""Specifies how this rule combines with other rules. UNION evaluates this rule independently and adds matching rows to the result set. SERIAL applies this rule sequentially to filter rows selected by a compatible preceding rule.""")
+@cli_util.option('--related-tables-propagation', type=custom_types.CliCaseInsensitiveChoice(["ANCESTORS_AND_DESCENDANTS", "ANCESTORS", "DESCENDANTS", "NONE"]), help=u"""Strategy to be applied while propagating subsetting rule to related tables""")
+@cli_util.option('--peer-tables-action', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_ROWS", "SUBSET", "MAXIMUM_ROWS"]), help=u"""Strategy to be applied while processing peer tables""")
@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('--subset-rule-entry-partitions-list', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A list of partition names which are to be part of the subset data""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--subset-rule-entry-sub-partitions-list', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A list of sub-partition names which are to be part of the subset data. The sub-partition names should have the partition name also, separated by a dot""" + 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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'scope': {'module': 'data_safe', 'class': 'SubsetScope'}, 'subset-rule-entry-partitions-list': {'module': 'data_safe', 'class': 'list[string]'}, 'subset-rule-entry-sub-partitions-list': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'scope': {'module': 'data_safe', 'class': 'SubsetScope'}, 'subset-rule-entry-partitions-list': {'module': 'data_safe', 'class': 'list[string]'}, 'subset-rule-entry-sub-partitions-list': {'module': 'data_safe', 'class': 'list[string]'}})
@cli_util.wrap_exceptions
-def update_sensitive_types_export(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sensitive_types_export_id, display_name, description, freeform_tags, defined_tags, if_match):
+def update_subsetting_rule_partition_subset_rule_entry(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_rule_key, subsetting_policy_id, display_name, description, scope, rule_combination_mode, related_tables_propagation, peer_tables_action, if_match, subset_rule_entry_partitions_list, subset_rule_entry_sub_partitions_list):
- if isinstance(sensitive_types_export_id, six.string_types) and len(sensitive_types_export_id.strip()) == 0:
- raise click.UsageError('Parameter --sensitive-types-export-id cannot be whitespace or empty string')
+ if isinstance(subsetting_rule_key, six.string_types) and len(subsetting_rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-rule-key cannot be whitespace or empty string')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
if not force:
- if freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if scope:
+ if not click.confirm("WARNING: Updates to scope will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -26030,6 +30544,7 @@ def update_sensitive_types_export(ctx, from_json, force, wait_for_state, max_wai
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['subsetRuleEntry'] = {}
if display_name is not None:
_details['displayName'] = display_name
@@ -26037,16 +30552,31 @@ def update_sensitive_types_export(ctx, from_json, force, wait_for_state, max_wai
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 scope is not None:
+ _details['scope'] = cli_util.parse_json_parameter("scope", scope)
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if rule_combination_mode is not None:
+ _details['ruleCombinationMode'] = rule_combination_mode
+
+ if related_tables_propagation is not None:
+ _details['relatedTablesPropagation'] = related_tables_propagation
+
+ if peer_tables_action is not None:
+ _details['peerTablesAction'] = peer_tables_action
+
+ if subset_rule_entry_partitions_list is not None:
+ _details['subsetRuleEntry']['partitionsList'] = cli_util.parse_json_parameter("subset_rule_entry_partitions_list", subset_rule_entry_partitions_list)
+
+ if subset_rule_entry_sub_partitions_list is not None:
+ _details['subsetRuleEntry']['subPartitionsList'] = cli_util.parse_json_parameter("subset_rule_entry_sub_partitions_list", subset_rule_entry_sub_partitions_list)
+
+ _details['subsetRuleEntry']['ruleType'] = 'PARTITION'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_sensitive_types_export(
- sensitive_types_export_id=sensitive_types_export_id,
- update_sensitive_types_export_details=_details,
+ result = client.update_subsetting_rule(
+ subsetting_rule_key=subsetting_rule_key,
+ subsetting_policy_id=subsetting_policy_id,
+ update_subsetting_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -26079,31 +30609,36 @@ def update_sensitive_types_export(ctx, from_json, force, wait_for_state, max_wai
cli_util.render_response(result, ctx)
-@sql_collection_group.command(name=cli_util.override('data_safe.update_sql_collection.command_name', 'update'), help=u"""Updates the SQL collection. \n[Command Reference](updateSqlCollection)""")
-@cli_util.option('--sql-collection-id', required=True, help=u"""The OCID of the SQL collection resource.""")
-@cli_util.option('--display-name', help=u"""The display name of the SQL collection. The name does not have to be unique, and it is changeable.""")
-@cli_util.option('--description', help=u"""The description of the SQL collection.""")
-@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)
+@subsetting_rule_group.command(name=cli_util.override('data_safe.update_subsetting_rule_percent_subset_rule_entry.command_name', 'update-subsetting-rule-percent-subset-rule-entry'), help=u"""Updates one or more attributes of the specified subsetting rule. Note that updating the subsettingRuleEntry attribute replaces the currently assigned subsettingRuleEntry \n[Command Reference](updateSubsettingRule)""")
+@cli_util.option('--subsetting-rule-key', required=True, help=u"""The unique key that identifies the subsetting rule. It's numeric and unique within a subsetting policy.""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--subset-rule-entry-percent', required=True, type=click.INT, help=u"""The percentage of rows to retain in the subset (between 0 and 100)""")
+@cli_util.option('--display-name', help=u"""The display name of the subset rule""")
+@cli_util.option('--description', help=u"""The description of the subset rule""")
+@cli_util.option('--scope', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--rule-combination-mode', type=custom_types.CliCaseInsensitiveChoice(["UNION", "SERIAL"]), help=u"""Specifies how this rule combines with other rules. UNION evaluates this rule independently and adds matching rows to the result set. SERIAL applies this rule sequentially to filter rows selected by a compatible preceding rule.""")
+@cli_util.option('--related-tables-propagation', type=custom_types.CliCaseInsensitiveChoice(["ANCESTORS_AND_DESCENDANTS", "ANCESTORS", "DESCENDANTS", "NONE"]), help=u"""Strategy to be applied while propagating subsetting rule to related tables""")
+@cli_util.option('--peer-tables-action', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_ROWS", "SUBSET", "MAXIMUM_ROWS"]), help=u"""Strategy to be applied while processing peer tables""")
@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", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'scope': {'module': 'data_safe', 'class': 'SubsetScope'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'scope': {'module': 'data_safe', 'class': 'SubsetScope'}})
@cli_util.wrap_exceptions
-def update_sql_collection(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_collection_id, display_name, description, freeform_tags, defined_tags, if_match):
+def update_subsetting_rule_percent_subset_rule_entry(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_rule_key, subsetting_policy_id, subset_rule_entry_percent, display_name, description, scope, rule_combination_mode, related_tables_propagation, peer_tables_action, if_match):
- if isinstance(sql_collection_id, six.string_types) and len(sql_collection_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-collection-id cannot be whitespace or empty string')
+ if isinstance(subsetting_rule_key, six.string_types) and len(subsetting_rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-rule-key cannot be whitespace or empty string')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
if not force:
- if freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if scope:
+ if not click.confirm("WARNING: Updates to scope will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -26112,6 +30647,8 @@ def update_sql_collection(ctx, from_json, force, wait_for_state, max_wait_second
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['subsetRuleEntry'] = {}
+ _details['subsetRuleEntry']['percent'] = subset_rule_entry_percent
if display_name is not None:
_details['displayName'] = display_name
@@ -26119,16 +30656,25 @@ def update_sql_collection(ctx, from_json, force, wait_for_state, max_wait_second
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 scope is not None:
+ _details['scope'] = cli_util.parse_json_parameter("scope", scope)
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ if rule_combination_mode is not None:
+ _details['ruleCombinationMode'] = rule_combination_mode
+
+ if related_tables_propagation is not None:
+ _details['relatedTablesPropagation'] = related_tables_propagation
+
+ if peer_tables_action is not None:
+ _details['peerTablesAction'] = peer_tables_action
+
+ _details['subsetRuleEntry']['ruleType'] = 'PERCENT'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_sql_collection(
- sql_collection_id=sql_collection_id,
- update_sql_collection_details=_details,
+ result = client.update_subsetting_rule(
+ subsetting_rule_key=subsetting_rule_key,
+ subsetting_policy_id=subsetting_policy_id,
+ update_subsetting_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -26161,38 +30707,36 @@ def update_sql_collection(ctx, from_json, force, wait_for_state, max_wait_second
cli_util.render_response(result, ctx)
-@sql_firewall_policy_group.command(name=cli_util.override('data_safe.update_sql_firewall_policy.command_name', 'update'), help=u"""Updates the SQL Firewall policy. \n[Command Reference](updateSqlFirewallPolicy)""")
-@cli_util.option('--sql-firewall-policy-id', required=True, help=u"""The OCID of the SQL Firewall policy resource.""")
-@cli_util.option('--display-name', help=u"""The display name of the SQL Firewall policy. The name does not have to be unique, and it is changeable.""")
-@cli_util.option('--description', help=u"""The description of the SQL Firewall policy.""")
-@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Specifies whether the SQL Firewall policy is enabled or disabled.""")
-@cli_util.option('--enforcement-scope', type=custom_types.CliCaseInsensitiveChoice(["ENFORCE_CONTEXT", "ENFORCE_SQL", "ENFORCE_ALL"]), help=u"""Specifies the SQL Firewall policy enforcement option.""")
-@cli_util.option('--violation-action', type=custom_types.CliCaseInsensitiveChoice(["BLOCK", "OBSERVE"]), help=u"""Specifies the SQL Firewall action based on detection of SQL Firewall violations.""")
-@cli_util.option('--violation-audit', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Specifies whether a unified audit policy should be enabled for auditing the SQL Firewall policy violations.""")
-@cli_util.option('--allowed-client-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of allowed ip addresses for the SQL Firewall policy.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--allowed-client-os-usernames', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of allowed operating system user names for the SQL Firewall policy.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--allowed-client-programs', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of allowed client programs for the SQL Firewall policy.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]
-
-Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
-@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags] Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@subsetting_rule_group.command(name=cli_util.override('data_safe.update_subsetting_rule_condition_subset_rule_entry.command_name', 'update-subsetting-rule-condition-subset-rule-entry'), help=u"""Updates one or more attributes of the specified subsetting rule. Note that updating the subsettingRuleEntry attribute replaces the currently assigned subsettingRuleEntry \n[Command Reference](updateSubsettingRule)""")
+@cli_util.option('--subsetting-rule-key', required=True, help=u"""The unique key that identifies the subsetting rule. It's numeric and unique within a subsetting policy.""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@cli_util.option('--subset-rule-entry-condition', required=True, help=u"""The SQL WHERE clause condition used to filter rows for the subset""")
+@cli_util.option('--display-name', help=u"""The display name of the subset rule""")
+@cli_util.option('--description', help=u"""The description of the subset rule""")
+@cli_util.option('--scope', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
+@cli_util.option('--rule-combination-mode', type=custom_types.CliCaseInsensitiveChoice(["UNION", "SERIAL"]), help=u"""Specifies how this rule combines with other rules. UNION evaluates this rule independently and adds matching rows to the result set. SERIAL applies this rule sequentially to filter rows selected by a compatible preceding rule.""")
+@cli_util.option('--related-tables-propagation', type=custom_types.CliCaseInsensitiveChoice(["ANCESTORS_AND_DESCENDANTS", "ANCESTORS", "DESCENDANTS", "NONE"]), help=u"""Strategy to be applied while propagating subsetting rule to related tables""")
+@cli_util.option('--peer-tables-action', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_ROWS", "SUBSET", "MAXIMUM_ROWS"]), help=u"""Strategy to be applied while processing peer tables""")
@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", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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({'allowed-client-ips': {'module': 'data_safe', 'class': 'list[string]'}, 'allowed-client-os-usernames': {'module': 'data_safe', 'class': 'list[string]'}, 'allowed-client-programs': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.get_cli_json_input_option({'scope': {'module': 'data_safe', 'class': 'SubsetScope'}})
@cli_util.help_option
@click.pass_context
-@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'allowed-client-ips': {'module': 'data_safe', 'class': 'list[string]'}, 'allowed-client-os-usernames': {'module': 'data_safe', 'class': 'list[string]'}, 'allowed-client-programs': {'module': 'data_safe', 'class': 'list[string]'}, 'freeform-tags': {'module': 'data_safe', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_safe', 'class': 'dict(str, dict(str, object))'}})
+@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'scope': {'module': 'data_safe', 'class': 'SubsetScope'}})
@cli_util.wrap_exceptions
-def update_sql_firewall_policy(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, sql_firewall_policy_id, display_name, description, status, enforcement_scope, violation_action, violation_audit, allowed_client_ips, allowed_client_os_usernames, allowed_client_programs, freeform_tags, defined_tags, if_match):
+def update_subsetting_rule_condition_subset_rule_entry(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, subsetting_rule_key, subsetting_policy_id, subset_rule_entry_condition, display_name, description, scope, rule_combination_mode, related_tables_propagation, peer_tables_action, if_match):
- if isinstance(sql_firewall_policy_id, six.string_types) and len(sql_firewall_policy_id.strip()) == 0:
- raise click.UsageError('Parameter --sql-firewall-policy-id cannot be whitespace or empty string')
+ if isinstance(subsetting_rule_key, six.string_types) and len(subsetting_rule_key.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-rule-key cannot be whitespace or empty string')
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-id cannot be whitespace or empty string')
if not force:
- if allowed_client_ips or allowed_client_os_usernames or allowed_client_programs or freeform_tags or defined_tags:
- if not click.confirm("WARNING: Updates to allowed-client-ips and allowed-client-os-usernames and allowed-client-programs and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
+ if scope:
+ if not click.confirm("WARNING: Updates to scope will replace any existing values. Are you sure you want to continue?"):
ctx.abort()
kwargs = {}
@@ -26201,6 +30745,8 @@ def update_sql_firewall_policy(ctx, from_json, force, wait_for_state, max_wait_s
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
_details = {}
+ _details['subsetRuleEntry'] = {}
+ _details['subsetRuleEntry']['condition'] = subset_rule_entry_condition
if display_name is not None:
_details['displayName'] = display_name
@@ -26208,37 +30754,25 @@ def update_sql_firewall_policy(ctx, from_json, force, wait_for_state, max_wait_s
if description is not None:
_details['description'] = description
- if status is not None:
- _details['status'] = status
-
- if enforcement_scope is not None:
- _details['enforcementScope'] = enforcement_scope
-
- if violation_action is not None:
- _details['violationAction'] = violation_action
-
- if violation_audit is not None:
- _details['violationAudit'] = violation_audit
-
- if allowed_client_ips is not None:
- _details['allowedClientIps'] = cli_util.parse_json_parameter("allowed_client_ips", allowed_client_ips)
+ if scope is not None:
+ _details['scope'] = cli_util.parse_json_parameter("scope", scope)
- if allowed_client_os_usernames is not None:
- _details['allowedClientOsUsernames'] = cli_util.parse_json_parameter("allowed_client_os_usernames", allowed_client_os_usernames)
+ if rule_combination_mode is not None:
+ _details['ruleCombinationMode'] = rule_combination_mode
- if allowed_client_programs is not None:
- _details['allowedClientPrograms'] = cli_util.parse_json_parameter("allowed_client_programs", allowed_client_programs)
+ if related_tables_propagation is not None:
+ _details['relatedTablesPropagation'] = related_tables_propagation
- if freeform_tags is not None:
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
+ if peer_tables_action is not None:
+ _details['peerTablesAction'] = peer_tables_action
- if defined_tags is not None:
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
+ _details['subsetRuleEntry']['ruleType'] = 'CONDITION'
client = cli_util.build_client('data_safe', 'data_safe', ctx)
- result = client.update_sql_firewall_policy(
- sql_firewall_policy_id=sql_firewall_policy_id,
- update_sql_firewall_policy_details=_details,
+ result = client.update_subsetting_rule(
+ subsetting_rule_key=subsetting_rule_key,
+ subsetting_policy_id=subsetting_policy_id,
+ update_subsetting_rule_details=_details,
**kwargs
)
if wait_for_state:
@@ -27456,3 +31990,64 @@ def upload_sensitive_data_model(ctx, from_json, wait_for_state, max_wait_seconds
else:
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
cli_util.render_response(result, ctx)
+
+
+@subsetting_policy_group.command(name=cli_util.override('data_safe.upload_subsetting_policy.command_name', 'upload'), help=u"""Uploads a subsetting policy file (also called template) to update the specified subsetting policy. To create a new subsetting policy using a file, first use the CreateSubsettingPolicy operation to create an empty subsetting policy and then use this operation to upload the subsetting policy file. Note that the upload operation replaces the content of the specified subsetting policy, including all the subsetting rules, with the content of the file. \n[Command Reference](uploadSubsettingPolicy)""")
+@cli_util.option('--upload-subsetting-policy-details', required=True, help=u"""Details to upload a subsetting policy file.""")
+@cli_util.option('--subsetting-policy-id', required=True, help=u"""The OCID of the subsetting policy.""")
+@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", "SUSPENDING", "SUSPENDED"]), 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 SUSPENDED 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 upload_subsetting_policy(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, upload_subsetting_policy_details, subsetting_policy_id, if_match):
+
+ if isinstance(subsetting_policy_id, six.string_types) and len(subsetting_policy_id.strip()) == 0:
+ raise click.UsageError('Parameter --subsetting-policy-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'])
+
+ # do not automatically retry operations with binary inputs
+ kwargs['retry_strategy'] = oci.retry.NoneRetryStrategy()
+
+ client = cli_util.build_client('data_safe', 'data_safe', ctx)
+ result = client.upload_subsetting_policy(
+ upload_subsetting_policy_details=upload_subsetting_policy_details,
+ subsetting_policy_id=subsetting_policy_id,
+ **kwargs
+ )
+ if wait_for_state:
+
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
+ try:
+ wait_period_kwargs = {}
+ if max_wait_seconds is not None:
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
+ if wait_interval_seconds is not None:
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
+ if 'opc-work-request-id' not in result.headers:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
+ cli_util.render_response(result, ctx)
+ return
+
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
+ # If we fail, we should show an error, but we should still provide the information to the customer
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ sys.exit(2)
+ except Exception:
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
+ raise
+ else:
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
+ cli_util.render_response(result, ctx)
diff --git a/services/data_safe/tests/util/generated/command_to_api.py b/services/data_safe/tests/util/generated/command_to_api.py
index 3b03b75f0..e4800e776 100644
--- a/services/data_safe/tests/util/generated/command_to_api.py
+++ b/services/data_safe/tests/util/generated/command_to_api.py
@@ -29,6 +29,7 @@
"data_safe.change_masking_policy_compartment": "oci.data_safe.DataSafeClient.change_masking_policy_compartment",
"data_safe.change_masking_policy_health_report_compartment": "oci.data_safe.DataSafeClient.change_masking_policy_health_report_compartment",
"data_safe.change_on_prem_connector_compartment": "oci.data_safe.DataSafeClient.change_on_prem_connector_compartment",
+ "data_safe.change_registration_policy_compartment": "oci.data_safe.DataSafeClient.change_registration_policy_compartment",
"data_safe.change_report_compartment": "oci.data_safe.DataSafeClient.change_report_compartment",
"data_safe.change_report_definition_compartment": "oci.data_safe.DataSafeClient.change_report_definition_compartment",
"data_safe.change_retention": "oci.data_safe.DataSafeClient.change_retention",
@@ -43,6 +44,8 @@
"data_safe.change_sensitive_types_export_compartment": "oci.data_safe.DataSafeClient.change_sensitive_types_export_compartment",
"data_safe.change_sql_collection_compartment": "oci.data_safe.DataSafeClient.change_sql_collection_compartment",
"data_safe.change_sql_firewall_policy_compartment": "oci.data_safe.DataSafeClient.change_sql_firewall_policy_compartment",
+ "data_safe.change_subsetting_policy_compartment": "oci.data_safe.DataSafeClient.change_subsetting_policy_compartment",
+ "data_safe.change_subsetting_policy_health_report_compartment": "oci.data_safe.DataSafeClient.change_subsetting_policy_health_report_compartment",
"data_safe.change_target_alert_policy_association_compartment": "oci.data_safe.DataSafeClient.change_target_alert_policy_association_compartment",
"data_safe.change_target_database_compartment": "oci.data_safe.DataSafeClient.change_target_database_compartment",
"data_safe.change_target_database_group_compartment": "oci.data_safe.DataSafeClient.change_target_database_group_compartment",
@@ -65,6 +68,7 @@
"data_safe.create_on_prem_connector": "oci.data_safe.DataSafeClient.create_on_prem_connector",
"data_safe.create_peer_target_database": "oci.data_safe.DataSafeClient.create_peer_target_database",
"data_safe.create_referential_relation": "oci.data_safe.DataSafeClient.create_referential_relation",
+ "data_safe.create_registration_policy": "oci.data_safe.DataSafeClient.create_registration_policy",
"data_safe.create_report_definition": "oci.data_safe.DataSafeClient.create_report_definition",
"data_safe.create_sdm_masking_policy_difference": "oci.data_safe.DataSafeClient.create_sdm_masking_policy_difference",
"data_safe.create_security_assessment": "oci.data_safe.DataSafeClient.create_security_assessment",
@@ -77,6 +81,9 @@
"data_safe.create_sensitive_type_group": "oci.data_safe.DataSafeClient.create_sensitive_type_group",
"data_safe.create_sensitive_types_export": "oci.data_safe.DataSafeClient.create_sensitive_types_export",
"data_safe.create_sql_collection": "oci.data_safe.DataSafeClient.create_sql_collection",
+ "data_safe.create_subsetting_policy": "oci.data_safe.DataSafeClient.create_subsetting_policy",
+ "data_safe.create_subsetting_rule": "oci.data_safe.DataSafeClient.create_subsetting_rule",
+ "data_safe.create_subsetting_schema_relation": "oci.data_safe.DataSafeClient.create_subsetting_schema_relation",
"data_safe.create_target_alert_policy_association": "oci.data_safe.DataSafeClient.create_target_alert_policy_association",
"data_safe.create_target_database": "oci.data_safe.DataSafeClient.create_target_database",
"data_safe.create_target_database_group": "oci.data_safe.DataSafeClient.create_target_database_group",
@@ -101,6 +108,7 @@
"data_safe.delete_on_prem_connector": "oci.data_safe.DataSafeClient.delete_on_prem_connector",
"data_safe.delete_peer_target_database": "oci.data_safe.DataSafeClient.delete_peer_target_database",
"data_safe.delete_referential_relation": "oci.data_safe.DataSafeClient.delete_referential_relation",
+ "data_safe.delete_registration_policy": "oci.data_safe.DataSafeClient.delete_registration_policy",
"data_safe.delete_report_definition": "oci.data_safe.DataSafeClient.delete_report_definition",
"data_safe.delete_sdm_masking_policy_difference": "oci.data_safe.DataSafeClient.delete_sdm_masking_policy_difference",
"data_safe.delete_security_assessment": "oci.data_safe.DataSafeClient.delete_security_assessment",
@@ -115,6 +123,11 @@
"data_safe.delete_sql_collection": "oci.data_safe.DataSafeClient.delete_sql_collection",
"data_safe.delete_sql_firewall_allowed_sql": "oci.data_safe.DataSafeClient.delete_sql_firewall_allowed_sql",
"data_safe.delete_sql_firewall_policy": "oci.data_safe.DataSafeClient.delete_sql_firewall_policy",
+ "data_safe.delete_subsetting_policy": "oci.data_safe.DataSafeClient.delete_subsetting_policy",
+ "data_safe.delete_subsetting_policy_health_report": "oci.data_safe.DataSafeClient.delete_subsetting_policy_health_report",
+ "data_safe.delete_subsetting_report": "oci.data_safe.DataSafeClient.delete_subsetting_report",
+ "data_safe.delete_subsetting_rule": "oci.data_safe.DataSafeClient.delete_subsetting_rule",
+ "data_safe.delete_subsetting_schema_relation": "oci.data_safe.DataSafeClient.delete_subsetting_schema_relation",
"data_safe.delete_target_alert_policy_association": "oci.data_safe.DataSafeClient.delete_target_alert_policy_association",
"data_safe.delete_target_database": "oci.data_safe.DataSafeClient.delete_target_database",
"data_safe.delete_target_database_group": "oci.data_safe.DataSafeClient.delete_target_database_group",
@@ -132,8 +145,12 @@
"data_safe.download_security_assessment_report": "oci.data_safe.DataSafeClient.download_security_assessment_report",
"data_safe.download_sensitive_data_model": "oci.data_safe.DataSafeClient.download_sensitive_data_model",
"data_safe.download_sensitive_types_export": "oci.data_safe.DataSafeClient.download_sensitive_types_export",
+ "data_safe.download_subsetting_log": "oci.data_safe.DataSafeClient.download_subsetting_log",
+ "data_safe.download_subsetting_policy": "oci.data_safe.DataSafeClient.download_subsetting_policy",
+ "data_safe.download_subsetting_report": "oci.data_safe.DataSafeClient.download_subsetting_report",
"data_safe.download_user_assessment_report": "oci.data_safe.DataSafeClient.download_user_assessment_report",
"data_safe.enable_data_safe_configuration": "oci.data_safe.DataSafeClient.enable_data_safe_configuration",
+ "data_safe.estimate_table_sizes": "oci.data_safe.DataSafeClient.estimate_table_sizes",
"data_safe.generate_crypto_assessment_report": "oci.data_safe.DataSafeClient.generate_crypto_assessment_report",
"data_safe.generate_discovery_report_for_download": "oci.data_safe.DataSafeClient.generate_discovery_report_for_download",
"data_safe.generate_health_report": "oci.data_safe.DataSafeClient.generate_health_report",
@@ -144,6 +161,9 @@
"data_safe.generate_security_assessment_report": "oci.data_safe.DataSafeClient.generate_security_assessment_report",
"data_safe.generate_sensitive_data_model_for_download": "oci.data_safe.DataSafeClient.generate_sensitive_data_model_for_download",
"data_safe.generate_sql_firewall_policy": "oci.data_safe.DataSafeClient.generate_sql_firewall_policy",
+ "data_safe.generate_subsetting_health_report": "oci.data_safe.DataSafeClient.generate_subsetting_health_report",
+ "data_safe.generate_subsetting_policy_for_download": "oci.data_safe.DataSafeClient.generate_subsetting_policy_for_download",
+ "data_safe.generate_subsetting_report_for_download": "oci.data_safe.DataSafeClient.generate_subsetting_report_for_download",
"data_safe.generate_user_assessment_report": "oci.data_safe.DataSafeClient.generate_user_assessment_report",
"data_safe.get_alert": "oci.data_safe.DataSafeClient.get_alert",
"data_safe.get_alert_policy": "oci.data_safe.DataSafeClient.get_alert_policy",
@@ -175,6 +195,7 @@
"data_safe.get_peer_target_database": "oci.data_safe.DataSafeClient.get_peer_target_database",
"data_safe.get_profile": "oci.data_safe.DataSafeClient.get_profile",
"data_safe.get_referential_relation": "oci.data_safe.DataSafeClient.get_referential_relation",
+ "data_safe.get_registration_policy": "oci.data_safe.DataSafeClient.get_registration_policy",
"data_safe.get_report": "oci.data_safe.DataSafeClient.get_report",
"data_safe.get_report_content": "oci.data_safe.DataSafeClient.get_report_content",
"data_safe.get_report_definition": "oci.data_safe.DataSafeClient.get_report_definition",
@@ -194,6 +215,11 @@
"data_safe.get_sql_collection": "oci.data_safe.DataSafeClient.get_sql_collection",
"data_safe.get_sql_firewall_allowed_sql": "oci.data_safe.DataSafeClient.get_sql_firewall_allowed_sql",
"data_safe.get_sql_firewall_policy": "oci.data_safe.DataSafeClient.get_sql_firewall_policy",
+ "data_safe.get_subsetting_policy": "oci.data_safe.DataSafeClient.get_subsetting_policy",
+ "data_safe.get_subsetting_policy_health_report": "oci.data_safe.DataSafeClient.get_subsetting_policy_health_report",
+ "data_safe.get_subsetting_report": "oci.data_safe.DataSafeClient.get_subsetting_report",
+ "data_safe.get_subsetting_rule": "oci.data_safe.DataSafeClient.get_subsetting_rule",
+ "data_safe.get_subsetting_schema_relation": "oci.data_safe.DataSafeClient.get_subsetting_schema_relation",
"data_safe.get_target_alert_policy_association": "oci.data_safe.DataSafeClient.get_target_alert_policy_association",
"data_safe.get_target_database": "oci.data_safe.DataSafeClient.get_target_database",
"data_safe.get_target_database_group": "oci.data_safe.DataSafeClient.get_target_database_group",
@@ -263,6 +289,8 @@
"data_safe.list_profile_analytics": "oci.data_safe.DataSafeClient.list_profile_analytics",
"data_safe.list_profile_summaries": "oci.data_safe.DataSafeClient.list_profile_summaries",
"data_safe.list_referential_relations": "oci.data_safe.DataSafeClient.list_referential_relations",
+ "data_safe.list_registration_policies": "oci.data_safe.DataSafeClient.list_registration_policies",
+ "data_safe.list_registration_policy_target_databases": "oci.data_safe.DataSafeClient.list_registration_policy_target_databases",
"data_safe.list_report_definitions": "oci.data_safe.DataSafeClient.list_report_definitions",
"data_safe.list_reports": "oci.data_safe.DataSafeClient.list_reports",
"data_safe.list_role_grant_paths": "oci.data_safe.DataSafeClient.list_role_grant_paths",
@@ -295,6 +323,19 @@
"data_safe.list_sql_firewall_policy_analytics": "oci.data_safe.DataSafeClient.list_sql_firewall_policy_analytics",
"data_safe.list_sql_firewall_violation_analytics": "oci.data_safe.DataSafeClient.list_sql_firewall_violation_analytics",
"data_safe.list_sql_firewall_violations": "oci.data_safe.DataSafeClient.list_sql_firewall_violations",
+ "data_safe.list_subsetted_objects": "oci.data_safe.DataSafeClient.list_subsetted_objects",
+ "data_safe.list_subsetting_analytics": "oci.data_safe.DataSafeClient.list_subsetting_analytics",
+ "data_safe.list_subsetting_errors": "oci.data_safe.DataSafeClient.list_subsetting_errors",
+ "data_safe.list_subsetting_policies": "oci.data_safe.DataSafeClient.list_subsetting_policies",
+ "data_safe.list_subsetting_policy_health_report_logs": "oci.data_safe.DataSafeClient.list_subsetting_policy_health_report_logs",
+ "data_safe.list_subsetting_policy_health_reports": "oci.data_safe.DataSafeClient.list_subsetting_policy_health_reports",
+ "data_safe.list_subsetting_reports": "oci.data_safe.DataSafeClient.list_subsetting_reports",
+ "data_safe.list_subsetting_rule_processing_chain_objects": "oci.data_safe.DataSafeClient.list_subsetting_rule_processing_chain_objects",
+ "data_safe.list_subsetting_rules": "oci.data_safe.DataSafeClient.list_subsetting_rules",
+ "data_safe.list_subsetting_schema_objects": "oci.data_safe.DataSafeClient.list_subsetting_schema_objects",
+ "data_safe.list_subsetting_schema_relations": "oci.data_safe.DataSafeClient.list_subsetting_schema_relations",
+ "data_safe.list_subsetting_schemas": "oci.data_safe.DataSafeClient.list_subsetting_schemas",
+ "data_safe.list_table_estimates": "oci.data_safe.DataSafeClient.list_table_estimates",
"data_safe.list_tables": "oci.data_safe.DataSafeClient.list_tables",
"data_safe.list_target_alert_policy_associations": "oci.data_safe.DataSafeClient.list_target_alert_policy_associations",
"data_safe.list_target_alert_policy_unassociated_members": "oci.data_safe.DataSafeClient.list_target_alert_policy_unassociated_members",
@@ -312,6 +353,7 @@
"data_safe.list_work_request_errors": "oci.data_safe.DataSafeClient.list_work_request_errors",
"data_safe.list_work_request_logs": "oci.data_safe.DataSafeClient.list_work_request_logs",
"data_safe.list_work_requests": "oci.data_safe.DataSafeClient.list_work_requests",
+ "data_safe.manage_privileges": "oci.data_safe.DataSafeClient.manage_privileges",
"data_safe.mask_data": "oci.data_safe.DataSafeClient.mask_data",
"data_safe.modify_global_settings": "oci.data_safe.DataSafeClient.modify_global_settings",
"data_safe.patch_alerts": "oci.data_safe.DataSafeClient.patch_alerts",
@@ -323,6 +365,7 @@
"data_safe.patch_sdm_masking_policy_difference_columns": "oci.data_safe.DataSafeClient.patch_sdm_masking_policy_difference_columns",
"data_safe.patch_sensitive_columns": "oci.data_safe.DataSafeClient.patch_sensitive_columns",
"data_safe.patch_sql_firewall_allowed_sql": "oci.data_safe.DataSafeClient.patch_sql_firewall_allowed_sql",
+ "data_safe.patch_subsetting_rules": "oci.data_safe.DataSafeClient.patch_subsetting_rules",
"data_safe.patch_target_alert_policy_association": "oci.data_safe.DataSafeClient.patch_target_alert_policy_association",
"data_safe.provision_audit_policy": "oci.data_safe.DataSafeClient.provision_audit_policy",
"data_safe.purge_sql_collection_logs": "oci.data_safe.DataSafeClient.purge_sql_collection_logs",
@@ -345,6 +388,7 @@
"data_safe.start_sql_collection": "oci.data_safe.DataSafeClient.start_sql_collection",
"data_safe.stop_audit_trail": "oci.data_safe.DataSafeClient.stop_audit_trail",
"data_safe.stop_sql_collection": "oci.data_safe.DataSafeClient.stop_sql_collection",
+ "data_safe.subset_data": "oci.data_safe.DataSafeClient.subset_data",
"data_safe.suspend_work_request": "oci.data_safe.DataSafeClient.suspend_work_request",
"data_safe.unset_security_assessment_baseline": "oci.data_safe.DataSafeClient.unset_security_assessment_baseline",
"data_safe.unset_user_assessment_baseline": "oci.data_safe.DataSafeClient.unset_user_assessment_baseline",
@@ -366,6 +410,8 @@
"data_safe.update_on_prem_connector": "oci.data_safe.DataSafeClient.update_on_prem_connector",
"data_safe.update_on_prem_connector_wallet": "oci.data_safe.DataSafeClient.update_on_prem_connector_wallet",
"data_safe.update_peer_target_database": "oci.data_safe.DataSafeClient.update_peer_target_database",
+ "data_safe.update_processing_chain_object": "oci.data_safe.DataSafeClient.update_processing_chain_object",
+ "data_safe.update_registration_policy": "oci.data_safe.DataSafeClient.update_registration_policy",
"data_safe.update_report": "oci.data_safe.DataSafeClient.update_report",
"data_safe.update_report_definition": "oci.data_safe.DataSafeClient.update_report_definition",
"data_safe.update_sdm_masking_policy_difference": "oci.data_safe.DataSafeClient.update_sdm_masking_policy_difference",
@@ -380,6 +426,8 @@
"data_safe.update_sensitive_types_export": "oci.data_safe.DataSafeClient.update_sensitive_types_export",
"data_safe.update_sql_collection": "oci.data_safe.DataSafeClient.update_sql_collection",
"data_safe.update_sql_firewall_policy": "oci.data_safe.DataSafeClient.update_sql_firewall_policy",
+ "data_safe.update_subsetting_policy": "oci.data_safe.DataSafeClient.update_subsetting_policy",
+ "data_safe.update_subsetting_rule": "oci.data_safe.DataSafeClient.update_subsetting_rule",
"data_safe.update_target_alert_policy_association": "oci.data_safe.DataSafeClient.update_target_alert_policy_association",
"data_safe.update_target_database": "oci.data_safe.DataSafeClient.update_target_database",
"data_safe.update_target_database_group": "oci.data_safe.DataSafeClient.update_target_database_group",
@@ -388,4 +436,5 @@
"data_safe.update_user_assessment": "oci.data_safe.DataSafeClient.update_user_assessment",
"data_safe.upload_masking_policy": "oci.data_safe.DataSafeClient.upload_masking_policy",
"data_safe.upload_sensitive_data_model": "oci.data_safe.DataSafeClient.upload_sensitive_data_model",
+ "data_safe.upload_subsetting_policy": "oci.data_safe.DataSafeClient.upload_subsetting_policy",
}
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 d8de3bbdb..e3f3e22ae 100644
--- a/services/database/src/oci_cli_database/generated/database_cli.py
+++ b/services/database/src/oci_cli_database/generated/database_cli.py
@@ -36978,6 +36978,8 @@ 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('--memory-per-oracle-compute-unit-in-gbs', type=click.INT, help=u"""The amount of memory (in GBs) to be enabled per OCPU or ECPU.""")
+@cli_util.option('--sga-percentage', type=click.FLOAT, help=u"""The new value of percentage of ECPU memory allocated for SGA(System Global Area).""")
@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.""")
@@ -36993,7 +36995,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, time_zone, scan_listener_port_tls, scan_listener_port_non_tls, is_mtls_enabled, distribution_algorithm, 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, memory_per_oracle_compute_unit_in_gbs, sga_percentage, 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')
@@ -37030,6 +37032,12 @@ 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 memory_per_oracle_compute_unit_in_gbs is not None:
+ _details['memoryPerOracleComputeUnitInGBs'] = memory_per_oracle_compute_unit_in_gbs
+
+ if sga_percentage is not None:
+ _details['sgaPercentage'] = sga_percentage
+
if time_zone is not None:
_details['timeZone'] = time_zone
@@ -37356,6 +37364,8 @@ def update_basecc_vm_cluster(ctx, from_json, force, wait_for_state, max_wait_sec
@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('--memory-per-oracle-compute-unit-in-gbs', type=click.INT, help=u"""The amount of memory (in GBs) to be enabled per OCPU or ECPU.""")
+@cli_util.option('--sga-percentage', type=click.FLOAT, help=u"""The new value of percentage of ECPU memory allocated for SGA(System Global Area).""")
@cli_util.option('--license-model', type=custom_types.CliCaseInsensitiveChoice(["LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE"]), help=u"""The Oracle license model that applies to the Oracle Autonomous AI Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle services in the cloud. License Included allows you to subscribe to new Oracle AI Database software licenses and the Oracle AI Database service. Note that when provisioning an [Autonomous AI Database on dedicated Exadata infrastructure], this attribute must be null. It is already set at the Autonomous Exadata Infrastructure level. When provisioning an [Autonomous AI Database Serverless] database, if a value is not specified, the system defaults the value to `BRING_YOUR_OWN_LICENSE`. Bring your own license (BYOL) also allows you to select the DB edition using the optional parameter.
This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""")
@@ -37381,7 +37391,7 @@ def update_basecc_vm_cluster(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={'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, 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):
+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, memory_per_oracle_compute_unit_in_gbs, sga_percentage, 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')
@@ -37417,6 +37427,12 @@ def update_cloud_autonomous_vm_cluster(ctx, from_json, force, wait_for_state, ma
if total_container_databases is not None:
_details['totalContainerDatabases'] = total_container_databases
+ if memory_per_oracle_compute_unit_in_gbs is not None:
+ _details['memoryPerOracleComputeUnitInGBs'] = memory_per_oracle_compute_unit_in_gbs
+
+ if sga_percentage is not None:
+ _details['sgaPercentage'] = sga_percentage
+
if license_model is not None:
_details['licenseModel'] = license_model
diff --git a/services/functions/src/oci_cli_functions_invoke/generated/functionsinvoke_cli.py b/services/functions/src/oci_cli_functions_invoke/generated/functionsinvoke_cli.py
index 08ac7b1db..0128645f8 100644
--- a/services/functions/src/oci_cli_functions_invoke/generated/functionsinvoke_cli.py
+++ b/services/functions/src/oci_cli_functions_invoke/generated/functionsinvoke_cli.py
@@ -22,7 +22,7 @@ def functions_invoke_root_group():
pass
-@click.command(cli_util.override('functions_invoke.function_group.command_name', 'function'), cls=CommandGroupWithAlias, help="""Note: Deprecated. Use the new resource model APIs instead. A function resource defines the code (Docker image) and configuration for a specific function. Functions are defined in applications. Avoid entering confidential information.""")
+@click.command(cli_util.override('functions_invoke.function_group.command_name', 'function'), cls=CommandGroupWithAlias, help="""A function resource defines the code (Docker image) and configuration for a specific function. Functions are defined in applications. Avoid entering confidential information.""")
@cli_util.help_option_group
def function_group():
pass
@@ -32,7 +32,7 @@ def function_group():
functions_invoke_root_group.add_command(function_group)
-@function_group.command(name=cli_util.override('functions_invoke.invoke_function.command_name', 'invoke'), help=u"""Note: Deprecated. Use the new operation instead. \"Invokes a function\" \n[Command Reference](invokeFunction)""")
+@function_group.command(name=cli_util.override('functions_invoke.invoke_function.command_name', 'invoke'), help=u"""Invokes a function \n[Command Reference](invokeFunction)""")
@cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
@cli_util.option('--invoke-function-body', help=u"""The body of the function invocation. Note: The maximum size of the request is limited. This limit is currently 6MB and the endpoint will not accept requests that are bigger than this limit.""")
diff --git a/setup.py b/setup.py
index 0847de720..699454881 100644
--- a/setup.py
+++ b/setup.py
@@ -30,7 +30,7 @@ def open_relative(*path):
readme = f.read()
requires = [
- 'oci==2.187.0',
+ 'oci==2.187.1',
'arrow>=1.0.0,<2.0.0',
'certifi>=2025.1.31,<2026.0.0',
'click>=8.0.4,<=8.1.2; python_version < "3.11"',
diff --git a/src/common_util/ignored_commands.py b/src/common_util/ignored_commands.py
index 392436dce..889d3026a 100644
--- a/src/common_util/ignored_commands.py
+++ b/src/common_util/ignored_commands.py
@@ -10,6 +10,7 @@
['setup', 'keys'],
['setup', 'repair-file-permissions'],
['setup', 'oci-cli-rc'],
+ ['setup', 'pkcs11-auth'],
['raw-request'],
['session', 'authenticate'],
['session', 'export'],
diff --git a/src/oci_cli/cli_constants.py b/src/oci_cli/cli_constants.py
index 3bdfbfa88..c948ab3ba 100644
--- a/src/oci_cli/cli_constants.py
+++ b/src/oci_cli/cli_constants.py
@@ -12,6 +12,12 @@
OCI_CLI_PROFILE_ENV_VAR = 'OCI_CLI_PROFILE'
CLI_RC_GENERIC_SETTINGS_DEFAULT_PROFILE_KEY = 'default_profile'
CLI_RC_GENERIC_SETTINGS_USE_CLICK_HELP = 'use_click_help'
+CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY = 'pkcs11_slot_label'
+CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_KEY = 'pkcs11_key_id'
+CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_LABEL_KEY = 'pkcs11_token_label'
+CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_SERIAL_NUMBER_KEY = 'pkcs11_token_serial_number'
+CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_OVERRIDE_KEY = 'pkcs11_key_id_override'
+CLI_RC_GENERIC_SETTINGS_PKCS11_MODULE_PATH_KEY = 'pkcs11_module_path'
OCI_CLI_AUTH_ENV_VAR = 'OCI_CLI_AUTH'
OCI_CLI_AUTH_INSTANCE_PRINCIPAL = 'instance_principal'
@@ -20,6 +26,7 @@
OCI_CLI_AUTH_API_KEY = 'api_key'
OCI_CLI_AUTH_SESSION_TOKEN = 'security_token'
OCI_CLI_AUTH_OKE_WORKLOAD_IDENTITY = 'oke_workload_identity'
+OCI_CLI_AUTH_PKCS11 = 'pkcs11'
OCI_CLI_UPST_TOKEN_MAX_TTL = '60'
OCI_CLI_UPST_TOKEN_MIN_TTL = '5'
ENABLE_PROPAGATION_LOCATION = 'propagation.txt'
@@ -39,6 +46,13 @@
OCI_CLI_FEDERATION_ENDPOINT_ENV_VAR = 'OCI_CLI_FEDERATION_ENDPOINT'
OCI_CLI_DELEGATION_TOKEN_FILE_ENV_VAR = 'OCI_CLI_DELEGATION_TOKEN_FILE'
OCI_CLI_SECURITY_TOKEN_FILE_ENV_VAR = 'OCI_CLI_SECURITY_TOKEN_FILE'
+OCI_CLI_PKCS11_SLOT_LABEL_ENV_VAR = 'OCI_CLI_PKCS11_SLOT_LABEL'
+OCI_CLI_PKCS11_PIN_ENV_VAR = 'OCI_CLI_PKCS11_PIN'
+OCI_CLI_PKCS11_KEY_ID_ENV_VAR = 'OCI_CLI_PKCS11_KEY_ID'
+OCI_CLI_PKCS11_TOKEN_LABEL_ENV_VAR = 'OCI_CLI_PKCS11_TOKEN_LABEL'
+OCI_CLI_PKCS11_TOKEN_SERIAL_ENV_VAR = 'OCI_CLI_PKCS11_TOKEN_SERIAL'
+OCI_CLI_PKCS11_KEY_ID_OVERRIDE_ENV_VAR = 'OCI_CLI_PKCS11_KEY_ID_OVERRIDE'
+OCI_CLI_PKCS11_MODULE_PATH_ENV_VAR = 'OCI_CLI_PKCS11_MODULE_PATH'
OCI_CLI_ENDPOINT_ENV_VAR = 'OCI_CLI_ENDPOINT'
OCI_CLI_AUTO_PROMPT_ENV_VAR = 'OCI_CLI_AUTO_PROMPT'
OCI_CLI_ENABLEPROPAGATION_ENV_VAR = 'PROPAGATION_ENABLED'
@@ -67,6 +81,12 @@
'federation_endpoint': OCI_CLI_FEDERATION_ENDPOINT_ENV_VAR,
'cert_bundle': OCI_CLI_CERT_BUNDLE_ENV_VAR,
'config_file': OCI_CLI_CONFIG_FILE_ENV_VAR,
+ 'pkcs11_slot_label': OCI_CLI_PKCS11_SLOT_LABEL_ENV_VAR,
+ 'pkcs11_key_id': OCI_CLI_PKCS11_KEY_ID_ENV_VAR,
+ 'pkcs11_token_label': OCI_CLI_PKCS11_TOKEN_LABEL_ENV_VAR,
+ 'pkcs11_token_serial': OCI_CLI_PKCS11_TOKEN_SERIAL_ENV_VAR,
+ 'pkcs11_key_id_override': OCI_CLI_PKCS11_KEY_ID_OVERRIDE_ENV_VAR,
+ 'pkcs11_module_path': OCI_CLI_PKCS11_MODULE_PATH_ENV_VAR,
}
MEBIBYTE = 1024 * 1024
diff --git a/src/oci_cli/cli_root.py b/src/oci_cli/cli_root.py
index c303cfd20..99ec9a04b 100644
--- a/src/oci_cli/cli_root.py
+++ b/src/oci_cli/cli_root.py
@@ -42,7 +42,7 @@
# important security information.
logging.basicConfig(level=logging.WARN)
-OCI_CLI_AUTH_CHOICES = [cli_constants.OCI_CLI_AUTH_API_KEY, cli_constants.OCI_CLI_AUTH_INSTANCE_PRINCIPAL, cli_constants.OCI_CLI_AUTH_SESSION_TOKEN, cli_constants.OCI_CLI_AUTH_INSTANCE_OBO_USER, cli_constants.OCI_CLI_AUTH_RESOURCE_PRINCIPAL, cli_constants.OCI_CLI_AUTH_OKE_WORKLOAD_IDENTITY]
+OCI_CLI_AUTH_CHOICES = [cli_constants.OCI_CLI_AUTH_API_KEY, cli_constants.OCI_CLI_AUTH_INSTANCE_PRINCIPAL, cli_constants.OCI_CLI_AUTH_SESSION_TOKEN, cli_constants.OCI_CLI_AUTH_INSTANCE_OBO_USER, cli_constants.OCI_CLI_AUTH_RESOURCE_PRINCIPAL, cli_constants.OCI_CLI_AUTH_OKE_WORKLOAD_IDENTITY, cli_constants.OCI_CLI_AUTH_PKCS11]
OCI_HELP = 'Oracle Cloud Infrastructure command line interface'
@@ -498,6 +498,9 @@ def cli(ctx, config_file, profile, cli_rc_file, request_id, region, endpoint, re
else:
raise click.BadParameter('invalid choice: {arg_value}. (choose from {choices})'.format(arg_value=os.environ[cli_constants.OCI_CLI_AUTH_ENV_VAR], choices=', '.join(OCI_CLI_AUTH_CHOICES)), param_hint='OCI_CLI_AUTH')
+ if auth == cli_constants.OCI_CLI_AUTH_PKCS11 and sys.version_info < (3, 9, 0):
+ raise click.ClickException("Python 3.9.0 or higher is required for using {pkcs11_auth} authentication.".format(pkcs11_auth=cli_constants.OCI_CLI_AUTH_PKCS11))
+
initial_dict = {
'config_file': config_file,
'profile': profile,
diff --git a/src/oci_cli/cli_session.py b/src/oci_cli/cli_session.py
index d380aee4e..e965a8304 100644
--- a/src/oci_cli/cli_session.py
+++ b/src/oci_cli/cli_session.py
@@ -144,7 +144,8 @@ def authenticate(ctx, region, tenancy_name, profile_name, config_location, use_p
user_session = cli_setup_bootstrap.UserSession(user_ocid, tenancy_ocid, region, token, public_key, private_key, fingerprint)
else:
# create a user session through the browser login flow
- user_session = cli_setup_bootstrap.create_user_session(region, tenancy_name, identity_provider_name)
+ enable_dual_stack = ctx.obj.get('enable_dual_stack', False) if ctx.obj else False
+ user_session = cli_setup_bootstrap.create_user_session(region, tenancy_name, identity_provider_name, enable_dual_stack=enable_dual_stack)
# persist the session to a config (including the token value)
profile, config = cli_setup_bootstrap.persist_user_session(user_session, profile_name=profile_name, config=config_location, token_location=token_location, use_passphrase=use_passphrase, persist_token=True, session_auth=True, persist_only_public_key=persist_only_public_key)
diff --git a/src/oci_cli/cli_setup.py b/src/oci_cli/cli_setup.py
index 09a2f5d4f..5fb5cb611 100644
--- a/src/oci_cli/cli_setup.py
+++ b/src/oci_cli/cli_setup.py
@@ -5,7 +5,23 @@
from __future__ import print_function
import click
from oci_cli.cli_root import cli
-from oci_cli.cli_constants import CLI_RC_CANNED_QUERIES_SECTION_NAME, CLI_RC_COMMAND_ALIASES_SECTION_NAME, CLI_RC_PARAM_ALIASES_SECTION_NAME, CLI_RC_DEFAULT_LOCATION, OCI_CLI_AUTH_API_KEY, OCI_CLI_AUTH_SESSION_TOKEN, OCI_CLI_AUTH_INSTANCE_PRINCIPAL, OCI_CLI_AUTH_RESOURCE_PRINCIPAL
+from oci_cli.cli_constants import (
+ CLI_RC_CANNED_QUERIES_SECTION_NAME,
+ CLI_RC_COMMAND_ALIASES_SECTION_NAME,
+ CLI_RC_PARAM_ALIASES_SECTION_NAME,
+ CLI_RC_DEFAULT_LOCATION,
+ OCI_CLI_AUTH_API_KEY,
+ OCI_CLI_AUTH_SESSION_TOKEN,
+ OCI_CLI_AUTH_INSTANCE_PRINCIPAL,
+ OCI_CLI_AUTH_RESOURCE_PRINCIPAL,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_KEY,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_LABEL_KEY,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_SERIAL_NUMBER_KEY,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_OVERRIDE_KEY,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_MODULE_PATH_KEY,
+ OCI_CLI_AUTH_PKCS11
+)
from oci_cli import cli_util
from services.identity.src.oci_cli_identity.generated import identity_cli
from oci_cli.util import pymd5
@@ -463,6 +479,82 @@ def setup_cli_rc(file):
click.echo('Parameter aliases written under section {}'.format(CLI_RC_PARAM_ALIASES_SECTION_NAME))
+@setup_group.command('pkcs11-auth', help="""Interactive script to generate PKCS#11 authentication config.""")
+@cli_util.option('--profile-name', help='Name of the profile you are creating')
+@cli_util.option('--use-default-pkcs11-options', is_flag=True, help='Skip PKCS#11 selector prompts and rely on the SDK defaults, environment variables, or existing CLI RC defaults.')
+@cli_util.option('--user-ocid', help='The OCID of the user to write to the PKCS#11 config profile.')
+@cli_util.option('--tenancy-ocid', help='The OCID of the tenancy to write to the PKCS#11 config profile.')
+@cli_util.help_option
+@click.pass_context
+@cli_util.wrap_exceptions
+def setup_pkcs11_auth(ctx, profile_name, use_default_pkcs11_options, user_ocid, tenancy_ocid):
+ cli_rc_file = ctx.obj.get('cli_rc_file', CLI_RC_DEFAULT_LOCATION)
+ if profile_name:
+ config_location = os.path.abspath(os.path.expanduser(ctx.obj['config_file']))
+ else:
+ config_location, profile_name = prompt_session_for_profile()
+ validate_profile_name(profile_name)
+
+ config_dir = os.path.dirname(config_location)
+ if config_dir and not os.path.exists(config_dir):
+ cli_util.create_directory(config_dir)
+ if os.path.exists(config_location):
+ config_parser = configparser.ConfigParser()
+ config_parser.read(config_location)
+ if profile_name in config_parser and not click.confirm(
+ 'Profile {} already exists in config. Do you want to overwrite it?'.format(profile_name),
+ default=False
+ ):
+ click.echo(config_generation_canceled_message)
+ return
+
+ if user_ocid is None:
+ user_ocid = click.prompt('Enter a user OCID', value_proc=lambda ocid: validate_ocid(ocid, config.PATTERNS['user']))
+ else:
+ user_ocid = validate_ocid(user_ocid, config.PATTERNS['user'])
+
+ if tenancy_ocid is None:
+ tenancy_ocid = click.prompt('Enter a tenancy OCID', value_proc=lambda ocid: validate_ocid(ocid, config.PATTERNS['tenancy']))
+ else:
+ tenancy_ocid = validate_ocid(tenancy_ocid, config.PATTERNS['tenancy'])
+
+ region = ctx.obj.get('region')
+ if region is None:
+ region = prompt_for_region()
+
+ pkcs11_defaults = {
+ CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY: None,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_KEY: None,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_LABEL_KEY: None,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_SERIAL_NUMBER_KEY: None,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_OVERRIDE_KEY: None,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_MODULE_PATH_KEY: None
+ }
+ if not use_default_pkcs11_options:
+ pkcs11_defaults = prompt_for_pkcs11_defaults()
+
+ remove_profile_from_config(config_location, profile_name)
+ write_config(
+ config_location,
+ user_ocid,
+ None,
+ None,
+ tenancy_ocid,
+ region,
+ profile_name=profile_name,
+ write_key_file=False
+ )
+ write_pkcs11_defaults_to_cli_rc(cli_rc_file, profile_name, pkcs11_defaults)
+
+ click.echo('Config written to: {}'.format(config_location))
+ click.echo('PKCS#11 defaults written to: {}'.format(os.path.expanduser(cli_rc_file)))
+ click.echo("""
+ Try out your newly created PKCS#11 profile with the following example command:
+
+ oci os ns get --config-file {config_file} --profile {profile} --auth {auth}
+""".format(config_file=config_location, profile=profile_name, auth=OCI_CLI_AUTH_PKCS11))
+
+
@setup_group.command('autocomplete', help="""Interactive script to set up tab completion for commands and parameters.""")
@cli_util.help_option
def setup_autocomplete():
@@ -667,7 +759,7 @@ def public_key_to_fingerprint(public_key):
return ':'.join(a + b for a, b in zip(fp_plain[::2], fp_plain[1::2]))
-def write_config(filename, user_id=None, fingerprint=None, key_file=None, tenancy=None, region=None, pass_phrase=None, profile_name=DEFAULT_PROFILE_NAME, security_token_file=None, **kwargs):
+def write_config(filename, user_id=None, fingerprint=None, key_file=None, tenancy=None, region=None, pass_phrase=None, profile_name=DEFAULT_PROFILE_NAME, security_token_file=None, write_key_file=True, **kwargs):
existing_file = os.path.exists(filename)
with open(filename, 'a') as f:
if existing_file:
@@ -678,8 +770,11 @@ def write_config(filename, user_id=None, fingerprint=None, key_file=None, tenanc
if user_id:
f.write('user={}\n'.format(user_id))
- f.write('fingerprint={}\n'.format(fingerprint))
- f.write('key_file={}\n'.format(key_file))
+ if fingerprint:
+ f.write('fingerprint={}\n'.format(fingerprint))
+
+ if write_key_file and key_file:
+ f.write('key_file={}\n'.format(key_file))
f.write('tenancy={}\n'.format(tenancy))
f.write('region={}\n'.format(region))
@@ -693,6 +788,80 @@ def write_config(filename, user_id=None, fingerprint=None, key_file=None, tenanc
cli_util.apply_user_only_access_permissions(filename)
+def prompt_for_pkcs11_defaults():
+ # Slot label and key id are alternate ways to select the same PKCS#11 key. Prompt for key
+ # id only when the user did not provide a slot label so setup does not write conflicting
+ # selector defaults.
+ pkcs11_slot_label = click.prompt('Enter the PKCS#11 slot label, or leave blank to use the SDK default', default='', show_default=False).strip() or None
+
+ pkcs11_key_id = None
+ if not pkcs11_slot_label: # since slot label and key id can't be provided together
+ pkcs11_key_id = click.prompt('Enter the PKCS#11 key id, or leave blank to use the SDK default', default='', show_default=False).strip() or None
+
+ pkcs11_token_label = click.prompt('Enter the PKCS#11 token label, or leave blank to use the default token', default='', show_default=False).strip() or None
+
+ pkcs11_token_serial = None
+ if not pkcs11_token_label: # since token label and token serial can't be provided together
+ pkcs11_token_serial = click.prompt('Enter the PKCS#11 token serial number, or leave blank to use the default token', default='', show_default=False).strip() or None
+
+ pkcs11_key_id_override = click.prompt('Enter a PKCS#11 keyId override, or leave blank to use the SDK-derived keyId', default='', show_default=False).strip() or None
+
+ pkcs11_module_path = click.prompt('Enter a PKCS#11 module path, or leave blank to use automatic discovery', default='', show_default=False).strip() or None
+
+ return {
+ CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY: pkcs11_slot_label,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_KEY: pkcs11_key_id,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_LABEL_KEY: pkcs11_token_label,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_SERIAL_NUMBER_KEY: pkcs11_token_serial,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_OVERRIDE_KEY: pkcs11_key_id_override,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_MODULE_PATH_KEY: pkcs11_module_path
+ }
+
+
+def write_pkcs11_defaults_to_cli_rc(cli_rc_file, profile_name, pkcs11_defaults):
+ # CLI RC supports profile sections. Keeping PKCS#11 selectors here avoids adding specialized
+ # auth configuration to the root command and avoids storing PIN material in any config file.
+ cli_rc_file = os.path.abspath(os.path.expanduser(cli_rc_file))
+ cli_rc_dir = os.path.dirname(cli_rc_file)
+ if cli_rc_dir and not os.path.exists(cli_rc_dir):
+ cli_util.create_directory(cli_rc_dir)
+
+ parser = configparser.ConfigParser(interpolation=None)
+ parser.optionxform = str
+ if os.path.exists(cli_rc_file):
+ parser.read(cli_rc_file)
+
+ pkcs11_keys = [
+ CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_KEY,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_LABEL_KEY,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_SERIAL_NUMBER_KEY,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_OVERRIDE_KEY,
+ CLI_RC_GENERIC_SETTINGS_PKCS11_MODULE_PATH_KEY
+ ]
+ has_pkcs11_defaults = any(pkcs11_defaults.get(key) for key in pkcs11_keys)
+
+ if profile_name == parser.default_section:
+ section = parser[parser.default_section]
+ else:
+ if profile_name not in parser:
+ if not has_pkcs11_defaults:
+ return
+ parser.add_section(profile_name)
+ section = parser[profile_name]
+
+ for key in pkcs11_keys:
+ if key in section:
+ del section[key]
+ value = pkcs11_defaults.get(key)
+ if value:
+ section[key] = value
+
+ with open(cli_rc_file, 'w') as f:
+ parser.write(f)
+ cli_util.apply_user_only_access_permissions(cli_rc_file)
+
+
def write_public_key_to_file(filename, public_key, overwrite=False, silent=False):
if not overwrite and os.path.isfile(filename) and not click.confirm('File {} already exists, do you want to overwrite?'.format(filename)):
return False
@@ -939,6 +1108,16 @@ def prompt_for_passphrase():
def remove_profile_from_config(config_file, profile_name_to_terminate):
+ if profile_name_to_terminate == DEFAULT_PROFILE_NAME:
+ config = configparser.ConfigParser()
+ config.read(config_file)
+ for key in ['user', 'fingerprint', 'key_file', 'tenancy', 'region', 'pass_phrase', 'security_token_file']:
+ if key in config[DEFAULT_PROFILE_NAME]:
+ del config[DEFAULT_PROFILE_NAME][key]
+ with open(config_file, 'w') as config_file_handle:
+ config.write(config_file_handle)
+ return
+
# Set default_section to custom value or else we can't delete 'DEFAULT'
# profiles since it is protected by configparser
config = configparser.ConfigParser(default_section="")
diff --git a/src/oci_cli/cli_setup_bootstrap.py b/src/oci_cli/cli_setup_bootstrap.py
index cba8ac5b1..693f04446 100644
--- a/src/oci_cli/cli_setup_bootstrap.py
+++ b/src/oci_cli/cli_setup_bootstrap.py
@@ -27,6 +27,17 @@
BOOTSTRAP_PROCESS_CANCELED_MESSAGE = 'Bootstrap process canceled.'
CONSOLE_AUTH_URL_FORMAT = "https://login.{region}.{realm}/v1/oauth2/authorize"
+# Login dual-stack support is currently available in OC1. This mapping is
+# derived from the SDK region catalog so new OC1 regions are supported without
+# maintaining a hardcoded region list.
+DUAL_STACK_LOGIN_ENDPOINTS = {
+ region: "https://login.{}.ds.oci.{}/v1/oauth2/authorize".format(
+ region, regions.REALMS[realm]
+ )
+ for region, realm in regions.REGION_REALMS.items()
+ if realm == 'oc1'
+}
+
@cli_setup.setup_group.command('bootstrap', help="""
Provides an interactive process to create a CLI config file using username / password based login through a browser.
@@ -109,7 +120,7 @@ def bootstrap_oci_cli(ctx, profile_name, config_location):
""".format(config_file=config_location, profile=profile_name))
-def create_user_session(region='', tenancy_name=None, identity_provider_name=None):
+def create_user_session(region='', tenancy_name=None, identity_provider_name=None, enable_dual_stack=False):
if region == '':
region = cli_setup.prompt_for_region()
@@ -160,8 +171,7 @@ def create_user_session(region='', tenancy_name=None, identity_provider_name=Non
region = regions.REGIONS_SHORT_NAMES[region]
if regions.is_region(region):
- console_url = CONSOLE_AUTH_URL_FORMAT.format(region=region,
- realm=regions.REALMS[regions.REGION_REALMS[region]])
+ console_url = get_console_auth_url(region, enable_dual_stack)
else:
click.echo('Error: {} is not a valid region. Valid regions are \n{}'.format(region, regions.REGIONS))
sys.exit(1)
@@ -201,6 +211,17 @@ def create_user_session(region='', tenancy_name=None, identity_provider_name=Non
return UserSession(user_ocid, tenancy_ocid, region, token, public_key, private_key, fingerprint)
+def get_console_auth_url(region, enable_dual_stack=False):
+ """Return the browser authentication URL for a session login."""
+ if enable_dual_stack and region in DUAL_STACK_LOGIN_ENDPOINTS:
+ return DUAL_STACK_LOGIN_ENDPOINTS[region]
+
+ return CONSOLE_AUTH_URL_FORMAT.format(
+ region=region,
+ realm=regions.REALMS[regions.REGION_REALMS[region]]
+ )
+
+
def persist_user_session(user_session, profile_name=None, config=None, token_location=None, use_passphrase=False, persist_token=False, bootstrap=False, session_auth=False, persist_only_public_key=False):
if not profile_name:
# prompt for location of user config
diff --git a/src/oci_cli/cli_util.py b/src/oci_cli/cli_util.py
index 458c0bf07..7c947001b 100644
--- a/src/oci_cli/cli_util.py
+++ b/src/oci_cli/cli_util.py
@@ -353,6 +353,132 @@ def get_session_token_signer(client_config):
return signer
+def get_pkcs11_value(ctx, env_var, rc_key):
+ # PKCS#11 selectors are intentionally resolved outside the root command. Environment
+ # variables remain the highest-precedence override, followed by the active profile section
+ # in oci_cli_rc and then the legacy/global CLI RC settings section.
+ value = os.environ.get(env_var)
+ if value is None:
+ value = ctx.obj.get('default_values_from_file', {}).get(rc_key)
+ if value is None:
+ value = ctx.obj.get('settings', {}).get(rc_key)
+ if isinstance(value, six.string_types):
+ value = value.strip()
+ return value or None
+
+
+def _raise_pkcs11_auth_failure(exit_value):
+ raise SystemExit(exit_value)
+
+
+def get_pkcs11_signer(ctx, client_config):
+ required_config_values = ['user', 'tenancy', 'region']
+ missing_config_values = []
+ for key in required_config_values:
+ value = client_config.get(key)
+ if isinstance(value, six.string_types):
+ value = value.strip()
+ if not value:
+ missing_config_values.append(key)
+
+ if missing_config_values:
+ _raise_pkcs11_auth_failure(
+ "ERROR: Config value(s) {} must be specified when using --auth {}.".format(
+ ', '.join("'{}'".format(value) for value in missing_config_values),
+ cli_constants.OCI_CLI_AUTH_PKCS11
+ )
+ )
+
+ pkcs11_signer_class = oci.auth.signers.PKCS11RequestSigner
+
+ pkcs11_slot_label = get_pkcs11_value(ctx, cli_constants.OCI_CLI_PKCS11_SLOT_LABEL_ENV_VAR, cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY)
+ pkcs11_key_id = get_pkcs11_value(ctx, cli_constants.OCI_CLI_PKCS11_KEY_ID_ENV_VAR, cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_KEY)
+ pkcs11_token_label = get_pkcs11_value(ctx, cli_constants.OCI_CLI_PKCS11_TOKEN_LABEL_ENV_VAR, cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_LABEL_KEY)
+ pkcs11_token_serial = get_pkcs11_value(ctx, cli_constants.OCI_CLI_PKCS11_TOKEN_SERIAL_ENV_VAR, cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_SERIAL_NUMBER_KEY)
+ pkcs11_key_id_override = get_pkcs11_value(ctx, cli_constants.OCI_CLI_PKCS11_KEY_ID_OVERRIDE_ENV_VAR, cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_OVERRIDE_KEY)
+ pkcs11_module_path = get_pkcs11_value(ctx, cli_constants.OCI_CLI_PKCS11_MODULE_PATH_ENV_VAR, cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_MODULE_PATH_KEY)
+
+ if pkcs11_slot_label and pkcs11_key_id:
+ click.echo("WARNING: pkcs11_slot_label and pkcs11_key_id cannot both be provided. Using pkcs11_slot_label.", err=True)
+ pkcs11_key_id = None
+
+ if pkcs11_token_label and pkcs11_token_serial:
+ click.echo("WARNING: pkcs11_token_label and pkcs11_token_serial cannot both be provided. Using pkcs11_token_label.", err=True)
+ pkcs11_token_serial = None
+
+ card_auth_selected = False
+ if pkcs11_slot_label is not None and pkcs11_slot_label.strip().upper().replace('_', ' ').replace('-', ' ') in ('CARD', 'CARD AUTH', '9E'):
+ card_auth_selected = True
+ if pkcs11_key_id is not None and pkcs11_key_id.strip().lower() in ('4', '04', '0x04'):
+ card_auth_selected = True
+ pkcs11_pin = None
+ if card_auth_selected:
+ pkcs11_pin = os.environ.get(cli_constants.OCI_CLI_PKCS11_PIN_ENV_VAR)
+ if pkcs11_pin:
+ click.echo(
+ 'Using PKCS#11 CARD AUTH PIN from {}. Unset it when it is no longer required.'.format(
+ cli_constants.OCI_CLI_PKCS11_PIN_ENV_VAR
+ ),
+ err=True
+ )
+ else:
+ click.echo(
+ 'PKCS#11 CARD AUTH PIN is not set in {}. You will be prompted for the PIN for each CLI command. '
+ 'To avoid repeated prompts, set this environment variable for your terminal session and clear it when '
+ 'finished.'.format(cli_constants.OCI_CLI_PKCS11_PIN_ENV_VAR),
+ err=True
+ )
+ if not pkcs11_pin:
+ try:
+ pkcs11_pin = pkcs11_signer_class.get_pkcs11_pin()
+ except (KeyboardInterrupt, EOFError):
+ _raise_pkcs11_auth_failure("\nPKCS#11 PIN entry was cancelled. Exiting.")
+ except OSError as e:
+ _raise_pkcs11_auth_failure("Failed to read PKCS#11 PIN: {}".format(str(e)))
+ if not pkcs11_pin:
+ _raise_pkcs11_auth_failure("PKCS#11 PIN cannot be empty.")
+
+ try:
+ signer = pkcs11_signer_class.get_pkcs11_signer(
+ client_config,
+ pkcs11_pin,
+ pkcs11_slot=pkcs11_slot_label,
+ pkcs11_key_id=pkcs11_key_id,
+ pkcs11_token_label=pkcs11_token_label,
+ pkcs11_token_serial=pkcs11_token_serial,
+ pkcs11_key_id_override=pkcs11_key_id_override,
+ pkcs11_module_path=pkcs11_module_path
+ )
+ except (RuntimeError, ValueError, OSError) as e:
+ # inspired from python-sdk examples/pkcs11_example.py since the requirement highlighted the need for the CLI to
+ # returns actionable errors.
+ error_name = e.__class__.__name__
+ error_message = str(e).strip()
+ pkcs11_error_details = {
+ 'PinLenRange': 'The PKCS#11 PIN length is outside the range accepted by the token.',
+ 'PinIncorrect': 'The PKCS#11 PIN was rejected by the token.',
+ 'PinInvalid': 'The PKCS#11 PIN was rejected by the token.',
+ 'PinLocked': 'The PKCS#11 PIN is locked on the token.',
+ 'PinExpired': 'The PKCS#11 PIN is expired on the token.',
+ 'NoSuchKey': 'The selected PKCS#11 key was not found on the token.',
+ 'UserNotLoggedIn': 'The selected PKCS#11 key requires user login before signing.',
+ 'OperationNotInitialized': 'The token rejected context-specific authentication for this signing operation.',
+ 'GeneralError': 'The token rejected the signing operation. Touch the external authenticator when it blinks during signing.'
+ }
+ if error_name in pkcs11_error_details:
+ _raise_pkcs11_auth_failure("Failed to initialize PKCS#11 signer: {}".format(pkcs11_error_details[error_name]))
+
+ if error_message:
+ _raise_pkcs11_auth_failure("Failed to initialize PKCS#11 signer: {}: {}".format(error_name, error_message))
+
+ _raise_pkcs11_auth_failure("Failed to initialize PKCS#11 signer: {}.".format(error_name))
+
+ if card_auth_selected:
+ click.echo("Using PKCS#11 CARD AUTH/Key ID 04. Touch the pkcs11 external authenticator when it blinks to authorize signing. This may be required for each request. It can also timeout.", err=True)
+
+ return signer
+
+
def create_config_and_signer_based_on_click_context(ctx):
# If not set by the user as part of the command, then set it to a default.
# This value is used later by some commands.
@@ -364,6 +490,7 @@ def create_config_and_signer_based_on_click_context(ctx):
session_token_auth = 'auth' in ctx.obj and ctx.obj['auth'] == cli_constants.OCI_CLI_AUTH_SESSION_TOKEN
delegation_token_auth = 'auth' in ctx.obj and ctx.obj['auth'] == cli_constants.OCI_CLI_AUTH_INSTANCE_OBO_USER
oke_workload_identity_auth = 'auth' in ctx.obj and ctx.obj['auth'] == cli_constants.OCI_CLI_AUTH_OKE_WORKLOAD_IDENTITY
+ pkcs11_auth = 'auth' in ctx.obj and ctx.obj['auth'] == cli_constants.OCI_CLI_AUTH_PKCS11
signer = None
kwargs = {}
@@ -418,6 +545,10 @@ def create_config_and_signer_based_on_click_context(ctx):
if ctx.obj['debug']:
logger.debug("auth: session_token")
signer = get_session_token_signer(client_config)
+ elif pkcs11_auth:
+ if ctx.obj['debug']:
+ logger.debug("auth: pkcs11")
+ signer = get_pkcs11_signer(ctx, client_config)
elif resource_principal_auth:
# The following environment variables are expected to be set for this to work.
#
@@ -2679,12 +2810,21 @@ def convert_time_elapsed(time_elapsed):
# Checks that enough env variables have been set to mock a config
def is_config_valid_from_env(command_args):
+ if command_args.get('auth') == cli_constants.OCI_CLI_AUTH_PKCS11:
+ required_pkcs11_env_vars = [
+ cli_constants.OCI_CLI_USER_ENV_VAR,
+ cli_constants.OCI_CLI_TENANCY_ENV_VAR
+ ]
+ for env_var in required_pkcs11_env_vars:
+ if env_var not in os.environ:
+ return False
+ return cli_constants.OCI_CLI_REGION_ENV_VAR in os.environ or bool(command_args.get('region'))
+
for required_key in cli_constants.OCI_CONFIG_REQUIRED_VARS:
if not cli_constants.OCI_CONFIG_REQUIRED_VARS[required_key] in os.environ:
if cli_constants.OCI_CONFIG_REQUIRED_VARS[required_key] == cli_constants.OCI_CLI_REGION_ENV_VAR and command_args['region']:
continue
return False
-
return cli_constants.OCI_CLI_KEY_FILE_ENV_VAR in os.environ or cli_constants.OCI_CLI_KEY_CONTENT_ENV_VAR in os.environ
diff --git a/src/oci_cli/version.py b/src/oci_cli/version.py
index a85e05644..868fefa7f 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.94.0'
+__version__ = '3.94.1'
diff --git a/tests/resources/json_ignore_command_list.txt b/tests/resources/json_ignore_command_list.txt
index 1b50adb4f..e6932b51b 100644
--- a/tests/resources/json_ignore_command_list.txt
+++ b/tests/resources/json_ignore_command_list.txt
@@ -619,4 +619,4 @@ iot, iot-flow-runtime, update-iot-flow-runtime-flows
iot, flow-runtime, update-flows
fn, function, create, archive-function, direct-archive, fn-update-runtime-config
fn, function, create, archive-function, direct-archive, manual-runtime-config
-fn, function, update, archive-function
\ No newline at end of file
+fn, function, update, archive-function
diff --git a/tests/unit/test_cli_util.py b/tests/unit/test_cli_util.py
index 223c1b61a..3b73e9cff 100644
--- a/tests/unit/test_cli_util.py
+++ b/tests/unit/test_cli_util.py
@@ -5,11 +5,13 @@
import click
import os
import oci
+import sys
+import pytest
import requests
import tempfile
import unittest
import unittest.mock as mock
-from oci_cli import cli_util
+from oci_cli import cli_constants, cli_util
# Trivial object to provide dictionary and dot accessor capabilities
@@ -54,6 +56,7 @@ def _build_ctx():
ctx.obj = Obj()
ctx.obj['query'] = None
ctx.obj['debug'] = False
+ ctx.obj['default_values_from_file'] = {}
return ctx
@staticmethod
@@ -75,6 +78,16 @@ def _build_sse_response(event_payloads):
response.data = MockSseStream([MockSseEvent(payload) for payload in event_payloads])
return response
+ @staticmethod
+ def _build_pkcs11_client_config():
+ client_config = {
+ 'user': 'ocid1.user.oc1..test',
+ 'tenancy': 'ocid1.tenancy.oc1..test',
+ 'region': 'us-phoenix-1'
+ }
+
+ return client_config
+
def test_iam_coalesce_provided_and_default_value(self):
ctx = Obj()
ctx.obj = Obj()
@@ -153,6 +166,377 @@ def test_iam_coalesce_provided_and_default_value(self):
value = cli_util.coalesce_provided_and_default_value(ctx, param_name, original_value, is_required)
assert value == 'abc'
+ def _assert_pkcs11_signer_values(
+ self,
+ ctx,
+ expected_pin='123456',
+ expected_slot=None,
+ expected_key_id=None,
+ expected_token_label=None,
+ expected_token_serial=None,
+ expected_key_id_override=None,
+ expected_module_path=None,
+ env=None
+ ):
+ client_config = self._build_pkcs11_client_config()
+ signer = Obj()
+ signer.pkcs11_signer = Obj()
+
+ class FakePKCS11RequestSigner(object):
+ @staticmethod
+ def get_pkcs11_signer(config, pin, pkcs11_slot=None, pkcs11_key_id=None, pkcs11_token_label=None, pkcs11_token_serial=None, pkcs11_key_id_override=None, pkcs11_module_path=None):
+ assert config is client_config
+ assert pin == expected_pin
+ assert pkcs11_slot == expected_slot
+ assert pkcs11_key_id == expected_key_id
+ assert pkcs11_token_label == expected_token_label
+ assert pkcs11_token_serial == expected_token_serial
+ assert pkcs11_key_id_override == expected_key_id_override
+ assert pkcs11_module_path == expected_module_path
+ return signer
+
+ @staticmethod
+ def get_pkcs11_pin():
+ return expected_pin
+
+ with mock.patch.object(oci.auth.signers, 'PKCS11RequestSigner', FakePKCS11RequestSigner, create=True):
+ with mock.patch.dict(os.environ, env or {}, clear=True):
+ assert cli_util.get_pkcs11_signer(ctx, client_config) is signer
+
+ def test_pkcs11_config_can_be_valid_from_env_without_fingerprint_or_key_file(self):
+ command_args = {
+ 'auth': cli_constants.OCI_CLI_AUTH_PKCS11,
+ 'region': None
+ }
+
+ with mock.patch.dict(os.environ, {
+ cli_constants.OCI_CLI_USER_ENV_VAR: 'ocid1.user.oc1..test',
+ cli_constants.OCI_CLI_TENANCY_ENV_VAR: 'ocid1.tenancy.oc1..test',
+ cli_constants.OCI_CLI_REGION_ENV_VAR: 'us-phoenix-1'
+ }, clear=True):
+ assert cli_util.is_config_valid_from_env(command_args)
+
+ def test_pkcs11_config_from_env_accepts_region_from_root_option(self):
+ command_args = {
+ 'auth': cli_constants.OCI_CLI_AUTH_PKCS11,
+ 'region': 'us-phoenix-1'
+ }
+
+ with mock.patch.dict(os.environ, {
+ cli_constants.OCI_CLI_USER_ENV_VAR: 'ocid1.user.oc1..test',
+ cli_constants.OCI_CLI_TENANCY_ENV_VAR: 'ocid1.tenancy.oc1..test'
+ }, clear=True):
+ assert cli_util.is_config_valid_from_env(command_args)
+
+ def test_pkcs11_config_from_env_requires_user_and_tenancy(self):
+ command_args = {
+ 'auth': cli_constants.OCI_CLI_AUTH_PKCS11,
+ 'region': 'us-phoenix-1'
+ }
+
+ with mock.patch.dict(os.environ, {
+ cli_constants.OCI_CLI_USER_ENV_VAR: 'ocid1.user.oc1..test'
+ }, clear=True):
+ assert not cli_util.is_config_valid_from_env(command_args)
+
+ @pytest.mark.skipif(sys.version_info < (3, 9),
+ reason="Python 3.9.0 or higher is required for using pkcs11 authentication. Skipping this test.")
+ def test_get_pkcs11_signer_reads_optional_values_from_profile_rc_defaults(self):
+ ctx = self._build_ctx()
+ ctx.obj['settings'] = {}
+ ctx.obj['default_values_from_file'] = {
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY: 'PIV AUTH',
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_LABEL_KEY: 'token-label-from-rc',
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_OVERRIDE_KEY: 'override-from-rc',
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_MODULE_PATH_KEY: '/tmp/pkcs11-from-rc.so'
+ }
+
+ self._assert_pkcs11_signer_values(
+ ctx,
+ expected_slot='PIV AUTH',
+ expected_token_label='token-label-from-rc',
+ expected_key_id_override='override-from-rc',
+ expected_module_path='/tmp/pkcs11-from-rc.so'
+ )
+
+ @pytest.mark.skipif(sys.version_info < (3, 9),
+ reason="Python 3.9.0 or higher is required for using pkcs11 authentication. Skipping this test.")
+ def test_get_pkcs11_signer_env_overrides_profile_rc_defaults(self):
+ ctx = self._build_ctx()
+ ctx.obj['settings'] = {}
+ ctx.obj['default_values_from_file'] = {
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY: 'PIV AUTH',
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_SERIAL_NUMBER_KEY: 'serial-from-rc',
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_OVERRIDE_KEY: 'override-from-rc',
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_MODULE_PATH_KEY: '/tmp/pkcs11-from-rc.so'
+ }
+
+ self._assert_pkcs11_signer_values(
+ ctx,
+ expected_slot='CARD AUTH',
+ expected_token_serial='serial-from-env',
+ expected_key_id_override='override-from-env',
+ expected_module_path='/tmp/pkcs11-from-env.so',
+ expected_pin='pin-from-env',
+ env={
+ cli_constants.OCI_CLI_PKCS11_SLOT_LABEL_ENV_VAR: 'CARD AUTH',
+ cli_constants.OCI_CLI_PKCS11_TOKEN_SERIAL_ENV_VAR: 'serial-from-env',
+ cli_constants.OCI_CLI_PKCS11_KEY_ID_OVERRIDE_ENV_VAR: 'override-from-env',
+ cli_constants.OCI_CLI_PKCS11_MODULE_PATH_ENV_VAR: '/tmp/pkcs11-from-env.so',
+ cli_constants.OCI_CLI_PKCS11_PIN_ENV_VAR: 'pin-from-env'
+ }
+ )
+
+ @pytest.mark.skipif(sys.version_info < (3, 9),
+ reason="Python 3.9.0 or higher is required for using pkcs11 authentication. Skipping this test.")
+ def test_get_pkcs11_signer_prompts_for_piv_auth_when_env_pin_is_set(self):
+ ctx = self._build_ctx()
+ ctx.obj['settings'] = {}
+ ctx.obj['default_values_from_file'] = {
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY: 'PIV AUTH'
+ }
+ self._assert_pkcs11_signer_values(
+ ctx,
+ expected_pin='prompted-pin',
+ expected_slot='PIV AUTH',
+ env={cli_constants.OCI_CLI_PKCS11_PIN_ENV_VAR: 'pin-from-env'}
+ )
+
+ @pytest.mark.skipif(sys.version_info < (3, 9),
+ reason="Python 3.9.0 or higher is required for using pkcs11 authentication. Skipping this test.")
+ def test_get_pkcs11_signer_uses_env_pin_for_card_auth_without_prompting(self):
+ ctx = self._build_ctx()
+ ctx.obj['settings'] = {}
+ ctx.obj['default_values_from_file'] = {
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY: 'CARD AUTH'
+ }
+ client_config = self._build_pkcs11_client_config()
+ signer = Obj()
+ signer.pkcs11_signer = Obj()
+
+ class FakePKCS11RequestSigner(object):
+ @staticmethod
+ def get_pkcs11_signer(config, pin, **kwargs):
+ assert config is client_config
+ assert pin == 'pin-from-env'
+ assert kwargs['pkcs11_slot'] == 'CARD AUTH'
+ return signer
+
+ @staticmethod
+ def get_pkcs11_pin():
+ raise AssertionError('PIN prompt should not be used when OCI_CLI_PKCS11_PIN is set')
+
+ with mock.patch.object(oci.auth.signers, 'PKCS11RequestSigner', FakePKCS11RequestSigner, create=True):
+ with mock.patch.dict(os.environ, {cli_constants.OCI_CLI_PKCS11_PIN_ENV_VAR: 'pin-from-env'}, clear=True):
+ with mock.patch.object(click, 'echo') as echo:
+ assert cli_util.get_pkcs11_signer(ctx, client_config) is signer
+
+ warning = echo.call_args_list[0][0][0]
+ assert cli_constants.OCI_CLI_PKCS11_PIN_ENV_VAR in warning
+ assert 'Unset it' in warning
+
+ @pytest.mark.skipif(sys.version_info < (3, 9),
+ reason="Python 3.9.0 or higher is required for using pkcs11 authentication. Skipping this test.")
+ def test_get_pkcs11_signer_warns_and_prompts_for_card_auth_without_env_pin(self):
+ ctx = self._build_ctx()
+ ctx.obj['settings'] = {}
+ ctx.obj['default_values_from_file'] = {
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY: 'CARD AUTH'
+ }
+ client_config = self._build_pkcs11_client_config()
+ signer = Obj()
+ signer.pkcs11_signer = Obj()
+
+ class FakePKCS11RequestSigner(object):
+ @staticmethod
+ def get_pkcs11_signer(config, pin, **kwargs):
+ assert config is client_config
+ assert pin == 'prompted-pin'
+ assert kwargs['pkcs11_slot'] == 'CARD AUTH'
+ return signer
+
+ @staticmethod
+ def get_pkcs11_pin():
+ return 'prompted-pin'
+
+ with mock.patch.object(oci.auth.signers, 'PKCS11RequestSigner', FakePKCS11RequestSigner, create=True):
+ with mock.patch.dict(os.environ, {}, clear=True):
+ with mock.patch.object(click, 'echo') as echo:
+ assert cli_util.get_pkcs11_signer(ctx, client_config) is signer
+
+ warning = echo.call_args_list[0][0][0]
+ assert cli_constants.OCI_CLI_PKCS11_PIN_ENV_VAR in warning
+ assert 'each CLI command' in warning
+
+ @pytest.mark.skipif(sys.version_info < (3, 9),
+ reason="Python 3.9.0 or higher is required for using pkcs11 authentication. Skipping this test.")
+ def test_get_pkcs11_signer_rejects_empty_pin(self):
+ ctx = self._build_ctx()
+ ctx.obj['settings'] = {}
+ client_config = self._build_pkcs11_client_config()
+
+ class FakePKCS11RequestSigner(object):
+ @staticmethod
+ def get_pkcs11_pin():
+ return ''
+
+ with mock.patch.object(oci.auth.signers, 'PKCS11RequestSigner', FakePKCS11RequestSigner, create=True):
+ with mock.patch.dict(os.environ, {}, clear=True):
+ with self.assertRaises(SystemExit) as raised:
+ cli_util.get_pkcs11_signer(ctx, client_config)
+
+ assert "PKCS#11 PIN cannot be empty." in str(raised.exception)
+
+ @pytest.mark.skipif(sys.version_info < (3, 9),
+ reason="Python 3.9.0 or higher is required for using pkcs11 authentication. Skipping this test.")
+ def test_get_pkcs11_signer_warns_and_prefers_slot_label_over_key_id(self):
+ ctx = self._build_ctx()
+ ctx.obj['default_values_from_file'] = {
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY: 'CARD AUTH',
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_KEY_ID_KEY: '04'
+ }
+ signer = Obj()
+ signer.pkcs11_signer = Obj()
+
+ class FakePKCS11RequestSigner(object):
+ @staticmethod
+ def get_pkcs11_signer(config, pin, **kwargs):
+ assert kwargs['pkcs11_slot'] == 'CARD AUTH'
+ assert kwargs['pkcs11_key_id'] is None
+ return signer
+
+ with mock.patch.object(oci.auth.signers, 'PKCS11RequestSigner', FakePKCS11RequestSigner, create=True):
+ with mock.patch.dict(os.environ, {cli_constants.OCI_CLI_PKCS11_PIN_ENV_VAR: 'pin-from-env'}, clear=True):
+ with mock.patch.object(click, 'echo') as echo:
+ assert cli_util.get_pkcs11_signer(ctx, self._build_pkcs11_client_config()) is signer
+
+ assert "pkcs11_slot_label and pkcs11_key_id cannot both be provided" in echo.call_args_list[0][0][0]
+
+ @pytest.mark.skipif(sys.version_info < (3, 9),
+ reason="Python 3.9.0 or higher is required for using pkcs11 authentication. Skipping this test.")
+ def test_get_pkcs11_signer_warns_and_prefers_token_label_over_token_serial(self):
+ ctx = self._build_ctx()
+ ctx.obj['default_values_from_file'] = {
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_LABEL_KEY: 'token-label',
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_TOKEN_SERIAL_NUMBER_KEY: 'serial'
+ }
+ signer = Obj()
+ signer.pkcs11_signer = Obj()
+
+ class FakePKCS11RequestSigner(object):
+ @staticmethod
+ def get_pkcs11_signer(config, pin, **kwargs):
+ assert kwargs['pkcs11_token_label'] == 'token-label'
+ assert kwargs['pkcs11_token_serial'] is None
+ return signer
+
+ @staticmethod
+ def get_pkcs11_pin():
+ return 'prompted-pin'
+
+ with mock.patch.object(oci.auth.signers, 'PKCS11RequestSigner', FakePKCS11RequestSigner, create=True):
+ with mock.patch.dict(os.environ, {}, clear=True):
+ with mock.patch.object(click, 'echo') as echo:
+ assert cli_util.get_pkcs11_signer(ctx, self._build_pkcs11_client_config()) is signer
+
+ assert "pkcs11_token_label and pkcs11_token_serial cannot both be provided" in echo.call_args_list[0][0][0]
+
+ @pytest.mark.skipif(sys.version_info < (3, 9),
+ reason="Python 3.9.0 or higher is required for using pkcs11 authentication. Skipping this test.")
+ def test_get_pkcs11_signer_shows_actionable_pin_incorrect_error(self):
+ ctx = self._build_ctx()
+ ctx.obj['settings'] = {}
+ ctx.obj['default_values_from_file'] = {
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY: 'PIV AUTH'
+ }
+ client_config = self._build_pkcs11_client_config()
+
+ class PinIncorrect(RuntimeError):
+ pass
+
+ class FakePKCS11RequestSigner(object):
+ @staticmethod
+ def get_pkcs11_signer(config, pin, **kwargs):
+ raise PinIncorrect('PIN_INCORRECT')
+
+ @staticmethod
+ def get_pkcs11_pin():
+ return '123456'
+
+ with mock.patch.object(oci.auth.signers, 'PKCS11RequestSigner', FakePKCS11RequestSigner, create=True):
+ with mock.patch.dict(os.environ, {}, clear=True):
+ with self.assertRaises(SystemExit) as raised:
+ cli_util.get_pkcs11_signer(ctx, client_config)
+
+ assert "Failed to initialize PKCS#11 signer: The PKCS#11 PIN was rejected by the token." in str(raised.exception)
+
+ @pytest.mark.skipif(sys.version_info < (3, 9),
+ reason="Python 3.9.0 or higher is required for using pkcs11 authentication. Skipping this test.")
+ def test_get_pkcs11_signer_shows_actionable_user_not_logged_in_error(self):
+ ctx = self._build_ctx()
+ ctx.obj['settings'] = {}
+ ctx.obj['default_values_from_file'] = {
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY: 'CARD AUTH'
+ }
+ client_config = self._build_pkcs11_client_config()
+
+ class UserNotLoggedIn(RuntimeError):
+ pass
+
+ class FakePKCS11RequestSigner(object):
+ @staticmethod
+ def get_pkcs11_signer(config, pin, **kwargs):
+ assert pin == '123456'
+ raise UserNotLoggedIn('USER_NOT_LOGGED_IN')
+
+ @staticmethod
+ def get_pkcs11_pin():
+ return '123456'
+
+ with mock.patch.object(oci.auth.signers, 'PKCS11RequestSigner', FakePKCS11RequestSigner, create=True):
+ with mock.patch.dict(os.environ, {}, clear=True):
+ with self.assertRaises(SystemExit) as raised:
+ cli_util.get_pkcs11_signer(ctx, client_config)
+
+ assert "Failed to initialize PKCS#11 signer: The selected PKCS#11 key requires user login before signing." in str(raised.exception)
+
+ @pytest.mark.skipif(sys.version_info < (3, 9),
+ reason="Python 3.9.0 or higher is required for using pkcs11 authentication. Skipping this test.")
+ def test_get_pkcs11_signer_prints_card_auth_touch_guidance(self):
+ ctx = self._build_ctx()
+ ctx.obj['settings'] = {}
+ ctx.obj['default_values_from_file'] = {
+ cli_constants.CLI_RC_GENERIC_SETTINGS_PKCS11_SLOT_LABEL_KEY: 'CARD AUTH'
+ }
+ client_config = self._build_pkcs11_client_config()
+ signer = Obj()
+ signer.pkcs11_signer = Obj()
+
+ class FakePKCS11RequestSigner(object):
+ @staticmethod
+ def get_pkcs11_signer(config, pin, **kwargs):
+ assert pin == 'pin-from-env'
+ assert kwargs['pkcs11_slot'] == 'CARD AUTH'
+ return signer
+
+ with mock.patch.object(oci.auth.signers, 'PKCS11RequestSigner', FakePKCS11RequestSigner, create=True):
+ with mock.patch.dict(os.environ, {cli_constants.OCI_CLI_PKCS11_PIN_ENV_VAR: 'pin-from-env'}, clear=True):
+ with mock.patch('oci_cli.cli_util.click.echo') as mock_echo:
+ assert cli_util.get_pkcs11_signer(ctx, client_config) is signer
+
+ assert mock_echo.call_count == 2
+ assert 'Using PKCS#11 CARD AUTH PIN from' in mock_echo.call_args_list[0][0][0]
+ assert 'Touch the pkcs11 external authenticator when it blinks to authorize signing.' in mock_echo.call_args_list[1][0][0]
+
+ def test_root_command_rejects_removed_pkcs11_selector_option(self):
+ from click.testing import CliRunner
+ from oci_cli.cli_root import cli
+
+ result = CliRunner().invoke(cli, ['--pkcs11-slot-label', 'CARD AUTH', '--help'])
+
+ assert result.exit_code == 2
+ assert 'No such command' in result.output
+
# TODO: This test does not work on Windows due to the use of tempfile.NamedTemoraryFile.
# https://bugs.python.org/issue14243
def test_coalesce_param_with_explicit_default_value_for_file_type_param(self):