3.10.9. 管理资源类型
以前硬编码的 Telemetry 资源类型现在可以由 gnocchi 客户端管理。您可以使用 gnocchi 客户端来创建、查看和删除资源类型,您可以使用 gnocchi API 更新或删除属性。
1.创建新 资源类型 :
$ gnocchi resource-type create testResource01 -a bla:string:True:min_length=123
+----------------+------------------------------------------------------------+
| Field | Value |
+----------------+------------------------------------------------------------+
| attributes/bla | max_length=255, min_length=123, required=True, type=string |
| name | testResource01 |
| state | active |
+----------------+------------------------------------------------------------+
2.检查 资源类型的 配置:
$ gnocchi resource-type show testResource01
+----------------+------------------------------------------------------------+
| Field | Value |
+----------------+------------------------------------------------------------+
| attributes/bla | max_length=255, min_length=123, required=True, type=string |
| name | testResource01 |
| state | active |
+----------------+------------------------------------------------------------+
3.删除 资源类型 :
$ gnocchi resource-type delete testResource01
注意
如果资源正在使用,则无法删除资源类型。