You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Prasanna Santhanam <pr...@citrix.com> on 2012/06/22 14:50:38 UTC

Re: CloudStack API question

Hi Amit,

Posting this to the asf-dev list. There are more eyes here to correct me
if I am wrong. 

Answers Inline: 

> Where can I find more information on specific parameters passed to a
> CLoudStack API. The API reference guide only provides a one line
> description
> 

I think that the API reference is the current authoritative doc.  

> Eg: In the deployVirtualMachine API what is the networkids parameter
> used for ? It says list of networks.  So how do I pass the list ? in
> a array ? is there any advanced documentation with examples ?
> 

This parameter chooses the guest networks that the VM becomes a part of
on successful deployment. The deployVirtualMachine's networkIds are a
comma-seperated list of networkIds returned by listNetworks API call.

> 
> The current issue I am working on is provisioning machines on a
> CloudStack setup which has multiple networks available. So how do I
> choose what network to select for the VM. I don't want to provide
> this as an option to the user as that will complicate the
> implementation. 

Few approaches I can think of:

* You could always choose the one single network you are interested in. 

* One network can be selected to be default so that the VM always gets
deployed in that network when not given a networkid.

* If your user is using the CloudStack UI I'm not sure how to hide the
other networks. If not - filtering out listNetworks should work for
you.

HTH

-- 
Prasanna.,

Re: CloudStack API question

Posted by Alena Prokharchyk <Al...@citrix.com>.
Here is the doc explaining @ usage in API commands / API responses:

http://wiki.cloudstack.org/display/dev/Annotations+use+in+API

-Alena.


On 6/25/12 9:37 AM, "Alena Prokharchyk" <Al...@citrix.com>
wrote:

>I'll write something up, and let you know the wiki page location once I'm
>done.
>
>-Alena.
>
>
>On 6/25/12 4:23 AM, "Deepak Garg" <de...@citrix.com> wrote:
>
>>
>>
>>-----Original Message-----
>>From: Prasanna Santhanam [mailto:prasanna.santhanam@citrix.com]
>>Sent: Monday, June 25, 2012 1:45 PM
>>To: cloudstack-dev@incubator.apache.org
>>Cc: Radhika Nair
>>Subject: Re: CloudStack API question
>>
>>On Fri, Jun 22, 2012 at 05:20:45PM -0400, Jessica Tomechak wrote:
>>> Thanks to Amit for raising these API questions. I have noted the
>>>answers in
>>> in the documentation bug http://bugs.cloudstack.org/browse/CS-12742,
>>>"API
>>> docs: Better describe parameters." I filed this bug myself last
>>>January.
>>> I'm sad to say the existing CloudStack tech writing team does not have
>>> enough resources to address it.
>>> 
>>> Community contribution might be a good way to incrementally improve
>>>these
>>> descriptions. As you use the API, you will find out more about the
>>>calls
>>> you are using. This could be a good time to write those answers down
>>>for
>>> the next person.
>>> 
>>> The API reference docs are implemented as annotations in the code. I'd
>>>be
>>> interested to hear from the community on this: do you feel you can
>>> understand how to update these annotations just by looking at the code?
>>>Or
>>> would a wiki page on "how to edit the API reference annotations" be
>>>helpful?
>>> 
>>>  Jessica T.
>>> 
>>> CloudStack Tech Pubs
>>
>>>> I think a wiki page explaining the annotation and how to use it will
>>>> be quite helpful. I would be happy to send in patches with the
>>>> corrections for the API.
>>
>>-- 
>>>> Prasanna.,
>>
>>+1 
>>
>>
>>Deepak Garg
>>
>
>
>



Re: CloudStack API question

Posted by Alena Prokharchyk <Al...@citrix.com>.
I'll write something up, and let you know the wiki page location once I'm
done.

-Alena.


On 6/25/12 4:23 AM, "Deepak Garg" <de...@citrix.com> wrote:

