The Report API for Rackspace Cloud Load Balancers.

This commit is contained in:
Everett Toews 2013-01-26 14:11:03 -06:00
parent e18ef518fb
commit 96f98c4fc4
23 changed files with 2668 additions and 2 deletions

View File

@ -32,6 +32,7 @@ import org.jclouds.rackspace.cloudloadbalancers.features.ErrorPageApi;
import org.jclouds.rackspace.cloudloadbalancers.features.HealthMonitorApi;
import org.jclouds.rackspace.cloudloadbalancers.features.LoadBalancerApi;
import org.jclouds.rackspace.cloudloadbalancers.features.NodeApi;
import org.jclouds.rackspace.cloudloadbalancers.features.ReportApi;
import org.jclouds.rackspace.cloudloadbalancers.features.SSLTerminationApi;
import org.jclouds.rackspace.cloudloadbalancers.features.SessionPersistenceApi;
import org.jclouds.rackspace.cloudloadbalancers.features.VirtualIPApi;
@ -56,7 +57,7 @@ public interface CloudLoadBalancersApi {
Set<String> getConfiguredZones();
/**
* Provides synchronous access to LoadBalancer features.
* Provides synchronous access to Load Balancer features.
*/
@Delegate
LoadBalancerApi getLoadBalancerApiForZone(
@ -133,4 +134,11 @@ public interface CloudLoadBalancersApi {
@Path("/loadbalancers/{lbId}")
ErrorPageApi getErrorPageApiForZoneAndLoadBalancer(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone, @PathParam("lbId") int lbId);
/**
* Provides synchronous access to Report features.
*/
@Delegate
ReportApi getReportApiForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
}

View File

@ -33,6 +33,7 @@ import org.jclouds.rackspace.cloudloadbalancers.features.ErrorPageAsyncApi;
import org.jclouds.rackspace.cloudloadbalancers.features.HealthMonitorAsyncApi;
import org.jclouds.rackspace.cloudloadbalancers.features.LoadBalancerAsyncApi;
import org.jclouds.rackspace.cloudloadbalancers.features.NodeAsyncApi;
import org.jclouds.rackspace.cloudloadbalancers.features.ReportAsyncApi;
import org.jclouds.rackspace.cloudloadbalancers.features.SSLTerminationAsyncApi;
import org.jclouds.rackspace.cloudloadbalancers.features.SessionPersistenceAsyncApi;
import org.jclouds.rackspace.cloudloadbalancers.features.VirtualIPAsyncApi;
@ -134,4 +135,11 @@ public interface CloudLoadBalancersAsyncApi {
@Path("/loadbalancers/{lbId}")
ErrorPageAsyncApi getErrorPageApiForZoneAndLoadBalancer(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone, @PathParam("lbId") int lbId);
/**
* Provides asynchronous access to Report features.
*/
@Delegate
ReportAsyncApi getReportApiForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
}

View File

@ -42,6 +42,8 @@ import org.jclouds.rackspace.cloudloadbalancers.features.LoadBalancerAsyncApi;
import org.jclouds.rackspace.cloudloadbalancers.features.LoadBalancerApi;
import org.jclouds.rackspace.cloudloadbalancers.features.NodeAsyncApi;
import org.jclouds.rackspace.cloudloadbalancers.features.NodeApi;
import org.jclouds.rackspace.cloudloadbalancers.features.ReportApi;
import org.jclouds.rackspace.cloudloadbalancers.features.ReportAsyncApi;
import org.jclouds.rackspace.cloudloadbalancers.features.SSLTerminationApi;
import org.jclouds.rackspace.cloudloadbalancers.features.SSLTerminationAsyncApi;
import org.jclouds.rackspace.cloudloadbalancers.features.SessionPersistenceApi;
@ -76,6 +78,7 @@ public class CloudLoadBalancersRestClientModule extends
.put(ContentCachingApi.class, ContentCachingAsyncApi.class)
.put(SSLTerminationApi.class, SSLTerminationAsyncApi.class)
.put(ErrorPageApi.class, ErrorPageAsyncApi.class)
.put(ReportApi.class, ReportAsyncApi.class)
.build();
public CloudLoadBalancersRestClientModule() {

View File

@ -0,0 +1,94 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.domain;
import static com.google.common.base.Preconditions.checkNotNull;
import java.beans.ConstructorProperties;
import java.util.Date;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
/**
* @author Everett Toews
*/
public final class AccountUsage {
private int numPublicVIPs;
private int numServiceNetVIPs;
private int numLoadBalancers;
private Date startTime;
private Optional<Date> endTime;
@ConstructorProperties({ "numPublicVips", "numServicenetVips", "numLoadBalancers", "startTime", "endTime" })
protected AccountUsage(int numPublicVIPs, int numServiceNetVIPs, int numLoadBalancers, Date startTime, Date endTime) {
this.numPublicVIPs = numPublicVIPs;
this.numServiceNetVIPs = numServiceNetVIPs;
this.numLoadBalancers = numLoadBalancers;
this.startTime = checkNotNull(startTime, "startTime");
this.endTime = Optional.fromNullable(endTime);
}
public int getNumPublicVIPs() {
return numPublicVIPs;
}
public int getNumServiceNetVIPs() {
return numServiceNetVIPs;
}
public int getNumLoadBalancers() {
return numLoadBalancers;
}
public Date getStartTime() {
return startTime;
}
public Optional<Date> getEndTime() {
return endTime;
}
@Override
public int hashCode() {
return Objects.hashCode(numPublicVIPs, numServiceNetVIPs, numLoadBalancers, startTime, endTime);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null || getClass() != obj.getClass())
return false;
AccountUsage that = AccountUsage.class.cast(obj);
return Objects.equal(this.numPublicVIPs, that.numPublicVIPs)
&& Objects.equal(this.numServiceNetVIPs, that.numServiceNetVIPs)
&& Objects.equal(this.numLoadBalancers, that.numLoadBalancers)
&& Objects.equal(this.startTime, that.startTime)
&& Objects.equal(this.endTime, that.endTime);
}
@Override
public String toString() {
return Objects.toStringHelper(this).omitNullValues().add("numPublicVIPs", numPublicVIPs)
.add("numServiceNetVIPs", numServiceNetVIPs).add("numLoadBalancers", numLoadBalancers)
.add("startTime", startTime).add("endTime", endTime.orNull()).toString();
}
}

View File

@ -0,0 +1,78 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.domain;
import static com.google.common.base.Preconditions.checkNotNull;
import java.beans.ConstructorProperties;
import java.util.Map;
import com.google.common.base.Objects;
import com.google.common.collect.Iterables;
/**
* @author Everett Toews
*/
public final class HistoricalUsage {
private int accountId;
private Map<String, Iterable<AccountUsage>> accountUsage;
private Iterable<LoadBalancerInfo> loadBalancerUsages;
@ConstructorProperties({ "accountId", "accountUsage", "loadBalancerUsages" })
protected HistoricalUsage(int accountId, Map<String, Iterable<AccountUsage>> accountUsage,
Iterable<LoadBalancerInfo> loadBalancerUsages) {
this.accountId = accountId;
this.accountUsage = checkNotNull(accountUsage, "accountUsage");
this.loadBalancerUsages = checkNotNull(loadBalancerUsages, "loadBalancerUsages");
}
public int getAccountId() {
return accountId;
}
public Iterable<AccountUsage> getAccountUsage() {
return Iterables.get(accountUsage.values(), 0);
}
public Iterable<LoadBalancerInfo> getLoadBalancerInfo() {
return loadBalancerUsages;
}
@Override
public int hashCode() {
return Objects.hashCode(accountId);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null || getClass() != obj.getClass())
return false;
HistoricalUsage that = HistoricalUsage.class.cast(obj);
return Objects.equal(this.accountId, that.accountId);
}
@Override
public String toString() {
return Objects.toStringHelper(this).omitNullValues().add("accountId", accountId)
.add("accountUsage", getAccountUsage()).add("loadBalancerInfo", loadBalancerUsages).toString();
}
}

View File

@ -0,0 +1,75 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.domain;
import static com.google.common.base.Preconditions.checkNotNull;
import java.beans.ConstructorProperties;
import com.google.common.base.Objects;
/**
* @author Everett Toews
*/
public final class LoadBalancerInfo {
private int loadBalancerId;
private String loadBalancerName;
private Iterable<LoadBalancerUsage> loadBalancerUsageRecords;
@ConstructorProperties({ "loadBalancerId", "loadBalancerName", "loadBalancerUsageRecords" })
protected LoadBalancerInfo(int port, String name, Iterable<LoadBalancerUsage> loadBalancerUsageRecords) {
this.loadBalancerId = port;
this.loadBalancerName = checkNotNull(name, "name");
this.loadBalancerUsageRecords = checkNotNull(loadBalancerUsageRecords, "loadBalancerUsageRecords");
}
public int getLoadBalancerId() {
return loadBalancerId;
}
public String getLoadBalancerName() {
return loadBalancerName;
}
public Iterable<LoadBalancerUsage> getLoadBalancerUsage() {
return loadBalancerUsageRecords;
}
@Override
public int hashCode() {
return Objects.hashCode(loadBalancerId);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null || getClass() != obj.getClass())
return false;
LoadBalancerInfo that = LoadBalancerInfo.class.cast(obj);
return Objects.equal(this.loadBalancerId, that.loadBalancerId);
}
@Override
public String toString() {
return Objects.toStringHelper(this).omitNullValues().add("loadBalancerId", loadBalancerId)
.add("loadBalancerName", loadBalancerName).add("loadBalancerUsage", loadBalancerUsageRecords).toString();
}
}

