Skip to main content

strm create data-contract

Create a Data Contract

Synopsis

Data Contracts are the core of STRM Privacy. See here for details

Usage

strm create data-contract (handle/name/version) [flags]

Examples

Here's an example of a Simple Schema file

{
"name": "GDDemo",
"nodes": [
{ "type": "STRING", "name": "transactionId", "required": true },
{ "type": "STRING", "name": "userId"},
{ "type": "STRING", "name": "email"},
{ "type": "INTEGER", "name": "age"},
{ "type": "FLOAT", "name": "height"},
{ "type": "STRING", "name": "size"},
{ "type": "INTEGER", "name": "transactionAmount"},
{ "type": "STRING", "name": "items"},
{ "type": "STRING", "name": "hairColor"},
{ "type": "INTEGER", "name": "itemCount"},
{ "type": "STRING", "name": "date"},
{ "type": "INTEGER", "name": "purpose"}
],
}
Here's an example of Data Contract definition file'

{
"keyField": "transactionId",
"dataSubjectField": "userId",
"validations": [{"field": "email", "type": "regex", "value": "..."}],
"fieldMetadata": [
{
"fieldName": "email",
"personalDataConfig": {"isPii": true, "isQuasiId": true, "purposeLevel": 1}
},
{
"fieldName": "userId",
"personalDataConfig": {"isPii": false, "isQuasiId": true}
},
{
"fieldName": "userAgeGroup",
"personalDataConfig": {"isPii": false, "isQuasiId": true},
"statisticalDataType": "ORDINAL",
"ordinalValues": ["child", "teenager", "adult", "senior"],
"nullHandlingConfig": {"type": "DEFAULT_VALUE", "defaultValue": "adult"}
}
]
}

Options

      --contract-definition string   the path to the file with the keyField, and possibly piiFields and validations. See example.
-h, --help help for data-contract
--public whether the data contract should be made public (accessible to other STRM Privacy customers)
--schema-definition string filename of the schema definition (yaml or JSON) - either a Simple Schema, Avro Schema or JSON Schema

Options inherited from parent commands

      --api-auth-url string   user authentication host (default "https://accounts.strmprivacy.io")
--api-host string api host and port (default "api.strmprivacy.io:443")
-o, --output string output format [json, json-raw, table, plain] (default "table")
-p, --project string project to use (defaults to context-configured project)
--token-file string token file that contains an access token (default is $HOME/.config/strmprivacy/credentials-<api-auth-url>.json)

SEE ALSO