jclouds-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject [jclouds-labs] branch 2.1.x updated: Expose wait for predicates on relevant API
Date Mon, 14 Jan 2019 09:04:05 GMT
This is an automated email from the ASF dual-hosted git repository.

nacx pushed a commit to branch 2.1.x
in repository https://gitbox.apache.org/repos/asf/jclouds-labs.git


The following commit(s) were added to refs/heads/2.1.x by this push:
     new 3f637ae  Expose wait for predicates on relevant API
3f637ae is described below

commit 3f637ae3aa788868c36113d6836b1a223f9fb019
Author: Boris Trishkin <boris.trishkin@itaas.dimensiondata.com>
AuthorDate: Thu Jan 10 10:06:49 2019 +0000

    Expose wait for predicates on relevant API
---
 .../cloudcontrol/features/NetworkApi.java          | 27 ++++++++++++++++++++++
 .../cloudcontrol/features/ServerApi.java           | 27 ++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/NetworkApi.java
b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/NetworkApi.java
index c46ae38..f43c41b 100644
--- a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/NetworkApi.java
+++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/NetworkApi.java
@@ -18,6 +18,8 @@ package org.jclouds.dimensiondata.cloudcontrol.features;
 
 import com.google.common.base.Function;
 import com.google.common.base.Optional;
+import com.google.common.base.Predicate;
+import com.google.inject.Provides;
 import com.google.inject.TypeLiteral;
 import org.jclouds.Fallbacks;
 import org.jclouds.Fallbacks.NullOnNotFoundOr404;
@@ -66,6 +68,15 @@ import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import java.util.List;
 
+import static org.jclouds.dimensiondata.cloudcontrol.config.DimensionDataCloudControlComputeServiceContextModule.NETWORK_DOMAIN_DELETED_PREDICATE;
+import static org.jclouds.dimensiondata.cloudcontrol.config.DimensionDataCloudControlComputeServiceContextModule.NETWORK_DOMAIN_NORMAL_PREDICATE;
+import static org.jclouds.dimensiondata.cloudcontrol.config.DimensionDataCloudControlComputeServiceContextModule.VLAN_DELETED_PREDICATE;
+import static org.jclouds.dimensiondata.cloudcontrol.config.DimensionDataCloudControlComputeServiceContextModule.VLAN_NORMAL_PREDICATE;
+
+/**
+ * For examples of how to use this API please refer to https://jclouds.apache.org/guides/dimensiondata/
+ */
+
 @RequestFilters({ BasicAuthentication.class, OrganisationIdFilter.class })
 @Consumes(MediaType.APPLICATION_JSON)
 @Path("/caas/{jclouds.api-version}/network")
@@ -297,6 +308,22 @@ public interface NetworkApi {
    @Fallback(Fallbacks.VoidOnNotFoundOr404.class)
    void deletePortList(@PayloadParam("id") String portListId);
 
+   @Provides
+   @Named(VLAN_DELETED_PREDICATE)
+   Predicate<String> vlanDeletedPredicate();
+
+   @Provides
+   @Named(NETWORK_DOMAIN_DELETED_PREDICATE)
+   Predicate<String> networkDomainDeletedPredicate();
+
+   @Provides
+   @Named(NETWORK_DOMAIN_NORMAL_PREDICATE)
+   Predicate<String> networkDomainNormalPredicate();
+
+   @Provides
+   @Named(VLAN_NORMAL_PREDICATE)
+   Predicate<String> vlanNormalPredicate();
+
    @Singleton
    final class ParseFirewallRules extends ParseJson<FirewallRules> {
 
diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/ServerApi.java
b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/ServerApi.java
index e3062ab..8e0333f 100644
--- a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/ServerApi.java
+++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/ServerApi.java
@@ -18,6 +18,8 @@ package org.jclouds.dimensiondata.cloudcontrol.features;
 
 import com.google.common.base.Function;
 import com.google.common.base.Optional;
+import com.google.common.base.Predicate;
+import com.google.inject.Provides;
 import com.google.inject.TypeLiteral;
 import org.jclouds.Fallbacks;
 import org.jclouds.collect.IterableWithMarker;
@@ -59,6 +61,15 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import java.util.List;
 
+import static org.jclouds.dimensiondata.cloudcontrol.config.DimensionDataCloudControlComputeServiceContextModule.SERVER_DELETED_PREDICATE;
+import static org.jclouds.dimensiondata.cloudcontrol.config.DimensionDataCloudControlComputeServiceContextModule.SERVER_NORMAL_PREDICATE;
+import static org.jclouds.dimensiondata.cloudcontrol.config.DimensionDataCloudControlComputeServiceContextModule.SERVER_STARTED_PREDICATE;
+import static org.jclouds.dimensiondata.cloudcontrol.config.DimensionDataCloudControlComputeServiceContextModule.SERVER_STOPPED_PREDICATE;
+
+/**
+ * For examples of how to use this API please refer to https://jclouds.apache.org/guides/dimensiondata/
+ */
+
 @RequestFilters({ BasicAuthentication.class, OrganisationIdFilter.class })
 @Consumes(MediaType.APPLICATION_JSON)
 @Path("/caas/{jclouds.api-version}/server")
@@ -171,6 +182,22 @@ public interface ServerApi {
    @MapBinder(BindToJsonPayload.class)
    void shutdownServer(@PayloadParam("id") String id);
 
+   @Provides
+   @Named(SERVER_STOPPED_PREDICATE)
+   Predicate<String> serverStoppedPredicate();
+
+   @Provides
+   @Named(SERVER_DELETED_PREDICATE)
+   Predicate<String> serverDeletedPredicate();
+
+   @Provides
+   @Named(SERVER_STARTED_PREDICATE)
+   Predicate<String> serverStartedPredicate();
+
+   @Provides
+   @Named(SERVER_NORMAL_PREDICATE)
+   Predicate<String> serverNormalPredicate();
+
    @Singleton
    final class ParseServers extends ParseJson<Servers> {
 


Mime
View raw message