View File

@ -0,0 +1,96 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.domain;
import java.beans.ConstructorProperties;
import com.google.common.base.Objects;
/**
* @author Everett Toews
*/
public final class LoadBalancerStats {
private int connectTimeOut;
private int connectError;
private int connectFailure;
private int dataTimedOut;
private int keepAliveTimedOut;
private int maxConn;
@ConstructorProperties({ "connectTimeOut", "connectError", "connectFailure", "dataTimedOut", "keepAliveTimedOut",
"maxConn" })
protected LoadBalancerStats(int connectTimeOut, int connectError, int connectFailure, int dataTimedOut,
int keepAliveTimedOut, int maxConn) {
this.connectTimeOut = connectTimeOut;
this.connectError = connectError;
this.connectFailure = connectFailure;
this.dataTimedOut = dataTimedOut;
this.keepAliveTimedOut = keepAliveTimedOut;
this.maxConn = maxConn;
}
/**
* Connections closed by this load balancer because the 'connect_timeout' interval was exceeded.
*/
public int getConnectTimeOut() {
return connectTimeOut;
}
/**
* Number of transaction or protocol errors in this load balancer.
*/
public int getConnectError() {
return connectError;
}
/**
* Number of connection failures in this load balancer.
*/
public int getConnectFailure() {
return connectFailure;
}
/**
* Connections closed by this load balancer because the 'timeout' interval was exceeded.
*/
public int getDataTimedOut() {
return dataTimedOut;
}
/**
* Connections closed by this load balancer because the 'keepalive_timeout' interval was exceeded.
*/
public int getKeepAliveTimedOut() {
return keepAliveTimedOut;
}
/**
* Maximum number of simultaneous TCP connections this load balancer has processed at any one time.
*/
public int getMaxConn() {
return maxConn;
}
@Override
public String toString() {
return Objects.toStringHelper(this).omitNullValues().add("connectTimeOut", connectTimeOut)
.add("connectError", connectError).add("connectFailure", connectFailure).add("dataTimedOut", dataTimedOut)
.add("keepAliveTimedOut", keepAliveTimedOut).add("maxConn", maxConn).toString();
}
}

View File

