jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <n...@apache.org>
Subject Re: Example end-to-end walkthrough?
Date Sat, 07 Jan 2017 10:16:45 GMT
Good to see you progressed!

You're almost there. The error you are getting is because the Azure ARM
provider needs some additional configuration properties.

As you might have already seen, when creating the jclouds context you can
pass a set of configuration properties. This is done here [1] in the
compute-basics example app, but jclouds also loads them from the system
properties. You could use this to pass the additional properties when
executing the jar file.

The additional properties you need to set are:

* azurecompute-arm.endpoint (because the endpoint is not fixed as it
contains the subscription id).
* oauth.endpoint (because it is not fixed as it contains the tenant id).

You can follow the steps described in the Azure ARM README [2] to create an
application you can use for jclouds. Once you have it, you should be able
to run the examples with a command similar to:

java  -Dazurecompute-arm.endpoint="
https://management.azure.com/subscriptions/<Subscription-id>" \
    -Doauth.endpoint="https://login.microsoftonline.com/<Tenant-id>/oauth2/token"
\
    -jar target/compute-basics-jar-with-dependencies.jar \
    azurecompute-arm <Application-Id> <Password> mygroup add


HTH!

P.S. If you want to contribute or help improve the jclouds site, you can
have a look at our "How to contribute documentation" guide [3]. Also, it
would be great if you could add, once you manage to run the examples with
Azure, the example command to the compute-basics README [4]. That will help
other future users.



[1]
https://github.com/jclouds/jclouds-examples/blob/master/compute-basics/src/main/java/org/jclouds/examples/compute/basics/MainApp.java#L267-L271
[2]
https://github.com/jclouds/jclouds-labs/tree/master/azurecompute-arm#setting-up-test-credentials
[3]
https://cwiki.apache.org/confluence/display/JCLOUDS/How+to+Contribute+Documentation
[4]
https://github.com/jclouds/jclouds-examples/blob/master/compute-basics/README.md

On 6 January 2017 at 23:42, Teo De Las Heras <teodelas@microsoft.com> wrote:

> I'm getting an error (below) and following up with the creators of the
> azurecompute-arm libraries.
>
> Documentation feedback: I'd be happy to write up / contribute a 'jclouds
> for dummies' page.  I'm sure it's easy for someone who understands or works
> with Maven / Java projects.  Without that background, it's hard to decipher
> how all the pieces work together.  Or maybe some additional links to
> relevant Maven documentation that explains what mvn install does, what
> pom.xml is for, how to add dependencies (to use jclouds-labs).
>
> Error I'm getting:
> java -jar target/compute-basics-jar-with-dependencies.jar
> azurecompute-arm <my application id> <mypassword> mygroup add
> >> initializing {id=azurecompute-arm, name=Microsoft Azure Resource
> Manager REST API, views=[org.jclouds.compute.ComputeServiceContext],
> endpointName=Resource Manager Endpoint ending in your Subscription Id,
> identityName=Azure Service Principal Application Id,
> credentialName=Optional.of(Azure Service Principal Application Password),
> documentation=https://msdn.microsoft.com/en-us/library/azure/dn790568.aspx,
> api=interface org.jclouds.azurecompute.arm.AzureComputeApi}
> Exception in thread "main" com.google.inject.CreationException: Guice
> creation errors:
>
> 1) No implementation for java.lang.String annotated with
> @com.google.inject.name.Named(value=oauth.endpoint) was bound.
>   at org.jclouds.oauth.v2.config.OAuthModule.oauthEndpoint(
> OAuthModule.java:63)
>
> 1 error
>         at com.google.inject.internal.Errors.
> throwCreationExceptionIfErrorsExist(Errors.java:435)
>         at com.google.inject.internal.InternalInjectorCreator.
> initializeStatically(InternalInjectorCreator.java:154)
>         at com.google.inject.internal.InternalInjectorCreator.build(
> InternalInjectorCreator.java:106)
>         at com.google.inject.Guice.createInjector(Guice.java:95)
>         at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.
> java:405)
>         at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.
> java:328)
>         at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:615)
>         at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:595)
>         at org.jclouds.examples.compute.basics.MainApp.
> initComputeService(MainApp.java:292)
>         at org.jclouds.examples.compute.basics.MainApp.main(MainApp.
> java:141)
>
>
> Teo
>
>
>
> -----Original Message-----
> From: Andrew Phillips [mailto:aphillips@qrmedia.com]
> Sent: Friday, January 6, 2017 3:25 PM
> To: user@jclouds.apache.org
> Subject: Re: Example end-to-end walkthrough?
>
> > I was completely confused by being directed to the github for the
> > azurecompute-arm as I thought that was an example I should be
> > following.
>
>
> Thanks for the update! Are things working now, or is there still something
> that's not doing what it should?
>
> Also, do you have any thoughts on what we could do to make the
> documentation clearer?
>
> ap
>

Mime
View raw message