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.

Query parameters

  • custom_audit - string

    Custom audit information to be included in the audit log.

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 base64 encoded self-contained JavaScript code snippet.

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

Possible responses

The request is successful.

required*
All of:
12
  • description - string

    The description of a model.

  • code - string

    A base64 encoded self-contained JavaScript code snippet.

Example
{
"name": "example_bundle",
"description": "An example bundle that exports a validator, normalizer, transformer, and action",
"exports": {
"validators": [
{
"name": "is_positive",
"type": "validator",
"description": "A validator that returns true if its argument is positive.",
"dependencies": {
"properties": []
}
}
],
"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"
]
}
}
],
"actions": [
{
"name": "decrypt_and_send",
"type": "action",
"description": "An action that decrypts an object and sends it to a compliant third-party service."
}
]
},
"code": "U2FtcGxlIGNvZGU=",
"creation_time": "2022-12-02T02:02:14.398599Z"
}

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