# Update Twin Doc
This endpoint updates the "description"
of the given Doc attached to the given Twin.
Method | Path | Operation* |
---|---|---|
PATCH | /twins/{twin}/docs/{doc_name} | update_twin_doc |
*
In order for a user to perform the "update_twin_doc" operation, the "update_twin_doc" permission must be included in the list of allowed actions in the statement of the user's role.
# Request
Parameter | Type | In | Description |
---|---|---|---|
{handler} required | string | path | Twin UUID. |
doc_name required | string | path | Name of the Doc. It must match the regular expression(opens new window) ^([a-zA-Z0-9_-]{1,32}\/){0,5}([a-zA-Z0-9_-]{1,32})(.[a-zA-Z0-9]{1,8})?$ . It must be unique in the context of the Twin. |
description optional * | dictionary | body | User-defined key-value pairs: - key: It must match the regular expression(opens new window) ^[a-z_][0-9a-z_]{0,63}$ .- value: JSON compliant value. If no fields have been added, the "description" attribute will not be displayed. For more details consult the description field section. |
*
If the "description"
field with attributes is provided in the request body, the "description"
field from the request body will replace the current "description"
field.
If no attributes are provided in the request body of "description"
("description": {}
), all attributes from the current "description"
will be removed. The response will return an empty dictionary ("description": {}
).
If "description"
with the value null
is provided in the request body, all attributes from the current "description"
will be removed. The response will not return the "description"
field.
If the request body does not contain "description"
, no changes will be made to the "description"
field.
# Response
The response returns the details of the updated Doc.
Attribute | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
creation_certificate | dictionary | Certificate generated automatically by the system upon sending a request to copy the Doc (attach_twin_doc endpoint). It cannot be modified after it has been generated.
| |||||||||||||||
storage_class | string, value can be "access_optimized" or "cost_optimized" | Storage class of the Doc: - "access_optimized" : Storage class for frequently accessed data.- "cost_optimized" : Storage class for automatic cost savings for less frequently accessed data. Once the Doc has been copied and attached to a Twin, the "storage_class" cannot be changed. | |||||||||||||||
status | string, value can be "copying" , "ok" , "error" , or "hash_mismatch" | Status of the Doc: - "copying" : The Doc is in the process of being copied.- "ok" : The copy of the Doc has been successfully generated. It is attached to the Twin and stored in the Twin's directory.- "hash_mismatch" : The "hash" provided in the request does not match the hash of the Doc. A copy of the Doc could not be generated.- "error" : An error occurred and a copy of the Doc could not be generated. | |||||||||||||||
updated_ts | timestamp | Time at which the Doc was last updated. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window). | |||||||||||||||
description | dictionary | User-defined key-value pairs: - key: It must match the regular expression(opens new window) ^[a-z_][0-9a-z_]{0,63}$ .- value: JSON compliant value. For more details consult the description field section. |
*
The "hash"
attribute is only displayed in the "creation_certificate"
if it was provided in the request to attach the attach_twin_doc endpoint.
# 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?