Attribute Masks¶
/api/repositories/{repository}/entities/{entity}/attributes/{attribute}/masks
Parameter | Type | Purpose |
---|---|---|
repository | string | The repository name |
entity | int | The entity ID |
attribute | int | The attribute ID |
Only POST requests are supported for this endpoint.
-
POST
/api/repositories/
(string: repository)/entities/
(int: entityID)/attributes/
(int: attributeID)/masks
¶ Get a page of masks for an attribute
POST /api/repositories/jupiter/entities/1/attributes/55/masks HTTP/1.1
Content-Type: application/json
{
"command": "get",
"options": {
"pageStart": 1,
"pageSize": 32
}
}
The response is a Standard Response.
The columns
array will show the following columns:
Human Name | Column Name | Description |
---|---|---|
Mask | VALUE | The mask of the data |
Mask Stats | _mask_stat | The pattern of the mask |
Value Count | VALUE_COUNT | The number of values that match the mask |
Frequency | FREQUENCY_COUNT | The frequency of all the values that match the mask. |
Dist % | _distribution | A measure of how much of the attribute contains values that match the mask |
A datarow
element will look like:
{
"dataRow": [
"NNNNNNNNNN",
"N10",
"43",
"574",
"40.508"
]
}
Export¶
Some or all of the rows may be exported as a scheduled task.
POST /api/repositories/jupiter/entities/1/attributes/2/masks HTTP/1.1
Content-Type: application/json
{
"command": "export",
"data": {
"filename": "filename.csv",
"filetype": "csv",
"encoding": "utf-8"
},
"options": {
"where": "Frequency = 3"
}
}
Response Code | Reason |
---|---|
200 | No error |
400 | Invalid data passed with request |
500 | Server error |
The request packet must contain the command
and data
elements. The options
element is not required, but may specify the columns to export, and/or the rows to filter.
The following table shows which fields are required in the data
element:
Field | Required |
---|---|
filename | Y |
filetype | N |
encoding | N |
If filetype
is not specified, it defaults to csv. If encoding
is not specified, it defaults to the server native encoding.
The response will contain the URL of the scheduled task and the link to download the exported file.
{
"job": "/api/repositories/jupiter/scheduler/1",
"file": "/api/repositories/jupiter/download/filename.csv"
}
Recode Masks¶
Edit¶
/api/repositories/{repository}/entities/{entity}/attributes/{attribute}/recodemasks
Parameter | Type | Purpose |
---|---|---|
repository | string | The repository name |
entity | int | The entity ID |
attribute | int | The attribute ID |
-
POST
/api/repositories/
(string: repository)/entities/
(int: entityID)/attributes/
(int: attributeID)/recodemasks
¶ Recode masks for an attribute
POST /api/repositories/jupiter/entities/1/attributes/55/recodemasks HTTP/1.1
Content-Type: application/json
{
"command": "edit",
"data": "AANNNNN AANN ANNNNN ANN"
}
data is a list of “<MASK1> <RECODING MASK1> <MASK2> <RECODING MASK2>.................” data should contain a list of “Mask and Recoding Mask” pairs. In the above example AANNNNN is the mask and AANN is the recoding mask. AANNNNN will be recoded to AANN
All fields are required.
Response Code | Reason |
---|---|
200 | Success |
500 | Server error |
If the recode is successful, the response will contain a URL pointing at the masks of the attribute.
Export¶
/api/repositories/{repository}/entities/{entity}/attributes/{attribute}/recodemasks
Parameter | Type | Purpose |
---|---|---|
repository | string | The repository name |
entity | int | The entity ID |
attribute | int | The attribute ID |
-
POST
/api/repositories/
(string: repository)/entities/
(int: entityID)/attributes/
(int: attributeID)/recodemasks
¶ Export recode masks of an attribute
POST /api/repositories/jupiter/entities/1/attributes/55/recodemasks HTTP/1.1
Content-Type: application/json
{
"command": "export",
"data": {
"filename": "filename",
"encoding": "ascii",
"fieldWidth":"AUTO"
}
}
All fields are required.
filename
enter the filename, the ddx will be created with the same filename but with .ddx extention.
encoding
field indicates the character encoding used by the data file. The following are the supported encodings:
cp1252, ascii, big5, cp1250, cp1251, cp1253, cp1254, cp1255, cp1256, cp1257, cp1258, cp437, cp737, cp775, cp850, cp852, cp855, cp857, cp860, cp861, cp862, cp863, cp864, cp865, cp866, cp869, cp874, cp932, cp936, cp949, cp950, dingbats, ebcdic, euc-cn, euc-jp, euc-kr, gb12345, gb1988, gb2312, gb2312-raw, identity, iso2022, iso2022-jp, iso2022-kr, iso8859-1, iso8859-10, iso8859-13, iso8859-14, iso8859-15, iso8859-16, iso8859-2, iso8859-3 iso8859-4, iso8859-5, iso8859-6, iso8859-7, iso8859-8, iso8859-9, jis0201, jis0208, jis0212, koi8-r, koi8-u, ksc5601, macCentEuro, macCroatian macCyrillic, macDingbats, macGreek, macIceland, macJapan, macRoman, macRomania, macThai, macTurkish, macUkraine, shiftjis, symbol, tis-620, unicode, utf-8
fieldWidth
should either be set to “AUTO” or to a value between 0 and 100.
Response Code | Reason |
---|---|
200 | Success |
500 | Server error |
If the export is successful, the response will as follows, containing URL pointing to an export job and URL links to download the created files.
{
"job": "/api/repositories/jupiter/scheduler/107",
"file": "/api/repositories/jupiter/download/filename",
"ddxFile": "/api/repositories/jupiter/download/filename.ddx"
}