Skip to main content

Update data type

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

Updates a data type.

This implementation only supports updating the transformers of custom and built-in data types.

note
  • 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.

Request body

Details of 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.

  • custom_transformers - array of strings

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

    Each string:

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

Example
{
"custom_transformers": [
"example_bundle.format_student_id",
"example_bundle.mask_first_4_digits"
]
}

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 a 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

Request body

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

Code examples

Example