Association Import
Paritech.Authority.Control Association Import <Service> <FromType> <FromCode>
Defines multiple Associations from an Asset by importing from a file or STDIN.
Arguments
Section titled “Arguments”Field | Description |
---|---|
Service | The Authority Service to connect to. |
FromType | The type of the Asset the Association is from. |
FromCode | The unique code of the Asset the Association is from. |
Available Options
Section titled “Available Options”These options affect the From Asset.
Option | Description |
---|---|
-App <Code> | Specifies metadata for an Application on the From Asset. Affects the -Meta and -ID options. Can be specified multiple times. |
-ID <Name> | Specifies a new ID for the current App. Can be specified multiple times. |
-Meta <Key> <Value> | Supplies a metadata key/value for the current App. Can be specified multiple times. |
-Val <Key> <Value> | Supplies a key/value for the current ID. Can be specified multiple times. |
These options affect the data import of the To Assets.
Option | Description |
---|---|
-Cols <Columns> | A comma-separated list of column names. Defaults to type,code. |
-Enc <Encoding> | Input encoding. One of ASCII, UTF8 (default). |
-File <FileName> | Read from the given file |
-Format <Format> | Input data format. One of CSV (default), TSV, JSON. |
-Header | The input CSV data does contain a header line. With -Cols, specify to skip the header. |
-NoHeader | The input CSV data does not contain a header line. |
-Stdin | Read from STDIN. Default. |
When using the CSV format, Type and Code determine the To Asset. Subsequent columns provide context information based on the column header. Empty values are ignored.
A:<AppCode>:<Key>
: Adds a Metadata value to theAppCode
application for the Asset.A:<AppCode>:<IdName>:<Key>
: Adds an ID value to theIdName
set under theAppCode
application for the Asset.X:<AppCode>:<Key>
: Adds a Metadata value to theAppCode
application for the Association.X:<AppCode>:<IdName>:<Key>
: Adds an ID value to theIdName
set under theAppCode
application for the Association.
When using the JSON format, each line is interpreted as a JSON serialised ToAssetAssociation.
Output
Section titled “Output”The process result will be 0 on success, and a negative value on failure.
Examples
Section titled “Examples”Type,Code,X:Zenith:VisibilityTradingAccount,XS:0001,TradingAccount,XS:0002,TradingAccount,XS:0003,TradingAccount,XS:0004,Market,XSX,Full
Paritech.Authority.Control Association Import XOSP User 1234 < Associations.csv
{"ToAsset":{"Type":"TradingAccount","Code":"XS:0001"}}{"ToAsset":{"Type":"TradingAccount","Code":"XS:0002"}}{"ToAsset":{"Type":"TradingAccount","Code":"XS:0003"}}{"ToAsset":{"Type":"TradingAccount","Code":"XS:0004"}}{"ToAsset":{"Type":"Market","Code":"XSX"},"Association":{"Context":[{"Application":"Zenith","Metadata":{"Visibility":"Full"}}]}}
Paritech.Authority.Control Association Import XOSP User 1234 -Format Json < Associations.json
More Information
Section titled “More Information”Utilises the /association API.