>
>
>-----Original Message-----
>From: Prasanna Santhanam [mailto:prasanna.santhanam@citrix.com]
>Sent: Monday, June 25, 2012 1:45 PM
>To: cloudstack-dev@incubator.apache.org
>Cc: Radhika Nair
>Subject: Re: CloudStack API question
>
>On Fri, Jun 22, 2012 at 05:20:45PM -0400, Jessica Tomechak wrote:
>> Thanks to Amit for raising these API questions. I have noted the
>>answers in
>> in the documentation bug http://bugs.cloudstack.org/browse/CS-12742,
>>"API
>> docs: Better describe parameters." I filed this bug myself last January.
>> I'm sad to say the existing CloudStack tech writing team does not have
>> enough resources to address it.
>> 
>> Community contribution might be a good way to incrementally improve
>>these
>> descriptions. As you use the API, you will find out more about the calls
>> you are using. This could be a good time to write those answers down for
>> the next person.
>> 
>> The API reference docs are implemented as annotations in the code. I'd
>>be
>> interested to hear from the community on this: do you feel you can
>> understand how to update these annotations just by looking at the code?
>>Or
>> would a wiki page on "how to edit the API reference annotations" be
>>helpful?
>> 
>>  Jessica T.
>> 
>> CloudStack Tech Pubs
>
>>> I think a wiki page explaining the annotation and how to use it will
>>> be quite helpful. I would be happy to send in patches with the
>>> corrections for the API.
>
>-- 
>>> Prasanna.,
>
>+1 
>
>
>Deepak Garg
>



RE: CloudStack API question

Posted by Deepak Garg <de...@citrix.com>.

-----Original Message-----
From: Prasanna Santhanam [mailto:prasanna.santhanam@citrix.com] 
Sent: Monday, June 25, 2012 1:45 PM
To: cloudstack-dev@incubator.apache.org
Cc: Radhika Nair
Subject: Re: CloudStack API question

On Fri, Jun 22, 2012 at 05:20:45PM -0400, Jessica Tomechak wrote:
> Thanks to Amit for raising these API questions. I have noted the answers in
> in the documentation bug http://bugs.cloudstack.org/browse/CS-12742, "API
> docs: Better describe parameters." I filed this bug myself last January.
> I'm sad to say the existing CloudStack tech writing team does not have
> enough resources to address it.
> 
> Community contribution might be a good way to incrementally improve these
> descriptions. As you use the API, you will find out more about the calls
> you are using. This could be a good time to write those answers down for
> the next person.
> 
> The API reference docs are implemented as annotations in the code. I'd be
> interested to hear from the community on this: do you feel you can
> understand how to update these annotations just by looking at the code? Or
> would a wiki page on "how to edit the API reference annotations" be helpful?
> 
>  Jessica T.
> 
> CloudStack Tech Pubs

>> I think a wiki page explaining the annotation and how to use it will
>> be quite helpful. I would be happy to send in patches with the
>> corrections for the API.

-- 
>> Prasanna.,

+1 


Deepak Garg

Re: CloudStack API question

Posted by Prasanna Santhanam <pr...@citrix.com>.
On Fri, Jun 22, 2012 at 05:20:45PM -0400, Jessica Tomechak wrote:
> Thanks to Amit for raising these API questions. I have noted the answers in
> in the documentation bug http://bugs.cloudstack.org/browse/CS-12742, "API
> docs: Better describe parameters." I filed this bug myself last January.
> I'm sad to say the existing CloudStack tech writing team does not have
> enough resources to address it.
> 
> Community contribution might be a good way to incrementally improve these
> descriptions. As you use the API, you will find out more about the calls
> you are using. This could be a good time to write those answers down for
> the next person.
> 
> The API reference docs are implemented as annotations in the code. I'd be
> interested to hear from the community on this: do you feel you can
> understand how to update these annotations just by looking at the code? Or
> would a wiki page on "how to edit the API reference annotations" be helpful?
> 
>  Jessica T.
> 
> CloudStack Tech Pubs

I think a wiki page explaining the annotation and how to use it will
be quite helpful. I would be happy to send in patches with the
corrections for the API.

-- 
Prasanna.,

Re: CloudStack API question

Posted by Jessica Tomechak <je...@gmail.com>.
Thanks to Amit for raising these API questions. I have noted the answers in
in the documentation bug http://bugs.cloudstack.org/browse/CS-12742, "API
docs: Better describe parameters." I filed this bug myself last January.
I'm sad to say the existing CloudStack tech writing team does not have
enough resources to address it.

Community contribution might be a good way to incrementally improve these
descriptions. As you use the API, you will find out more about the calls
you are using. This could be a good time to write those answers down for
the next person.

The API reference docs are implemented as annotations in the code. I'd be
interested to hear from the community on this: do you feel you can
understand how to update these annotations just by looking at the code? Or
would a wiki page on "how to edit the API reference annotations" be helpful?

 Jessica T.

