AT&T Synaptic Compute (vCloud): Hello World

45 views
Skip to first unread message

Paul C. Bryan

unread,
Jul 18, 2012, 8:18:34 PM7/18/12
to jcl...@googlegroups.com
Still new to jclouds. I'm trying a trivial test to confirm I can talk to AT&T Synaptic Compute as a Service via the vCloud API using jclouds 1.5.0-beta.4:

----- Source ------

import org.jclouds.ContextBuilder;
import org.jclouds.compute.ComputeService;
import org.jclouds.compute.ComputeServiceContext;

public class Test {

    public static void main(String[] args) throws Exception {
        ContextBuilder cb = ContextBuilder.newBuilder("vcloud")
         .credentials("[REDACTED]", "[REDACTED]")
         .endpoint("https://vcloudapi.[REDACTED].synaptic.att.com/api");
        ComputeServiceContext csc = cb.buildView(ComputeServiceContext.class);
        try {
            ComputeService cs = csc.getComputeService();
            System.out.println("Nodes:");
            System.out.println(cs.listNodes());
        } finally {
            csc.close();
        }
    }
}

----- Output -----

Nodes:
Exception in thread "main" java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:191)
at com.google.common.collect.SingletonImmutableSet.<init>(SingletonImmutableSet.java:47)
at com.google.common.collect.ImmutableSet.of(ImmutableSet.java:93)
at com.google.common.collect.ImmutableSet.copyFromCollection(ImmutableSet.java:357)
at com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:302)
at com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:287)
at org.jclouds.util.Iterables2.concreteCopy(Iterables2.java:38)
at org.jclouds.vcloud.functions.OrgsForNames.apply(OrgsForNames.java:57)
at org.jclouds.vcloud.functions.OrgsForNames.apply(OrgsForNames.java:42)
at org.jclouds.vcloud.config.VCloudRestClientModule$OrgMapSupplier.get(VCloudRestClientModule.java:279)
at org.jclouds.vcloud.config.VCloudRestClientModule$OrgMapSupplier.get(VCloudRestClientModule.java:265)
at org.jclouds.rest.suppliers.SetAndThrowAuthorizationExceptionSupplier.get(SetAndThrowAuthorizationExceptionSupplier.java:49)
at org.jclouds.concurrent.RetryOnTimeOutExceptionSupplier.get(RetryOnTimeOutExceptionSupplier.java:47)
at org.jclouds.util.Suppliers2$ExpiringMemoizingSupplier.get(Suppliers2.java:130)
at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:64)
at org.jclouds.vcloud.compute.strategy.VCloudComputeServiceAdapter.listNodes(VCloudComputeServiceAdapter.java:128)
at org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listDetailsOnNodesMatching(AdaptingComputeServiceStrategies.java:115)
at org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listNodes(AdaptingComputeServiceStrategies.java:110)
at org.jclouds.compute.internal.BaseComputeService.listNodes(BaseComputeService.java:342)
at Test.main(Test.java:16)

-----

This kind of test worked with SoftLayer and EC2, perhaps accidentally. Any idea where I'm going wrong with vCloud? Do I need to consider adding EntepriseConfigurationModule? Something else?

Paul

Adrian Cole

unread,
Jul 18, 2012, 10:31:11 PM7/18/12
to jcl...@googlegroups.com

Hmm. Looks like we could use some xml.  Can you try compute-basics on github jclouds-examples?  Make sure you uncomment the debug logging on src/main/resources/logback.xml and send relevant part of jclouds-wire.xml

-A
P.s. try 1.5.0-beta.7.. just.. cause :)

--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

Paul C. Bryan

unread,
Jul 23, 2012, 12:39:39 PM7/23/12
to jcl...@googlegroups.com
Okay, finally did some analysis on this. Attached is the wire log output.

The problem is that access is unauthorized because the x-vcloud-authorization header is not being sent in requests after login. A cookie with the same value is being sent, but vCloud is apparently not using this. When I set x-vcloud-authorization header to the value received in the login response, I can successfully GET the organization URI.

Next step: open a couple of tickets (one for setting x-vcloud-authorization, the other for the lack of error handling of the 403 response?)

Paul
output

Adrian Cole

unread,
Jul 23, 2012, 1:47:53 PM7/23/12
to jcl...@googlegroups.com, jclou...@googlegroups.com
moving to jclouds-dev

Good work, Paul.

I think a bit of context will help. Do you know which version of
vcloud director these guys are running? Seems this data with what you
already have will make short work of a new issue:
http://code.google.com/p/jclouds/issues/list

-A

Paul C. Bryan

unread,
Jul 23, 2012, 3:17:13 PM7/23/12
to jcl...@googlegroups.com, jclou...@googlegroups.com
They're using Cloud Director 1.5.

Paul
Reply all
Reply to author
Forward
0 new messages