diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java index 8a79790c0a..85ceeaf85e 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java @@ -23,6 +23,7 @@ import java.net.URI; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; +import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -36,6 +37,7 @@ import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog; import org.jclouds.vcloud.director.v1_5.domain.Owner; +import org.jclouds.vcloud.director.v1_5.domain.PublishCatalogParams; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; @@ -99,6 +101,15 @@ public interface AdminCatalogAsyncClient { ListenableFuture setOwner(@EndpointParam URI catalogRef, @BinderParam(BindToXMLPayload.class) Owner newOwner); -// DELETE /admin/catalog/{id} -// POST /admin/catalog/{id}/action/publish + /** + * @see AdminClient#AdminClient(URI, PublishCatalogParams) + */ + @POST + @Path("/action/publish") + @Consumes + @Produces(VCloudDirectorMediaType.PUBLISH_CATALOG_PARAMS) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture publishCatalog(@EndpointParam URI catalogRef, + @BinderParam(BindToXMLPayload.class) PublishCatalogParams params); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java index f15fa2375f..f4219f629c 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java @@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog; import org.jclouds.vcloud.director.v1_5.domain.Owner; +import org.jclouds.vcloud.director.v1_5.domain.PublishCatalogParams; /** * Provides synchronous access to {@link AdminCatalog} objects. @@ -86,4 +87,9 @@ public interface AdminCatalogClient { * */ void setOwner(URI catalogRef, Owner newOwner); + + /** + * Publish a catalog. Publishing a catalog makes the catalog visible to all organizations in a vCloud. + */ + void publishCatalog(URI catalogRef, PublishCatalogParams params); }