Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource Type association? #461

Open
xuyao18 opened this issue Oct 30, 2017 · 3 comments
Open

Resource Type association? #461

xuyao18 opened this issue Oct 30, 2017 · 3 comments
Labels

Comments

@xuyao18
Copy link

xuyao18 commented Oct 30, 2017

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 ?

@jd
Copy link
Member

jd commented Oct 30, 2017

Maybe, what do you have in mind exactly?

@jd jd added the api label Oct 30, 2017
@xuyao18
Copy link
Author

xuyao18 commented Nov 13, 2017

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.

@jd
Copy link
Member

jd commented Nov 13, 2017

So that'd be a foreign key implementation basically. That's something we could think about I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants