attribute
Read ../idmp-shared/SKILL.md first.
Before any write: Follow the 🛑 Destructive op confirmation protocol. Read-only commands stay read-only here, but delete / write / patch flows still require the shared yes-gate.
Recommended shortcuts
| Shortcut |
Purpose |
+list |
Read attribute definitions before value or history work. |
+get |
Read one attribute's current value. |
+data |
Read multiple current values in one request. |
+history |
Read historical data for one attribute. |
Recommended references
references/idmp-attribute-evaluate-expression.md
Product-style workflow
- Read definitions with
attributes.
- Read current values with
data-get or data-post only when needed.
- Run
new-name without --ack-risk before creating an attribute.
- Run
attribute evaluate-expression create before saving a formula or expression.
- Use
write-data only when you need controlled test input on a metric-backed attribute.
Missing context to resolve first
| Context |
Why it must be resolved before create or write |
| Owner element |
You need the final elementId before you can reserve names, create the attribute, or reread definitions and values. |
| Candidate attribute name |
attribute attributes new-name only works after the owner is fixed. |
| Attribute type plan |
You need the intended valueType and whether the attribute is only metadata, expression-backed, or a metric-backed writable reference. |
| Write target |
Decide whether write-data should target an existing TDengine metric reference rather than the newly created attribute. |
| Verification and cleanup target |
Decide how you will prove create success, how you will reread written data, and which temporary attribute must be deleted at the end. |
Constrained live behaviors
attribute attributes new-name only needs the owner scope, but attributes-post must use the final reserved name and a real valueType.
- The expression-preview command family is
attribute evaluate-expression create, and the schema path is attribute.evaluate-expression.create; the older guessed attribute.attributes.evaluate-expression path is wrong.
- Older checks may still mention the guessed
attribute.attributes.evaluate-expression path; use idmp-cli attribute evaluate-expression create --dry-run --ack-risk --params for the real request.
attribute evaluate-expression create needs a request body with at least dataReferenceType and expression. The live-safe starter is {"dataReferenceType":"Formula","expression":"..."}; attributeId and uomId are optional context helpers, not substitutes for the formula text.
- A newly created generic attribute is not automatically a TDengine metric reference.
attribute write-data create can fail with etda390037 unless the target attribute is backed by writable metric storage.
- In strict live validation,
attribute historydata list should use explicit start and end bounds instead of relying on ambient defaults.
- Attribute create is not complete until
attributes reread shows the new definition.
- Template-derived attributes are not generic scratch objects. If an attribute still has
attrTempId, the generic attribute elements attributes-delete path is expected to reject the delete while the backing template exists.
- Temporary probe attributes should be deleted after the workflow, even when write-data validation used a different existing metric-backed attribute.
Evidence of completion
- A create is only complete when
attribute elements attributes --params rereads the new definition under the same owner.
- A value probe is only complete when
data-get, data-post, or bounded historydata list returns the intended attribute data.
- A write probe is only complete when the target is known to be metric-backed and the reread reflects the inserted row, not just the CLI success line.
Key commands
idmp-cli schema attribute.elements.attributes
idmp-cli attribute elements attributes --params '{"elementId":1}'
idmp-cli schema attribute.attributes.new-name
# new-name is read-only (reserves a name); no --ack-risk required
idmp-cli attribute attributes new-name --params '{"elementId":1}'
idmp-cli schema attribute.elements.attributes-post
idmp-cli attribute elements attributes-post --ack-risk --params '{"elementId":1}' --data '{"name":"probe-attribute","valueType":"Double"}'
idmp-cli schema attribute.evaluate-expression.create
idmp-cli attribute evaluate-expression create --params '{"elementId":1}' --data '{...}' --dry-run --ack-risk
idmp-cli schema attribute.attributes.data-get
idmp-cli attribute attributes data-get --params '{"elementId":1,"attributeId":2}'
idmp-cli schema attribute.historydata.list
idmp-cli attribute historydata list --params '{"elementId":1,"attributeId":2,"current":1,"size":20,"start":1704067200000,"end":1704153600000}'
Exception and failure handling
- If an attribute is not returned by
attributes, do not guess the ID from older notes or scripts.
- If the definition exists but the current value is empty, check history before treating it as a product failure.
- If
new-name returns a different candidate, use the reserved value instead of forcing the original name.
- If expression evaluation fails, fix the formula before create or update; do not save a broken expression first.
- If test writes are rejected with errors such as
etda390037, switch to a known metric-backed attribute; do not assume the newly created attribute is writable.
- If delete fails because the attribute came from an attribute template, treat that as a scope boundary; do not keep retrying the generic element-attribute delete path.
- If the preview differs from the intended payload, stay read-only until the schema and permissions are correct.
Validation scenarios
- Read attribute definitions with
idmp-cli schema attribute.elements.attributes and idmp-cli attribute elements attributes --params '{"elementId":1}'.
- Reserve a create-safe name with
idmp-cli attribute attributes new-name --params '{"elementId":1}'.
- Read one live value with
idmp-cli attribute attributes data-get --params '{"elementId":1,"attributeId":2}'.
- Create a probe attribute only after
idmp-cli attribute attributes new-name --params '{"elementId":1}', then verify the create path with idmp-cli attribute elements attributes-post --ack-risk --params '{"elementId":1}' --data '{"name":"probe-attribute","valueType":"Double"}'.
- Check history paging with
idmp-cli attribute historydata list --params '{"elementId":1,"attributeId":2,"current":1,"size":20,"start":1704067200000,"end":1704153600000}', then use idmp-cli attribute write-data create --dry-run --ack-risk --params '{"elementId":1}' --data '{"probe":"example"}' only after confirming the target attribute is a writable metric reference and idmp-cli attribute evaluate-expression create --params '{"elementId":1}' --data '{"dataReferenceType":"Formula","expression":"AVG(${attributes['"'"'Current'"'"']})"}' --dry-run --ack-risk already succeeded.
1---2name: idmp-attribute3description: IDMP attribute skill for reading definitions and values, checking history, evaluating expressions, reserving names, and safely writing test data.4---56# attribute78**Read [`../idmp-shared/SKILL.md`](../idmp-shared/SKILL.md) first.**910**Before any write:** Follow the [🛑 Destructive op confirmation protocol](../idmp-shared/SKILL.md#-destructive-op-confirmation-mandatory). Read-only commands stay read-only here, but delete / write / patch flows still require the shared yes-gate.111213## Recommended shortcuts1415| Shortcut | Purpose |16|----------|---------|17| [`+list`](references/idmp-attribute-list.md) | Read attribute definitions before value or history work. |18| [`+get`](references/idmp-attribute-get.md) | Read one attribute's current value. |19| [`+data`](references/idmp-attribute-data.md) | Read multiple current values in one request. |20| [`+history`](references/idmp-attribute-history.md) | Read historical data for one attribute. |2122## Recommended references2324- [`references/idmp-attribute-evaluate-expression.md`](references/idmp-attribute-evaluate-expression.md)2526## Product-style workflow27281. Read definitions with `attributes`.292. Read current values with `data-get` or `data-post` only when needed.303. Run `new-name` without `--ack-risk` before creating an attribute.314. Run `attribute evaluate-expression create` before saving a formula or expression.325. Use `write-data` only when you need controlled test input on a metric-backed attribute.3334## Missing context to resolve first3536| Context | Why it must be resolved before create or write |37| --- | --- |38| Owner element | You need the final `elementId` before you can reserve names, create the attribute, or reread definitions and values. |39| Candidate attribute name | `attribute attributes new-name` only works after the owner is fixed. |40| Attribute type plan | You need the intended `valueType` and whether the attribute is only metadata, expression-backed, or a metric-backed writable reference. |41| Write target | Decide whether `write-data` should target an existing TDengine metric reference rather than the newly created attribute. |42| Verification and cleanup target | Decide how you will prove create success, how you will reread written data, and which temporary attribute must be deleted at the end. |4344## Constrained live behaviors4546- `attribute attributes new-name` only needs the owner scope, but `attributes-post` must use the final reserved name and a real `valueType`.47- The expression-preview command family is `attribute evaluate-expression create`, and the schema path is `attribute.evaluate-expression.create`; the older guessed `attribute.attributes.evaluate-expression` path is wrong.48- Older checks may still mention the guessed `attribute.attributes.evaluate-expression` path; use `idmp-cli attribute evaluate-expression create --dry-run --ack-risk --params` for the real request.49- `attribute evaluate-expression create` needs a request body with at least `dataReferenceType` and `expression`. The live-safe starter is `{"dataReferenceType":"Formula","expression":"..."}`; `attributeId` and `uomId` are optional context helpers, not substitutes for the formula text.50- A newly created generic attribute is not automatically a TDengine metric reference. `attribute write-data create` can fail with `etda390037` unless the target attribute is backed by writable metric storage.51- In strict live validation, `attribute historydata list` should use explicit `start` and `end` bounds instead of relying on ambient defaults.52- Attribute create is not complete until `attributes` reread shows the new definition.53- Template-derived attributes are not generic scratch objects. If an attribute still has `attrTempId`, the generic `attribute elements attributes-delete` path is expected to reject the delete while the backing template exists.54- Temporary probe attributes should be deleted after the workflow, even when write-data validation used a different existing metric-backed attribute.5556## Evidence of completion5758- A create is only complete when `attribute elements attributes --params` rereads the new definition under the same owner.59- A value probe is only complete when `data-get`, `data-post`, or bounded `historydata list` returns the intended attribute data.60- A write probe is only complete when the target is known to be metric-backed and the reread reflects the inserted row, not just the CLI success line.6162## Key commands6364```bash65idmp-cli schema attribute.elements.attributes66idmp-cli attribute elements attributes --params '{"elementId":1}'6768idmp-cli schema attribute.attributes.new-name69# new-name is read-only (reserves a name); no --ack-risk required70idmp-cli attribute attributes new-name --params '{"elementId":1}'7172idmp-cli schema attribute.elements.attributes-post73idmp-cli attribute elements attributes-post --ack-risk --params '{"elementId":1}' --data '{"name":"probe-attribute","valueType":"Double"}'7475idmp-cli schema attribute.evaluate-expression.create76idmp-cli attribute evaluate-expression create --params '{"elementId":1}' --data '{...}' --dry-run --ack-risk7778idmp-cli schema attribute.attributes.data-get79idmp-cli attribute attributes data-get --params '{"elementId":1,"attributeId":2}'8081idmp-cli schema attribute.historydata.list82idmp-cli attribute historydata list --params '{"elementId":1,"attributeId":2,"current":1,"size":20,"start":1704067200000,"end":1704153600000}'83```8485## Exception and failure handling8687- If an attribute is not returned by `attributes`, do not guess the ID from older notes or scripts.88- If the definition exists but the current value is empty, check history before treating it as a product failure.89- If `new-name` returns a different candidate, use the reserved value instead of forcing the original name.90- If expression evaluation fails, fix the formula before create or update; do not save a broken expression first.91- If test writes are rejected with errors such as `etda390037`, switch to a known metric-backed attribute; do not assume the newly created attribute is writable.92- If delete fails because the attribute came from an attribute template, treat that as a scope boundary; do not keep retrying the generic element-attribute delete path.93- If the preview differs from the intended payload, stay read-only until the schema and permissions are correct.9495## Validation scenarios96971. Read attribute definitions with `idmp-cli schema attribute.elements.attributes` and `idmp-cli attribute elements attributes --params '{"elementId":1}'`.982. Reserve a create-safe name with `idmp-cli attribute attributes new-name --params '{"elementId":1}'`.993. Read one live value with `idmp-cli attribute attributes data-get --params '{"elementId":1,"attributeId":2}'`.1004. Create a probe attribute only after `idmp-cli attribute attributes new-name --params '{"elementId":1}'`, then verify the create path with `idmp-cli attribute elements attributes-post --ack-risk --params '{"elementId":1}' --data '{"name":"probe-attribute","valueType":"Double"}'`.1015. Check history paging with `idmp-cli attribute historydata list --params '{"elementId":1,"attributeId":2,"current":1,"size":20,"start":1704067200000,"end":1704153600000}'`, then use `idmp-cli attribute write-data create --dry-run --ack-risk --params '{"elementId":1}' --data '{"probe":"example"}'` only after confirming the target attribute is a writable metric reference and `idmp-cli attribute evaluate-expression create --params '{"elementId":1}' --data '{"dataReferenceType":"Formula","expression":"AVG(${attributes['"'"'Current'"'"']})"}' --dry-run --ack-risk` already succeeded.