# Update Indexes table
This endpoint updates a given Indexes table.
Method | Path | Operation* |
---|---|---|
PATCH | /account/services/indexes/{index} | update_indexes_table |
*
In order for a user to perform the "update_indexes_table" operation, the "update_indexes_table" permission must be included in the list of allowed actions in the statement of the user's role.
# Request
UPDATING PROPERTIES
You can add a new property or update the name of an exiting property. Please note that the entire "properties"
dictionary must be included in the request body when adding new properties or updating existing properties. The new "properties"
dictionary content will replace the old "properties"
dictionary content.
Adding a new property
When adding a new property, add a new property after the existing one(s) and a data type for this property to the "types"
list. You must as well add a new template for the property.
Updating an exiting property
When updating a property name, add a list containing the old and the new property name (e.g. ["gdansk_ozone", "gdansk_ozone_new"]
).It is not possible to update the property type.
Parameter | Type | In | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
index required | string | path | Name of the Indexes table to be updated. | |||||||||
rule optional * | string | body | Rule used to select Twins that should be present in the given Indexes table. This rule is evaluated when the Ledger is changed. This rule is not evaluated when a user or a Twin are changed. | |||||||||
properties optional ** | dictionary | body | Dictionary containing a list of property column names and a list of data types of the property columns. You can add a new property or update the name of an exiting property.
| |||||||||
templates optional *** | dictionary | body | Dictionary containing templates for "properties" in form of key-value pairs:- key: property name, - value: template. The templates follow the Python string str.format() convention (see Format String Syntax(opens new window)). |
*
This parameter is optional. If it is not included in the request, no changes will be made to the Indexes table.
**
If the "properties"
dictionary with attributes is provided in the request body, the "properties"
dictionary from the request body will replace the current "properties"
dictionary.
If no attributes are provided in the request body of "properties"
("properties": {}
), or if "properties"
with the value null
is provided in the request body, the response will return an error, because "properties"
columns cannot be removed.
If the request body does not contain "properties"
, no changes will be made to the "properties"
field.
***
If the "templates"
dictionary with attributes is provided in the request body, the "templates"
dictionary from the request body will replace the current "templates"
dictionary.
If no attributes are provided in the request body of "templates"
("templates": {}
), or if "templates"
with the value null
is provided in the request body, the response will return an error, because "templates"
columns cannot be removed.
If the request body does not contain "templates"
, no changes will be made to the "templates"
field.
The "templates"
dictionary must be provided if you are adding a new property.
# Response
Attribute | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
stats | dictionary | Indexes table stats.
| |||||||||||||||
properties | dictionary | Dictionary containing a list of property names and a list of data types of the properties.
| |||||||||||||||
rule | string | Rule used to select Twins that should be present in the given Indexes table. | |||||||||||||||
templates | dictionary | Dictionary containing templates for "properties" in form of key-value pairs:- key: property name, - value: template. The templates follow the Python string str.format() convention (see Format String Syntax(opens new window)). | |||||||||||||||
database | string | Database UUID. |
# Status codes
Requests to this endpoint result in generic status codes. For a comprehensive list of status codes, please consult the Status codes section.
Was this article helpful?