@ -0,0 +1,157 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.domain;
import static com.google.common.base.Preconditions.checkNotNull;
import java.beans.ConstructorProperties;
import java.util.Date;
import org.jclouds.rackspace.cloudloadbalancers.domain.VirtualIP.Type;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
/**
* @author Everett Toews
*/
public final class LoadBalancerUsage {
private int id;
private float averageNumConnections;
private float averageNumConnectionsSsl;
private int incomingTransferInBytes;
private int outgoingTransferInBytes;
private int incomingTransferSslInBytes;
private int outgoingTransferSslInBytes;
private int numVIPs;
private int numPolls;
private Date startTime;
private Date endTime;
private VirtualIP.Type vipType;
private String sslMode;
private Optional<String> eventType;
@ConstructorProperties({ "id", "averageNumConnections", "averageNumConnectionsSsl", "incomingTransfer",
"outgoingTransfer", "incomingTransferSsl", "outgoingTransferSsl", "numVips", "numPolls", "startTime",
"endTime", "vipType", "sslMode", "eventType" })
protected LoadBalancerUsage(int id, float averageNumConnections, float averageNumConnectionsSsl,
int incomingTransferInBytes, int outgoingTransferInBytes, int incomingTransferSslInBytes,
int outgoingTransferSslInBytes, int numVIPs, int numPolls, Date startTime, Date endTime, Type vipType,
String sslMode, String eventType) {
this.id = id;
this.averageNumConnections = averageNumConnections;
this.averageNumConnectionsSsl = averageNumConnectionsSsl;
this.incomingTransferInBytes = incomingTransferInBytes;
this.outgoingTransferInBytes = outgoingTransferInBytes;
this.incomingTransferSslInBytes = incomingTransferSslInBytes;
this.outgoingTransferSslInBytes = outgoingTransferSslInBytes;
this.numVIPs = numVIPs;
this.numPolls = numPolls;
this.startTime = checkNotNull(startTime, "startTime");
this.endTime = checkNotNull(endTime, "endTime");
this.vipType = checkNotNull(vipType, "vipType");
this.sslMode = checkNotNull(sslMode, "sslMode");
this.eventType = Optional.fromNullable(eventType);
}
public int getId() {
return id;
}
public float getAverageNumConnections() {
return averageNumConnections;
}
public float getAverageNumConnectionsSsl() {
return averageNumConnectionsSsl;
}
public int getIncomingTransferInBytes() {
return incomingTransferInBytes;
}
public int getOutgoingTransferInBytes() {
return outgoingTransferInBytes;
}
public int getIncomingTransferSslInBytes() {
return incomingTransferSslInBytes;
}
public int getOutgoingTransferSslInBytes() {
return outgoingTransferSslInBytes;
}
public int getNumVIPs() {
return numVIPs;
}
public int getNumPolls() {
return numPolls;
}
public Date getStartTime() {
return startTime;
}
public Date getEndTime() {
return endTime;
}
public VirtualIP.Type getVIPType() {
return vipType;
}
public String getSSLMode() {
return sslMode;
}
public Optional<String> getEventType() {
return eventType;
}
@Override
public int hashCode() {
return Objects.hashCode(id);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null || getClass() != obj.getClass())
return false;
LoadBalancerUsage that = LoadBalancerUsage.class.cast(obj);
return Objects.equal(this.id, that.id);
}
@Override
public String toString() {
return Objects.toStringHelper(this).omitNullValues()
.add("averageNumConnections", averageNumConnections)
.add("averageNumConnectionsSsl", averageNumConnectionsSsl)
.add("incomingTransferInBytes", incomingTransferInBytes)
.add("outgoingTransferInBytes", outgoingTransferInBytes)
.add("incomingTransferSslInBytes", incomingTransferSslInBytes)
.add("outgoingTransferSslInBytes", outgoingTransferSslInBytes).add("numVIPs", numVIPs)
.add("numPolls", numPolls).add("startTime", startTime).add("endTime", endTime).add("vipType", vipType)
.add("sslMode", sslMode).add("eventType", eventType.orNull()).toString();
}
}

View File

@ -0,0 +1,68 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.domain;
import static com.google.common.base.Preconditions.checkNotNull;
import java.beans.ConstructorProperties;
import com.google.common.base.Objects;
/**
* @author Everett Toews
*/
public final class Protocol {
private String name;
private int port;
@ConstructorProperties({ "name", "port" })
protected Protocol(String name, int port) {
this.name = checkNotNull(name, "name");
this.port = checkNotNull(port, "port");
}
public String getName() {
return name;
}
public int getPort() {
return port;
}
@Override
public int hashCode() {
return Objects.hashCode(name, port);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null || getClass() != obj.getClass())
return false;
Protocol that = Protocol.class.cast(obj);
return Objects.equal(this.name, that.name) && Objects.equal(this.port, that.port);
}
@Override
public String toString() {
return Objects.toStringHelper(this).omitNullValues().add("name", name).add("port", port).toString();
}
}

View File

@ -0,0 +1,82 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.features;
import java.util.Date;
import org.jclouds.collect.IterableWithMarker;
import org.jclouds.collect.PagedIterable;
import org.jclouds.openstack.v2_0.options.PaginationOptions;
import org.jclouds.rackspace.cloudloadbalancers.domain.HistoricalUsage;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancer;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancerStats;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancerUsage;
import org.jclouds.rackspace.cloudloadbalancers.domain.Protocol;
/**
*
* <p/>
* @see ReportAsyncApi
* @author Everett Toews
*/
public interface ReportApi {
/**
* List billable load balancers for the given date range.
*/
PagedIterable<LoadBalancer> listBillableLoadBalancers(Date startTime, Date endTime);
IterableWithMarker<LoadBalancer> listBillableLoadBalancers(PaginationOptions options);
/**
* View of all transfer activity, average number of connections, and number of virtual IPs associated with the load
* balancing service. Historical usage data is available for up to 90 days of service activity.
*/
HistoricalUsage getHistoricalUsage(Date startTime, Date endTime);
/**
* Historical usage data is available for up to 90 days of service activity.
*/
PagedIterable<LoadBalancerUsage> listLoadBalancerUsage(int loadBalancerId, Date startTime, Date endTime);
IterableWithMarker<LoadBalancerUsage> listLoadBalancerUsage(PaginationOptions options);
/**
* Current usage represents all usage recorded within the preceding 24 hours.
*/
PagedIterable<LoadBalancerUsage> listCurrentLoadBalancerUsage(int loadBalancerId);
IterableWithMarker<LoadBalancerUsage> listCurrentLoadBalancerUsage(PaginationOptions options);
/**
* Current usage represents all usage recorded within the preceding 24 hours.
*/
LoadBalancerStats getLoadBalancerStats(int loadBalancerId);
/**
* All load balancers must define the protocol of the service which is being load balanced. The protocol selection
* should be based on the protocol of the back-end nodes. When configuring a load balancer, the default port for
* the given protocol will be selected from this list unless otherwise specified.
*/
Iterable<Protocol> listProtocols();
/**
* Get all of the possible algorthims usable by load balancers.
*/
Iterable<String> listAlgorithms();
}

View File

