You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Asanka sanjaya Herath <an...@gmail.com> on 2014/09/27 18:43:58 UTC

Specifying the ip address of the iaas when creating Compute service

I'm using this code to create a compute service in jclouds. My Iaas
provider is cloudstak.

   ComputeServiceContext context =
ContextBuilder.newBuilder(provider).credentials(apiKey, secretKey)
                .buildView(ComputeServiceContext.class);

The context object has been created for localhost (Default). But I need to
point to another IP instead of localhost. Because Cloudstak is *not*
running @ localhost. How can I do this?

-- 
Thanks,
Regards,
ASH

Re: Specifying the ip address of the iaas when creating Compute service

Posted by Asanka sanjaya Herath <an...@gmail.com>.
Hi andrew,
Thank you for the answer. Its helpfull.

On Sun, Sep 28, 2014 at 11:40 PM, Andrew Phillips <an...@apache.org>
wrote:

> Quoting Asanka sanjaya Herath <an...@gmail.com>:
>
>  Thank you for your quick response. I have another problem. Is there any
>> way
>> to get current ram,cpu stats of an instance using jclouds?
>>
>
> Again, this will likely require use of API- or provider-specific calls.
> Have a look at the Javadoc for the return types of the appropriate calls,
> such as RunningInstance for EC2 [1] - they are the most likely place to get
> you what you need.
>
> Regards
>
> ap
>
> [1] http://javadocs.jclouds.cloudbees.net/org/jclouds/ec2/
> domain/RunningInstance.html
>



-- 
Thanks,
Regards,
ASH

Re: Specifying the ip address of the iaas when creating Compute service

Posted by Andrew Phillips <an...@apache.org>.
Quoting Asanka sanjaya Herath <an...@gmail.com>:

> Thank you for your quick response. I have another problem. Is there any way
> to get current ram,cpu stats of an instance using jclouds?

Again, this will likely require use of API- or provider-specific  
calls. Have a look at the Javadoc for the return types of the  
appropriate calls, such as RunningInstance for EC2 [1] - they are the  
most likely place to get you what you need.

Regards

ap

[1]  
http://javadocs.jclouds.cloudbees.net/org/jclouds/ec2/domain/RunningInstance.html

Re: Specifying the ip address of the iaas when creating Compute service

Posted by Asanka sanjaya Herath <an...@gmail.com>.
Thank you for your quick response. I have another problem. Is there any way
to get current ram,cpu stats of an instance using jclouds?

On Sun, Sep 28, 2014 at 5:15 AM, Andrew Phillips <an...@apache.org> wrote:

> Is there any way to stop an instance using jclouds? In ComputeService
>> interface there is no such a method. There is a method for destroy an
>> instance. But I want to an instance.
>>
>
> Stopping instances is not currently supported at the view level, i.e. in
> ComputeService. But for those APIs and providers that support this, you can
> usually do it using an API/provider-specific call.
>
> See e.g. the InstanceApi in the case of EC2 [1].
>
> Hope that helps!
>
> ap
>
> [1] http://javadocs.jclouds.cloudbees.net/org/jclouds/ec2/
> features/InstanceApi.html
>



-- 
Thanks,
Regards,
ASH

Re: Specifying the ip address of the iaas when creating Compute service

Posted by Andrew Phillips <an...@apache.org>.
> Is there any way to stop an instance using jclouds? In ComputeService
> interface there is no such a method. There is a method for destroy an
> instance. But I want to an instance.

Stopping instances is not currently supported at the view level, i.e.  
in ComputeService. But for those APIs and providers that support this,  
you can usually do it using an API/provider-specific call.

See e.g. the InstanceApi in the case of EC2 [1].

Hope that helps!

ap

[1]  
http://javadocs.jclouds.cloudbees.net/org/jclouds/ec2/features/InstanceApi.html

Re: Specifying the ip address of the iaas when creating Compute service

Posted by Asanka sanjaya Herath <an...@gmail.com>.
Hi,
Is there any way to stop an instance using jclouds? In ComputeService
interface there is no such a method. There is a method for destroy an
instance. But I want to an instance.

On Sat, Sep 27, 2014 at 11:10 PM, Andrew Phillips <an...@apache.org>
wrote:

> Problem solved. I changed my code like this. Then it's working fine.
>>
>
> Good to hear!
>
> ap
>



-- 
Thanks,
Regards,
ASH

Re: Specifying the ip address of the iaas when creating Compute service

Posted by Andrew Phillips <an...@apache.org>.
> Problem solved. I changed my code like this. Then it's working fine.

Good to hear!

ap

Re: Specifying the ip address of the iaas when creating Compute service

Posted by Asanka sanjaya Herath <an...@gmail.com>.
Hi,
Problem solved. I changed my code like this. Then it's working fine.

ContextBuilder builder =
                ContextBuilder.newBuilder(provider).endpoint("
http://10.100.4.127:8096").credentials(apiKey, secretKey);

        ComputeServiceContext context =
builder.buildView(ComputeServiceContext.class);

On Sat, Sep 27, 2014 at 10:13 PM, Asanka sanjaya Herath <an...@gmail.com>
wrote:

> I'm using this code to create a compute service in jclouds. My Iaas
> provider is cloudstak.
>
>    ComputeServiceContext context =
> ContextBuilder.newBuilder(provider).credentials(apiKey, secretKey)
>                 .buildView(ComputeServiceContext.class);
>
> The context object has been created for localhost (Default). But I need to
> point to another IP instead of localhost. Because Cloudstak is *not*
> running @ localhost. How can I do this?
>
> --
> Thanks,
> Regards,
> ASH
>



-- 
Thanks,
Regards,
ASH