diff options
Diffstat (limited to 'nova-client')
-rw-r--r-- | nova-client/src/main/java/com/woorea/openstack/nova/Nova.java | 8 | ||||
-rw-r--r-- | nova-client/src/main/java/com/woorea/openstack/nova/api/AvailabilityZoneResource.java | 45 |
2 files changed, 53 insertions, 0 deletions
diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/Nova.java b/nova-client/src/main/java/com/woorea/openstack/nova/Nova.java index 908e1e9..4073568 100644 --- a/nova-client/src/main/java/com/woorea/openstack/nova/Nova.java +++ b/nova-client/src/main/java/com/woorea/openstack/nova/Nova.java @@ -19,6 +19,7 @@ package com.woorea.openstack.nova; import com.woorea.openstack.base.client.OpenStackClient; import com.woorea.openstack.base.client.OpenStackClientConnector; +import com.woorea.openstack.nova.api.AvailabilityZoneResource; import com.woorea.openstack.nova.api.ExtensionsResource; import com.woorea.openstack.nova.api.FlavorsResource; import com.woorea.openstack.nova.api.ImagesResource; @@ -61,6 +62,8 @@ public class Nova extends OpenStackClient { private final HypervisorsExtension hypervisor; + private final AvailabilityZoneResource availabilityZones; + public Nova(String endpoint, OpenStackClientConnector connector) { super(endpoint, connector); extensions = new ExtensionsResource(this); @@ -76,6 +79,7 @@ public class Nova extends OpenStackClient { quotaSets = new QuotaSetsResource(this); hosts = new HostsExtension(this); hypervisor = new HypervisorsExtension(this); + availabilityZones = new AvailabilityZoneResource(this); } public Nova(String endpoint) { @@ -133,4 +137,8 @@ public class Nova extends OpenStackClient { public HypervisorsExtension hypervisors() { return hypervisor; } + + public AvailabilityZoneResource availabilityZones() { + return availabilityZones; + } } diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/AvailabilityZoneResource.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/AvailabilityZoneResource.java new file mode 100644 index 0000000..e97839e --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/AvailabilityZoneResource.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * Licensed 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. + * ============LICENSE_END========================================================= + */ + +package com.woorea.openstack.nova.api; + + +import com.woorea.openstack.base.client.HttpMethod; +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.nova.model.AvailabilityZones; + +public class AvailabilityZoneResource { + + private final OpenStackClient client; + + public AvailabilityZoneResource(OpenStackClient client) { + this.client = client; + } + + public List list() { + return new List(false); + } + + public class List extends OpenStackRequest<AvailabilityZones> { + + public List(boolean detail) { + super(client, HttpMethod.GET, detail ? "/os-availability-zone/detail" : "/os-availability-zone", null, + AvailabilityZones.class); + } + } + +} |