Code Monkey home page Code Monkey logo

legacy-jclouds-cli's Introduction

jclouds

Apache jclouds is an open source multi-cloud toolkit for the Java platform that gives you the freedom to create applications that are portable across clouds while giving you full control to use cloud-specific features.

This repository is archived. Please see apache/jclouds.

License

Copyright (C) 2009-2019 The Apache Software Foundation

Licensed under the Apache License, Version 2.0

legacy-jclouds-cli's People

Contributors

abayer avatar demobox avatar gaul avatar iocanel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

legacy-jclouds-cli's Issues

Disambiguate return codes from jclouds-cli

When trying certain operations that are guaranteed to error out (eg - try creating a container with a name that already exists), the cli exits with status:1 (eg - exception: "Could not create container"). If we could disambiguate the return code, we could provide the user with enough information to "fix" his/her problem (eg - retry with a different name on EEXIST).

Command-line help incomplete

The command-line help that is printed when "jclouds" is executed does not mention the "blobstore" category:

$ jclouds --help
Usage:jclouds {category} {action} {options/arguments}.

Categories: node, group, image, location hardware
Actions: list, create, destroy, runscript

However, "blobstore" at least is a valid category.

Blobstore commands fail with error message "bad substitution"

As per the jclouds-cli documentation, I downloaded the zip wanting to try out jclouds-cli. I am particularly interested in the blobstore commands. So I tried listing the blobs in my container. That failed with the following error.

[~:jclouds-cli-master]$ jclouds-cli blobstore list --provider aws-s3 --identity my-identity --credential my-credential my-container-name
$HOME/jclouds-cli-master/assembly/src/main/filtered-resources/unix/bin/shell: line 264: $KARAF_HOME/system/org/jclouds/cli/runner/${project.version}/runner-${project.version}.jar: bad substitution

The same thing happened with "create".

FWIW, I am using Bash version 3.2 on Mac OS.

$ bash --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)
Copyright (C) 2007 Free Software Foundation, Inc.

Also, I have java version 1.6.
$ java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)

command line scripts should take arg for properties file, + examples

Specifying a properties file on the command line would be a good way to get going, especially when another jclouds application like Whirr can use the same file.

Skeleton configs for different clouds could show what props are necessary. For instance, it is unclear how TenantID in HPCloud maps to the current credential commandline flags. It also helps if people know what the prop values look like for each cloud so that jclouds-cli can help them get going when they are just learning a new cloud even though terminology differs between clouds.

jclouds-cli starts up slowly

I measure 3 seconds for even simple commands, seems like entirely startup overhead:

$ time jclouds-cli-1.6.0-SNAPSHOT/bin/jclouds blobstore container-exists jclouds-cli2
File not found: Container does not exist: jclouds-cli2

real    0m3.172s
user    0m3.460s
sys     0m0.152s

incorrect help string when first parameter to blobstore-write is missing

First command should complain about container name:

$ jclouds blobstore write --provider $PROVIDER --identity $IDENTITY --credential $CREDENTIAL
Error executing command jclouds:blobstore-write: argument blobName is required

$ jclouds blobstore write --provider $PROVIDER --identity $IDENTITY --credential $CREDENTIAL $CONTAINER
Error executing command jclouds:blobstore-write: argument blobName is required

$ jclouds blobstore write --provider $PROVIDER --identity $IDENTITY --credential $CREDENTIAL $CONTAINER $BLOBNAME
Error executing command jclouds:blobstore-write: argument payload is required

update to standard license headers

This project hasn't yet been updated to follow the standard license headers discussed here: https://groups.google.com/forum/#!msg/jclouds-dev/iMui29UJaDo/-wCVl8xcKWQJ

Please update this to the way that is addressed in jclouds/jclouds, jclouds-chef. Feel free to cite companies that deserve calling out (such as FuseSource) in resources/NOTICE.txt as needed.

ex. copy project/src/etc/header.txt, resources/LICENCE.txt from jclouds/jclouds to same dir here, add the following to the root pom.xml, then run mvn com.mycila.maven-license-plugin:maven-license-plugin:format

