gnocchi
gnocchi copied to clipboard
Resource Type association?
Hi jd!
I'm using gnocchi for about 1 year, this is a cool project.
Recently my workmate make some suggestion about association between resource-types . We create some new resource-types , but we can't query association between this new types by some certain way. The only method is refering some config file . Could we define some new API to do this ?
Maybe, what do you have in mind exactly?
For example , we can define resource-type instance and instance_disk , when we are searching some instance disk , we use condition like this {"instance_id": {"=": "instance_id_1" }}
.
However , if I can't get the definition file about resource-type , I don't know the sub-resource about instance.
Thus, in my mind , we may need to change "get resource-type" like this:
Method: Get
URL: /v1/resource_type/instance
Response:
{
"attributes": {
"uptime": {
"min_length": 0,
"max_length": 255,
"type": "string",
"required": true
},
...
},
"state": "active",
"name": "instance",
"association": {
"instance_disk": {
"query": "{\"=\": {\"instance_id\": \"%s\"}}",
"args": "instance_id"
}
}
}
This part of job is done by ceilometer's config file for now . But without access to the config file , I can't get the true definition about certain resource-type.
So that'd be a foreign key implementation basically. That's something we could think about I guess.