Update collection
Updates properties of a collection.
The update includes:
- Adding any properties in the request that are not in the collection.
- Amending the
description
,is_unique
,is_index
,is_substring_index
, andis_nullable
attributes, where they have changed, for any properties in the request that are in the collection.is_nullable
can only be changed fromfalse
totrue
.is_unique
can only be changed fromtrue
tofalse
.is_substring_index
can only be changed fromtrue
tofalse
.- All other property attributes are ignored.
The combined length of the collection name and the longest property name can not exceed 40 characters.
The collection request can be provided in JSON or PVSchema format by setting the Content-Type
header to application/json
or application/pvschema
, respectively. The collection can be returned in JSON or PVSchema format using the format
query parameter or by setting the Accept
header to application/json
or application/pvschema
, respectively. The default is to return JSON.
See PVSchema for more details on the structure and content of PVSchema.
The collection name provided in the path parameter must match the collection name in the JSON or PVSchema.
The response contains the collection with all the properties.
This command may take a while to complete (e.g. when adding an index) and is excluded from Vault's standard call timeout.
The role that performs this operation must have the CapCollectionsWriter
capability.
See Access control for more information about how
capabilities are used to control access to operations.
Request
Path parameters
collection
- string required*The name of a collection.
Query parameters
format
- stringThe format of the response. Overrides any
Accept
header value provided.options
- array of stringsOptions for the operation. Options include:
show_builtins
– show built-in properties in the response.
Request body
Details of the collection, including its properties.
- application/json
- application/pvschema
creation_time
- stringThe time when the collection was created, in RFC3339Nano format. Vault sets this value automatically. Sending a value for this field is ignored.
modification_time
- stringThe time when the collection was last modified, in RFC3339Nano format. Vault sets this value automatically. Sending a value for this field is ignored.
name
- string required*The name of a collection.
properties
- array of objects required*Each object:creation_time
- stringThe time when the property was created, in RFC3339Nano format. Vault sets this value automatically. Sending a value for this field is ignored.
modification_time
- stringThe time when the property was last modified, in RFC3339 format. Vault sets this value automatically. Sending a value for this field is ignored.
description
- stringThe description of a model.
is_builtin
- booleanWhether the property is created by Vault (or by the user). Built-in properties cannot be deleted or modified. Sending a value for this field is ignored.
is_encrypted
- booleanWhether the value is stored encrypted.
is_index
- booleanWhether the backend storage is optimized for searches on this property. Cannot be set to
true
for properties with data typesLONG_TEXT
,JSON
, orBLOB
, or custom data types based on those types.is_substring_index
- booleanWhether the backend storage is optimized for substring searches on this property.
is_nullable
- booleanWhether the value of the property can be removed (set to null).
is_readonly
- booleanWhether the user can modify values of this property. Ignored for user define properties. Sending a value for this field is ignored.
is_unique
- booleanWhether the backend storage enforces unique values for active objects. Cannot be set to
true
for properties with data typesLONG_TEXT
,JSON
, orBLOB
, or custom data types based on those types.name
- string required*The name of a property.
data_type_name
- string required*The name of a data type.
type
- string required*The schema prototype the collection is based on.
{
"type": "PERSONS",
"name": "customers",
"properties": [
{
"description": "Date of birth",
"name": "date_of_birth",
"data_type_name": "DATE_OF_BIRTH",
"is_nullable": true
},
{
"description": "Email",
"name": "email",
"data_type_name": "EMAIL",
"is_unique": true,
"is_index": true,
"is_substring_index": false,
"is_nullable": true
},
{
"description": "First name",
"name": "first_name",
"data_type_name": "NAME"
},
{
"description": "Last name",
"name": "last_name",
"data_type_name": "NAME"
},
{
"description": "Phone number",
"name": "phone_number",
"data_type_name": "PHONE_NUMBER",
"is_unique": true,
"is_index": true,
"is_substring_index": false,
"is_nullable": true
}
]
}
{
"type": "PERSONS",
"name": "customers",
"properties": [
{
"description": "Social Security Number",
"name": "ssn",
"data_type_name": "SSN",
"is_unique": true,
"is_index": true,
"is_substring_index": false,
"is_encrypted": true,
"is_nullable": true,
"is_builtin": false,
"is_readonly": false,
"creation_time": "2023-01-25T17:31:40.291033Z",
"modification_time": "2023-01-25T17:31:40.291033Z"
}
],
"creation_time": "2023-01-25T16:21:48.308234Z",
"modification_time": "2023-01-25T16:21:48.308234Z"
}
customers PERSONS (
ssn SSN NULL UNIQUE INDEX COMMENT 'Social Security Number',
);
Possible responses
- 200
- 400
- 401
- 403
- 404
- 405
- 409
- 410
- 500
- 501
- 503
The request is successful.
- application/json
- application/pvschema
creation_time
- stringThe time when the collection was created, in RFC3339Nano format. Vault sets this value automatically. Sending a value for this field is ignored.
modification_time
- stringThe time when the collection was last modified, in RFC3339Nano format. Vault sets this value automatically. Sending a value for this field is ignored.
name
- string required*The name of a collection.
properties
- array of objects required*Each object:creation_time
- stringThe time when the property was created, in RFC3339Nano format. Vault sets this value automatically. Sending a value for this field is ignored.
modification_time
- stringThe time when the property was last modified, in RFC3339 format. Vault sets this value automatically. Sending a value for this field is ignored.
description
- stringThe description of a model.
is_builtin
- booleanWhether the property is created by Vault (or by the user). Built-in properties cannot be deleted or modified. Sending a value for this field is ignored.
is_encrypted
- booleanWhether the value is stored encrypted.
is_index
- booleanWhether the backend storage is optimized for searches on this property. Cannot be set to
true
for properties with data typesLONG_TEXT
,JSON
, orBLOB
, or custom data types based on those types.is_substring_index
- booleanWhether the backend storage is optimized for substring searches on this property.
is_nullable
- booleanWhether the value of the property can be removed (set to null).
is_readonly
- booleanWhether the user can modify values of this property. Ignored for user define properties. Sending a value for this field is ignored.
is_unique
- booleanWhether the backend storage enforces unique values for active objects. Cannot be set to
true
for properties with data typesLONG_TEXT
,JSON
, orBLOB
, or custom data types based on those types.name
- string required*The name of a property.
data_type_name
- string required*The name of a data type.
type
- string required*The schema prototype the collection is based on.
{
"type": "PERSONS",
"name": "customers",
"properties": [
{
"description": "Date of birth",
"name": "date_of_birth",
"data_type_name": "DATE_OF_BIRTH",
"is_nullable": true
},
{
"description": "Email",
"name": "email",
"data_type_name": "EMAIL",
"is_unique": true,
"is_index": true,
"is_substring_index": false,
"is_nullable": true
},
{
"description": "First name",
"name": "first_name",
"data_type_name": "NAME"
},
{
"description": "Last name",
"name": "last_name",
"data_type_name": "NAME"
},
{
"description": "Phone number",
"name": "phone_number",
"data_type_name": "PHONE_NUMBER",
"is_unique": true,
"is_index": true,
"is_substring_index": false,
"is_nullable": true
}
]
}
{
"type": "PERSONS",
"name": "customers",
"properties": [
{
"description": "Social Security Number",
"name": "ssn",
"data_type_name": "ssn",
"is_unique": true,
"is_index": true,
"is_substring_index": false,
"is_encrypted": true,
"is_nullable": true,
"is_builtin": false,
"is_readonly": false,
"creation_time": "2022-12-01T10:20:47.115228Z",
"modification_time": "2022-12-01T10:20:47.115228Z"
}
],
"creation_time": "2022-12-01T09:45:03.015895Z",
"modification_time": "2022-12-01T09:45:03.015895Z"
}
customers PERSONS (
ssn SSN NULL UNIQUE INDEX COMMENT 'Social Security Number',
);
The request is invalid.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1001",
"message": "The access reason is missing.",
"context": {
"reason": null
}
}
Authentication credentials are incorrect or missing.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1005",
"message": "The request is unauthorized.",
"context": {}
}
The caller doesn't have the required access rights.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1007",
"message": "The operation is forbidden due to missing capabilities.",
"context": {
"username": "WebServer"
}
}
The collection is not found.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"context": {
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
},
"error_code": "PVxxxx",
"message": "The object is not found.",
"error_url": "https://docs.piiano.com/api/error-codes#PV1005"
}
The operation is not allowed.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1026",
"message": "The operation is not allowed in in-memory mode.",
"context": {}
}
A conflict occurs.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV3218",
"message": "Concurrent conflicting updates to the same object.",
"context": {}
}
Access to a resource that is no longer available occurs.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1033",
"message": "The resource is gone.",
"context": {}
}
An error occurs on the server.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1000",
"message": "Something went wrong",
"context": {}
}
Not implemented.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV2001",
"message": "This operation is not implemented.",
"context": {}
}
The service is unavailable.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1009",
"message": "The operation timed out on the server.",
"context": {}
}
Path parameters
Query parameters
Request body
Code examples