Skip to main content

Update data type

patch
/api/pvlt/1.0/ctl/types/{type}

Updates a data type.

The update includes:

  • For built-in and custom data types, adding or removing custom transformers.
  • For custom data types, updating the description, default_transformer, and validator attributes.
note
  • The update of validator is allowed only if the custom data type does not have a normalizer.
  • Built-in transformers can not be added or removed.
  • Custom transformers may be added or removed but must be exported by a loaded bundle.

Request

Path parameters

  • type - string required*

    The name of a data type.

Query parameters

  • custom_audit - string

    Custom audit information to be included in the audit log.

Request body

Details of the properties to update for the data type, including the names and locations of the JavaScript functions it uses.

object required*

The data type and its function. default_transformer is the default transformer for the data type and should be taken from the transformers list.

  • name - string required*

    The name of a data type.

  • base_type_name - string required*

    The name of the base data type.

  • description - string

    The description of a model.

  • validator - string

    The bundle and function name formatted as <bundle-name>.<function-name>.

  • normalizer - string

    The bundle and function name formatted as <bundle-name>.<function-name>.

  • transformers - array of strings

    The names of transformers that are supported for the data type.

    Each string:

    The bundle and function name formatted as <bundle-name>.<function-name>.

  • default_transformer - string

    The bundle and function name formatted as <bundle-name>.<function-name>.

Example
{
"description": "A custom data type representing a student ID based on the built-in STRING type.",
"validator": "example_bundle.validate_student_id",
"transformers": [
"example_bundle.format_student_id",
"example_bundle.mask_first_4_digits"
],
"default_transformer": "example_bundle.format_student_id"
}

Possible responses

The request is successful.

object required*

The data type and its function. default_transformer is the default transformer for the data type and should be taken from the transformers list.

  • name - string required*

    The name of a data type.

  • is_builtin - boolean

    Whether this data type is built-in or user defined.

  • base_type_name - string required*

    The name of the base data type.

  • description - string

    The description of a model.

  • validator - string

    The bundle and function name formatted as <bundle-name>.<function-name>.

  • normalizer - string

    The bundle and function name formatted as <bundle-name>.<function-name>.

  • transformers - array of strings

    The names of transformers that are supported for the data type.

    Each string:

    The bundle and function name formatted as <bundle-name>.<function-name>.

  • default_transformer - string

    The bundle and function name formatted as <bundle-name>.<function-name>.

  • creation_time - string

    The time when the data type was created.

Example
{
"name": "student_id",
"base_type_name": "STRING",
"description": "A custom data type representing a student ID based on the built-in STRING type.",
"validator": "example_bundle.validate_student_id",
"normalizer": "example_bundle.normalize_student_id",
"transformers": [
"token",
"example_bundle.format_student_id",
"example_bundle.mask_first_4_digits"
],
"default_transformer": "example_bundle.format_student_id",
"creation_time": "2022-12-01T10:04:42.777225Z"
}

Try the API

Authorization

Path parameters

Query parameters

Request body

Navigate to the docs of your local Vault installation to try the API directly from there.

Code examples

Example