CloudStack Tech Pubs

>
>
> -----Original Message-----
> From: Alena Prokharchyk [mailto:Alena.Prokharchyk@citrix.com]
> Sent: Friday, June 22, 2012 9:52 AM
> To: cloudstack-dev@incubator.apache.org
> Cc: Amit Shah
> Subject: Re: CloudStack API question
>
> On 6/22/12 5:50 AM, "Prasanna Santhanam" <pr...@citrix.com>
> wrote:
>
> >Hi Amit,
> >
> >Posting this to the asf-dev list. There are more eyes here to correct
> >me if I am wrong.
> >
> >Answers Inline:
> >
> >> Where can I find more information on specific parameters passed to a
> >> CLoudStack API. The API reference guide only provides a one line
> >> description
> >>
> >
> >I think that the API reference is the current authoritative doc.
> >
> >> Eg: In the deployVirtualMachine API what is the networkids parameter
> >> used for ? It says list of networks.  So how do I pass the list ? in
> >> a array ? is there any advanced documentation with examples ?
> >>
> >
> >This parameter chooses the guest networks that the VM becomes a part of
> >on successful deployment. The deployVirtualMachine's networkIds are a
> >comma-seperated list of networkIds returned by listNetworks API call.
> >
> >>
> >> The current issue I am working on is provisioning machines on a
> >> CloudStack setup which has multiple networks available. So how do I
> >> choose what network to select for the VM. I don't want to provide
> >> this as an option to the user as that will complicate the
> >> implementation.
> >
> >Few approaches I can think of:
> >
> >* You could always choose the one single network you are interested in.
> >
> >* One network can be selected to be default so that the VM always gets
> >deployed in that network when not given a networkid.
>
>
> We don't have notion of default network in 3.0.x, any network can be
> default now. If multiple networks are passed to deployVm command, the first
> one in the list becomes default.
>
>
> >
> >* If your user is using the CloudStack UI I'm not sure how to hide the
> >other networks. If not - filtering out listNetworks should work for
> >you.
>
>
>
> To expose network only to specific account/domain, you have to create it
> with specifying scope=account or scope=domain. In this case only users from
> network's account/domain can use the network for vm deployment.
> Or you can do filtering based on some parameter as Prasanna suggested. You
> can use specific network offering for networks you want to expose to the
> user, and list by networkoffering id.
>
>
> >
> >HTH
> >
> >--
> >Prasanna.,
> >
>
>
>

Re: CloudStack API question

Posted by Alena Prokharchyk <Al...@citrix.com>.
On 6/22/12 5:50 AM, "Prasanna Santhanam" <pr...@citrix.com>
wrote:

>Hi Amit,
>
>Posting this to the asf-dev list. There are more eyes here to correct me
>if I am wrong. 
>
>Answers Inline: 
>
>> Where can I find more information on specific parameters passed to a
>> CLoudStack API. The API reference guide only provides a one line
>> description
>> 
>
>I think that the API reference is the current authoritative doc.
>
>> Eg: In the deployVirtualMachine API what is the networkids parameter
>> used for ? It says list of networks.  So how do I pass the list ? in
>> a array ? is there any advanced documentation with examples ?
>> 
>
>This parameter chooses the guest networks that the VM becomes a part of
>on successful deployment. The deployVirtualMachine's networkIds are a
>comma-seperated list of networkIds returned by listNetworks API call.
>
>> 
>> The current issue I am working on is provisioning machines on a
>> CloudStack setup which has multiple networks available. So how do I
>> choose what network to select for the VM. I don't want to provide
>> this as an option to the user as that will complicate the
>> implementation. 
>
>Few approaches I can think of:
>
>* You could always choose the one single network you are interested in.
>
>* One network can be selected to be default so that the VM always gets
>deployed in that network when not given a networkid.


We don't have notion of default network in 3.0.x, any network can be
default now. If multiple networks are passed to deployVm command, the
first one in the list becomes default.


>
>* If your user is using the CloudStack UI I'm not sure how to hide the
>other networks. If not - filtering out listNetworks should work for
>you.



To expose network only to specific account/domain, you have to create it
with specifying scope=account or scope=domain. In this case only users
from network's account/domain can use the network for vm deployment.
Or you can do filtering based on some parameter as Prasanna suggested. You
can use specific network offering for networks you want to expose to the
user, and list by networkoffering id.


>
>HTH
>
>-- 
>Prasanna.,
>