...
A domain model schema (model) is a JSON object describing the schema for a data domain; it defines the properties that make up the domain's schema. The root node of the model schema is the properties
element. See Domains and Domains below.
...
POST the Domain
The first step in creating a domain is to define the domain name, its type and the owning zone:
...
property | required | valid values | description |
---|---|---|---|
name | yes | Must be at least 3 characters long but no longer than 128. | The domain name. Must be unique to the entire YOUnite deployment since domains are typically shared. |
zoneUuid | no | Owning zone's domain UUID | TODO ROBBIE: The zone that the domain, the domain's versions and its MDRs will be tied to. If this is omitted the caller's current zone will be used. Note that the caller must have permissions to create a domain for the zone. |
domainType | no | MASTER_CENTRALIZED or MASTER_FEDERATED | The domain type which can be either: MASTER CENTRALIZED (defaul TODO ROBBIE - still?t) When the domain master data is centrally stored in YOUnite. This is used when the entire organization is comfortable or mandated to migrate a domain to a single store. Central stores are optimal for reference data such as a list of states countries, zip-codes, etc. MASTER FEDERATED domains do not store their data centrally in YOUnite but reference and update data on the systems in which it resides. Federated domains require adaptors and metadata and scope configurations and are covered in detail *TODO: TUTORIAL ON FEDERATED* |
The model is not created in this step. Models are tied to specific versions covered below.
...
POST a Domain Version
With the domain in place, its first version can be created. The domain version defines the properties that make up domain version's model. The domain version numbers are automatically generated and start with 1 and continue in ascending order. The root node of the model schema is the properties
element. See Domains and Domains below.
A domain version is defined with a domain JSON Object as described below:
POST /domains/versions/<zone-uuid>
Code Block | ||
---|---|---|
| ||
{ "modelSchema": { "properties": { "<property-name>": { "type": "<property-type>", ...item1 properties.... }, "<property-name>": { ... } } }, "displayProperty": "<property-name>", "uniquenssRuless": "<property-name1> [, <property-name2>, .....]" } |
Descriptions of the Domain Version Properties:
Define the Domain
For example, to create a simple states
domain including the modelSchema:
POST /domains
...
language | js |
---|---|
title | Defining a Model Schema |
...
property | required | valid values | description |
---|---|---|---|
name modelSchema | yes | Must be at least 3 characters long but no longer than 128. | The domain name. Must be unique to the entire YOUnite deployment since domains are typically shared. |
version | no | Positive integer | The version number. If the version number is omitted the version starts with 1 and is incremented for each new version of the domain. |
domainType | no | CENTRALIZED or FEDERATED | The domain type which can be either: CENTRALIZED (default) When the domain master data is centrally stored in YOUnite. This is used when the entire organization is comfortable or mandated to migrate a domain to a single store. Central stores are optimal for reference data such as a list of states countries, zip-codes, etc. FEDERATED domains do not store their data centrally in YOUnite but reference and update data on the systems in which it resides. Federated domains require adaptors and metadata and scope configurations and are covered in detail *TODO: TUTORIAL ON FEDERATED* |
modelSchema | yes | See Domains and Domains below. | A JSON model describing the schema for the data domain; it defines the properties that make up the domains schema. The root node of the model schema is the properties element. See Domains and Domains below. |
displayProperty | yes | A valid model schema property name | A property defined in the modelSchema that acts as an index for the domain. The data values for the displayProperty must always be unique. See Domains below. |
uniquenessRules | no | One or more valid model schema property names | Required data and their associated rules that are cache'd to make sure duplicate data entries are not POSTed to the domain. This defaults to the displayProperty if it is not provided. See Domains below. |
...
See Domains and Domains below. | A JSON model describing the schema for the data domain; it defines the properties that make up the domains schema. The root node of the model schema is the properties element. See Domains and Domains below. | ||
displayProperty | yes | A valid model schema property name | A property defined in the modelSchema that acts as an index for the domain. The data values for the displayProperty must always be unique. See Domains below. |
uniquenessRules | no | One or more valid model schema property names | Required data and their associated rules that are cache'd to make sure duplicate data entries are not POSTed to the domain. This defaults to the displayProperty if it is not provided. See Domains below. |
Creating a Domain is Three-Step Process
For example, we'll create a centralized data domain and load one MDR:
- POST the Domain
- POST a Domain Version
- POST (or Map) the Master Data
POST the Domain
For example, to create a simple states domain :
POST /domains
Code Block language js title Defining a Model Schema { "name": "states", "zoneUuid": "a1aca070-846f-44e5-9471-c73b46c35f4a", "domainType": "MASTER_CENTRALIZED" }
The location header returned provides the URI for POSTing a domain version below.
e.g.
Location /domains/7f28180b-7d9f-42b5-b5ed-d4a0e7ec09fc
POST a Domain Version
POST /domains/versions/
7f28180b-7d9f-42b5-b5ed-d4a0e7ec09fc
POST Master Data Records to the Domain
Once the domain/version has been created, master data can be POSTed to it using the /mdr endpoint:POST /mdr/statesmdrs
Code Block | ||||
---|---|---|---|---|
| ||||
{ "data" "name": "states", "version": 1, "json": { "name" : "California", "abbreviation" : "CA" } } |
...