@ -0,0 +1,183 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.features;
import java.util.Date;
import javax.inject.Named;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import org.jclouds.Fallbacks.NullOnNotFoundOr404;
import org.jclouds.collect.IterableWithMarker;
import org.jclouds.collect.PagedIterable;
import org.jclouds.openstack.keystone.v2_0.KeystoneFallbacks.EmptyPaginatedCollectionOnNotFoundOr404;
import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
import org.jclouds.openstack.v2_0.options.PaginationOptions;
import org.jclouds.rackspace.cloudloadbalancers.domain.HistoricalUsage;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancer;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancerStats;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancerUsage;
import org.jclouds.rackspace.cloudloadbalancers.domain.Protocol;
import org.jclouds.rackspace.cloudloadbalancers.functions.DateParser;
import org.jclouds.rackspace.cloudloadbalancers.functions.ParseAlgorithms;
import org.jclouds.rackspace.cloudloadbalancers.functions.ParseLoadBalancerUsages;
import org.jclouds.rackspace.cloudloadbalancers.functions.ParseLoadBalancers;
import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.ParamParser;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.ResponseParser;
import org.jclouds.rest.annotations.SelectJson;
import org.jclouds.rest.annotations.Transform;
import com.google.common.util.concurrent.ListenableFuture;
/**
* Provides asynchronous access to Rackspace Cloud Load Balancers via their REST API.
* <p/>
*
* @see ReportApi
* @author Everett Toews
*/
@RequestFilters(AuthenticateRequest.class)
public interface ReportAsyncApi {
/**
* @see ReportApi#listBillableLoadBalancers(Date, Date)
*/
@Named("report:list")
@GET
@Consumes(MediaType.APPLICATION_JSON)
@ResponseParser(ParseLoadBalancers.class)
@Transform(ParseLoadBalancers.ToPagedIterable.class)
@Fallback(NullOnNotFoundOr404.class)
@Path("/loadbalancers/billable")
ListenableFuture<PagedIterable<LoadBalancer>> listBillableLoadBalancers(
@ParamParser(DateParser.class) @QueryParam("startTime") Date startTime,
@ParamParser(DateParser.class) @QueryParam("endTime") Date endTime);
/**
* @see ReportApi#listBillableLoadBalancers(PaginationOptions)
*/
@Named("report:list")
@GET
@ResponseParser(ParseLoadBalancers.class)
@Consumes(MediaType.APPLICATION_JSON)
@Fallback(EmptyPaginatedCollectionOnNotFoundOr404.class)
@Path("/loadbalancers/billable")
ListenableFuture<IterableWithMarker<LoadBalancer>> listBillableLoadBalancers(PaginationOptions options);
/**
* @see ReportApi#getHistoricalUsage(Date, Date)
*/
@Named("report:list")
@GET
@Consumes(MediaType.APPLICATION_JSON)
@Fallback(NullOnNotFoundOr404.class)
@Path("/loadbalancers/usage")
ListenableFuture<HistoricalUsage> getHistoricalUsage(
@ParamParser(DateParser.class) @QueryParam("startTime") Date startTime,
@ParamParser(DateParser.class) @QueryParam("endTime") Date endTime);
/**
* @see ReportApi#listLoadBalancerUsage(int, Date, Date)
*/
@Named("report:list")
@GET
@Consumes(MediaType.APPLICATION_JSON)
@ResponseParser(ParseLoadBalancerUsages.class)
@Transform(ParseLoadBalancerUsages.ToPagedIterable.class)
@Fallback(NullOnNotFoundOr404.class)
@Path("/loadbalancers/{id}/usage")
ListenableFuture<PagedIterable<LoadBalancerUsage>> listLoadBalancerUsage(
@PathParam("id") int loadBalancerId,
@ParamParser(DateParser.class) @QueryParam("startTime") Date startTime,
@ParamParser(DateParser.class) @QueryParam("endTime") Date endTime);
/**
* @see ReportApi#listLoadBalancerUsage(PaginationOptions)
*/
@Named("report:list")
@GET
@ResponseParser(ParseLoadBalancerUsages.class)
@Consumes(MediaType.APPLICATION_JSON)
@Fallback(EmptyPaginatedCollectionOnNotFoundOr404.class)
@Path("/loadbalancers/{id}/usage")
ListenableFuture<IterableWithMarker<LoadBalancerUsage>> listLoadBalancerUsage(PaginationOptions options);
/**
* @see ReportApi#listCurrentLoadBalancerUsage(int)
*/
@Named("report:list")
@GET
@Consumes(MediaType.APPLICATION_JSON)
@ResponseParser(ParseLoadBalancerUsages.class)
@Transform(ParseLoadBalancerUsages.ToPagedIterable.class)
@Fallback(NullOnNotFoundOr404.class)
@Path("/loadbalancers/{id}/usage/current")
ListenableFuture<PagedIterable<LoadBalancerUsage>> listCurrentLoadBalancerUsage(
@PathParam("id") int loadBalancerId);
/**
* @see ReportApi#listCurrentLoadBalancerUsage(PaginationOptions)
*/
@Named("report:list")
@GET
@ResponseParser(ParseLoadBalancerUsages.class)
@Consumes(MediaType.APPLICATION_JSON)
@Fallback(EmptyPaginatedCollectionOnNotFoundOr404.class)
@Path("/loadbalancers/{id}/usage/current")
ListenableFuture<IterableWithMarker<LoadBalancerUsage>> listCurrentLoadBalancerUsage(PaginationOptions options);
/**
* @see ReportApi#getLoadBalancerStats(int)
*/
@Named("report:list")
@GET
@Consumes(MediaType.APPLICATION_JSON)
@Fallback(NullOnNotFoundOr404.class)
@Path("/loadbalancers/{id}/stats")
ListenableFuture<LoadBalancerStats> getLoadBalancerStats(
@PathParam("id") int loadBalancerId);
/**
* @see ReportApi#listProtocols()
*/
@Named("report:list")
@GET
@Consumes(MediaType.APPLICATION_JSON)
@SelectJson("protocols")
@Fallback(NullOnNotFoundOr404.class)
@Path("/loadbalancers/protocols")
ListenableFuture<Iterable<Protocol>> listProtocols();
/**
* @see ReportApi#listAlgorithms()
*/
@Named("report:list")
@GET
@Consumes(MediaType.APPLICATION_JSON)
@ResponseParser(ParseAlgorithms.class)
@Fallback(NullOnNotFoundOr404.class)
@Path("/loadbalancers/algorithms")
ListenableFuture<Iterable<String>> listAlgorithms();
}

View File

