Skip to content

Commit 136aaf5

Browse files
author
Jeff Hu
committed
list available cinder zone
1 parent 709a950 commit 136aaf5

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package org.openstack4j.openstack.storage.block.domain;
2+
3+
import static com.google.common.base.Objects.toStringHelper;
4+
5+
import java.util.List;
6+
7+
import org.openstack4j.openstack.common.ListResult;
8+
9+
import com.fasterxml.jackson.annotation.JsonProperty;
10+
import com.fasterxml.jackson.annotation.JsonRootName;
11+
12+
public class ExtAvailabilityZone implements AvailabilityZone {
13+
14+
private static final long serialVersionUID = 1L;
15+
16+
ExtZoneState zoneState;
17+
String zoneName;
18+
19+
/**
20+
* {@inheritDoc}
21+
*/
22+
@Override
23+
public ZoneState getZoneState() {
24+
return zoneState;
25+
}
26+
27+
/**
28+
* {@inheritDoc}
29+
*/
30+
@Override
31+
public String getZoneName() {
32+
return zoneName;
33+
}
34+
35+
36+
@JsonRootName("zoneState")
37+
static class ExtZoneState implements ZoneState {
38+
private static final long serialVersionUID = 1L;
39+
40+
boolean available;
41+
42+
/**
43+
* {@inheritDoc}
44+
*/
45+
@Override
46+
public boolean getAvailable() {
47+
return available;
48+
}
49+
50+
@Override
51+
public String toString() {
52+
return toStringHelper(this).omitNullValues()
53+
.add("available", available)
54+
.toString();
55+
}
56+
}
57+
58+
59+
public static class AvailabilityZones extends ListResult<ExtAvailabilityZone> {
60+
61+
private static final long serialVersionUID = 1L;
62+
63+
@JsonProperty("availabilityZoneInfo")
64+
private List<ExtAvailabilityZone> result;
65+
66+
@Override
67+
protected List<ExtAvailabilityZone> value() {
68+
return result;
69+
}
70+
71+
72+
}
73+
}

0 commit comments

Comments
 (0)