You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Kyle Flavin <ky...@citrix.com> on 2015/04/17 19:03:57 UTC
Querying the API for private templates
Is it possible to create an account that can see all templates in the database through the API?
We've done some automation around our Cloudstack installation, and we query the API to get values such as the operating system from the template. Unfortunately, it looks like private templates, or templates that belong to a particular account/project, which are not made public, are not visible even to admin users.
Using a template uploaded by another user as an example (which is not set to public), I've attempted to view this template with Cloudmonkey. I've tried variations of the following, substituting the database id/uuid/string name for each field.
> list templates templatefilter=all projected=<projectid> id=<templateid>
> list templates templatefilter=all account=<accountid> id=<templateid>
In each case, I can't pull back the template from the API, even though I see it in the database. In the database, I can see the template gets associated with an account_id (although, I don't see a project id).
Is this just not possible, or am I doing something wrong?
RE: Querying the API for private templates
Posted by Kyle Flavin <ky...@citrix.com>.
Ack, forgot about listall=true. Added them both and that did it. Thanks!
-----Original Message-----
From: Jeff Moody [mailto:jeff@fifthecho.com]
Sent: Friday, April 17, 2015 10:22 AM
To: users@cloudstack.apache.org
Subject: Re: Querying the API for private templates
As a ROOT user, you should be able to see all templates if you also add listall and isrecursive
So, using CloudMonkey, under an Admin user keys, "list templates templatefilter=all listall=true isrecursive=true" should list all templates for every domain and project.
On Fri, 2015-04-17 at 17:03 +0000, Kyle Flavin wrote:
> Is it possible to create an account that can see all templates in the
> database through the API?
>
> We've done some automation around our Cloudstack installation, and we
> query the API to get values such as the operating system from the
> template. Unfortunately, it looks like private templates, or
> templates that belong to a particular account/project, which are not
> made public, are not visible even to admin users.
>
> Using a template uploaded by another user as an example (which is not
> set to public), I've attempted to view this template with Cloudmonkey.
> I've tried variations of the following, substituting the database
> id/uuid/string name for each field.
>
> > list templates templatefilter=all projected=<projectid>
> > id=<templateid> list templates templatefilter=all
> > account=<accountid> id=<templateid>
>
> In each case, I can't pull back the template from the API, even though
> I see it in the database. In the database, I can see the template
> gets associated with an account_id (although, I don't see a project
> id).
>
> Is this just not possible, or am I doing something wrong?
>
>
Re: Querying the API for private templates
Posted by Jeff Moody <je...@fifthecho.com>.
As a ROOT user, you should be able to see all templates if you also
add listall and isrecursive
So, using CloudMonkey, under an Admin user keys, "list templates
templatefilter=all listall=true isrecursive=true" should list all
templates for every domain and project.
On Fri, 2015-04-17 at 17:03 +0000, Kyle Flavin wrote:
> Is it possible to create an account that can see all templates in
> the database through the API?
>
> We've done some automation around our Cloudstack installation, and
> we query the API to get values such as the operating system from the
> template. Unfortunately, it looks like private templates, or
> templates that belong to a particular account/project, which are not
> made public, are not visible even to admin users.
>
> Using a template uploaded by another user as an example (which is
> not set to public), I've attempted to view this template with
> Cloudmonkey. I've tried variations of the following, substituting
> the database id/uuid/string name for each field.
>
> > list templates templatefilter=all projected=<projectid>
> > id=<templateid>
> > list templates templatefilter=all account=<accountid>
> > id=<templateid>
>
> In each case, I can't pull back the template from the API, even
> though I see it in the database. In the database, I can see the
> template gets associated with an account_id (although, I don't see a
> project id).
>
> Is this just not possible, or am I doing something wrong?
>
>