@ -71,7 +71,7 @@ public interface SSLTerminationApi {
* If a user wants to replace the existing SSL configuration, a new certificate, privatekey, and securePort
* combination must be provided instead of, or in addition to, the optional/editable attributes.
*/
void createOrUpdate(SSLTermination healthMonitor);
void createOrUpdate(SSLTermination sslTermination);
/**
* Get SSL termination info.

View File

@ -0,0 +1,48 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.functions;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.inject.Singleton;
import com.google.common.base.Function;
/**
* Takes a Date and return a yyyy-MM-dd String.
*
* @author Everett Toews
*/
@Singleton
public class DateParser implements Function<Object, String> {
@Override
public String apply(Object input) {
checkArgument(checkNotNull(input, "input") instanceof Date, "This function is only valid for Dates!");
Date date = Date.class.cast(input);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
return format.format(date);
}
}

View File

@ -0,0 +1,71 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.functions;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse;
import org.jclouds.http.HttpResponseException;
import org.jclouds.http.functions.ParseJson;
import org.jclouds.rest.InvocationContext;
import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
/**
* @author Everett Toews
*/
public class ParseAlgorithms implements Function<HttpResponse, List<String>>, InvocationContext<ParseAlgorithms> {
private final ParseJson<Map<String, List<Map<String, String>>>> json;
@Inject
ParseAlgorithms(ParseJson<Map<String, List<Map<String, String>>>> json) {
this.json = checkNotNull(json, "json");
}
@Override
public List<String> apply(HttpResponse response) {
Map<String, List<Map<String, String>>> map = json.apply(response);
if (map == null || map.size() == 0)
throw new HttpResponseException("Unexpected JSON format returned.", null, response);
List<Map<String, String>> list = Iterables.get(map.values(), 0);
List<String> algorithms = Lists.newArrayList();
for (Map<String, String> nameAlgorithmPair: list) {
algorithms.add(Iterables.get(nameAlgorithmPair.values(), 0));
}
return algorithms;
}
@Override
public ParseAlgorithms setContext(HttpRequest request) {
return this;
}
}

View File

@ -0,0 +1,94 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.functions;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.openstack.v2_0.options.PaginationOptions.Builder.marker;
import java.beans.ConstructorProperties;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.collect.IterableWithMarker;
import org.jclouds.collect.internal.CallerArg0ToPagedIterable;
import org.jclouds.http.functions.ParseJson;
import org.jclouds.json.Json;
import org.jclouds.openstack.keystone.v2_0.domain.PaginatedCollection;
import org.jclouds.openstack.v2_0.domain.Link;
import org.jclouds.rackspace.cloudloadbalancers.CloudLoadBalancersApi;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancerUsage;
import org.jclouds.rackspace.cloudloadbalancers.features.ReportApi;
import org.jclouds.rackspace.cloudloadbalancers.functions.ParseLoadBalancerUsages.LoadBalancerUsages;
import com.google.common.base.Function;
import com.google.inject.TypeLiteral;
/**
* boiler plate until we determine a better way
*
* @author Everett Toews
*/
@Singleton
public class ParseLoadBalancerUsages extends ParseJson<LoadBalancerUsages> {
@Inject
public ParseLoadBalancerUsages(Json json) {
super(json, TypeLiteral.get(LoadBalancerUsages.class));
}
static class LoadBalancerUsages extends PaginatedCollection<LoadBalancerUsage> {
@ConstructorProperties({ "loadBalancerUsageRecords", "links" })
protected LoadBalancerUsages(Iterable<LoadBalancerUsage> loadBalancerUsageRecords, Iterable<Link> links) {
super(loadBalancerUsageRecords, links);
}
}
public static class ToPagedIterable extends CallerArg0ToPagedIterable<LoadBalancerUsage, ToPagedIterable> {
private final CloudLoadBalancersApi api;
@Inject
protected ToPagedIterable(CloudLoadBalancersApi api) {
this.api = checkNotNull(api, "api");
}
@Override
protected Function<Object, IterableWithMarker<LoadBalancerUsage>> markerToNextForCallingArg0(final String zone) {
final ReportApi reportApi = api.getReportApiForZone(zone);
return new Function<Object, IterableWithMarker<LoadBalancerUsage>>() {
@Override
public IterableWithMarker<LoadBalancerUsage> apply(Object input) {
IterableWithMarker<LoadBalancerUsage> list = reportApi.listLoadBalancerUsage(marker(input.toString()));
return list;
}
@Override
public String toString() {
return "listLoadBalancerUsage()";
}
};
}
}
}

View File

@ -0,0 +1,186 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.features;
import static org.testng.Assert.assertEquals;
import java.net.URI;
import java.util.Calendar;
import java.util.Date;
import org.jclouds.http.HttpResponse;
import org.jclouds.rackspace.cloudloadbalancers.CloudLoadBalancersApi;
import org.jclouds.rackspace.cloudloadbalancers.domain.HistoricalUsage;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancer;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancerStats;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancerUsage;
import org.jclouds.rackspace.cloudloadbalancers.domain.Protocol;
import org.jclouds.rackspace.cloudloadbalancers.functions.DateParser;
import org.jclouds.rackspace.cloudloadbalancers.internal.BaseCloudLoadBalancerApiExpectTest;
import org.testng.annotations.Test;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Iterables;
/**
* @author Everett Toews
*/
@Test(groups = "unit")
public class ReportApiExpectTest extends BaseCloudLoadBalancerApiExpectTest<CloudLoadBalancersApi> {
public void testListBillableLoadBalancers() {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, -7);
Date aWeekAgo = calendar.getTime();
Date today = new Date();
String query = new StringBuilder()
.append("?startTime=")
.append(new DateParser().apply(aWeekAgo))
.append("&endTime=")
.append(new DateParser().apply(today))
.toString();
URI endpoint = URI.create("https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/123123/loadbalancers/billable" + query);
ReportApi api = requestsSendResponses(
rackspaceAuthWithUsernameAndApiKey,
responseWithAccess,
authenticatedGET().endpoint(endpoint).build(),
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/report-billable-list.json")).build()
).getReportApiForZone("DFW");
FluentIterable<LoadBalancer> loadBalancers = api.listBillableLoadBalancers(aWeekAgo, today).concat();
assertEquals(Iterables.size(loadBalancers), 2);
}
public void testGetHistoricalUsage() {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, -7);
Date aWeekAgo = calendar.getTime();
Date today = new Date();
String query = new StringBuilder()
.append("?startTime=")
.append(new DateParser().apply(aWeekAgo))
.append("&endTime=")
.append(new DateParser().apply(today))
.toString();
URI endpoint = URI.create("https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/123123/loadbalancers/usage" + query);
ReportApi api = requestsSendResponses(
rackspaceAuthWithUsernameAndApiKey,
responseWithAccess,
authenticatedGET().endpoint(endpoint).build(),
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/report-historical-get.json")).build()
).getReportApiForZone("DFW");
HistoricalUsage historicalUsage = api.getHistoricalUsage(aWeekAgo, today);
assertEquals(historicalUsage.getAccountId(), 717071);
assertEquals(Iterables.get(historicalUsage.getAccountUsage(), 0).getNumLoadBalancers(), 2);
assertEquals(Iterables.size(historicalUsage.getLoadBalancerInfo()), 2);
}
public void testListLoadBalancerUsage() {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, -7);
Date aWeekAgo = calendar.getTime();
Date today = new Date();
String query = new StringBuilder()
.append("?startTime=")
.append(new DateParser().apply(aWeekAgo))
.append("&endTime=")
.append(new DateParser().apply(today))
.toString();
URI endpoint = URI.create("https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/123123/loadbalancers/2000/usage" + query);
ReportApi api = requestsSendResponses(
rackspaceAuthWithUsernameAndApiKey,
responseWithAccess,
authenticatedGET().endpoint(endpoint).build(),
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/report-loadbalancerusage-list.json")).build()
).getReportApiForZone("DFW");
FluentIterable<LoadBalancerUsage> loadBalancerUsages = api.listLoadBalancerUsage(2000, aWeekAgo, today).concat();
assertEquals(Iterables.size(loadBalancerUsages), 25);
}
public void testListCurrentLoadBalancerUsage() {
URI endpoint = URI.create("https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/123123/loadbalancers/2000/usage/current");
ReportApi api = requestsSendResponses(
rackspaceAuthWithUsernameAndApiKey,
responseWithAccess,
authenticatedGET().endpoint(endpoint).build(),
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/report-loadbalancerusage-list.json")).build()
).getReportApiForZone("DFW");
FluentIterable<LoadBalancerUsage> loadBalancerUsages = api.listCurrentLoadBalancerUsage(2000).concat();
assertEquals(Iterables.size(loadBalancerUsages), 25);
}
public void testGetLoadBalancerStats() {
URI endpoint = URI.create("https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/123123/loadbalancers/2000/stats");
ReportApi api = requestsSendResponses(
rackspaceAuthWithUsernameAndApiKey,
responseWithAccess,
authenticatedGET().endpoint(endpoint).build(),
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/report-loadbalancerstats-get.json")).build()
).getReportApiForZone("DFW");
LoadBalancerStats loadBalancerStats = api.getLoadBalancerStats(2000);
assertEquals(loadBalancerStats.getConnectTimeOut(), 2);
assertEquals(loadBalancerStats.getConnectError(), 0);
assertEquals(loadBalancerStats.getConnectFailure(), 0);
assertEquals(loadBalancerStats.getDataTimedOut(), 10);
assertEquals(loadBalancerStats.getKeepAliveTimedOut(), 0);
assertEquals(loadBalancerStats.getMaxConn(), 22);
}
public void testListProtocols() {
URI endpoint = URI.create("https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/123123/loadbalancers/protocols");
ReportApi api = requestsSendResponses(
rackspaceAuthWithUsernameAndApiKey,
responseWithAccess,
authenticatedGET().endpoint(endpoint).build(),
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/report-protocols-list.json")).build()
).getReportApiForZone("DFW");
Iterable<Protocol> protocols = api.listProtocols();
assertEquals(Iterables.size(protocols), 20);
}
public void testListAlgorithms() {
URI endpoint = URI.create("https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/123123/loadbalancers/algorithms");
ReportApi api = requestsSendResponses(
rackspaceAuthWithUsernameAndApiKey,
responseWithAccess,
authenticatedGET().endpoint(endpoint).build(),
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/report-algorithms-list.json")).build()
).getReportApiForZone("DFW");
Iterable<String> algorithms = api.listAlgorithms();
assertEquals(Iterables.size(algorithms), 5);
}
}

