Added LogDelivery
diff --git a/openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/domain/CreateService.java b/openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/domain/CreateService.java
index e4c885a..0d2a419 100644
--- a/openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/domain/CreateService.java
+++ b/openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/domain/CreateService.java
@@ -59,9 +59,15 @@
*/
public abstract String getFlavorId();
+ /**
+ * @see Builder#logDelivery(LogDelivery)
+ */
+ public abstract LogDelivery getLogDelivery();
+
public static Builder builder() {
return new AutoValue_CreateService.Builder().caching(null).restrictions(null);
}
+
public Builder toBuilder() {
return builder()
.name(getName())
@@ -69,19 +75,21 @@
.origins(getOrigins())
.caching(getCaching())
.restrictions(getRestrictions())
- .flavorId(getFlavorId());
+ .flavorId(getFlavorId())
+ .logDelivery(getLogDelivery());
}
- @SerializedNames({ "name", "domains", "origins", "caching", "restrictions", "flavor_id" })
+ @SerializedNames({ "name", "domains", "origins", "caching", "restrictions", "flavor_id", "log_delivery" })
private static CreateService create(String name, List<Domain> domains, List<Origin> origins, List<Caching> caching,
- List<Restriction> restrictions, String flavorId) {
+ List<Restriction> restrictions, String flavorId, LogDelivery logDelivery) {
return builder()
.name(name)
.domains(domains)
.origins(origins)
.caching(caching)
.restrictions(restrictions)
- .flavorId(flavorId).build();
+ .flavorId(flavorId)
+ .logDelivery(logDelivery).build();
}
public static final class Builder {
@@ -91,6 +99,7 @@
private List<Caching> caching;
private List<Restriction> restrictions;
private String flavorId;
+ private LogDelivery logDelivery;
Builder() {
}
Builder(CreateService source) {
@@ -100,6 +109,7 @@
caching(source.getCaching());
restrictions(source.getRestrictions());
flavorId(source.getFlavorId());
+ logDelivery(source.getLogDelivery());
}
/**
@@ -164,6 +174,17 @@
return this;
}
+ /**
+ * Required.
+ *
+ * @param logDelivery
+ * @return The CreateService builder.
+ */
+ public Builder logDelivery(LogDelivery logDelivery) {
+ this.logDelivery = logDelivery;
+ return this;
+ }
+
public CreateService build() {
String missing = "";
if (name == null) {
@@ -178,6 +199,9 @@
if (flavorId == null) {
missing += " flavorId";
}
+ if (logDelivery == null) {
+ missing += " logDelivery";
+ }
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
@@ -187,7 +211,8 @@
this.origins,
this.caching == null ? null : ImmutableList.copyOf(this.caching),
this.restrictions == null ? null : ImmutableList.copyOf(this.restrictions),
- this.flavorId);
+ this.flavorId,
+ this.logDelivery);
return result;
}
}
diff --git a/openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/domain/LogDelivery.java b/openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/domain/LogDelivery.java
new file mode 100644
index 0000000..79a8b96
--- /dev/null
+++ b/openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/domain/LogDelivery.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.poppy.v1.domain;
+
+import org.jclouds.json.SerializedNames;
+
+import com.google.auto.value.AutoValue;
+
+/**
+ * Representation of an OpenStack Poppy Service Logging.
+ */
+@AutoValue
+public abstract class LogDelivery {
+
+ /**
+ * @return Specifies the delivery logging status
+ */
+ public abstract boolean getEnabled();
+
+ @SerializedNames({ "enabled" })
+ private static LogDelivery create(boolean enabled) {
+ return builder().enabled(enabled).build();
+ }
+
+ public static Builder builder() {
+ return new AutoValue_LogDelivery.Builder();
+ }
+
+ public Builder toBuilder() {
+ return builder().enabled(getEnabled());
+ }
+
+ public static final class Builder {
+ private boolean enabled;
+
+ Builder() {
+ }
+
+ Builder(LogDelivery source) {
+ enabled(source.getEnabled());
+ }
+
+ public LogDelivery.Builder enabled(boolean enabled) {
+ this.enabled = enabled;
+ return this;
+ }
+
+ public LogDelivery build() {
+ LogDelivery result = new AutoValue_LogDelivery(this.enabled);
+ return result;
+ }
+ }
+}
diff --git a/openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/domain/Service.java b/openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/domain/Service.java
index c42778c..9c973ad 100644
--- a/openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/domain/Service.java
+++ b/openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/domain/Service.java
@@ -85,11 +85,16 @@
*/
public abstract Set<Link> getLinks();
+ /**
+ * @return Specifies the delivery logging
+ */
+ public abstract LogDelivery getLogDelivery();
+
@SerializedNames({ "id", "name", "domains", "origins", "caching", "restrictions", "flavor_id",
- "status", "errors", "links" })
+ "status", "errors", "links", "log_delivery" })
private static Service create(String id, String name, List<Domain> domains,
List<Origin> origins, List<Caching> caching, List<Restriction> restrictions,
- String flavorId, ServiceStatus status, List<Error> errors, Set<Link> links) {
+ String flavorId, ServiceStatus status, List<Error> errors, Set<Link> links, LogDelivery logDelivery) {
return new AutoValue_Service(
id,
name,
@@ -100,7 +105,8 @@
flavorId,
status,
errors != null ? ImmutableList.copyOf(errors) : null,
- ImmutableSet.copyOf(links));
+ ImmutableSet.copyOf(links),
+ logDelivery);
}
public UpdateService.Builder toUpdatableService() {
diff --git a/openstack-poppy/src/test/java/org/jclouds/openstack/poppy/v1/features/ServiceApiLiveTest.java b/openstack-poppy/src/test/java/org/jclouds/openstack/poppy/v1/features/ServiceApiLiveTest.java
index 9abf2b3..0c75a80 100644
--- a/openstack-poppy/src/test/java/org/jclouds/openstack/poppy/v1/features/ServiceApiLiveTest.java
+++ b/openstack-poppy/src/test/java/org/jclouds/openstack/poppy/v1/features/ServiceApiLiveTest.java
@@ -27,6 +27,7 @@
import org.jclouds.openstack.poppy.v1.domain.Caching;
import org.jclouds.openstack.poppy.v1.domain.CreateService;
import org.jclouds.openstack.poppy.v1.domain.Domain;
+import org.jclouds.openstack.poppy.v1.domain.LogDelivery;
import org.jclouds.openstack.poppy.v1.domain.Origin;
import org.jclouds.openstack.poppy.v1.domain.Restriction;
import org.jclouds.openstack.poppy.v1.domain.RestrictionRule;
@@ -74,6 +75,7 @@
.build())).build()))
.caching(ImmutableList.of(Caching.builder().name("default").ttl(3600).build()))
.flavorId(flavorApi.list().first().get().getId())
+ .logDelivery(LogDelivery.builder().enabled(false).build())
.build()
);
diff --git a/openstack-poppy/src/test/java/org/jclouds/openstack/poppy/v1/features/ServiceApiMockTest.java b/openstack-poppy/src/test/java/org/jclouds/openstack/poppy/v1/features/ServiceApiMockTest.java
index d487a19..dca0932 100644
--- a/openstack-poppy/src/test/java/org/jclouds/openstack/poppy/v1/features/ServiceApiMockTest.java
+++ b/openstack-poppy/src/test/java/org/jclouds/openstack/poppy/v1/features/ServiceApiMockTest.java
@@ -30,6 +30,7 @@
import org.jclouds.openstack.poppy.v1.domain.Caching;
import org.jclouds.openstack.poppy.v1.domain.CreateService;
import org.jclouds.openstack.poppy.v1.domain.Domain;
+import org.jclouds.openstack.poppy.v1.domain.LogDelivery;
import org.jclouds.openstack.poppy.v1.domain.Origin;
import org.jclouds.openstack.poppy.v1.domain.Restriction;
import org.jclouds.openstack.poppy.v1.domain.RestrictionRule;
@@ -77,6 +78,7 @@
.caching(ImmutableList.of(
Caching.builder().name("default").ttl(3600).build()))
.flavorId("cdn")
+ .logDelivery(LogDelivery.builder().enabled(false).build())
.build();
URI uri = api.create(options);
diff --git a/openstack-poppy/src/test/resources/poppy_service_create_request.json b/openstack-poppy/src/test/resources/poppy_service_create_request.json
index f84c47a..1f745ba 100644
--- a/openstack-poppy/src/test/resources/poppy_service_create_request.json
+++ b/openstack-poppy/src/test/resources/poppy_service_create_request.json
@@ -32,5 +32,9 @@
"ttl": 3600
}
],
- "flavor_id": "cdn"
+ "flavor_id": "cdn",
+ "log_delivery":
+ {
+ "enabled": false
+ }
}
diff --git a/openstack-poppy/src/test/resources/poppy_service_get_response.json b/openstack-poppy/src/test/resources/poppy_service_get_response.json
index 3e6ead9..f893053 100644
--- a/openstack-poppy/src/test/resources/poppy_service_get_response.json
+++ b/openstack-poppy/src/test/resources/poppy_service_get_response.json
@@ -53,6 +53,10 @@
}
],
"flavor_id": "cdn",
+ "log_delivery":
+ {
+ "enabled": false
+ },
"status": "deployed",
"errors": [],
"links": [
diff --git a/openstack-poppy/src/test/resources/poppy_service_list_response_paged1.json b/openstack-poppy/src/test/resources/poppy_service_list_response_paged1.json
index 44dcfca..d1dcfe5 100644
--- a/openstack-poppy/src/test/resources/poppy_service_list_response_paged1.json
+++ b/openstack-poppy/src/test/resources/poppy_service_list_response_paged1.json
@@ -63,6 +63,10 @@
}
],
"flavor_id": "asia",
+ "log_delivery":
+ {
+ "enabled": false
+ },
"status": "deployed",
"errors" : [],
"links": [
@@ -115,6 +119,10 @@
"restrictions": [
],
"flavor_id": "europe",
+ "log_delivery":
+ {
+ "enabled": false
+ },
"status": "deployed",
"links": [
{
diff --git a/openstack-poppy/src/test/resources/poppy_service_list_response_paged2.json b/openstack-poppy/src/test/resources/poppy_service_list_response_paged2.json
index 0edcbce..bc580f3 100644
--- a/openstack-poppy/src/test/resources/poppy_service_list_response_paged2.json
+++ b/openstack-poppy/src/test/resources/poppy_service_list_response_paged2.json
@@ -59,6 +59,10 @@
}
],
"flavor_id": "asia",
+ "log_delivery":
+ {
+ "enabled": false
+ },
"status": "deployed",
"errors" : [],
"links": [
@@ -111,6 +115,10 @@
"restrictions": [
],
"flavor_id": "europe",
+ "log_delivery":
+ {
+ "enabled": false
+ },
"status": "deployed",
"links": [
{