Creates a new mapping rule for a given conversion workspace.
Scopes
You will need authorization for the https://www.googleapis.com/auth/cloud-platform scope to make a valid call.
If unset, the scope for this method defaults to https://www.googleapis.com/auth/cloud-platform.
You can set the scope for this method like this: datamigration1 --scope <scope> projects locations-conversion-workspaces-mapping-rules-create ...
Required Scalar Argument
- <parent> (string)
- Required. The parent which owns this collection of mapping rules.
Required Request Value
The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.
For example, a structure like this:
MappingRule:
conditional-column-set-value:
source-numeric-filter:
numeric-filter-option: string
source-max-precision-filter: integer
source-max-scale-filter: integer
source-min-precision-filter: integer
source-min-scale-filter: integer
source-text-filter:
source-max-length-filter: string
source-min-length-filter: string
value-transformation:
assign-specific-value:
value: string
double-comparison:
value: number
value-comparison: string
int-comparison:
value: string
value-comparison: string
round-scale:
scale: integer
value-list:
ignore-case: boolean
value-present-list: string
values: [string]
convert-rowid-column:
only-if-no-primary-key: boolean
display-name: string
entity-move:
new-schema: string
filter:
entities: [string]
entity-name-contains: string
entity-name-prefix: string
entity-name-suffix: string
parent-entity: string
filter-table-columns:
exclude-columns: [string]
include-columns: [string]
multi-column-data-type-change:
new-data-type: string
override-fractional-seconds-precision: integer
override-length: string
override-precision: integer
override-scale: integer
source-data-type-filter: string
source-numeric-filter:
numeric-filter-option: string
source-max-precision-filter: integer
source-max-scale-filter: integer
source-min-precision-filter: integer
source-min-scale-filter: integer
source-text-filter:
source-max-length-filter: string
source-min-length-filter: string
multi-entity-rename:
new-name-pattern: string
source-name-transformation: string
name: string
revision-create-time: string
revision-id: string
rule-order: string
rule-scope: string
set-table-primary-key:
primary-key: string
primary-key-columns: [string]
single-column-change:
array: boolean
array-length: integer
auto-generated: boolean
charset: string
collation: string
comment: string
data-type: string
fractional-seconds-precision: integer
length: string
nullable: boolean
precision: integer
scale: integer
set-values: [string]
udt: boolean
single-entity-rename:
new-name: string
single-package-change:
package-body: string
package-description: string
source-sql-change:
sql-code: string
state: string
can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.
-r .conditional-column-set-value.source-numeric-filter numeric-filter-option=tempor
- Required. Enum to set the option defining the datatypes numeric filter has to be applied to
source-max-precision-filter=67
- Optional. The filter will match columns with precision smaller than or equal to this number.
source-max-scale-filter=76
- Optional. The filter will match columns with scale smaller than or equal to this number.
source-min-precision-filter=49
- Optional. The filter will match columns with precision greater than or equal to this number.
-
source-min-scale-filter=17
- Optional. The filter will match columns with scale greater than or equal to this number.
-
..source-text-filter source-max-length-filter=amet
- Optional. The filter will match columns with length smaller than or equal to this number.
-
source-min-length-filter=ut
- Optional. The filter will match columns with length greater than or equal to this number.
-
..value-transformation.assign-specific-value value=at
- Required. Specific value to be assigned
-
..double-comparison value=0.3787849038508272
- Required. Double compare value to be used
-
value-comparison=duo
- Required. Relation between source value and compare value
-
..int-comparison value=sadipscing
- Required. Integer compare value to be used
-
value-comparison=ut
- Required. Relation between source value and compare value
-
..round-scale scale=85
- Required. Scale value to be used
-
..value-list ignore-case=false
- Required. Whether to ignore case when filtering by values. Defaults to false
value-present-list=kasd
- Required. Indicates whether the filter matches rows with values that are present in the list or those with values not present in it.
-
values=sadipscing
- Required. The list to be used to filter by
- Each invocation of this argument appends the given value to the array.
-
....convert-rowid-column only-if-no-primary-key=true
- Required. Only work on tables without primary key defined
-
.. display-name=sea
- Optional. A human readable name
-
entity-move new-schema=et
- Required. The new schema
-
..filter entities=lorem
- Optional. The rule should be applied to specific entities defined by their fully qualified names.
- Each invocation of this argument appends the given value to the array.
entity-name-contains=magna
- Optional. The rule should be applied to entities whose non-qualified name contains the given string.
entity-name-prefix=takimata
- Optional. The rule should be applied to entities whose non-qualified name starts with the given prefix.
entity-name-suffix=rebum.
- Optional. The rule should be applied to entities whose non-qualified name ends with the given suffix.
-
parent-entity=at
- Optional. The rule should be applied to entities whose parent entity (fully qualified name) matches the given value. For example, if the rule applies to a table entity, the expected value should be a schema (schema). If the rule applies to a column or index entity, the expected value can be either a schema (schema) or a table (schema.table)
-
..filter-table-columns exclude-columns=invidunt
- Optional. List of columns to be excluded for a particular table.
- Each invocation of this argument appends the given value to the array.
-
include-columns=clita
- Optional. List of columns to be included for a particular table.
- Each invocation of this argument appends the given value to the array.
-
..multi-column-data-type-change new-data-type=stet
- Required. New data type.
override-fractional-seconds-precision=19
- Optional. Column fractional seconds precision - used only for timestamp based datatypes - if not specified and relevant uses the source column fractional seconds precision.
override-length=ut
- Optional. Column length - e.g. varchar (50) - if not specified and relevant uses the source column length.
override-precision=98
- Optional. Column precision - when relevant - if not specified and relevant uses the source column precision.
override-scale=75
- Optional. Column scale - when relevant - if not specified and relevant uses the source column scale.
source-data-type-filter=rebum.
- Required. Filter on source data type.
source-numeric-filter numeric-filter-option=dolores
- Required. Enum to set the option defining the datatypes numeric filter has to be applied to
source-max-precision-filter=5
- Optional. The filter will match columns with precision smaller than or equal to this number.
source-max-scale-filter=82
- Optional. The filter will match columns with scale smaller than or equal to this number.
source-min-precision-filter=71
- Optional. The filter will match columns with precision greater than or equal to this number.
-
source-min-scale-filter=63
- Optional. The filter will match columns with scale greater than or equal to this number.
-
..source-text-filter source-max-length-filter=clita
- Optional. The filter will match columns with length smaller than or equal to this number.
-
source-min-length-filter=dolor
- Optional. The filter will match columns with length greater than or equal to this number.
-
...multi-entity-rename new-name-pattern=aliquyam
- Optional. The pattern used to generate the new entity's name. This pattern must include the characters '{name}', which will be replaced with the name of the original entity. For example, the pattern 't_{name}' for an entity name jobs would be converted to 't_jobs'. If unspecified, the default value for this field is '{name}'
-
source-name-transformation=magna
- Optional. Additional transformation that can be done on the source entity name before it is being used by the new_name_pattern, for example lower case. If no transformation is desired, use NO_TRANSFORMATION
-
.. name=diam
- Full name of the mapping rule resource, in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{set}/mappingRule/{rule}.
revision-create-time=nonumy
- Output only. The timestamp that the revision was created.
revision-id=et
- Output only. The revision ID of the mapping rule. A new revision is committed whenever the mapping rule is changed in any way. The format is an 8-character hexadecimal string.
rule-order=sanctus
- Required. The order in which the rule is applied. Lower order rules are applied before higher value rules so they may end up being overridden.
rule-scope=accusam
- Required. The rule scope
set-table-primary-key primary-key=tempor
- Optional. Name for the primary key
-
primary-key-columns=sed
- Required. List of column names for the primary key
- Each invocation of this argument appends the given value to the array.
-
..single-column-change array=false
- Optional. Is the column of array type.
array-length=22
- Optional. The length of the array, only relevant if the column type is an array.
auto-generated=false
- Optional. Is the column auto-generated/identity.
charset=erat
- Optional. Charset override - instead of table level charset.
collation=justo
- Optional. Collation override - instead of table level collation.
comment=ipsum
- Optional. Comment associated with the column.
data-type=accusam
- Optional. Column data type name.
fractional-seconds-precision=82
- Optional. Column fractional seconds precision - e.g. 2 as in timestamp (2) - when relevant.
length=consetetur
- Optional. Column length - e.g. 50 as in varchar (50) - when relevant.
nullable=true
- Optional. Is the column nullable.
precision=59
- Optional. Column precision - e.g. 8 as in double (8,2) - when relevant.
scale=91
- Optional. Column scale - e.g. 2 as in double (8,2) - when relevant.
set-values=ipsum
- Optional. Specifies the list of values allowed in the column.
- Each invocation of this argument appends the given value to the array.
-
udt=true
- Optional. Is the column a UDT (User-defined Type).
-
..single-entity-rename new-name=ipsum
- Required. The new name of the destination entity
-
..single-package-change package-body=no
- Optional. Sql code for package body
-
package-description=sit
- Optional. Sql code for package description
-
..source-sql-change sql-code=kasd
- Required. Sql code for source (stored procedure, function, trigger or view)
-
.. state=amet
- Optional. The mapping rule state
About Cursors
The cursor position is key to comfortably set complex nested structures. The following rules apply:
- The cursor position is always set relative to the current one, unless the field name starts with the
.
character. Fields can be nested such as in-r f.s.o
. - The cursor position is set relative to the top-level structure if it starts with
.
, e.g.-r .s.s
- You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify
-r struct.sub_struct=bar
. - You can move the cursor one level up by using
..
. Each additional.
moves it up one additional level. E.g....
would go three levels up.
Optional Output Flags
The method's return value a JSON encoded structure, which will be written to standard output by default.
- -o out
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
-
to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
Optional Method Properties
You may set the following properties to further configure the call. Please note that -p
is followed by one
or more key-value-pairs, and is called like this -p k1=v1 k2=v2
even though the listing below repeats the
-p
for completeness.
-
-p mapping-rule-id=string
- Required. The ID of the rule to create.
-
-p request-id=string
- A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.
Optional General Properties
The following properties can configure any call, and are not specific to this method.
-
-p $-xgafv=string
- V1 error format.
-
-p access-token=string
- OAuth access token.
-
-p alt=string
- Data format for response.
-
-p callback=string
- JSONP
-
-p fields=string
- Selector specifying which fields to include in a partial response.
-
-p key=string
- API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
-
-p oauth-token=string
- OAuth 2.0 token for the current user.
-
-p pretty-print=boolean
- Returns response with indentations and line breaks.
-
-p quota-user=string
- Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
-
-p upload-type=string
- Legacy upload protocol for media (e.g. "media", "multipart").
-
-p upload-protocol=string
- Upload protocol for media (e.g. "raw", "multipart").