View File

@ -0,0 +1,110 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.rackspace.cloudloadbalancers.features;
import static org.jclouds.rackspace.cloudloadbalancers.predicates.LoadBalancerPredicates.awaitAvailable;
import static org.jclouds.rackspace.cloudloadbalancers.predicates.LoadBalancerPredicates.awaitDeleted;
import static org.testng.Assert.assertNotEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import java.util.Calendar;
import java.util.Date;
import org.jclouds.http.HttpResponseException;
import org.jclouds.rackspace.cloudloadbalancers.domain.HistoricalUsage;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancer;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancerRequest;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancerStats;
import org.jclouds.rackspace.cloudloadbalancers.domain.LoadBalancerUsage;
import org.jclouds.rackspace.cloudloadbalancers.domain.NodeRequest;
import org.jclouds.rackspace.cloudloadbalancers.domain.Protocol;
import org.jclouds.rackspace.cloudloadbalancers.domain.VirtualIP.Type;
import org.jclouds.rackspace.cloudloadbalancers.internal.BaseCloudLoadBalancersApiLiveTest;
import org.testng.annotations.AfterGroups;
import org.testng.annotations.Test;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Iterables;
/**
* @author Everett Toews
*/
@Test(groups = "live", singleThreaded = true, testName = "ReportApiLiveTest")
public class ReportApiLiveTest extends BaseCloudLoadBalancersApiLiveTest {
private LoadBalancer lb;
private String zone;
public void testCreateLoadBalancer() {
NodeRequest nodeRequest = NodeRequest.builder().address("192.168.1.1").port(8080).build();
LoadBalancerRequest lbRequest = LoadBalancerRequest.builder()
.name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(nodeRequest).build();
zone = Iterables.getFirst(clbApi.getConfiguredZones(), null);
lb = clbApi.getLoadBalancerApiForZone(zone).create(lbRequest);
assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(zone)).apply(lb));
}
@Test(dependsOnMethods = "testCreateLoadBalancer")
public void testReports() throws Exception {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, -1);
Date yesterday = calendar.getTime();
Date today = new Date();
FluentIterable<LoadBalancer> loadBalancers = clbApi.getReportApiForZone(zone).listBillableLoadBalancers(yesterday, today).concat();
assertNotNull(loadBalancers);
HistoricalUsage historicalUsage = clbApi.getReportApiForZone(zone).getHistoricalUsage(yesterday, today);
assertNotEquals(historicalUsage.getAccountId(), 0);
FluentIterable<LoadBalancerUsage> loadBalancerUsages = clbApi.getReportApiForZone(zone).listLoadBalancerUsage(lb.getId(), yesterday, today).concat();
assertNotNull(loadBalancerUsages);
loadBalancerUsages = clbApi.getReportApiForZone(zone).listCurrentLoadBalancerUsage(lb.getId()).concat();
assertNotNull(loadBalancerUsages);
try {
LoadBalancerStats loadBalancerStats = clbApi.getReportApiForZone(zone).getLoadBalancerStats(lb.getId());
assertNotNull(loadBalancerStats);
}
catch (HttpResponseException e) {
// CLB sometimes doesn't like it when you get stats on a newly created LB so ignore a 500
if (e.getResponse().getStatusCode() != 500) {
throw e;
}
}
Iterable<Protocol> protocols = clbApi.getReportApiForZone(zone).listProtocols();
assertTrue(!Iterables.isEmpty(protocols));
Iterable<String> algorithms = clbApi.getReportApiForZone(zone).listAlgorithms();
assertTrue(!Iterables.isEmpty(algorithms));
}
@Override
@AfterGroups(groups = "live")
protected void tearDownContext() {
assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(zone)).apply(lb));
clbApi.getLoadBalancerApiForZone(zone).remove(lb.getId());
assertTrue(awaitDeleted(clbApi.getLoadBalancerApiForZone(zone)).apply(lb));
super.tearDownContext();
}
}

