Creating a property through API call: PUT /propDef/v1/save
Administrators must update or define and add new properties at various places in the application.
The API call PUT /propDef/v1/savefacilitates both creation/addition of a new property or update of an existing property.
The call requires JSON payload. While this method provides relative flexibility and control over properties, users must take care to configure the request payload.
Several conditions must be met for payload properties to be configured correctly:
-
3 properties in Request Payload are mandatory:
-
"Name"
-
"applicableClasses"
-
"propertyCategoryMembers"
-
Classes:"applicableClasses" are high level descriptions that bucket properties into Object Classes like Field, Entity, Source, Source Connection
-
Categories:"propertyCategoryMembers" tell the application where in the UI the property should appear.
- To indicate that value for this property is required in the UI, add a required flag ("required":true). Default value is "false" (see payload example below)
- Note behavior of "required" flag— The "required" flag means that: if 'required' is originally defined for 3 categories as "false" (not required), then the call is run again with 2 of those categories and an additional one now "true" (required)--but the original one that wasn't updated is still 'false'.
- Specify "defaultValue"="<value>" or "null". If a value is not provided it will default to "null"
ClassesValue must have at least one correspondingCategoriesvalue!
For example:
If the "applicableClasses"="com.nvs.core.model.meta.DataSource"
there must be a corresponding "propertyCategoryMembers" for defining a DataSource Property such as "Source Props", or "Default Source Props"
Class Name [applicableClasses] |
Categories [propertyCategoryMembers] |
---|---|
Data Source |
|
com.nvs.core.model.DataSource |
Default Source Props |
|
Source Props |
Entity |
|
com.nvs.core.model.meta.DataEntity |
Default Entity Props |
|
Entity Props |
Field |
|
com.nvs.core.model.meta.DataField |
Field Props |
|
Default Field Props, must specify source type(s): File Field Props Mainframe Field Props JDBC Field Props XML Field Props |
Source Connection |
|
com.nvs.core.model.meta.SourceConnection |
Source Conn Props |
|
SQOOP Source Conn Props |
|
OPENCONNECTOR Source Conn Props |
|
KAFKA Source Conn Props |
|
XML Source Conn Props |
|
JDBC Source Conn Props |
|
MAINFRAME Source Conn Props |
|
Hadoop Source Conn Props |
|
FILE Source Conn Props |
It is not permitted to remove existing class or category mapping so if a user specifies fewer categories than the original property definition, the existing classes and/or categories not listed in the update will remain.
Payload received from GET/podium/propDef/getAll provides JSON for properties in place and can be helpful for updating properties or as examples for creation of new properties.
Request Payload Properties |
Optional |
Values |
---|---|---|
applicableClasses |
No |
Options: (Multiple selections entered as comma-separated values) com.nvs.core.model.meta.DataField com.nvs.core.model.meta.DataEntity com.nvs.core.model.meta.DataSource com.nvs.core.model.meta.SourceConnection |
propertyCategoryMembers |
No |
Options: (Multiple selections entered as comma-separated values) See propertyCategoryMembers options below. |
displayName |
yes |
Display Name, user-definable |
description |
yes |
Property Description, user-definable |
defaultValue |
yes |
Provide "<value>", default value is "null" if not provided |
type |
yes |
Data type, default value is "STRING" if not provided |
editable |
yes |
Default is "false" if not set to "true" |
nullable |
yes |
Default is "false" if not set to "true" |
Example: Resource URL Request
http://<podiumHost>/podium/propDef/v1/save
Example: Payload.1 (Source Property):
{
"name": "new.prop2",
"displayName": "new.prop2",
"description": "new source property",
"defaultValue": "prop2",
"type": "STRING",
"editable": true,
"nullable": true,
"applicableClasses": ["com.nvs.core.model.meta.DataSource"],
"propertyCategoryMembers": ["Default Source Props","Source Props"],"required":true
}
Example: Response--Source Property:
{
"id": 181,
"name": "new.prop2",
"displayName": "new.prop2",
"description": "new source property",
"type": "STRING",
"defaultValue": "prop2",
"editable": true,
"nullable": true,
"applicableClasses": [
"com.nvs.core.model.meta.DataSource"
],
"propertyCategoryMembers": [
"Default Source Props",
"Source Props"
],
"required": true
}
Example: Payload.2 (Field Property):
{
"name": "MFprop2",
"displayName": "MFprop2",
"description": "new default field property now required",
"defaultValue": "prop2",
"type": "STRING",
"editable": true,
"nullable": true,
"applicableClasses": ["com.nvs.core.model.meta.DataField"],
"propertyCategoryMembers": ["Mainframe Field Props"],"required":true
}
Example: Response--Field Property:
{
"id": 214,
"name": "MFprop2",
"displayName": "MFprop2",
"description": "new default field property now required",
"type": "STRING",
"defaultValue": "prop2",
"editable": true,
"nullable": true,
"applicableClasses": [
"com.nvs.core.model.meta.DataField"
],
"propertyCategoryMembers": [
"Mainframe Field Props"
],
"required": true
}
Example: Payload.3 (Example: OpenConnector Property):
{
"name": "prop.p1",
"displayName": "new.prop.p1",
"description": "new openconnector prop",
"defaultValue": "prop.value",
"type": "STRING",
"editable": true,
"nullable": true,
"applicableClasses": ["com.nvs.core.model.meta.DataSource"],
"propertyCategoryMembers": [
"Default Source Props",
"Source Props"],
"required":true
}
Example: Response--OpenConnector Property:
{
"id": 270,
"name": "prop.p1",
"displayName": "new.prop.p1",
"description": "new openconnector prop",
"type": "STRING",
"defaultValue": "prop.value",
"editable": true,
"nullable": true,
"applicableClasses": [
"com.nvs.core.model.meta.DataSource"
],
"propertyCategoryMembers": [
"Default Source Props",
"Source Props"
],
"required": true
}
Example: Payload.4 (OpenConnector Property---SCP properties sfile and starget):
Example: Payload--sfile
{
"name": "sfile",
"displayName": "sfile",
"description": "scp input path",
"defaultValue": "prop.value",
"type": "STRING",
"editable": true,
"nullable": true,
"applicableClasses": ["com.nvs.core.model.meta.DataEntity"],
"propertyCategoryMembers": [
"Entity Props"],
"required":true
}
Example: Response--sfile
{
"id": 389,
"name": "sfile",
"displayName": "sfile",
"description": "scp input path",
"type": "STRING",
"defaultValue": "prop.value",
"editable": true,
"nullable": true,
"applicableClasses": [
"com.nvs.core.model.meta.DataEntity"
],
"propertyCategoryMembers": [
"Entity Props"
],
"required": true
}
Example: Payload--starget
{
"name": "starget",
"displayName": "starget",
"description": "scp target path",
"defaultValue": "prop.value",
"type": "STRING",
"editable": true,
"nullable": true,
"applicableClasses": ["com.nvs.core.model.meta.DataEntity"],
"propertyCategoryMembers": [
"Entity Props"],
"required":true
}
Example: Response--starget
{
"id": 390,
"name": "starget",
"displayName": "starget",
"description": "scp target path",
"type": "STRING",
"defaultValue": "prop.value",
"editable": true,
"nullable": true,
"applicableClasses": [
"com.nvs.core.model.meta.DataEntity"
],
"propertyCategoryMembers": [
"Entity Props"
],
"required": true
}