Skip to main content

Update bundle

patch
/api/pvlt/1.0/ctl/bundles/{bundle}

Updates a bundle.

An update is allowed only if the prototypes of the JavaScript functions in the request are a superset of those in the bundle. The name of the bundle can't be updated.

The role performing this operation must have the CapCodeWriter capability. See Access control for more information about how capabilities are used to control access to operations.

Request

Path parameters

  • bundle - string required*

    The name of a bundle.

Request body

Details of the bundle including the code that defines the functions as properties of the exports object. Name can't be updated.

object required*
  • description - string

    The description of a model.

  • code - string

    A byte[] containing a self-contained JavaScript code snippet.

Example
{
"name": "example_bundle",
"description": "An example bundle that exports a validator, normalizer, and transformer",
"code": "U2FtcGxlIGNvZGU="
}

Possible responses

The request is successful.

required*
All of:
12
  • description - string

    The description of a model.

  • code - string

    A byte[] containing a self-contained JavaScript code snippet.

Example
{
"name": "example_bundle",
"description": "An example bundle that exports a validator, normalizer, and transformer",
"exports": {
"validators": [
{
"name": "is_positive",
"type": "validator",
"description": "A validator that returns true if its argument is positive.",
"dependencies": {
"properties": [],
"http_get_access": [],
"http_post_access": []
}
}
],
"normalizers": [
{
"name": "to_lower",
"type": "normalizer",
"description": "A normalizer that formats a string to lowercase without any dependencies."
}
],
"transformers": [
{
"name": "to_name_with_title",
"type": "transformer",
"description": "A transformer that accepts a full name and returns it prepended with a title.",
"dependencies": {
"properties": [
"gender",
"marital_status"
]
}
}
]
},
"code": "U2FtcGxlIGNvZGU=",
"creation_time": "2022-12-02T02:02:14.398599Z"
}

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