View File

@ -0,0 +1,19 @@
{
"algorithms": [
{
"name": "LEAST_CONNECTIONS"
},
{
"name": "RANDOM"
},
{
"name": "ROUND_ROBIN"
},
{
"name": "WEIGHTED_LEAST_CONNECTIONS"
},
{
"name": "WEIGHTED_ROUND_ROBIN"
}
]
}

View File

@ -0,0 +1,64 @@
{
"loadBalancers": [
{
"name": "jclouds-app",
"id": 85901,
"protocol": "HTTP",
"port": 80,
"algorithm": "WEIGHTED_LEAST_CONNECTIONS",
"status": "ACTIVE",
"timeout": 30,
"created": {
"time": "2012-12-24T18:13:44Z"
},
"virtualIps": [
{
"address": "166.78.34.87",
"id": 5557,
"type": "PUBLIC",
"ipVersion": "IPV4"
},
{
"address": "2001:4800:7901:0000:9a32:3c2a:0000:0001",
"id": 9080119,
"type": "PUBLIC",
"ipVersion": "IPV6"
}
],
"updated": {
"time": "2013-01-24T17:35:56Z"
},
"nodeCount": 1
},
{
"name": "jclouds-app",
"id": 90903,
"protocol": "HTTP",
"port": 80,
"algorithm": "WEIGHTED_LEAST_CONNECTIONS",
"status": "ACTIVE",
"timeout": 30,
"created": {
"time": "2013-01-20T20:53:29Z"
},
"virtualIps": [
{
"address": "166.78.34.184",
"id": 5751,
"type": "PUBLIC",
"ipVersion": "IPV4"
},
{
"address": "2001:4800:7901:0000:9a32:3c2a:0000:0002",
"id": 9080915,
"type": "PUBLIC",
"ipVersion": "IPV6"
}
],
"updated": {
"time": "2013-01-24T21:32:42Z"
},
"nodeCount": 2
}
]
}

View File

@ -0,0 +1,750 @@
{
"accountId": 717071,
"accountUsage": {
"accountUsageRecords": [
{
"startTime": "2013-01-25T00:00:28Z",
"numLoadBalancers": 2,
"numPublicVips": 2,
"numServicenetVips": 0
}
],
"links": []
},
"loadBalancerUsages": [
{
"loadBalancerId": 85901,
"loadBalancerName": "jclouds-app",
"links": [],
"loadBalancerUsageRecords": [
{
"id": 17888041,
"startTime": "2013-01-25T00:00:00Z",
"endTime": "2013-01-25T01:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17895283,
"startTime": "2013-01-25T01:00:00Z",
"endTime": "2013-01-25T02:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17902527,
"startTime": "2013-01-25T02:00:00Z",
"endTime": "2013-01-25T03:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17909761,
"startTime": "2013-01-25T03:00:00Z",
"endTime": "2013-01-25T04:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17916995,
"startTime": "2013-01-25T04:00:00Z",
"endTime": "2013-01-25T05:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17924231,
"startTime": "2013-01-25T05:00:00Z",
"endTime": "2013-01-25T06:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17931467,
"startTime": "2013-01-25T06:00:00Z",
"endTime": "2013-01-25T07:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17938703,
"startTime": "2013-01-25T07:00:00Z",
"endTime": "2013-01-25T08:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17945951,
"startTime": "2013-01-25T08:00:00Z",
"endTime": "2013-01-25T09:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17953175,
"startTime": "2013-01-25T09:00:00Z",
"endTime": "2013-01-25T10:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 11,
"sslMode": "OFF"
},
{
"id": 17960399,
"startTime": "2013-01-25T10:00:00Z",
"endTime": "2013-01-25T11:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17967623,
"startTime": "2013-01-25T11:00:00Z",
"endTime": "2013-01-25T12:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17974855,
"startTime": "2013-01-25T12:00:00Z",
"endTime": "2013-01-25T13:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17982103,
"startTime": "2013-01-25T13:00:00Z",
"endTime": "2013-01-25T14:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17989349,
"startTime": "2013-01-25T14:00:00Z",
"endTime": "2013-01-25T15:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17996607,
"startTime": "2013-01-25T15:00:00Z",
"endTime": "2013-01-25T16:00:00Z",
"numVips": 1,
"incomingTransfer": 46,
"outgoingTransfer": 368,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18003887,
"startTime": "2013-01-25T16:00:00Z",
"endTime": "2013-01-25T17:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18011157,
"startTime": "2013-01-25T17:00:00Z",
"endTime": "2013-01-25T18:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18018437,
"startTime": "2013-01-25T18:00:00Z",
"endTime": "2013-01-25T19:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18025709,
"startTime": "2013-01-25T19:00:00Z",
"endTime": "2013-01-25T20:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18033013,
"startTime": "2013-01-25T20:00:00Z",
"endTime": "2013-01-25T21:00:00Z",
"numVips": 1,
"incomingTransfer": 847,
"outgoingTransfer": 2328,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18040267,
"startTime": "2013-01-25T21:00:00Z",
"endTime": "2013-01-25T22:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18047493,
"startTime": "2013-01-25T22:00:00Z",
"endTime": "2013-01-25T23:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18054719,
"startTime": "2013-01-25T23:00:00Z",
"endTime": "2013-01-26T00:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
}
]
},
{
"loadBalancerId": 90903,
"loadBalancerName": "jclouds-app",
"links": [],
"loadBalancerUsageRecords": [
{
"id": 17887647,
"startTime": "2013-01-25T00:00:00Z",
"endTime": "2013-01-25T01:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17894889,
"startTime": "2013-01-25T01:00:00Z",
"endTime": "2013-01-25T02:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17902133,
"startTime": "2013-01-25T02:00:00Z",
"endTime": "2013-01-25T03:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17909367,
"startTime": "2013-01-25T03:00:00Z",
"endTime": "2013-01-25T04:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17916601,
"startTime": "2013-01-25T04:00:00Z",
"endTime": "2013-01-25T05:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17923837,
"startTime": "2013-01-25T05:00:00Z",
"endTime": "2013-01-25T06:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17931073,
"startTime": "2013-01-25T06:00:00Z",
"endTime": "2013-01-25T07:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17938309,
"startTime": "2013-01-25T07:00:00Z",
"endTime": "2013-01-25T08:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17945557,
"startTime": "2013-01-25T08:00:00Z",
"endTime": "2013-01-25T09:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17952781,
"startTime": "2013-01-25T09:00:00Z",
"endTime": "2013-01-25T10:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17960005,
"startTime": "2013-01-25T10:00:00Z",
"endTime": "2013-01-25T11:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17967229,
"startTime": "2013-01-25T11:00:00Z",
"endTime": "2013-01-25T12:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17974461,
"startTime": "2013-01-25T12:00:00Z",
"endTime": "2013-01-25T13:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17981709,
"startTime": "2013-01-25T13:00:00Z",
"endTime": "2013-01-25T14:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17988955,
"startTime": "2013-01-25T14:00:00Z",
"endTime": "2013-01-25T15:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17996213,
"startTime": "2013-01-25T15:00:00Z",
"endTime": "2013-01-25T16:00:00Z",
"numVips": 1,
"incomingTransfer": 46,
"outgoingTransfer": 306,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18003493,
"startTime": "2013-01-25T16:00:00Z",
"endTime": "2013-01-25T17:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18010763,
"startTime": "2013-01-25T17:00:00Z",
"endTime": "2013-01-25T18:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18018043,
"startTime": "2013-01-25T18:00:00Z",
"endTime": "2013-01-25T19:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18025315,
"startTime": "2013-01-25T19:00:00Z",
"endTime": "2013-01-25T20:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18032619,
"startTime": "2013-01-25T20:00:00Z",
"endTime": "2013-01-25T21:00:00Z",
"numVips": 1,
"incomingTransfer": 427,
"outgoingTransfer": 662,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18039873,
"startTime": "2013-01-25T21:00:00Z",
"endTime": "2013-01-25T22:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18047099,
"startTime": "2013-01-25T22:00:00Z",
"endTime": "2013-01-25T23:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18054325,
"startTime": "2013-01-25T23:00:00Z",
"endTime": "2013-01-26T00:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
}
]
}
]
}

