[
https://issues.apache.org/jira/browse/JCLOUDS-1068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15132028#comment-15132028
]
Andrea Turli commented on JCLOUDS-1068:
---------------------------------------
[[email protected]] ok no problem
Unfortunately I don't have private images on my account, but could you confirm
that you can point to public images?
For example, you can find the gloabalIdentifier of a public image with
{code}
curl -uusername:apiKey
https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest_Block_Device_Template_Group/getPublicImages
{code}
and then use something like this:
{code}
Image image =
view.getComputeService().getImage("1176d22b-176a-499a-8d94-f9aaf29155a3");
{code}
with this result:
{code}
{id=CENTOS_5_64, providerId=CENTOS_5_64, os={family=centos, version=5.5,
description=CentOS / CentOS / 5.5-64 Minimal for VSI, is64Bit=true},
description=CENTOS_5_64, status=AVAILABLE, loginUser=root}
{code}
to use that public image.
Notice, In case you point to a private image the code used will be the same, so
it should be ok. See also http://jclouds.apache.org/guides/softlayer/ in case
you missed that.
> Softlayer context.getComputeService().getImage() does not work in 1.9.2 like
> it did in 1.9.1
> --------------------------------------------------------------------------------------------
>
> Key: JCLOUDS-1068
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1068
> Project: jclouds
> Issue Type: Bug
> Components: jclouds-compute
> Affects Versions: 1.9.2
> Reporter: Chava Jurado
> Priority: Minor
> Labels: softlayer
>
> In 1.9.1 the following code can retrieve a private image by global id, but in
> 1.9.2 it returns UBUNTU_14_64.
> {code:title=Softlayer Example|borderStyle=solid}
> import java.util.Properties;
> import org.jclouds.ContextBuilder;
> import org.jclouds.compute.ComputeServiceContext;
> import org.jclouds.compute.domain.Image;
> import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;
> import com.google.common.collect.ImmutableSet;
> import com.google.inject.Module;
> public class SoftlayerExample {
> public static void main(String[] args) {
> String identity = "SLxxxxxx"; //accountName
> String identityCredential = ""; //apiKey
> String imageId = ""; //globalIdentifier
> Properties overrides = new Properties();
> ImmutableSet<Module> modules = ImmutableSet
> .<Module> of(new SLF4JLoggingModule());
> ComputeServiceContext context =
> ContextBuilder.newBuilder("softlayer")
> .credentials(identity,
> identityCredential).overrides(overrides)
>
> .modules(modules).buildView(ComputeServiceContext.class);
> Image image = context.getComputeService().getImage(imageId);
> System.out.println(image.getId());
> if (!image.getId().matches(imageId)) {
> System.out.println("No workie in 1.9.2 :(");
> }
> }
> }
> {code}
> Looking at the API calls returned by Softlayer in 1.9.1 and 1.9.2, they are
> identical. Both are able to get the information from softlayer, but for some
> reason the object returned in 1.9.2 is a base ubuntu image.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)