<build>
    <plugins>
        <plugin>
            <groupId>com.mycila.maven-license-plugin</groupId>
            <artifactId>maven-license-plugin</artifactId>
            <version>1.9.0</version>
            <configuration>
                <strictCheck>true</strictCheck>
                <encoding>${sourceEncoding}</encoding>
                <aggregate>true</aggregate>
                <header>project/src/etc/header.txt</header>
                <mapping>
                    <clj>SEMICOLON_STYLE</clj>
                </mapping>
                <excludes>
                    <exclude>**/src/**/resources/**</exclude>
                    <exclude>**/LICENSE.txt</exclude>
                    <exclude>**/NOTICE.txt</exclude>
                    <exclude>**/README.md</exclude>
                    <exclude>**/README.txt</exclude>
                    <exclude>**/header.txt</exclude>
                </excludes>
                <properties>
                    <year>2012</year>
                    <copyrightHolder>jclouds, Inc.</copyrightHolder>
                </properties>
            </configuration>
        </plugin>
    </plugins>
</build>

HPCloud usage unclear

I tried setting the environment variables for HPCloud (openstack), like this:
JCLOUDS_COMPUTE_PROVIDER=hpcloud-compute
JCLOUDS_COMPUTE_IDENTITY=DSSIFFFFWJWQL
JCLOUDS_COMPUTE_CREDENTIAL=wjlsdfsjljljk+jfls+jlsfds
JCLOUDS_COMPUTE_ENDPOINT=https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/10837036762972
JCLOUDS_COMPUTE_API=1.1

and ran bin/jclouds-cli and got a karaf prompt, after I entered: node-list the error was:

Error executing command: java.lang.IllegalArgumentException: current configuration is set to [jclouds.keystone.requires-tenant]. Unless you set [jclouds.keystone.tenant-name] or [jclouds.keystone.tenant-id], you must prefix your identity with 'tenantName:'

If these are used the result is the same:

JCLOUDS_COMPUTE_API=2.0
JCLOUDS_COMPUTE_ENDPOINT=https://az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com/services/Cloud

Next I tried prefixing the identity (accessID) with TenantID since I don't know of any tenant like 'tenantName:' from the error msg, but the result is also auth. fail.

I tried emailName: as a prefix for accessID as the JCLOUDS_COMPUTE_IDENTITY but that also failed.

I also tried JCLOUDS_COMPUTE_CREDENTIAL as password (eek!) with api 1.1 and I put:
jclouds.keystone.tenant-id=${env:TENANT_ID}
into etc/org.jclouds.credentials.cfg but that did not work either, but this combo does work for Whirr.

jclouds node create (etc) fails with stacktrace, but node is actually created

Seems to be related to the credential store stuff. This is while using environment variables for the api/endpoint/identity/credential, but I also tried with the env vars wiped and specifying the arguments explicitly with the same result:

