Hi Ignacio,
As fas as I know there is no direct way to force a concrete IP address
using the portable TemplateOptions. Configuring a concrete IP address
is something that not all providers support, and that's why is not
part of the base TemplateOptions implementation. If you are using a
concrete provider that supports that, you could use the provider
specific template options. Something like:
TemplateOptions options =
options(foo).as(ProviderSpecificOptions.class).publicIp(something);
But that would depend on each provider implementation. If there no
such option, perhaps you could try sending a pull request? [1]. You
may also want to keep an eye on JCLOUDS-416 [2], as it is tightly
related to this.
Regarding the second question, yes, that's the way, although you could
use a more readable approach by using the Guava Lists/Sets helpers:
TemplateOptions options = nodeNames(Lists.newArrayList("name1", "name2"));
Finally, when working with public keys, you depend again on a provider
specific feature that is not supported in all them, so it is not part
of the portable TempalteOptions. The EC2TemplateOptions [3] has, for
example, a method to specify the name of the key pair to use. You
could again use the provider specific options here.
HTH!
Ignasi
[1] http://wiki.apache.org/jclouds/How%20to%20Contribute
[2] https://issues.apache.org/jira/browse/JCLOUDS-416
[3]
https://github.com/jclouds/jclouds/blob/master/apis/ec2/src/main/java/org/jclouds/ec2/compute/options/EC2TemplateOptions.java#L266
On 4 January 2014 19:42, Ignacio de Córdoba <[email protected]> wrote:
> Hello, as some of you know I'm pretty new to JClouds… let me please ask some
> questions I haven’t been able to solve with JavaDoc/online docs (I’m using
> Softlayer provider):
>
> 1) How can I specify that I want a new Node to use a specific IP address (in
> the subnet or address list that I have reserved/rented in the provider) when
> createNodesInGroup(...)? I can't find it in templateBuilder methods nor
> TemplateOptions class.
>
> 2) In a single node provision the correct way to specify the name for a node
> TemplateOptions templateOptions = nodeNames(new
> ArrayList<String>(){{add(nodeName);}})
> (I don’t see some nodeName() option for a simple node creation)
>
> 3) To specify public key I’m using
> templateOptions.authorizePublicKey(publicKey);
> is there a way to specify the publicKey id or name stored in the provider
> service?
>
> Thanks for any help/directions.
>
>
> Ignacio de Córdoba
> [email protected]
> Red Skios S.A. - www.skios.es
>
>
>
>