You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Zack Shoylev <no...@github.com> on 2014/02/05 02:49:10 UTC

[jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

This starts work on Cloud Big Data. More features to be implemented.
You can merge this Pull Request by running:

  git pull https://github.com/rackerlabs/jclouds-labs-openstack rackspace-cloud-big-data

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds-labs-openstack/pull/78

-- Commit Summary --

  * Adds support for Rackspace Cloud Big Data

-- File Changes --

    M pom.xml (2)
    A rackspace-cloudbigdata-us/README.md (7)
    A rackspace-cloudbigdata-us/pom.xml (164)
    A rackspace-cloudbigdata-us/src/main/java/org/jclouds/rackspace/cloudbigdata/us/v1/CloudBigDataUSProviderMetadata.java (131)
    A rackspace-cloudbigdata-us/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata (18)
    A rackspace-cloudbigdata-us/src/test/java/org/jclouds/rackspace/cloudbigdata/us/v1/CloudBigDataUSProviderMetadataMockTest.java (29)
    A rackspace-cloudbigdata-us/src/test/java/org/jclouds/rackspace/cloudbigdata/us/v1/CloudBigDataUSProviderTest.java (35)
    A rackspace-cloudbigdata-us/src/test/java/org/jclouds/rackspace/cloudbigdata/us/v1/features/CloudBigDataUSClusterApiLiveTest.java (35)
    A rackspace-cloudbigdata-us/src/test/java/org/jclouds/rackspace/cloudbigdata/us/v1/features/CloudBigDataUSProfileApiLiveTest.java (35)
    A rackspace-cloudbigdata-us/src/test/resources/access_rax_us.json (260)
    A rackspace-cloudbigdata-us/src/test/resources/logback.xml (69)
    A rackspace-cloudbigdata/README.md (7)
    A rackspace-cloudbigdata/pom.xml (157)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/CloudBigDataApi.java (72)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/CloudBigDataApiMetadata.java (102)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/config/CloudBigDataHttpApiModule.java (82)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/config/CloudBigDataParserModule.java (32)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/domain/Cluster.java (214)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/domain/CreateCluster.java (269)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/domain/CreateProfile.java (234)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/domain/Profile.java (99)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/domain/ProfileSSHKey.java (144)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/features/ClusterApi.java (125)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/features/ProfileApi.java (79)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/handlers/CloudBigDataErrorHandler.java (67)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/predicates/ClusterPredicates.java (146)
    A rackspace-cloudbigdata/src/main/java/org/jclouds/rackspace/cloudbigdata/v1/utils/CloudBigDataUtils.java (25)
    A rackspace-cloudbigdata/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata (18)
    A rackspace-cloudbigdata/src/test/java/org/jclouds/rackspace/cloudbigdata/v1/features/ClusterApiLiveTest.java (164)
    A rackspace-cloudbigdata/src/test/java/org/jclouds/rackspace/cloudbigdata/v1/features/ClusterApiMockTest.java (381)
    A rackspace-cloudbigdata/src/test/java/org/jclouds/rackspace/cloudbigdata/v1/features/ProfileApiLiveTest.java (116)
    A rackspace-cloudbigdata/src/test/java/org/jclouds/rackspace/cloudbigdata/v1/features/ProfileApiMockTest.java (194)
    A rackspace-cloudbigdata/src/test/java/org/jclouds/rackspace/cloudbigdata/v1/internal/BaseCloudBigDataApiLiveTest.java (46)
    A rackspace-cloudbigdata/src/test/java/org/jclouds/rackspace/cloudbigdata/v1/internal/BaseCloudBigDataApiMockTest.java (43)
    A rackspace-cloudbigdata/src/test/resources/access.json (260)
    A rackspace-cloudbigdata/src/test/resources/cluster_create_request.json (8)
    A rackspace-cloudbigdata/src/test/resources/cluster_create_response.json (21)
    A rackspace-cloudbigdata/src/test/resources/cluster_delete_response.json (20)
    A rackspace-cloudbigdata/src/test/resources/cluster_get_response.json (21)
    A rackspace-cloudbigdata/src/test/resources/cluster_list_response.json (42)
    A rackspace-cloudbigdata/src/test/resources/cluster_node_get_response.json (28)
    A rackspace-cloudbigdata/src/test/resources/cluster_node_list_response.json (111)
    A rackspace-cloudbigdata/src/test/resources/cluster_resize_request.json (4)
    A rackspace-cloudbigdata/src/test/resources/cluster_resize_response.json (21)
    A rackspace-cloudbigdata/src/test/resources/flavor_list_cluster_types_response.json (16)
    A rackspace-cloudbigdata/src/test/resources/flavor_list_details_response.json (17)
    A rackspace-cloudbigdata/src/test/resources/flavor_list_response.json (62)
    A rackspace-cloudbigdata/src/test/resources/profile_create_request.json (19)
    A rackspace-cloudbigdata/src/test/resources/profile_create_response.json (16)
    A rackspace-cloudbigdata/src/test/resources/profile_get_response.json (16)
    A rackspace-cloudbigdata/src/test/resources/resource_limits_get_response.json (30)
    A rackspace-cloudbigdata/src/test/resources/type_list_details_response.json (15)
    A rackspace-cloudbigdata/src/test/resources/type_list_response.json (16)
    A rackspace-cloudbigdata/src/test/resources/type_list_supported_flavors_response.json (32)

-- Patch Links --

https://github.com/jclouds/jclouds-labs-openstack/pull/78.patch
https://github.com/jclouds/jclouds-labs-openstack/pull/78.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +               .clusterType(in.getClusterType())
> +               .flavorId(in.getFlavorId())
> +               .nodeCount(in.getNodeCount())
> +               .postInitScript(in.getPostInitScript());
> +      }        
> +   }
> +
> +   @Override
> +   public int compareTo(CreateCluster that) {
> +      return this.getName().compareTo(that.getName());
> +   }
> +
> +   /**
> +    * Enumerates different types of clusters.
> +    */
> +   public static enum ClusterType {

This is correct! However to make this PR more testable I have included it for now.
Ho about removing it when the Cluster Type feature is added?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9606702

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-openstack-pull-requests #160](https://jclouds.ci.cloudbees.com/job/jclouds-labs-openstack-pull-requests/160/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34715615

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +               .clusterType(in.getClusterType())
> +               .flavorId(in.getFlavorId())
> +               .nodeCount(in.getNodeCount())
> +               .postInitScript(in.getPostInitScript());
> +      }        
> +   }
> +
> +   @Override
> +   public int compareTo(CreateCluster that) {
> +      return this.getName().compareTo(that.getName());
> +   }
> +
> +   /**
> +    * Enumerates different types of clusters.
> +    */
> +   public static enum ClusterType {

This whole enum should probably just be removed right?

The types of clusters will be changing relatively often and clients will be able to dynamically discover types via [List Cluster Types](http://docs.rackspace.com/cbd/api/v1.0/cbd-devguide/content/GET_getClusterTypes__types_typeOperations.html).

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9547569

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +   ProfileApi getProfileApiForZone(@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
> +
> +   /**
> +    * Provides access to all Profile features.
> +    * @param zone The zone (region) for the profile API.
> +    * @return A cluster API context.
> +    */
> +   @Delegate
> +   ClusterApi getClusterApiForZone(@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
> +
> +   /**
> +    * Provides the Tenant.
> +    * @return The current tenant.
> +    */
> +   @Provides 
> +   Optional<Tenant> getCurrentTenantId();

This is supported for other services. Unsure if it is used, though. I will remove for now. 

This might have to be removed in other places as well (if actually unused).

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9523450

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +       * @return The string value.
> +       */
> +      public String value() {
> +         return name();
> +      }
> +
> +      @Override
> +      public String toString() {
> +         return value();
> +      }
> +
> +      /**
> +       * @param status The string representation of a Status
> +       * @return The corresponding Status.
> +       */
> +      public static Status fromValue(String status) {

Sorry, I'm not sure what you mean. How would it be used? Why can't valueOf() be used instead?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9674175

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Ignasi Barrera <no...@github.com>.
> +      *
> +    </jclouds.osgi.import>
> +  </properties>
> +
> +  <repositories>
> +    <repository>
> +      <id>apache-snapshots</id>
> +      <url>https://repository.apache.org/content/repositories/snapshots</url>
> +      <releases>
> +        <enabled>false</enabled>
> +      </releases>
> +      <snapshots>
> +        <enabled>true</enabled>
> +      </snapshots>
> +    </repository>
> +  </repositories>

The snapshots repo is already defined in jclouds-project.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9580077

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404;
> +import org.jclouds.Fallbacks.NullOnNotFoundOr404;
> +import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
> +import org.jclouds.rackspace.cloudbigdata.v1.domain.Cluster;
> +import org.jclouds.rackspace.cloudbigdata.v1.domain.CreateCluster;
> +import org.jclouds.rest.annotations.Fallback;
> +import org.jclouds.rest.annotations.PayloadParam;
> +import org.jclouds.rest.annotations.RequestFilters;
> +import org.jclouds.rest.annotations.SelectJson;
> +import org.jclouds.rest.annotations.WrapWith;
> +
> +import com.google.common.collect.FluentIterable;
> +
> +/**
> + * The API for controlling profiles.
> + * Your Cloud Big Data profile is different from your cloud account. Your profile has the following characteristics and requirements:

Well this is just flat out wrong. :P

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9548927

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-openstack #835](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-openstack/835/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34715356

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +   private final Status status;
> +   private final ImmutableList<Link> links;
> +
> +   @ConstructorProperties({
> +      "name", "clusterType", "flavorId", "nodeCount", "pointInitScript",
> +      "id", "created", "updated", "postInitScriptStatus", "progress", "status", "links"
> +   })
> +   protected Cluster(String name, String clusterType, String flavorId, int nodeCount, URI pointInitScript,
> +         String id, String created, String updated, String postInitScriptStatus, float progress, Status status, ImmutableList<Link> links) {
> +      super(name, clusterType, flavorId, nodeCount, pointInitScript);
> +      this.id = checkNotNull(id, "id must not be null");
> +      this.created = checkNotNull(created, "created must not be null");
> +      this.updated = checkNotNull(updated, "updated must not be null");
> +      this.postInitScriptStatus = postInitScriptStatus;
> +      this.progress = progress;
> +      this.status = status;

Status can be null? Seems like the kind of thing that would always be there.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9548314

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +   /**
> +    * @return The status of the execution of the init script.
> +    */
> +   public String getPostInitScriptStatus() {
> +      return postInitScriptStatus;
> +   }
> +   
> +   /**
> +    * @return The operation progress of this cluster.
> +    */
> +   public float getProgress() {
> +      return progress;
> +   }
> +   
> +   /**
> +    * @return the current status.

What's the difference between progress and status? Make it more clear in the comments.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9548197

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +
> +import org.jclouds.rackspace.cloudbigdata.v1.features.ClusterApi;
> +
> +import com.google.common.base.Objects;
> +import com.google.common.base.Objects.ToStringHelper;
> +import com.google.common.base.Optional;
> +
> +/**
> + * Cloud Big Data CreateCluster. This class is used for requests.
> + * 
> + * @see ClusterApi#create
> + * @author Zack Shoylev
> + */
> +public class CreateCluster implements Comparable<CreateCluster> {
> +   private final String name;
> +   private final String clusterType;

What is available might change somewhat often service-side.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9447822

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-openstack-pull-requests #162](https://jclouds.ci.cloudbees.com/job/jclouds-labs-openstack-pull-requests/162/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34914850

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +       * @return The string value.
> +       */
> +      public String value() {
> +         return name();
> +      }
> +
> +      @Override
> +      public String toString() {
> +         return value();
> +      }
> +
> +      /**
> +       * @param status The string representation of a Status
> +       * @return The corresponding Status.
> +       */
> +      public static Status fromValue(String status) {

Is this method necessary? Looks like the default valueOf() method should suffice.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9547779

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Andrew Phillips <no...@github.com>.
> +      *
> +    </jclouds.osgi.import>
> +  </properties>
> +
> +  <repositories>
> +    <repository>
> +      <id>apache-snapshots</id>
> +      <url>https://repository.apache.org/content/repositories/snapshots</url>
> +      <releases>
> +        <enabled>false</enabled>
> +      </releases>
> +      <snapshots>
> +        <enabled>true</enabled>
> +      </snapshots>
> +    </repository>
> +  </repositories>

I think the problem here is that, if you check out only the labs-openstack repo, you need to get jclouds-project. If you don't have this snapshot repo, it won't work ;-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9600707

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +       * @return The string value.
> +       */
> +      public String value() {
> +         return name();
> +      }
> +
> +      @Override
> +      public String toString() {
> +         return value();
> +      }
> +
> +      /**
> +       * @param status The string representation of a Status
> +       * @return The corresponding Status.
> +       */
> +      public static Status fromValue(String status) {

I believe needed for UNRECOGNIZED support.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9606958

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-openstack-pull-requests #155](https://jclouds.ci.cloudbees.com/job/jclouds-labs-openstack-pull-requests/155/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34206797

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
merged

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34915516

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
Strange, it did not. I have doc warnings enabled too. 
After cleaning the project it did, though.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34384451

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
@zack-shoylev Good work on the code here but can you please give the Javadoc some more love?

Look at it from the perspective of a user who knows little about big data and nothing about jclouds. The class level Javadoc should be extra descriptive. Please double check every single line of Javadoc for accuracy and descriptiveness.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34483138

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +   /**
> +    * @return the timestamp when this cluster was created.
> +    */
> +   public String getCreated() {
> +      return created;
> +   }
> +   
> +   /**
> +    * @return the timestamp when this cluster was updated. This can be empty.
> +    */
> +   public String getUpdated() {
> +      return updated;
> +   }
> +   
> +   /**
> +    * @return The status of the execution of the init script.

What values can the status take? Do we need an enum?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9547866

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-openstack #843](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-openstack/843/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34914633

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +   /**
> +    * @return The operation progress of this cluster.
> +    */
> +   public float getProgress() {
> +      return progress;
> +   }
> +   
> +   /**
> +    * @return the current status.
> +    */
> +   public Status getStatus() {
> +      return status;
> +   }
> +   
> +   /**
> +    * @return the links for this cluster.

What exactly are these links? Are they something a jclouds user could actually make use of? If not, remove it.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9548241

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +   /**
> +    * @return The operation progress of this cluster.
> +    */
> +   public float getProgress() {
> +      return progress;
> +   }
> +   
> +   /**
> +    * @return the current status.
> +    */
> +   public Status getStatus() {
> +      return status;
> +   }
> +   
> +   /**
> +    * @return the links for this cluster.

While a jclouds user might not use the links through jclouds, they might be useful for custom logging or other purposes (they are returned in the response, so I am thinking they should be available). Thoughts?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9607467

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
The Javadoc can always be updated in later PRs. No need to block merging on Javadoc at this point in time.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34887114

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-openstack #844](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-openstack/844/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34915738

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
I will add some more Javadoc love to the PR. There are some doc questions I need to ask the big data team first though before I can finish with the doc update.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34499417

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +   ProfileApi getProfileApiForZone(@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
> +
> +   /**
> +    * Provides access to all Profile features.
> +    * @param zone The zone (region) for the profile API.
> +    * @return A cluster API context.
> +    */
> +   @Delegate
> +   ClusterApi getClusterApiForZone(@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
> +
> +   /**
> +    * Provides the Tenant.
> +    * @return The current tenant.
> +    */
> +   @Provides 
> +   Optional<Tenant> getCurrentTenantId();

Is this actually used anywhere? Is there a use for it?

If not, just remove it.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9522068

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +    */
> +   public String getUserId() {
> +      return this.userId;
> +   }
> +
> +   /**
> +    * @return the tenant id of this Profile.
> +    */
> +   public String getTenantId() {
> +      return this.tenantId;
> +   }
> +
> +   /**
> +    * @return the links to this Profile.
> +    */
> +   public ImmutableList<Link> getLinks() {

Are these links useful to jclouds users? If not, remove them.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9548763

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +       * @return The string value.
> +       */
> +      public String value() {
> +         return name();
> +      }
> +
> +      @Override
> +      public String toString() {
> +         return value();
> +      }
> +
> +      /**
> +       * @param status The string representation of a Status
> +       * @return The corresponding Status.
> +       */
> +      public static Status fromValue(String status) {

fromValue is used in our custom json parsers to provide UNRECOGNIZED. valueOf is used automatically otherwise. However, you can't override valueOf. Now, having looked at it some more, I think I can remove UNRECOGNIZED and fromValue. This will simplify the code without losing functionality.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9678918

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-openstack-pull-requests #163](https://jclouds.ci.cloudbees.com/job/jclouds-labs-openstack-pull-requests/163/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34915965

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +    */
> +   public static Builder builder() { 
> +      return new Builder();
> +   }
> +
> +   /**
> +    * @return The Builder object
> +    */
> +   public Builder toBuilder() { 
> +      return new Builder().fromCreateProfile(this);
> +   }
> +
> +   /**
> +    * Implements the Builder pattern
> +    */
> +   public static class Builder {

Revisit all of the Javadoc in this Builder. Make sure the descriptions match the params. Make it clear what the difference is between username and password and credentials username and api key.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9548504

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-openstack-pull-requests #161](https://jclouds.ci.cloudbees.com/job/jclouds-labs-openstack-pull-requests/161/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34828193

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Andrew Phillips <no...@github.com>.
> jclouds-labs-openstack-pull-requests #156 FAILURE

Jenkins error, unrelated to this request.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34364671

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Ignasi Barrera <no...@github.com>.
> +      <scope>test</scope>
> +    </dependency>
> +    <dependency>
> +      <groupId>ch.qos.logback</groupId>
> +      <artifactId>logback-classic</artifactId>
> +      <scope>test</scope>
> +    </dependency>
> +    <dependency>
> +    	<groupId>org.apache.jclouds.api</groupId>
> +    	<artifactId>rackspace-cloudidentity</artifactId>
> +    	<version>${project.parent.version}</version>
> +    </dependency>
> +    <dependency>
> +      <groupId>com.squareup.okhttp</groupId>
> +      <artifactId>mockwebserver</artifactId>
> +      <version>1.2.1</version>

The jclouds-project already sets the okhttp version for this, to make sure it is aligned with the jclouds-okhttp driver. This one should be removed.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9580105

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +       * @return The string value.
> +       */
> +      public String value() {
> +         return name();
> +      }
> +
> +      @Override
> +      public String toString() {
> +         return value();
> +      }
> +
> +      /**
> +       * @param status The string representation of a Status
> +       * @return The corresponding Status.
> +       */
> +      public static Status fromValue(String status) {

Specifically, it is needed for EnumTypeAdapterThatReturnsFromValue which is the custom jclouds enum adapter. If the enum string cannot be parsed automatically, fromValue is called.
I am not sure if I am explaining this well...

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9683492

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +   /**
> +    * @return the timestamp when this cluster was created.
> +    */
> +   public String getCreated() {
> +      return created;
> +   }
> +   
> +   /**
> +    * @return the timestamp when this cluster was updated. This can be empty.
> +    */
> +   public String getUpdated() {
> +      return updated;
> +   }
> +   
> +   /**
> +    * @return The status of the execution of the init script.

I forgot to ask that Friday. Will ask.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9606994

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +       * @return The string value.
> +       */
> +      public String value() {
> +         return name();
> +      }
> +
> +      @Override
> +      public String toString() {
> +         return value();
> +      }
> +
> +      /**
> +       * @param status The string representation of a Status
> +       * @return The corresponding Status.
> +       */
> +      public static Status fromValue(String status) {

I have not been explaining this in enough detail. There is a jclouds GSON feature (enum adapter) where fromValue is called if GSON cannot deserialize the value.
1. Bad value encountered in JSON
2. Adapter cannot deserialize using known enum values (exception)
3. Adapter calls fromValue
4. fromValue uses valueOf and fails (exception)
5. fromValue returns UNRECOGNIZED

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9684725

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Ignasi Barrera <no...@github.com>.
> +      *
> +    </jclouds.osgi.import>
> +  </properties>
> +
> +  <repositories>
> +    <repository>
> +      <id>apache-snapshots</id>
> +      <url>https://repository.apache.org/content/repositories/snapshots</url>
> +      <releases>
> +        <enabled>false</enabled>
> +      </releases>
> +      <snapshots>
> +        <enabled>true</enabled>
> +      </snapshots>
> +    </repository>
> +  </repositories>

Same comment about the snapshots repo. We should be able to remove them from this pom.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9580152

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +    */
> +   public static Builder builder() { 
> +      return new Builder();
> +   }
> +
> +   /**
> +    * @return The Builder object
> +    */
> +   public Builder toBuilder() { 
> +      return new Builder().fromCreateProfile(this);
> +   }
> +
> +   /**
> +    * Implements the Builder pattern
> +    */
> +   public static class Builder {

I am still waiting to get more info on that.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9607546

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-openstack-pull-requests #157](https://jclouds.ci.cloudbees.com/job/jclouds-labs-openstack-pull-requests/157/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34386195

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-openstack-pull-requests #159](https://jclouds.ci.cloudbees.com/job/jclouds-labs-openstack-pull-requests/159/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34501949

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> + * Your Cloud Big Data profile is different from your cloud account. Your profile has the following characteristics and requirements:
> + * A profile is the configuration for the administration and login account for the cluster.
> + * Only one profile is allowed for each user or account.
> + * Any updates or additions override the existing profile.
> + * @author Zack Shoylev
> + */
> +@RequestFilters(AuthenticateRequest.class)
> +@Consumes(MediaType.APPLICATION_JSON)
> +@Produces(MediaType.APPLICATION_JSON)
> +public interface ClusterApi extends Closeable {
> +
> +   /**
> +    * Create a Cluster.
> +    * Before creating a cluster, a profile has to be created.
> +    * @param cluster An object containing information about the cluster to be created.
> +    * @param profile A CreateCluster object containing information about the profile to be created.

This param doesn't exist. Does Eclipse not catch this stuff for you?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9522150

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +            .add("links", links);
> +   }
> +
> +   @Override
> +   public String toString() {
> +      return string().toString();
> +   }
> +   
> +   /**
> +    * Lists possible Cluster status.
> +    * @author zack-shoylev
> +    */
> +   public enum Status {
> +      /**
> +       * The cluster is in the process of being created. Servers are being created and booted.
> +       * */

Fix all of the Javadoc comment ends.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9547830

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +            .add("progress", progress)
> +            .add("status", status)
> +            .add("links", links);
> +   }
> +
> +   @Override
> +   public String toString() {
> +      return string().toString();
> +   }
> +   
> +   /**
> +    * Lists possible Cluster status.
> +    * @author zack-shoylev
> +    *
> +    */
> +   public enum Status {

I am getting more info about what exactly goes in here.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9447794

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Ignasi Barrera <no...@github.com>.
> +      *
> +    </jclouds.osgi.import>
> +  </properties>
> +
> +  <repositories>
> +    <repository>
> +      <id>apache-snapshots</id>
> +      <url>https://repository.apache.org/content/repositories/snapshots</url>
> +      <releases>
> +        <enabled>false</enabled>
> +      </releases>
> +      <snapshots>
> +        <enabled>true</enabled>
> +      </snapshots>
> +    </repository>
> +  </repositories>

Ah I see, you also need the repo to get the parent pom. Forget my comment then :) I didn't notice!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9601330

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-openstack-pull-requests #154](https://jclouds.ci.cloudbees.com/job/jclouds-labs-openstack-pull-requests/154/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34131145

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-openstack-pull-requests #158](https://jclouds.ci.cloudbees.com/job/jclouds-labs-openstack-pull-requests/158/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34496213

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> + */
> +package org.jclouds.rackspace.cloudbigdata.v1.domain;
> +
> +import static com.google.common.base.Preconditions.checkNotNull;
> +
> +import java.beans.ConstructorProperties;
> +
> +import org.jclouds.openstack.v2_0.domain.Link;
> +import org.jclouds.rackspace.cloudbigdata.v1.features.ProfileApi;
> +
> +import com.google.common.base.Objects;
> +import com.google.common.base.Objects.ToStringHelper;
> +import com.google.common.collect.ImmutableList;
> +
> +/**
> + * Cloud Big Data CreateProfile. This class is used for requests.

This class is not used for requests. In all of the Javadoc try to stay away from using "requests" and "responses". Those are underlying details. This doc should talk about what a Profile is, why you need it, what it is, how it works, and stuff like that.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9548639

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +import org.jclouds.rackspace.cloudbigdata.v1.features.ClusterApi;
> +
> +import com.google.common.base.Objects;
> +import com.google.common.base.Objects.ToStringHelper;
> +import com.google.common.collect.ImmutableList;
> +
> +/**
> + * Cloud Big Data Cluster. This class is used for responses.
> + * 
> + * @see ClusterApi#create
> + * @author Zack Shoylev
> + */
> +public class Cluster extends CreateCluster {
> +   private final String id;
> +   private final String created;
> +   private final String updated;

created and updated should be of type Date

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9547912

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-openstack #839](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-openstack/839/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34827649

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +import org.jclouds.rackspace.cloudbigdata.v1.features.ProfileApi;
> +
> +import com.google.common.base.Objects;
> +import com.google.common.base.Objects.ToStringHelper;
> +import com.google.common.collect.ImmutableList;
> +
> +/**
> + * Cloud Big Data CreateProfile. This class is used for requests.
> + * 
> + * @see ProfileApi#create
> + * @author Zack Shoylev
> + */
> +public class CreateProfile implements Comparable<CreateProfile> {
> +   private final String username;
> +   private final String password;
> +   private final ImmutableList<ProfileSSHKey> sshkeys;

sshKeys

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9548521

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +       * @return The string value.
> +       */
> +      public String value() {
> +         return name();
> +      }
> +
> +      @Override
> +      public String toString() {
> +         return value();
> +      }
> +
> +      /**
> +       * @param status The string representation of a Status
> +       * @return The corresponding Status.
> +       */
> +      public static Status fromValue(String status) {

Oh, and note null is still possible.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9684760

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Andrew Phillips <no...@github.com>.
> +      *
> +    </jclouds.osgi.import>
> +  </properties>
> +
> +  <repositories>
> +    <repository>
> +      <id>apache-snapshots</id>
> +      <url>https://repository.apache.org/content/repositories/snapshots</url>
> +      <releases>
> +        <enabled>false</enabled>
> +      </releases>
> +      <snapshots>
> +        <enabled>true</enabled>
> +      </snapshots>
> +    </repository>
> +  </repositories>

See response above. This is needed for bootstrapping, I think.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9600724

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
This seems to be code-complete. Remaining documentation todos will be updated later as that documentation becomes more available. Rebasing and merging.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34914050

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> +
> +/**
> + * Profile live test
> + * 
> + * @author Zack Shoylev
> + */
> +@Test(groups = "live", testName = "ProfileApiLiveTest", singleThreaded = true)
> +@SuppressWarnings("javadoc")
> +public class ClusterApiLiveTest extends BaseCloudBigDataApiLiveTest {   
> +
> +   @Override
> +   @BeforeClass(groups = { "integration", "live" })
> +   public void setup() {
> +      super.setup();
> +      for (String zone : api.getConfiguredZones()) {
> +         if(System.getProperty("test.live.region")!=null && !zone.equals(System.getProperty("test.live.region"))){

This needs to be moved to the base test in a separate PR. And test.live.region converted to a const.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9447867

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
> + * Your Cloud Big Data profile is different from your cloud account. Your profile has the following characteristics and requirements:
> + * A profile is the configuration for the administration and login account for the cluster.
> + * Only one profile is allowed for each user or account.
> + * Any updates or additions override the existing profile.
> + * @author Zack Shoylev
> + */
> +@RequestFilters(AuthenticateRequest.class)
> +@Consumes(MediaType.APPLICATION_JSON)
> +@Produces(MediaType.APPLICATION_JSON)
> +public interface ClusterApi extends Closeable {
> +
> +   /**
> +    * Create a Cluster.
> +    * Before creating a cluster, a profile has to be created.
> +    * @param cluster An object containing information about the cluster to be created.
> +    * @param profile A CreateCluster object containing information about the profile to be created.

It seems it creates a warning only for missing params =\.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9523402

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-openstack-pull-requests #156](https://jclouds.ci.cloudbees.com/job/jclouds-labs-openstack-pull-requests/156/) FAILURE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78#issuecomment-34274154

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Zack Shoylev <no...@github.com>.
Closed #78.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78

Re: [jclouds-labs-openstack] Adds support for Rackspace Cloud Big Data (#78)

Posted by Everett Toews <no...@github.com>.
> +       * The cluster is deleted.
> +       */
> +      DELETED,
> +      /**
> +       * A fatal error has occurred during cluster provisioning.
> +       */
> +      ERROR,
> +      /**
> +       * Unrecognized status response.
> +       */
> +      UNRECOGNIZED;
> +
> +      /**
> +       * @return The string value.
> +       */
> +      public String value() {

Is this method necessary? Looks like you only need toString.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/78/files#r9547747