[abayer@stuttgart jclouds-cli]$ jclouds node create --imageId=8888d241-697d-4267-86e6-ae80f72d4058 --hardwareId=2dfe6308-dc52-4a8f-9934-0bed5ac64ff0 apb-cli-testFailed to create nodes:error running 1 node group(apb-cli-test) location(7dbc4787-ec2f-498d-95f0-848c8c81e5da) image(8888d241-697d-4267-86e6-ae80f72d4058) size(2dfe6308-dc52-4a8f-9934-0bed5ac64ff0) options({})
Execution failures:

  1. ExecutionException on apb-cli-test-504:
    java.util.concurrent.ExecutionException: java.lang.NullPointerException
    at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:289)
    at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:276)
    at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:111)
    at org.jclouds.concurrent.FutureIterables$1.run(FutureIterables.java:134)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
    Caused by: java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:394)
    at org.jclouds.karaf.services.modules.PropertiesCredentialStore$PropertiesBacking.put(PropertiesCredentialStore.java:146)
    at org.jclouds.karaf.services.modules.PropertiesCredentialStore$PropertiesBacking.put(PropertiesCredentialStore.java:55)
    at org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.createNodeWithGroupEncodedIntoName(AdaptingComputeServiceStrategies.java:191)
    at org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet$AddNode.call(CreateNodesWithGroupEncodedIntoNameThenAddToSet.java:82)
    at org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet$AddNode.call(CreateNodesWithGroupEncodedIntoNameThenAddToSet.java:66)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
    at org.jclouds.concurrent.config.DescribingExecutorService.submit(DescribingExecutorService.java:89)
    at org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet.createNodeInGroupWithNameAndTemplate(CreateNodesWithGroupEncodedIntoNameThenAddToSet.java:170)
    at org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet.execute(CreateNodesWithGroupEncodedIntoNameThenAddToSet.java:125)
    at org.jclouds.compute.internal.BaseComputeService.createNodesInGroup(BaseComputeService.java:213)
    at org.jclouds.karaf.commands.compute.NodeCreateCommand.doExecute(NodeCreateCommand.java:140)
    at org.jclouds.karaf.commands.compute.ComputeCommandSupport.execute(ComputeCommandSupport.java:98)
    at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
    at org.jclouds.cli.runner.Main.run(Main.java:148)
    at org.jclouds.cli.runner.Main.run(Main.java:90)
    at org.jclouds.cli.runner.Main.main(Main.java:65)
    at org.jclouds.concurrent.config.DescribingExecutorService.submit(DescribingExecutorService.java:89)
    at org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet.createNodeInGroupWithNameAndTemplate(CreateNodesWithGroupEncodedIntoNameThenAddToSet.java:170)
    at org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet.execute(CreateNodesWithGroupEncodedIntoNameThenAddToSet.java:125)
    at org.jclouds.compute.internal.BaseComputeService.createNodesInGroup(BaseComputeService.java:213)
    at org.jclouds.karaf.commands.compute.NodeCreateCommand.doExecute(NodeCreateCommand.java:140)
    at org.jclouds.karaf.commands.compute.ComputeCommandSupport.execute(ComputeCommandSupport.java:98)
    at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
    at org.jclouds.cli.runner.Main.run(Main.java:148)
    at org.jclouds.cli.runner.Main.run(Main.java:90)
    at org.jclouds.cli.runner.Main.main(Main.java:65)

1 error[s]
Node failures:

0 error[s]
java.lang.NullPointerException
at org.jclouds.karaf.commands.compute.NodeCreateCommand.doExecute(NodeCreateCommand.java:150)
at org.jclouds.karaf.commands.compute.ComputeCommandSupport.execute(ComputeCommandSupport.java:98)
at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
at org.jclouds.cli.runner.Main.run(Main.java:148)
at org.jclouds.cli.runner.Main.run(Main.java:90)
at org.jclouds.cli.runner.Main.main(Main.java:65)

Checking for container existence may return EACCES for non-existing containers

I used valid AWS credentials against S3 and got the following results for different containers:
$JCLOUDS_CLI/bin/jclouds blobstore container-exists --provider=aws-s3 --identity= --credential= timur-test
File not found: Container does not exist: timur-test

$JCLOUDS_CLI/bin/jclouds blobstore container-exists --provider=aws-s3 --identity= --credential= cloud
Authorization error: HEAD https://cloud.s3.amazonaws.com/?max-keys=0 HTTP/1.1 -> HTTP/1.1 403 Forbidden

I double checked and the cloud container does not exist in AWS. Using names such as "bucket" also results in the same error. However, cloud-test succeeds.

README.md improvements, corrections

The getting started info needs to mention how to build and install in case there is no prebuilt tarball:
mvn clean package
cd assembly/target
#note which jclouds-cli-* you will expand for installation in another directory
After expanding the tar or zip or jar, cd to the directory created and run one of the scripts with bin as the relative path, example:
bin/jclouds-cli

These commands are documented, but do not work ("not found") in bin/shell:
features:list
features:install jclouds-api-cloudstack
Later I found that these are in bin/jclouds-cli and that should be clarified.

Command to upload file to blobstore

There is no documentation available for uploading files to blobstore. If this feature doesn't exist, I would suggest to add this feature.

Issue parsing Rackspace servers. Only lists 5

I am unable to list all the server in a test account. The listing stops at a server with ! in the name.

Same result in CLI and shell.
./jcloudsnode list --provider rackspace-cloudservers-us --identity XXX --credential XXX

jclouds:node-list --provider rackspace-cloudserus --identity XXX --credential XXX

shrink jclouds-cli size

Presently the tar.gz is 49 MB -- can we prune any unneeded dependencies? The biggest offenders are Karaf Jaas (7 MB), Spring (8 MB), Pax (7 MB) and Groovy (6 MB).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.