You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Marcus Wanner <no...@github.com> on 2015/07/21 16:42:39 UTC

[jclouds-labs-openstack] Add Manila support (#198)

https://issues.apache.org/jira/browse/JCLOUDS-966
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Add Manila support

-- File Changes --

    A openstack-manila/README.md (7)
    A openstack-manila/pom.xml (134)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/ManilaApi.java (87)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/ManilaApiMetadata.java (96)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/config/ManilaHttpApiModule.java (62)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/config/ManilaParserModule.java (77)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/domain/Share.java (419)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/domain/ShareNetwork.java (196)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/domain/ShareQuota.java (162)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/domain/ShareType.java (144)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/domain/Snapshot.java (278)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/domain/ZoneState.java (92)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/features/QuotaApi.java (53)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/features/ShareApi.java (118)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/features/ShareNetworkApi.java (102)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/features/ShareTypeApi.java (103)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/features/SnapshotApi.java (116)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/handlers/ManilaErrorHandler.java (68)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/options/CreateShareNetworkOptions.java (169)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/options/CreateShareOptions.java (289)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/options/CreateShareTypeOptions.java (113)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/options/CreateSnapshotOptions.java (135)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/predicates/SharePredicates.java (131)
    A openstack-manila/src/main/java/org/jclouds/openstack/manila/v1/predicates/SnapshotPredicates.java (134)
    A openstack-manila/src/test/java/org/jclouds/openstack/manila/v1/domain/ShareTest.java (32)
    A openstack-manila/src/test/java/org/jclouds/openstack/manila/v1/features/QuotasApiExpectTest.java (49)
    A openstack-manila/src/test/java/org/jclouds/openstack/manila/v1/features/QuotasApiLiveTest.java (53)
    A openstack-manila/src/test/java/org/jclouds/openstack/manila/v1/features/ShareAndSnapshotApiLiveTest.java (228)
    A openstack-manila/src/test/java/org/jclouds/openstack/manila/v1/features/ShareApiExpectTest.java (208)
    A openstack-manila/src/test/java/org/jclouds/openstack/manila/v1/features/ShareTypeApiExpectTest.java (86)
    A openstack-manila/src/test/java/org/jclouds/openstack/manila/v1/features/ShareTypeApiLiveTest.java (61)
    A openstack-manila/src/test/java/org/jclouds/openstack/manila/v1/features/SnapshotApiExpectTest.java (281)
    A openstack-manila/src/test/java/org/jclouds/openstack/manila/v1/internal/BaseManilaApiExpectTest.java (25)
    A openstack-manila/src/test/java/org/jclouds/openstack/manila/v1/internal/BaseManilaApiLiveTest.java (40)
    A openstack-manila/src/test/java/org/jclouds/openstack/manila/v1/internal/BaseManilaExpectTest.java (70)
    A openstack-manila/src/test/resources/availability_zones_list.json (8)
    A openstack-manila/src/test/resources/quotas.json (8)
    A openstack-manila/src/test/resources/share_create.json (9)
    A openstack-manila/src/test/resources/share_create_response.json (15)
    A openstack-manila/src/test/resources/share_get.json (15)
    A openstack-manila/src/test/resources/share_list_details.json (17)
    A openstack-manila/src/test/resources/share_type_get.json (10)
    A openstack-manila/src/test/resources/share_type_list_simple.json (12)
    A openstack-manila/src/test/resources/snapshot_create.json (8)
    A openstack-manila/src/test/resources/snapshot_create_response.json (12)
    A openstack-manila/src/test/resources/snapshot_get.json (13)
    A openstack-manila/src/test/resources/snapshot_list_details.json (15)
    M pom.xml (1)

-- Patch Links --

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

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Marcus Wanner <no...@github.com>.
Working on it! I should have an updated PR for you in a few days.

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
> +   @Nullable
> +   ShareNetwork get(@PathParam("id") String shareNetworkId);
> +
> +   /**
> +    * Creates a new ShareNetwork
> +    *
> +    * @param shareNetworkId Id of the ShareNetwork
> +    * @param options See CreateShareNetworkOptions
> +    * @return The new ShareNetwork
> +    */
> +   @Named("shareNetwork:create")
> +   @POST
> +   @SelectJson("share_network")
> +   @Produces(MediaType.APPLICATION_JSON)
> +   @MapBinder(CreateShareNetworkOptions.class)
> +   ShareNetwork create(CreateShareNetworkOptions... options);

See if you can get rid of the MapBinder by providing a CreateShareNetwork class using auto-value that contains the possible options.

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

Re: [jclouds/jclouds-labs-openstack] Add Manila support (#198)

Posted by Marcus Wanner <no...@github.com>.
Unfortunately, it looks like this project's sponsor has abandoned it. I haven't been employed there in about two years, so I'm not really sure what the status is, but at this point it seems unlikely to me that they're still working on it. Sorry about that :(

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/198#issuecomment-331578944

Re: [jclouds/jclouds-labs-openstack] Add Manila support (#198)

Posted by Andrew Gaul <no...@github.com>.
Closed due to inactivity.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/198#issuecomment-331580937

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
> + */
> +@SkipEncoding({'/', '='})
> +@RequestFilters(AuthenticateRequest.class)
> +@Consumes(MediaType.APPLICATION_JSON)
> +@Path("/share-networks")
> +public interface ShareNetworkApi {
> +   /**
> +    * Returns a summary list of ShareNetworks.
> +    *
> +    * @return The list of ShareNetworks
> +    */
> +   @Named("shareNetwork:list")
> +   @GET
> +   @SelectJson("share_networks")
> +   @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
> +   FluentIterable<? extends ShareNetwork> list();

See if you can use standard Java collections instead of guava collections for the apis.

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
> +
> +import org.jclouds.date.DateService;
> +import org.jclouds.date.internal.SimpleDateFormatDateService;
> +import org.jclouds.http.HttpResponse;
> +import org.jclouds.openstack.manila.v1.domain.Share;
> +import org.jclouds.openstack.manila.v1.options.CreateShareOptions;
> +import org.jclouds.rest.ResourceNotFoundException;
> +import org.testng.annotations.Test;
> +
> +import com.google.common.collect.ImmutableSet;
> +
> +/**
> + * Tests ShareApi Guice wiring and parsing
> + */
> +@Test(groups = "unit", testName = "ShareApiExpectTest")
> +public class ShareApiExpectTest extends org.jclouds.openstack.manila.v1.internal.BaseManilaApiExpectTest {

Use mock test instead of expect tests.

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

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

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
Note: Failing because it depends on the corresponding jclouds change for service type.

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Marcus Wanner <no...@github.com>.
I've taken care of some of the issues raised above, but the AutoValue and Mock test changes still need to be made. I'm no longer assigned to this project, but I've passed along this pull request and the corresponding jira ticket and someone should be finishing this up soon.

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

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

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
Reopened #198.

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
Reopened #198.

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
Wow, that's a lot of work there! Thank you for contributing. I added some notes. To see how these notes are implemented in other places, check our support for openstack-heat here: https://github.com/jclouds/jclouds-labs-openstack/tree/master/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1

Basically we are moving towards using MockHttp for testing and autovalue with autobuilder for domain and options classes. It saves a lot of code.

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

Re: [jclouds/jclouds-labs-openstack] Add Manila support (#198)

Posted by Andrew Gaul <no...@github.com>.
@marcuswanner do we have a path forward on this pull request?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/198#issuecomment-331355396

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
Great, it's passing now. There are still some notes to address though.

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
@marcuswanner ping?

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
> +import java.util.Date;
> +import java.util.Map;
> +
> +import javax.inject.Named;
> +
> +import org.jclouds.javax.annotation.Nullable;
> +
> +import com.google.common.base.CaseFormat;
> +import com.google.common.base.Objects;
> +import com.google.common.base.Objects.ToStringHelper;
> +import com.google.common.collect.ImmutableMap;
> +
> +/**
> + * An Openstack Manila Share.
> + */
> +public class Share {

This should use AutoValue with the auto value builder. It will save a lot of code and is the right thing to do going forward.

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

Re: [jclouds/jclouds-labs-openstack] Add Manila support (#198)

Posted by Andrew Gaul <no...@github.com>.
Closed #198.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/198#event-1262100447

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
I have merged the jclouds prereq PR.

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
Thanks for the update @marcuswanner ! Much appreciated.

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

Re: [jclouds-labs-openstack] Add Manila support (#198)

Posted by Zack Shoylev <no...@github.com>.
> + */
> +@SkipEncoding({'/', '='})
> +@RequestFilters(AuthenticateRequest.class)
> +@Consumes(MediaType.APPLICATION_JSON)
> +@Path("/share-networks")
> +public interface ShareNetworkApi {
> +   /**
> +    * Returns a summary list of ShareNetworks.
> +    *
> +    * @return The list of ShareNetworks
> +    */
> +   @Named("shareNetwork:list")
> +   @GET
> +   @SelectJson("share_networks")
> +   @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
> +   FluentIterable<? extends ShareNetwork> list();

? extends ... should not really be needed, with auto value we should have specific domain classes for everything., I think.

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