"create"
********

* Description

* Usage

* Required Parameters

* Optional Parameters

* Global Parameters

* Example using required parameter


Description
===========

Creates a new masking column in the specified masking policy. Use this
operation to add parent columns only. It automatically adds the child
columns from the associated sensitive data model or target database.
If you provide the sensitiveTypeId attribute but not the
maskingFormats attribute, it automatically assigns the default masking
format associated with the specified sensitive type. Alternatively, if
you provide the maskingFormats attribute, the specified masking
formats are assigned to the column.

Using the maskingFormats attribute, you can assign one or more masking
formats to a column. You need to specify a condition as part of each
masking format. It enables you to do <a
href=”https://docs.oracle.com/en/cloud/paas/data-safe/udscs
/conditional-masking.html”>conditional masking</a> so that you can
mask the column data values differently using different masking
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.

You can use the maskingColumnGroup attribute to group the columns that
you would like to mask together. It enables you to do <a
href=”https://docs.oracle.com/en/cloud/paas/data-safe/udscs/group-
masking1.html#GUID-755056B9-9540-48C0-9491-262A44A85037”>group or
compound masking</a> that ensures that the masked data across the
columns in a group continue to retain the same logical relationship.


Usage
=====

   oci data-safe masking-column create [OPTIONS]


Required Parameters
===================

--column-name [text]

The name of the database column. This attribute cannot be updated for
an existing  masking column. Note that the same name is used for the
masking column. There  is no separate displayName attribute for the
masking column.

--masking-policy-id [text]

The OCID of the masking policy.

--object-name [text]

The name of the object (table or editioning view) that contains the
database column. This attribute cannot be updated for an existing
masking column.

--schema-name [text]

The name of the schema that contains the database column. This
attribute cannot be updated for an existing masking column.


Optional Parameters
===================

--from-json [text]

Provide input to this command as a JSON document from a file using the
file://path-to/file syntax.

The "--generate-full-command-json-input" option can be used to
generate a sample json file to be used with this command option. The
key names are pre-populated and match the command option names
(converted to camelCase format, e.g. compartment-id –> compartmentId),
while the values of the keys need to be populated by the user before
using the sample file as an input to this command. For any command
option that accepts multiple values, the value of the key can be a
JSON array.

Options can still be provided on the command line. If an option exists
in both the JSON document and the command line then the command line
specified value will be used.

For examples on usage of this option, please see our “using CLI with
advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Conte
nt/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

--is-masking-enabled [boolean]

Indicates whether data masking is enabled for the masking column. Set
it to false if you don’t want to mask the column.

--masking-column-group [text]

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 <a href=https://docs.oracle.com/en/cloud/paas/data-safe/udscs
/group-masking1.html#GUID-755056B9-9540-48C0-9491-262A44A85037>Group
Masking in the Data Safe documentation.</a>

--masking-formats [complex type]

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 <a href=”https://docs.oracle.com/en/cloud/paas/data-safe/udscs
/conditional-masking.html”>conditional masking</a> 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.cloud.oracle.com/api/#/en/datasafe/20181201/datatypes/MaskingFor
mat. This is a complex type whose value must be valid JSON. The value
can be provided as a string on the command line or passed in as a file
using the file://path/to/file syntax.

The "--generate-param-json-input" option can be used to generate an
example of the JSON which must be provided. We recommend storing this
example in a file, modifying it as needed and then passing it back in
via the file:// syntax.

--max-wait-seconds [integer]

The maximum time to wait for the work request to reach the state
defined by "--wait-for-state". Defaults to 1200 seconds.

--object-type [text]

The type of the object that contains the database column.

Accepted values are:

   EDITIONING_VIEW, TABLE

--sensitive-type-id [text]

The OCID of the sensitive type to be associated with the masking
column. Note that if the maskingFormats attribute isn’t provided while
creating a masking column, the default masking format associated with
the specified sensitive type is assigned to the masking column.

--wait-for-state [text]

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.

Accepted values are:

   ACCEPTED, CANCELED, CANCELING, FAILED, IN_PROGRESS, SUCCEEDED, SUSPENDED, SUSPENDING

--wait-interval-seconds [integer]

Check every "--wait-interval-seconds" to see whether the work request
has reached the state defined by "--wait-for-state". Defaults to 30
seconds.


Global Parameters
=================

Use "oci --help" for help on global parameters.

"--auth-purpose", "--auth", "--cert-bundle", "--cli-auto-prompt", "--
cli-rc-file", "--config-file", "--connection-timeout", "--debug", "--
defaults-file", "--endpoint", "--generate-full-command-json-input", "
--generate-param-json-input", "--help", "--latest-version", "--max-
retries", "--no-retry", "--opc-client-request-id", "--opc-request-id",
"--output", "--profile", "--proxy", "--query", "--raw-output", "--
read-timeout", "--realm-specific-endpoint", "--region", "--release-
info", "--request-id", "--version", "-?", "-d", "-h", "-i", "-v"


Example using required parameter
================================

Copy and paste the following example into a JSON file, replacing the
example parameters with your own.

       oci data-safe masking-policy create --generate-param-json-input column-source > column-source.json

Copy the following CLI commands into a file named example.sh. Run the
command by typing “bash example.sh” and replacing the example
parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-
like shell. You need to set up the OCI configuration and appropriate
security policies before trying the examples.

       export compartment_id=<substitute-value-of-compartment_id> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/data-safe/masking-policy/create.html#cmdoption-compartment-id
       export column_name=<substitute-value-of-column_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/data-safe/masking-column/create.html#cmdoption-column-name
       export object_name=<substitute-value-of-object_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/data-safe/masking-column/create.html#cmdoption-object-name
       export schema_name=<substitute-value-of-schema_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/data-safe/masking-column/create.html#cmdoption-schema-name

       masking_policy_id=$(oci data-safe masking-policy create --column-source file://column-source.json --compartment-id $compartment_id --query data.id --raw-output)

       oci data-safe masking-column create --column-name $column_name --masking-policy-id $masking_policy_id --object-name $object_name --schema-name $schema_name