View File

@ -0,0 +1,8 @@
{
"connectTimeOut": 2,
"connectError": 0,
"connectFailure": 0,
"dataTimedOut": 10,
"keepAliveTimedOut": 0,
"maxConn": 22
}

View File

@ -0,0 +1,380 @@
{
"links": [],
"loadBalancerUsageRecords": [
{
"id": 17887647,
"startTime": "2013-01-25T00:00:00Z",
"endTime": "2013-01-25T01:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17894889,
"startTime": "2013-01-25T01:00:00Z",
"endTime": "2013-01-25T02:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17902133,
"startTime": "2013-01-25T02:00:00Z",
"endTime": "2013-01-25T03:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17909367,
"startTime": "2013-01-25T03:00:00Z",
"endTime": "2013-01-25T04:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17916601,
"startTime": "2013-01-25T04:00:00Z",
"endTime": "2013-01-25T05:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17923837,
"startTime": "2013-01-25T05:00:00Z",
"endTime": "2013-01-25T06:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17931073,
"startTime": "2013-01-25T06:00:00Z",
"endTime": "2013-01-25T07:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17938309,
"startTime": "2013-01-25T07:00:00Z",
"endTime": "2013-01-25T08:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17945557,
"startTime": "2013-01-25T08:00:00Z",
"endTime": "2013-01-25T09:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17952781,
"startTime": "2013-01-25T09:00:00Z",
"endTime": "2013-01-25T10:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17960005,
"startTime": "2013-01-25T10:00:00Z",
"endTime": "2013-01-25T11:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17967229,
"startTime": "2013-01-25T11:00:00Z",
"endTime": "2013-01-25T12:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17974461,
"startTime": "2013-01-25T12:00:00Z",
"endTime": "2013-01-25T13:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17981709,
"startTime": "2013-01-25T13:00:00Z",
"endTime": "2013-01-25T14:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17988955,
"startTime": "2013-01-25T14:00:00Z",
"endTime": "2013-01-25T15:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 17996213,
"startTime": "2013-01-25T15:00:00Z",
"endTime": "2013-01-25T16:00:00Z",
"numVips": 1,
"incomingTransfer": 46,
"outgoingTransfer": 306,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18003493,
"startTime": "2013-01-25T16:00:00Z",
"endTime": "2013-01-25T17:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18010763,
"startTime": "2013-01-25T17:00:00Z",
"endTime": "2013-01-25T18:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18018043,
"startTime": "2013-01-25T18:00:00Z",
"endTime": "2013-01-25T19:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18025315,
"startTime": "2013-01-25T19:00:00Z",
"endTime": "2013-01-25T20:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18032619,
"startTime": "2013-01-25T20:00:00Z",
"endTime": "2013-01-25T21:00:00Z",
"numVips": 1,
"incomingTransfer": 427,
"outgoingTransfer": 662,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18039873,
"startTime": "2013-01-25T21:00:00Z",
"endTime": "2013-01-25T22:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18047099,
"startTime": "2013-01-25T22:00:00Z",
"endTime": "2013-01-25T23:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18054325,
"startTime": "2013-01-25T23:00:00Z",
"endTime": "2013-01-26T00:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
},
{
"id": 18061573,
"startTime": "2013-01-26T00:00:00Z",
"endTime": "2013-01-26T01:00:00Z",
"numVips": 1,
"incomingTransfer": 0,
"outgoingTransfer": 0,
"incomingTransferSsl": 0,
"outgoingTransferSsl": 0,
"vipType": "PUBLIC",
"averageNumConnections": 0.0,
"averageNumConnectionsSsl": 0.0,
"numPolls": 12,
"sslMode": "OFF"
}
]
}

View File

@ -0,0 +1,84 @@
{
"protocols": [
{
"name": "DNS_TCP",
"port": 53
},
{
"name": "DNS_UDP",
"port": 53
},
{
"name": "FTP",
"port": 21
},
{
"name": "HTTP",
"port": 80
},
{
"name": "HTTPS",
"port": 443
},
{
"name": "IMAPS",
"port": 993
},
{
"name": "IMAPv2",
"port": 143
},
{
"name": "IMAPv3",
"port": 220
},
{
"name": "IMAPv4",
"port": 143
},
{
"name": "LDAP",
"port": 389
},
{
"name": "LDAPS",
"port": 636
},
{
"name": "MYSQL",
"port": 3306
},
{
"name": "POP3",
"port": 110
},
{
"name": "POP3S",
"port": 995
},
{
"name": "SFTP",
"port": 22
},
{
"name": "SMTP",
"port": 25
},
{
"name": "TCP",
"port": 0
},
{
"name": "TCP_CLIENT_FIRST",
"port": 0
},
{
"name": "UDP",
"port": 0
},
{
"name": "UDP_STREAM",
"port": 0
}
]
}