Page tree

Release 6.8.2


Contents:

   

For the latest updates on available API endpoints and documentation, see api.trifacta.com.

This is the latest version of the APIs.

Contents:


Retrieve a package containing the definition of the specified macro. 

Response body is the contents of the package, which is an importable version of the macro definition.

NOTE: Modification of the macro definition is not supported outside of the Designer Cloud application.

Version: v4

Required Permissions

NOTE: Each request to the Designer Cloud Powered by Trifacta® platform must include authentication credentials. See https://api.trifacta.com/ee/6.8/index.html#section/Authentication.

Request

Request Type: GET

Endpoint:

/v4/macros/<id>/package
ParameterDescription
<id>Internal identifier of the macro to retrieve.


Request URI - Example:

/v4/macros/7/package

Request Body:

None.

Response

Response Status Code - Success:  200 - OK

Response Body Example:

Tip: The response body can be pasted as the request when you import the macro into a different environment. For more information, see API Macros Package Post v4.


{
    "type": "macro",
    "kind": "artifact",
    "hash": "p/zDDBNXrNf4H/E1yH1PvwfedkxOobT1",
    "metadata": {
        "lastMigration": "20191024143300",
        "trifactaVersion": "6.8.0+4.20191104073802.8b6217a",
        "exportedAt": "2019-11-06T01:26:12.430Z",
        "exportedBy": 1,
        "uuid": "6b27eee0-0034-11ea-a378-9dc0586de9fb",
        "edition": "Enterprise"
    },
    "data": {
        "name": "columnFormatCleanup",
        "description": "",
        "signature": [
            {
                "type": "column",
                "name": "Store_Nbr",
                "description": "",
                "internal": false,
                "default": null
            },
            {
                "type": "string",
                "name": "valIfMissing",
                "description": "",
                "default": "'0'"
            },
            {
                "type": "column",
                "name": "POS_Sales",
                "description": "",
                "internal": false,
                "default": null
            },
            {
                "type": "column",
                "name": "POS_Cost",
                "description": "",
                "internal": false,
                "default": null
            },
            {
                "type": "column",
                "name": "Store_Specific_Cost",
                "description": "",
                "internal": false,
                "default": null
            },
            {
                "type": "column",
                "name": "Store_Specific_Retail",
                "description": "",
                "internal": false,
                "default": null
            },
            {
                "type": "column",
                "name": "Current_HO_Retail",
                "description": "",
                "internal": false,
                "default": null
            }
        ],
        "scriptlines": [
            {
                "portId": null,
                "task": {
                    "annotations": {
                        "outputColumnAnnotations": {
                            "Store_Nbr": {
                                "type": [
                                    "Integer"
                                ],
                                "_likely_types": [
                                    [
                                        "Integer"
                                    ],
                                    [
                                        "Float"
                                    ],
                                    [
                                        "String"
                                    ],
                                    [
                                        "Phone"
                                    ],
                                    [
                                        "SSN"
                                    ]
                                ]
                            }
                        }
                    },
                    "kind": "task",
                    "type": "Set",
                    "parameters": {
                        "col": {
                            "kind": "array",
                            "type": "Array",
                            "value": [
                                {
                                    "kind": "variable",
                                    "type": "Variable",
                                    "value": "Store_Nbr"
                                }
                            ]
                        },
                        "value": {
                            "annotations": {},
                            "kind": "func",
                            "type": "IfMissing",
                            "parameters": {
                                "col": {
                                    "kind": "variable",
                                    "type": "Variable",
                                    "value": "col"
                                },
                                "true_expression": {
                                    "kind": "variable",
                                    "type": "Variable",
                                    "value": "valIfMissing"
                                }
                            }
                        }
                    },
                    "outputName": null
                },
                "tableData": null,
                "hash": "976fbac32a53354931c62adfec19af83c65feb81",
                "columnMetadata": null
            },
            {
                "portId": null,
                "task": {
                    "annotations": {
                        "outputColumnAnnotations": {
                            "POS_Sales": {
                                "type": [
                                    "Float"
                                ],
                                "_likely_types": [
                                    [
                                        "Float"
                                    ],
                                    [
                                        "String"
                                    ],
                                    [
                                        "Integer"
                                    ],
                                    [
                                        "Phone"
                                    ],
                                    [
                                        "SSN"
                                    ]
                                ]
                            },
                            "POS_Cost": {
                                "type": [
                                    "Float"
                                ],
                                "_likely_types": [
                                    [
                                        "Float"
                                    ],
                                    [
                                        "String"
                                    ],
                                    [
                                        "Integer"
                                    ],
                                    [
                                        "Phone"
                                    ],
                                    [
                                        "SSN"
                                    ]
                                ]
                            },
                            "Store_Specific_Retail": {
                                "type": [
                                    "Float"
                                ],
                                "_likely_types": [
                                    [
                                        "Float"
                                    ],
                                    [
                                        "String"
                                    ],
                                    [
                                        "Integer"
                                    ],
                                    [
                                        "Phone"
                                    ],
                                    [
                                        "SSN"
                                    ]
                                ]
                            },
                            "Store_Specific_Cost": {
                                "type": [
                                    "Float"
                                ],
                                "_likely_types": [
                                    [
                                        "Float"
                                    ],
                                    [
                                        "String"
                                    ],
                                    [
                                        "Integer"
                                    ],
                                    [
                                        "Phone"
                                    ],
                                    [
                                        "SSN"
                                    ]
                                ]
                            },
                            "Current_HO_Retail": {
                                "type": [
                                    "Float"
                                ],
                                "_likely_types": [
                                    [
                                        "Float"
                                    ],
                                    [
                                        "String"
                                    ],
                                    [
                                        "Integer"
                                    ],
                                    [
                                        "Phone"
                                    ],
                                    [
                                        "SSN"
                                    ]
                                ]
                            }
                        }
                    },
                    "kind": "task",
                    "type": "ReplacePatterns",
                    "parameters": {
                        "with": {
                            "kind": "constant",
                            "type": "String",
                            "value": "0$1"
                        },
                        "col": {
                            "kind": "array",
                            "type": "Array",
                            "value": [
                                {
                                    "kind": "variable",
                                    "type": "Variable",
                                    "value": "POS_Sales"
                                },
                                {
                                    "kind": "variable",
                                    "type": "Variable",
                                    "value": "POS_Cost"
                                },
                                {
                                    "kind": "variable",
                                    "type": "Variable",
                                    "value": "Store_Specific_Cost"
                                },
                                {
                                    "kind": "variable",
                                    "type": "Variable",
                                    "value": "Store_Specific_Retail"
                                },
                                {
                                    "kind": "variable",
                                    "type": "Variable",
                                    "value": "Current_HO_Retail"
                                }
                            ]
                        },
                        "on": {
                            "kind": "constant",
                            "type": "Pattern",
                            "value": "{start}(.{digit}{digit})"
                        },
                        "ignoreCase": {
                            "kind": "constant",
                            "type": "Bool",
                            "value": false
                        },
                        "global": {
                            "kind": "constant",
                            "type": "Bool",
                            "value": false
                        }
                    },
                    "outputName": null
                },
                "tableData": null,
                "hash": "1afc62c208223dc7949ba2daa27b2451baeb5965",
                "columnMetadata": null
            },
            {
                "portId": null,
                "task": {
                    "annotations": {
                        "outputColumnAnnotations": {
                            "POS_Sales": {
                                "type": [
                                    "Float"
                                ],
                                "_likely_types": [
                                    [
                                        "Float"
                                    ],
                                    [
                                        "String"
                                    ],
                                    [
                                        "Integer"
                                    ],
                                    [
                                        "Phone"
                                    ],
                                    [
                                        "SSN"
                                    ]
                                ]
                            }
                        }
                    },
                    "kind": "task",
                    "type": "Set",
                    "parameters": {
                        "col": {
                            "kind": "array",
                            "type": "Array",
                            "value": [
                                {
                                    "kind": "variable",
                                    "type": "Variable",
                                    "value": "POS_Sales"
                                }
                            ]
                        },
                        "value": {
                            "annotations": {},
                            "kind": "func",
                            "type": "IfMissing",
                            "parameters": {
                                "col": {
                                    "kind": "variable",
                                    "type": "Variable",
                                    "value": "col"
                                },
                                "true_expression": {
                                    "kind": "variable",
                                    "type": "Variable",
                                    "value": "valIfMissing"
                                }
                            }
                        }
                    },
                    "outputName": null
                },
                "tableData": null,
                "hash": "393b942fadf8738e71a4ac0fb58622b7b950d952",
                "columnMetadata": null
            },
            {
                "portId": null,
                "task": {
                    "annotations": {},
                    "kind": "task",
                    "type": "Filter",
                    "parameters": {
                        "action": {
                            "kind": "enumerable",
                            "type": "Enumerable",
                            "value": "Delete"
                        },
                        "row": {
                            "annotations": {},
                            "kind": "func",
                            "type": "IsMismatched",
                            "parameters": {
                                "type": {
                                    "kind": "array",
                                    "type": "Array",
                                    "value": [
                                        {
                                            "kind": "constant",
                                            "type": "String",
                                            "value": "Float"
                                        }
                                    ]
                                },
                                "col": {
                                    "kind": "variable",
                                    "type": "Variable",
                                    "value": "POS_Cost"
                                }
                            }
                        },
                        "type": {
                            "kind": "bundle",
                            "type": "Bundle",
                            "value": "custom"
                        },
                        "rowType": {
                            "kind": "bundle",
                            "type": "Bundle",
                            "value": "single"
                        }
                    },
                    "outputName": null
                },
                "tableData": null,
                "hash": "467f90468d684970eac3595d9a046f76703a8585",
                "columnMetadata": null
            }
        ]
    }
}


Reference

AttributeDescription
typeType of artifact. This value is always macro for this endpoint.
kindThis value is artifact.
hashHash value used to verify the internal integrity of the macro definition.
metadata.exportedByInternal identifier of the user who exported the macro.
metadata.uuidUnique identifier for the macro object. This identifier is unique across all editions of the product.
metadata.edition

The edition of the product from which the macro was exported.

nameDisplay name of the macro.
descriptionDescription of the macro.
signatureInternal definition of the columns and parameters referenced in the macro.
scriptlinesEach section represents a separate recipe step from the macro. Steps are represented in an internal form of the transformation language, which is not accessible or modifiable by users.
scriptlines.hashHash value used to verify the internal integrity of the scriptline definition.

This page has no comments.