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 Thu, 05 Jan 2017 14:35:27 GMT
Hi,

jclouds is just a collection of APIs. It is not an executable or a
precompiled tool you can use out of the box to manage the different
cloud providers. It is a set of APIs you can use to write code that
can be used to manage any supported cloud.

The references to Maven or the reference to the jclouds-examples are
just the most common ways of configuring a Java project to use
jclouds. But in the end, like in any Java project, the only thing you
need to use jclouds is your project is to have the jclouds .jar files
in your classpath.

This said, the easiest way of starting a project that will use jclouds
is to use Maven, and configure the jclouds dependencies in the
pom.xml, just like is done in the jclouds-examples compute-basics
project. (The other pom files in the "main" jclouds repo are the ones
used to build jclouds itself; not examples on how to use the jclouds
jars).

To use Azure ARM you could easily copy the compute-basics project and
add the azure dependency to its pom.xml. That pom.xml is already
prepared to create an executable jar file, so it should be ready to
go. Just add the dependency and modify the code as needed for your
needs.



On 4 January 2017 at 21:36, Teo De Las Heras <teodelas@microsoft.com> wrote:
> Thanks for the replies.  Apologies for the n00b questions that follow…from
> what I've read, is my understanding below correct:
>
> Pom.xml is used by mvm to download the necessary jclouds binaries?
>
> http://jclouds.apache.org/start/install/
>
> Mvn dependency:copy-dependencies
>
> Maybe it’s just is an mvn / java ‘preference’ (which I don’t have a lot of
> experience with) but there doesn't seem to be consistency in the examples
> for how this should 'run'.
>
> The compute basics example:
> https://github.com/jclouds/jclouds-examples/tree/master/compute-basics
> Says to run mvn install and then java -jar … and never mentions running mvn
> dependency:copy-dependencies
> The Azure ARM example:
> https://github.com/jclouds/jclouds-labs/tree/master/azurecompute-arm
> Says to run mvn -DTest … DTest isn’t in the Maven documentation:
>
> https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
> Why would mvn install be needed in the compute basics but not the Azure ARM
> example?
>
> Once Pom.xml is ‘processed’ by mvn, I can build a .jar file that uses the
> jclouds API’s?
>
> http://jclouds.apache.org/start/compute/
>
> Java -jar …
>
> Again, maybe this is just an mvn / Java preference but why doesn’t the Azure
> ARM example show this?  Instead it just shows mvn
>
>
>
> Thank you,
>
>
>
> Teo De Las Heras
>
>
>
> -----Original Message-----
> From: Ignasi Barrera [mailto:nacx@apache.org]
> Sent: Thursday, December 29, 2016 4:58 PM
> To: user@jclouds.apache.org
> Cc: Teo De Las Heras <teodelas@microsoft.com>
> Subject: Re: Example end-to-end walkthrough?
>
>
>
> Trying to understand the compute basics examples is one of the better ways
> to get started with jclouds.
>
>
>
> There are two different Azure providers in jclouds:
>
>
>
> * The "azurecompute" one uses the old Azure API.
>
> * The "azurecompute-arm" uses the new ARM API.
>
>
>
> You'll need to add the "org.apache.jclouds.labs/azurecompute" or
> "org.apache.jclouds.labs/azurecompute-arm" dependencies to your project in
> order to use them.
>
>
>
> In the README for the azurecompute-arm provider you will find the
> instructions to create an Application in your subscription for
>
> jclouds:
>
> https://github.com/jclouds/jclouds-labs/tree/master/azurecompute-arm
>
>
>
> You might also find the following talks useful:
>
> https://speakerdeck.com/nacx/rule-the-cloud-with-apache-jclouds
>
> http://feathercast.apache.org/apachecon-na-2016-rule-the-cloud-with-apache-jclouds-ignasi-barrera/
>
> (audio recording for the talk)
>
> https://github.com/nacx/acna2016-demo (simple source code for the demo)
>
>
>
> https://speakerdeck.com/nacx/introduction-to-apache-jclouds-apachecon-eu-2014
>
>
>
>
>
> HTH!
>
>
>
> I.
>
>
>
> On 23 December 2016 at 20:20, Andrew Phillips <aphillips@qrmedia.com> wrote:
>
>> Hi Teo
>
>>
>
>> The jclouds-examples repo [1] may help - I don't think it has an
>
>> Azure-specific example at present, but the general "compute-basics"
>
>> app should hopefully give a better idea of how the end-to-end flow
>
>> might look
>
>> like:
>
>>
>
>> https://github.com/jclouds/jclouds-examples/blob/master/compute-basics
>
>> /src/main/java/org/jclouds/examples/compute/basics/MainApp.java
>
>>
>
>> It uses the jclouds' compute abstraction, but should also work with
>
>> the Azure providers.
>
>>
>
>> Of course, suggestions and/or PRs for ways we can improve the initial
>
>> "how does this all fit together?" documentation are also much
>
>> appreciated - definitely things we can do there.
>
>>
>
>> Regards
>
>>
>
>> ap
>
>>
>
>> [1] https://github.com/jclouds/jclouds-examples/

Mime
View raw message