Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

D toc

Create a list of value-based import rules for the specified deployment. Delete any previous rules applied to the same values.

Info

NOTE: Import rules must be applied to individual deployments.

The generated rules apply to all flows that are imported into the Production instance after they have been created.

Info

NOTE: Deployments pertain to Production instances of the

D s platform
rtrue
. For more information, see Overview of Deployment Management.

The response contains any previously created rules that have been deleted as a result of this change.

You can also make replacements in the import package based on object references. See API Deployments Object Import Rules Patch v3.

Version: v3

Required Permissions

D s api auth

Request

Request Type: PATCH

Endpoint:

Code Block
/v3/deployments/<id>/valueImportRules

where:

ParameterDescription
<id>Internal identifier for the deployment

Request URI - Example:

Code Block
/v3/deployments/4/valueImportRules

Request Body Example: Single value replacement

The following JSON array describes a single replacement rule for the S3 bucket name. In this case, the wrangle-dev bucket name has been replaced by the wrangle-prod bucket name, which means data is pulled in the Production deployment from the appropriate S3 bucket. 

Info

NOTE: The executing user of any job must have access to any data source that is remapped in the new instance.

Code Block
[{"type":"s3Bucket","on":"wrangle-dev","with":"wrangle-prod"}]

Request Body Example: Multiple value replacements

The following JSON array describes two replacements for the fileLocation values. In this case, rules are applied in succession. 

Info

NOTE: Rules are applied in the listed order. If you are applying multiple rules to the same object in the import package, the second rule must reference the expected changes applied by the first rule.

Code Block
[
  {"type":"fileLocation","on":"klamath","with":"klondike"}, 
  {"type":"fileLocation","on":"/\/dev\//","with":"/prod/"}
]

In the above:

  • The first rule replaces the string klamath in the path to the source with the following value: klondike
  • The second rule performs a regular expression match on the string /dev/. Since the match is described using the regular expression syntax, the backslashes must be escaped. The replacement value is the following literal: /prod/.

You can specify matching values using the following types of matches:

Match TypeExample Syntax
string literal
{"on":"d75255f0-a245-11e7-8618-adc1dbb4bed0"}
regular expression
{"on":"/[0-9a-zA-z]{8}-a245-11e7-8618-adc1dbb4bed0/"}
Info

NOTE: Use of

D s item
itempatterns
is not supported.

For more information on patterns, see Text Matching.

Response

Response Status Code - Success: 200 - OK

The response body contains any previously created rules that have been deleted as a result of this update.

Response Body Example: All new rule, no deletions

If the update does not overwrite any previous rules, then no rules are deleted. So, the response looks like the following:

Code Block
{
    "deleted": []
}

 


Response Body Example: Replace file location, delete previous rule

If you submit the request again, the response contains the rule definition of the previous update, which has been deleted. 

Code Block
{
    "deleted": [
        {
            "on": "wrangle-dev",
            "id": 1,
            "type": "s3Bucket",
            "with": "wrangle-prod",
            "createdBy": 3,
            "updatedBy": 3,
            "createdAt": "2017-11-07T02:16:57.743Z",
            "updatedAt": "2017-11-07T02:16:57.743Z",
            "deploymentId": 1
        }
    ]
}

Reference

PropertyDescription
onThe specified literal or pattern to match.
idInternal identifier for the value import rule
type

The type of value import rule:

  • fileLocation - the location of a specified file.
  • s3Bucket - location of the S3 bucket to modify
withThe replacement value or pattern
deploymentIdInternal identifier for the deployment to which to apply the import rule.