client_set_metadata

Function

ArgDescriptionType
client_idstring (required)
metadataA dict containing metadata. If not specified we use kwargs.ordereddict.Dict

Required permissions:COLLECT_CLIENT SERVER_ADMIN

Description

Sets client metadata.

Client metadata is a set of free form key-value pairs, i.e. a dict.

When updating metadata the result is the same as adding 2 dicts. For existing keys, the value is overwritten.

Setting a metadata key with a NULL value deletes that entry.

Example

SELECT client_set_metadata(client_id=client_id, metadata=dict(department="Lab02"))
FROM clients()
WHERE os_info.hostname =~ "TRAINING"

See also