updateAsset #
Update an existing asset model.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/device-manager/models/assets/:model?engineGroup=<engine group>
Method: PUT
Other protocols #
{
"controller": "device-manager/assets",
"action": "updateAsset",
"engineGroup": "<engine group>",
"model": "<asset model>",
"body": {
// Optional
"metadataMappings": {
// Metadata mappings
},
"defaultValues": {
// Default values for metadata
},
"metadataDetails": {
/*
Metadata details including translations and group.
[name: string]: {
group?: string;
locales: {
[locale: string]: {
friendlyName: string;
description: string;
};
};
editorHint?: BaseEditorHint | OptionsSelectorDefinition | DatetimeEditorHint;
};
*/
},
"metadataGroups": {
/*
Metadata groups list and details.
{
[groupName: string]: {
locales: {
[locale: string]: {
groupFriendlyName: string;
description: string;
};
};
};
};
*/
},
"tooltipModels": {
/*
Tooltip models for an asset model.
[key: string]: {
tooltipLabel: string;
content: [
{
category: "metadata";
label?: {
locales: {
[locale: string]: {
friendlyName: string;
description: string;
};
};
};
metadataPath: string;
suffix?: string;
},
{
category: "measure";
label?: {
locales: {
[locale: string]: {
friendlyName: string;
description: string;
};
};
};
measureSlot: string;
measureValuePath: string;
suffix?: string;
},
{
category: "static";
label?: {
locales: {
[locale: string]: {
friendlyName: string;
description: string;
};
};
};
type: "link" | "image" | "text" | "title" | "separator";
value: string;
}
];
};
*/
},
"measures": [
// Array of measure definition with type and name
]
}
}
Arguments #
engineGroup
: Name of the engine groupmodel
: Asset model name
Body properties #
metadataMappings
: Mappings of the metadata in Elasticsearch formatdefaultValues
: Default values for the metadatametadataDetails
: Translations, metadata group and editor hintmetadataGroups
: Groups list with translations for group nametooltipModels
: Tooltip model list, containing each labels and tooltip content to displaymeasures
: Array of measure definition. Each item definestype
andname
properties for the measure.
Response #
{
"status": 200,
"error": null,
"controller": "device-manager/models",
"action": "updateAsset",
"requestId": "<unique request identifier>",
"result": {
"_id": "<modelId>",
"_source": {
// Updated asset model content
},
}
}
Errors #
Updating an asset with metadata mappings can cause conflicts, in this case a MappingsConflictsError will be thrown with the HTTP code 409.
Edit this page on Github(opens new window)