http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateServiceOfferingOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateServiceOfferingOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateServiceOfferingOptions.java new file mode 100644 index 0000000..0de8292 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateServiceOfferingOptions.java @@ -0,0 +1,209 @@ +/* + * 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.cloudstack.options; + +import java.util.Set; + +import org.jclouds.cloudstack.domain.StorageType; +import org.jclouds.cloudstack.domain.SystemVmType; + +import com.google.common.collect.ImmutableSet; + +/** + * Options to control how service offerings are created + * + * @see <a + * href="http://download.cloud.com/releases/2.2.0/api_2.2.12/global_admin/createServiceOffering.html" + * /> + */ +public class CreateServiceOfferingOptions extends AccountInDomainOptions { + + public static final CreateServiceOfferingOptions NONE = new CreateServiceOfferingOptions(); + + /** + * @param hostTags + * the host tag for this service offering + */ + public CreateServiceOfferingOptions hostTags(Set<String> hostTags) { + this.queryParameters.replaceValues("hosttags", ImmutableSet.copyOf(hostTags)); + return this; + } + + /** + * @param isSystem + * is this a system vm offering + */ + public CreateServiceOfferingOptions isSystem(boolean isSystem) { + this.queryParameters.replaceValues("issystem", ImmutableSet.<String>of(isSystem + "")); + return this; + } + + /** + * @param limitCpuUse + * restrict the CPU usage to committed service offering + */ + public CreateServiceOfferingOptions limitCpuUse(boolean limitCpuUse) { + this.queryParameters.replaceValues("limitcpuuse", ImmutableSet.<String>of(limitCpuUse + "")); + return this; + } + + /** + * @param networkRateInMb + * data transfer rate in megabits per second allowed. Supported only + * for non-System offering and system offerings having "domainrouter" + * systemvmtype + */ + public CreateServiceOfferingOptions networkRateInMb(int networkRateInMb) { + this.queryParameters.replaceValues("networkrate", ImmutableSet.<String>of(networkRateInMb + "")); + return this; + } + + /** + * @param highlyAvailable + * the HA for the service offering + */ + public CreateServiceOfferingOptions highlyAvailable(boolean highlyAvailable) { + this.queryParameters.replaceValues("offerha", ImmutableSet.<String>of(highlyAvailable + "")); + return this; + } + + /** + * @param storageType + * the storage type of the service offering + */ + public CreateServiceOfferingOptions storageType(StorageType storageType) { + this.queryParameters.replaceValues("storagetype", ImmutableSet.<String>of(storageType.toString())); + return this; + } + + /** + * @param systemVmType + * the system VM type. Possible types are "domainrouter", "consoleproxy" and "secondarystoragevm" + */ + public CreateServiceOfferingOptions systemVmType(SystemVmType systemVmType) { + this.queryParameters.replaceValues("systemvmtype", ImmutableSet.<String>of(systemVmType.toString())); + return this; + } + + /** + * @param tags + * the tags for this service offering + */ + public CreateServiceOfferingOptions tags(Set<String> tags) { + this.queryParameters.replaceValues("tags", ImmutableSet.copyOf(tags)); + return this; + } + + public static class Builder { + + /** + * @see CreateServiceOfferingOptions#hostTags + */ + public static CreateServiceOfferingOptions hostTags(Set<String> hostTags) { + CreateServiceOfferingOptions options = new CreateServiceOfferingOptions(); + return options.hostTags(hostTags); + } + + /** + * @see CreateServiceOfferingOptions#isSystem + */ + public static CreateServiceOfferingOptions isSystem(boolean isSystem) { + CreateServiceOfferingOptions options = new CreateServiceOfferingOptions(); + return options.isSystem(isSystem); + } + + /** + * @see CreateServiceOfferingOptions#limitCpuUse + */ + public static CreateServiceOfferingOptions limitCpuUse(boolean limitCpuUse) { + CreateServiceOfferingOptions options = new CreateServiceOfferingOptions(); + return options.limitCpuUse(limitCpuUse); + } + + /** + * @see CreateServiceOfferingOptions#networkRateInMb + */ + public static CreateServiceOfferingOptions networkRateInMb(int networkRate) { + CreateServiceOfferingOptions options = new CreateServiceOfferingOptions(); + return options.networkRateInMb(networkRate); + } + + /** + * @see CreateServiceOfferingOptions#highlyAvailable + */ + public static CreateServiceOfferingOptions highlyAvailable(boolean highlyAvailable) { + CreateServiceOfferingOptions options = new CreateServiceOfferingOptions(); + return options.highlyAvailable(highlyAvailable); + } + + /** + * @see CreateServiceOfferingOptions#storageType + */ + public static CreateServiceOfferingOptions storageType(StorageType storageType) { + CreateServiceOfferingOptions options = new CreateServiceOfferingOptions(); + return options.storageType(storageType); + } + + /** + * @see CreateServiceOfferingOptions#systemVmType + */ + public static CreateServiceOfferingOptions systemVmType(SystemVmType systemVmType) { + CreateServiceOfferingOptions options = new CreateServiceOfferingOptions(); + return options.systemVmType(systemVmType); + } + + /** + * @see CreateServiceOfferingOptions#tags + */ + public static CreateServiceOfferingOptions tags(Set<String> tags) { + CreateServiceOfferingOptions options = new CreateServiceOfferingOptions(); + return options.tags(tags); + } + + /** + * @see CreateServiceOfferingOptions#accountInDomain + */ + public static CreateServiceOfferingOptions accountInDomain(String account, String domain) { + CreateServiceOfferingOptions options = new CreateServiceOfferingOptions(); + return options.accountInDomain(account, domain); + } + + /** + * @see CreateServiceOfferingOptions#domainId + */ + public static CreateServiceOfferingOptions domainId(String domainId) { + CreateServiceOfferingOptions options = new CreateServiceOfferingOptions(); + return options.domainId(domainId); + } + } + + /** + * {@inheritDoc} + */ + @Override + public CreateServiceOfferingOptions accountInDomain(String account, String domain) { + return CreateServiceOfferingOptions.class.cast(super.accountInDomain(account, domain)); + } + + /** + * {@inheritDoc} + */ + @Override + public CreateServiceOfferingOptions domainId(String domainId) { + return CreateServiceOfferingOptions.class.cast(super.domainId(domainId)); + } +}
http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateSnapshotOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateSnapshotOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateSnapshotOptions.java new file mode 100644 index 0000000..7902cc0 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateSnapshotOptions.java @@ -0,0 +1,64 @@ +/* + * 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.cloudstack.options; + +import com.google.common.collect.ImmutableSet; + +/** + * Options for the Snapshot createSnapshot method. + * + * @see org.jclouds.cloudstack.features.SnapshotApi#createSnapshot + * @see org.jclouds.cloudstack.features.SnapshotApi#createSnapshot + */ +public class CreateSnapshotOptions extends AccountInDomainOptions { + + public static final CreateSnapshotOptions NONE = new CreateSnapshotOptions(); + + /** + * @param policyId policy id of the snapshot, if this is null, then use MANUAL_POLICY. + */ + public CreateSnapshotOptions policyId(String policyId) { + this.queryParameters.replaceValues("policyid", ImmutableSet.of(policyId + "")); + return this; + } + + public static class Builder { + + /** + * @param account The account of the snapshot. + * @param domainId The domain ID of the snapshot. + */ + public static CreateSnapshotOptions accountInDomain(String account, String domainId) { + return (CreateSnapshotOptions) new CreateSnapshotOptions().accountInDomain(account, domainId); + } + + /** + * @param domainId The domain ID of the snapshot. + */ + public static CreateSnapshotOptions domainId(String domainId) { + return (CreateSnapshotOptions) new CreateSnapshotOptions().domainId(domainId); + } + + /** + * @param policyId policy id of the snapshot, if this is null, then use MANUAL_POLICY. + */ + public static CreateSnapshotOptions policyId(String policyId) { + return new CreateSnapshotOptions().policyId(policyId); + } + } + +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateTemplateOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateTemplateOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateTemplateOptions.java new file mode 100644 index 0000000..1cc0a2b --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateTemplateOptions.java @@ -0,0 +1,127 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.http.options.BaseHttpRequestOptions; + +import com.google.common.collect.ImmutableSet; + +/** + * Options used to control how a template is created. + * + * @see <a + * href="http://download.cloud.com/releases/2.2.8/api/user/createTemplate.html" + * /> + */ +public class CreateTemplateOptions extends BaseHttpRequestOptions { + + public static final CreateTemplateOptions NONE = new CreateTemplateOptions(); + + /** + * 32 or 64 bit + */ + public CreateTemplateOptions bits(int bits) { + this.queryParameters.replaceValues("bits", ImmutableSet.of(bits + "")); + return this; + } + + /** + * true if this template is a featured template, false otherwise + */ + public CreateTemplateOptions isFeatured(boolean isFeatured) { + this.queryParameters.replaceValues("isfeatured", ImmutableSet.of(isFeatured + "")); + return this; + } + + /** + * true if this template is a public template, false otherwise + */ + public CreateTemplateOptions isPublic(boolean isPublic) { + this.queryParameters.replaceValues("ispublic", ImmutableSet.of(isPublic + "")); + return this; + } + + /** + * true if the template supports the password reset feature; default is false + */ + public CreateTemplateOptions passwordEnabled(boolean passwordEnabled) { + this.queryParameters.replaceValues("passwordenabled", ImmutableSet.of(passwordEnabled + "")); + return this; + } + + /** + * true if the template requires HVM, false otherwise + */ + public CreateTemplateOptions requiresHVM(boolean requiresHVM) { + this.queryParameters.replaceValues("requireshvm", ImmutableSet.of(requiresHVM + "")); + return this; + } + + /** + * the ID of the snapshot the template is being created from. Either this parameter, or volumeId has to be passed in + */ + public CreateTemplateOptions snapshotId(String snapshotId) { + this.queryParameters.replaceValues("snapshotid", ImmutableSet.of(snapshotId + "")); + return this; + } + + /** + * the ID of the disk volume the template is being created from. Either this parameter, or snapshotId has to be passed in + */ + public CreateTemplateOptions volumeId(String volumeId) { + this.queryParameters.replaceValues("volumeid", ImmutableSet.of(volumeId + "")); + return this; + } + + public static class Builder { + + public static CreateTemplateOptions bits(int bits) { + CreateTemplateOptions options = new CreateTemplateOptions(); + return options.bits(bits); + } + + public static CreateTemplateOptions isFeatured(boolean isFeatured) { + CreateTemplateOptions options = new CreateTemplateOptions(); + return options.isFeatured(isFeatured); + } + + public static CreateTemplateOptions isPublic(boolean isPublic) { + CreateTemplateOptions options = new CreateTemplateOptions(); + return options.isPublic(isPublic); + } + + public static CreateTemplateOptions passwordEnabled(boolean passwordEnabled) { + CreateTemplateOptions options = new CreateTemplateOptions(); + return options.passwordEnabled(passwordEnabled); + } + + public static CreateTemplateOptions requiresHVM(boolean requiresHVM) { + CreateTemplateOptions options = new CreateTemplateOptions(); + return options.requiresHVM(requiresHVM); + } + + public static CreateTemplateOptions snapshotId(String snapshotId) { + CreateTemplateOptions options = new CreateTemplateOptions(); + return options.snapshotId(snapshotId); + } + + public static CreateTemplateOptions volumeId(String volumeId) { + CreateTemplateOptions options = new CreateTemplateOptions(); + return options.volumeId(volumeId); + } + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateUserOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateUserOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateUserOptions.java new file mode 100644 index 0000000..cde9d21 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateUserOptions.java @@ -0,0 +1,70 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.http.options.BaseHttpRequestOptions; + +import com.google.common.collect.ImmutableSet; + +/** + * Optional fields for user creation + * + * @see <a + * href="http://download.cloud.com/releases/2.2.0/api_2.2.12/global_admin/createUser.html" + * /> + */ +public class CreateUserOptions extends BaseHttpRequestOptions { + + public static final CreateUserOptions NONE = new CreateUserOptions(); + + /** + * @param domainId The domain for the resource + */ + public CreateUserOptions domainId(String domainId) { + this.queryParameters.replaceValues("domainid", ImmutableSet.of(domainId + "")); + return this; + + } + + /** + * @param timezone Specifies a timezone for this command. For more information + * on the timezone parameter, see Time Zone Format. + */ + public CreateUserOptions timezone(String timezone) { + this.queryParameters.replaceValues("timezone", ImmutableSet.of(timezone)); + return this; + } + + public static class Builder { + + /** + * @see CreateUserOptions#domainId + */ + public static CreateUserOptions domainId(String domainId) { + CreateUserOptions options = new CreateUserOptions(); + return options.domainId(domainId); + } + + /** + * @see CreateUserOptions#timezone + */ + public static CreateUserOptions timezone(String timezone) { + CreateUserOptions options = new CreateUserOptions(); + return options.timezone(timezone); + } + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateVMGroupOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateVMGroupOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateVMGroupOptions.java new file mode 100644 index 0000000..7966fe3 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateVMGroupOptions.java @@ -0,0 +1,84 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.http.options.BaseHttpRequestOptions; + +import com.google.common.collect.ImmutableSet; + +/** + * Options used to control options for creating a VM group + * + * @see <a + * href="http://download.cloud.com/releases/2.2.8/api/user/createInstanceGroup.html" + * /> + */ +public class CreateVMGroupOptions extends BaseHttpRequestOptions { + + public static final CreateVMGroupOptions NONE = new CreateVMGroupOptions(); + + /** + * @param account account who owns the VMGroup + */ + public CreateVMGroupOptions account(String account) { + this.queryParameters.replaceValues("account", ImmutableSet.of(account)); + return this; + } + + /** + * @param domainId domain ID of the account owning the VMGroup + */ + public CreateVMGroupOptions domainId(String domainId) { + this.queryParameters.replaceValues("domainid", ImmutableSet.of(domainId + "")); + return this; + } + + /** + * @param projectId the project the vm group will be in + */ + public CreateVMGroupOptions projectId(String projectId) { + this.queryParameters.replaceValues("projectid", ImmutableSet.of(projectId + "")); + return this; + } + + public static class Builder { + /** + * @see org.jclouds.cloudstack.options.CreateVMGroupOptions#account + */ + public static CreateVMGroupOptions account(String account) { + CreateVMGroupOptions options = new CreateVMGroupOptions(); + return options.account(account); + } + + /** + * @see org.jclouds.cloudstack.options.CreateVMGroupOptions#domainId + */ + public static CreateVMGroupOptions domainId(String id) { + CreateVMGroupOptions options = new CreateVMGroupOptions(); + return options.domainId(id); + } + + /** + * @see org.jclouds.cloudstack.options.CreateVMGroupOptions#projectId(String) + */ + public static CreateVMGroupOptions projectId(String id) { + CreateVMGroupOptions options = new CreateVMGroupOptions(); + return options.projectId(id); + } + } + +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateVlanIPRangeOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateVlanIPRangeOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateVlanIPRangeOptions.java new file mode 100644 index 0000000..f6eb4ef --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateVlanIPRangeOptions.java @@ -0,0 +1,128 @@ +/* + * 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.cloudstack.options; + +import com.google.common.collect.ImmutableSet; + +/** + * Options to the createVlanIPRange API call. + */ +public class CreateVlanIPRangeOptions extends AccountInDomainOptions { + + public static class Builder { + + public static CreateVlanIPRangeOptions accountInDomain(String account, String domain) { + return new CreateVlanIPRangeOptions().accountInDomain(account, domain); + } + + public static CreateVlanIPRangeOptions domainId(String domainId) { + return new CreateVlanIPRangeOptions().domainId(domainId); + } + + public static CreateVlanIPRangeOptions forVirtualNetwork(boolean forVirtualNetwork) { + return new CreateVlanIPRangeOptions().forVirtualNetwork(forVirtualNetwork); + } + + public static CreateVlanIPRangeOptions zoneId(String zoneId) { + return new CreateVlanIPRangeOptions().zoneId(zoneId); + } + + public static CreateVlanIPRangeOptions vlan(long vlan) { + return new CreateVlanIPRangeOptions().vlan(vlan); + } + + public static CreateVlanIPRangeOptions vlan(String vlan) { + return new CreateVlanIPRangeOptions().vlan(vlan); + } + + public static CreateVlanIPRangeOptions podId(String podId) { + return new CreateVlanIPRangeOptions().podId(podId); + } + + public static CreateVlanIPRangeOptions gateway(String gateway) { + return new CreateVlanIPRangeOptions().gateway(gateway); + } + + public static CreateVlanIPRangeOptions netmask(String netmask) { + return new CreateVlanIPRangeOptions().netmask(netmask); + } + + public static CreateVlanIPRangeOptions networkId(String networkId) { + return new CreateVlanIPRangeOptions().networkId(networkId); + } + + public static CreateVlanIPRangeOptions projectId(String projectId) { + return new CreateVlanIPRangeOptions().projectId(projectId); + } + + } + + @Override + public CreateVlanIPRangeOptions accountInDomain(String account, String domain) { + return (CreateVlanIPRangeOptions) super.accountInDomain(account, domain); + } + + @Override + public CreateVlanIPRangeOptions domainId(String domainId) { + return (CreateVlanIPRangeOptions) super.domainId(domainId); + } + + public CreateVlanIPRangeOptions forVirtualNetwork(boolean forVirtualNetwork) { + this.queryParameters.replaceValues("forvirtualnetwork", ImmutableSet.of(forVirtualNetwork + "")); + return this; + } + + public CreateVlanIPRangeOptions zoneId(String zoneId) { + this.queryParameters.replaceValues("zoneid", ImmutableSet.of(zoneId + "")); + return this; + } + + public CreateVlanIPRangeOptions vlan(long vlan) { + this.queryParameters.replaceValues("vlan", ImmutableSet.of(vlan + "")); + return this; + } + + public CreateVlanIPRangeOptions vlan(String vlan) { + this.queryParameters.replaceValues("vlan", ImmutableSet.of(vlan)); + return this; + } + + public CreateVlanIPRangeOptions podId(String podId) { + this.queryParameters.replaceValues("podid", ImmutableSet.of(podId + "")); + return this; + } + + public CreateVlanIPRangeOptions gateway(String gateway) { + this.queryParameters.replaceValues("gateway", ImmutableSet.of(gateway)); + return this; + } + + public CreateVlanIPRangeOptions netmask(String netmask) { + this.queryParameters.replaceValues("netmask", ImmutableSet.of(netmask)); + return this; + } + + public CreateVlanIPRangeOptions networkId(String networkId) { + this.queryParameters.replaceValues("networkid", ImmutableSet.of(networkId + "")); + return this; + } + + public CreateVlanIPRangeOptions projectId(String projectId) { + this.queryParameters.replaceValues("projectid", ImmutableSet.of(projectId + "")); + return this; + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateZoneOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateZoneOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateZoneOptions.java new file mode 100644 index 0000000..1e18e92 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/CreateZoneOptions.java @@ -0,0 +1,174 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.cloudstack.domain.AllocationState; +import org.jclouds.http.options.BaseHttpRequestOptions; +import org.jclouds.javax.annotation.Nullable; + +import com.google.common.collect.ImmutableSet; + +/** + * Options used to control how a zone is created + * + * @see <a href= + * "http://download.cloud.com/releases/2.2.0/api_2.2.12/global_admin/createZone.html" + * /> + */ +public class CreateZoneOptions extends BaseHttpRequestOptions { + + public static final CreateZoneOptions NONE = new CreateZoneOptions(); + + /** + * @param allocationState + * allocation state of this Zone for allocation of new resources + */ + public CreateZoneOptions allocationState(AllocationState allocationState) { + this.queryParameters.replaceValues("allocationstate", ImmutableSet.of(allocationState.toString())); + return this; + } + + /** + * @param dns2 + * the second DNS for the Zone + */ + public CreateZoneOptions dns2(String dns2) { + this.queryParameters.replaceValues("dns2", ImmutableSet.of(dns2)); + return this; + } + + /** + * @param internalDns2 + * the second internal DNS for the Zone + */ + public CreateZoneOptions internalDns2(String internalDns2) { + this.queryParameters.replaceValues("internaldns2", ImmutableSet.of(internalDns2)); + return this; + } + + /** + * @param domainName + * network domain name for the networks in zone + */ + public CreateZoneOptions domainName(String domainName) { + this.queryParameters.replaceValues("domain", ImmutableSet.of(domainName)); + return this; + } + + /** + * @param domainId + * the ID of the containing domain; null for public zones + */ + public CreateZoneOptions domainId(@Nullable String domainId) { + this.queryParameters.replaceValues("domainid", ImmutableSet.of(domainId + "")); + return this; + } + + /** + * @param guestCIDRAddress + * the guest CIDR address for the Zone + */ + public CreateZoneOptions guestCIDRAddress(String guestCIDRAddress) { + this.queryParameters.replaceValues("guestcidraddress", ImmutableSet.of(guestCIDRAddress)); + return this; + } + + /** + * @param securityGroupEnabled + * true if network is security group enabled, false otherwise + */ + public CreateZoneOptions securityGroupEnabled(boolean securityGroupEnabled) { + this.queryParameters.replaceValues("securitygroupenabled", ImmutableSet.of(securityGroupEnabled + "")); + return this; + } + + /** + * @param vlan + * the VLAN for the Zone + */ + public CreateZoneOptions vlan(String vlan) { + this.queryParameters.replaceValues("vlan", ImmutableSet.of(vlan)); + return this; + } + + public static class Builder { + + /** + * @see CreateZoneOptions#allocationState + */ + public static CreateZoneOptions allocationState(AllocationState allocationState) { + CreateZoneOptions options = new CreateZoneOptions(); + return options.allocationState(allocationState); + } + + /** + * @see CreateZoneOptions#dns2 + */ + public static CreateZoneOptions dns2(String dns2) { + CreateZoneOptions options = new CreateZoneOptions(); + return options.dns2(dns2); + } + + /** + * @see CreateZoneOptions#internalDns2 + */ + public static CreateZoneOptions internalDns2(String internalDns2) { + CreateZoneOptions options = new CreateZoneOptions(); + return options.internalDns2(internalDns2); + } + + /** + * @see CreateZoneOptions#domainName + */ + public static CreateZoneOptions domainName(String domainName) { + CreateZoneOptions options = new CreateZoneOptions(); + return options.domainName(domainName); + } + + /** + * @see CreateZoneOptions#domainId + */ + public static CreateZoneOptions domainId(@Nullable String domainId) { + CreateZoneOptions options = new CreateZoneOptions(); + return options.domainId(domainId); + } + + /** + * @see CreateZoneOptions#guestCIDRAddress + */ + public static CreateZoneOptions guestCIDRAddress(String guestCIDRAddress) { + CreateZoneOptions options = new CreateZoneOptions(); + return options.guestCIDRAddress(guestCIDRAddress); + } + + /** + * @see CreateZoneOptions#securityGroupEnabled + */ + public static CreateZoneOptions securityGroupEnabled(boolean securityGroupEnabled) { + CreateZoneOptions options = new CreateZoneOptions(); + return options.securityGroupEnabled(securityGroupEnabled); + } + + /** + * @see CreateZoneOptions#vlan + */ + public static CreateZoneOptions vlan(String vlan) { + CreateZoneOptions options = new CreateZoneOptions(); + return options.vlan(vlan); + } + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeleteHostOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeleteHostOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeleteHostOptions.java new file mode 100644 index 0000000..07e2ef4 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeleteHostOptions.java @@ -0,0 +1,63 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.http.options.BaseHttpRequestOptions; + +import com.google.common.collect.ImmutableSet; + +/** + * Options to the GlobalHostApi.deleteHost() API call + */ +public class DeleteHostOptions extends BaseHttpRequestOptions { + + public static final DeleteHostOptions NONE = new DeleteHostOptions(); + + /** + * @param forced Force delete the host. All HA enabled vms running on the host will be put to HA; HA disabled ones will be stopped + */ + public DeleteHostOptions forced(boolean forced) { + this.queryParameters.replaceValues("forced", ImmutableSet.of(forced + "")); + return this; + } + + /** + * @param forceDestroyLocalStorage Force destroy local storage on this host. All VMs created on this local storage will be destroyed + */ + public DeleteHostOptions forceDestroyLocalStorage(boolean forceDestroyLocalStorage) { + this.queryParameters.replaceValues("forcedestroylocalstorage", ImmutableSet.of(forceDestroyLocalStorage + "")); + return this; + } + + public static class Builder { + + /** + * @param forced Force delete the host. All HA enabled vms running on the host will be put to HA; HA disabled ones will be stopped + */ + public static DeleteHostOptions forced(boolean forced) { + return new DeleteHostOptions().forced(forced); + } + + /** + * @param forceDestroyLocalStorage Force destroy local storage on this host. All VMs created on this local storage will be destroyed + */ + public static DeleteHostOptions forceDestroyLocalStorage(boolean forceDestroyLocalStorage) { + return new DeleteHostOptions().forceDestroyLocalStorage(forceDestroyLocalStorage); + } + + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeleteISOOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeleteISOOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeleteISOOptions.java new file mode 100644 index 0000000..ceb3364 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeleteISOOptions.java @@ -0,0 +1,51 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.http.options.BaseHttpRequestOptions; + +import com.google.common.collect.ImmutableSet; + +/** + * Options for the ISO deleteISO method. + * + * @see org.jclouds.cloudstack.features.ISOApi#deleteISO + * @see org.jclouds.cloudstack.features.ISOApi#deleteISO + */ +public class DeleteISOOptions extends BaseHttpRequestOptions { + + public static final DeleteISOOptions NONE = new DeleteISOOptions(); + + /** + * @param zoneId the ID of the zone of the ISO file. If not specified, the ISO will be deleted from all the zones + */ + public DeleteISOOptions zoneId(String zoneId) { + this.queryParameters.replaceValues("zoneid", ImmutableSet.of(zoneId + "")); + return this; + } + + public static class Builder { + + /** + * @param zoneId the ID of the zone of the ISO file. If not specified, the ISO will be deleted from all the zones + */ + public static DeleteISOOptions zoneId(String zoneId) { + return new DeleteISOOptions().zoneId(zoneId); + } + } + +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeleteTemplateOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeleteTemplateOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeleteTemplateOptions.java new file mode 100644 index 0000000..26452a0 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeleteTemplateOptions.java @@ -0,0 +1,54 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.http.options.BaseHttpRequestOptions; + +import com.google.common.collect.ImmutableSet; + +/** + * Options used to control how a template is created. + * + * @see <a + * href="http://download.cloud.com/releases/2.2.8/api/user/createTemplate.html" + * /> + */ +public class DeleteTemplateOptions extends BaseHttpRequestOptions { + + public static final DeleteTemplateOptions NONE = new DeleteTemplateOptions(); + + /** + * @param zoneId selects the template's zoneId. + */ + public DeleteTemplateOptions zoneId(String zoneId) { + this.queryParameters.replaceValues("zoneid", ImmutableSet.of(zoneId + "")); + return this; + } + + public static class Builder { + + /** + * @see DeleteTemplateOptions#zoneId + */ + public static DeleteTemplateOptions zoneId(String id) { + DeleteTemplateOptions options = new DeleteTemplateOptions(); + return options.zoneId(id); + } + + } + +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeployVirtualMachineOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeployVirtualMachineOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeployVirtualMachineOptions.java new file mode 100644 index 0000000..9cdd5d2 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/DeployVirtualMachineOptions.java @@ -0,0 +1,378 @@ +/* + * 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.cloudstack.options; + +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.io.BaseEncoding.base64; + +import java.util.Map; + +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.base.Splitter; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; + +/** + * Options used to control what disk offerings are returned + * + * @see <a href= + * "http://download.cloud.com/releases/2.2.0/api/user/deployVirtualMachine.html" + * /> + */ +public class DeployVirtualMachineOptions extends AccountInDomainOptions { + + public static final DeployVirtualMachineOptions NONE = new DeployVirtualMachineOptions(); + + /** + * the ID of the disk offering for the virtual machine. If the template is of + * ISO format, the diskOfferingId is for the root disk volume. Otherwise this + * parameter is used to dinidcate the offering for the data disk volume. If + * the templateId parameter passed is from a Template object, the + * diskOfferingId refers to a DATA Disk Volume created. If the templateId + * parameter passed is from an ISO object, the diskOfferingId refers to a + * ROOT Disk Volume created. + * + * @param diskofferingid + * the ID of the disk offering + */ + public DeployVirtualMachineOptions diskOfferingId(String diskofferingid) { + checkArgument(!queryParameters.containsKey("size"), "Mutually exclusive with size"); + this.queryParameters.replaceValues("diskofferingid", ImmutableSet.of(diskofferingid + "")); + return this; + } + + /** + * sets the displayName - just for display purposes. We don't pass this + * parameter to the backend. + * + * @param displayName + * an optional user generated name for the virtual machine + */ + public DeployVirtualMachineOptions displayName(String displayName) { + this.queryParameters.replaceValues("displayname", ImmutableSet.of(displayName)); + return this; + } + + /** + * @param group + * an optional group for the virtual machine + */ + public DeployVirtualMachineOptions group(String group) { + this.queryParameters.replaceValues("group", ImmutableSet.of(group)); + return this; + } + + /** + * @param hypervisor + * the hypervisor on which to deploy the virtual machine + */ + public DeployVirtualMachineOptions hypervisor(String hypervisor) { + this.queryParameters.replaceValues("hypervisor", ImmutableSet.of(hypervisor)); + return this; + } + + /** + * @param keyPair + * name of the ssh key pair used to login to the virtual machine + */ + public DeployVirtualMachineOptions keyPair(String keyPair) { + this.queryParameters.replaceValues("keypair", ImmutableSet.of(keyPair)); + return this; + } + + /** + * sets the hostName, it will be propagated down to the backend and set on + * the user vm. If this parameter is not passed it, it will be defaulted to + * our usual "i-x-y' + * + * @param name + * host name for the virtual machine + */ + public DeployVirtualMachineOptions name(String name) { + this.queryParameters.replaceValues("name", ImmutableSet.of(name)); + return this; + } + + /** + * @param ipOnDefaultNetwork + * the requested ip address (2.2.12 only option) + */ + public DeployVirtualMachineOptions ipOnDefaultNetwork(String ipOnDefaultNetwork) { + this.queryParameters.replaceValues("ipaddress", ImmutableSet.of(ipOnDefaultNetwork)); + return this; + } + + /** + * @param ipsToNetworks + * mapping ip addresses to network ids (2.2.12 only option) + */ + public DeployVirtualMachineOptions ipsToNetworks(Map<String, String> ipsToNetworks) { + int count = 0; + for (Map.Entry<String, String> entry : ipsToNetworks.entrySet()) { + this.queryParameters.replaceValues(String.format("iptonetworklist[%d].ip", count), ImmutableSet.of(entry.getKey())); + this.queryParameters.replaceValues(String.format("iptonetworklist[%d].networkid", count), + ImmutableSet.of(entry.getValue())); + count += 1; + } + return this; + } + + /** + * @param networkId + * network id used by virtual machine + */ + public DeployVirtualMachineOptions networkId(String networkId) { + this.queryParameters.replaceValues("networkids", ImmutableSet.of(networkId + "")); + return this; + } + + /** + * @param networkIds + * network ids used by virtual machine + */ + public DeployVirtualMachineOptions networkIds(Iterable<String> networkIds) { + this.queryParameters.replaceValues("networkids", ImmutableSet.of(Joiner.on(',').join(networkIds))); + return this; + } + + public Iterable<String> getNetworkIds() { + if (queryParameters.get("networkids").size() == 1) { + return Iterables.transform( + Splitter.on(",").split(Iterables.getOnlyElement(queryParameters.get("networkids"))), + new Function<String, String>() { + + @Override + public String apply(String arg0) { + return arg0; + } + + }); + } else { + return ImmutableSet.<String> of(); + } + } + + /** + * @param projectId The project this VM will be in. + */ + public DeployVirtualMachineOptions projectId(String projectId) { + this.queryParameters.replaceValues("projectid", ImmutableSet.of(projectId + "")); + return this; + } + + /** + * @param securityGroupId + * security group applied to the virtual machine. Should be passed + * only when vm is created from a zone with Basic Network support + */ + public DeployVirtualMachineOptions securityGroupId(String securityGroupId) { + this.queryParameters.replaceValues("securitygroupids", ImmutableSet.of(securityGroupId + "")); + return this; + } + + /** + * @param securityGroupIds + * security groups applied to the virtual machine. Should be passed + * only when vm is created from a zone with Basic Network support + */ + public DeployVirtualMachineOptions securityGroupIds(Iterable<String> securityGroupIds) { + this.queryParameters.replaceValues("securitygroupids", ImmutableSet.of(Joiner.on(',').join(securityGroupIds))); + return this; + } + + /** + * @param dataDiskSize + * the arbitrary size for the DATADISK volume. + */ + public DeployVirtualMachineOptions dataDiskSize(long dataDiskSize) { + this.queryParameters.replaceValues("size", ImmutableSet.of(dataDiskSize + "")); + return this; + } + + /** + * @param unencodedData + * an optional binary data that can be sent to the virtual machine + * upon a successful deployment. This binary data must be base64 + * encoded before adding it to the request. Currently only HTTP GET + * is supported. Using HTTP GET (via querystring), you can send up + * to 2KB of data after base64 encoding. + */ + public DeployVirtualMachineOptions userData(byte[] unencodedData) { + int length = checkNotNull(unencodedData, "unencodedData").length; + checkArgument(length > 0, "userData cannot be empty"); + checkArgument(length <= 2 * 1024, "userData cannot be larger than 2kb"); + this.queryParameters.replaceValues("userdata", ImmutableSet.of(base64().encode(unencodedData))); + return this; + } + + public static class Builder { + + /** + * @see DeployVirtualMachineOptions#diskOfferingId + */ + public static DeployVirtualMachineOptions diskOfferingId(String diskOfferingId) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.diskOfferingId(diskOfferingId); + } + + /** + * @see DeployVirtualMachineOptions#displayName + */ + public static DeployVirtualMachineOptions displayName(String displayName) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.displayName(displayName); + } + + /** + * @see DeployVirtualMachineOptions#group + */ + public static DeployVirtualMachineOptions group(String group) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.group(group); + } + + /** + * @see DeployVirtualMachineOptions#hypervisor + */ + public static DeployVirtualMachineOptions hypervisor(String hypervisor) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.hypervisor(hypervisor); + } + + /** + * @see DeployVirtualMachineOptions#keyPair + */ + public static DeployVirtualMachineOptions keyPair(String keyPair) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.keyPair(keyPair); + } + + /** + * @see DeployVirtualMachineOptions#name + */ + public static DeployVirtualMachineOptions name(String name) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.name(name); + } + + /** + * @see DeployVirtualMachineOptions#ipOnDefaultNetwork + */ + public static DeployVirtualMachineOptions ipOnDefaultNetwork(String ipOnDefaultNetwork) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.ipOnDefaultNetwork(ipOnDefaultNetwork); + } + + /** + * @see DeployVirtualMachineOptions#ipsToNetworks + */ + public static DeployVirtualMachineOptions ipsToNetworks(Map<String, String> ipsToNetworks) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.ipsToNetworks(ipsToNetworks); + } + + /** + * @see DeployVirtualMachineOptions#networkId + */ + public static DeployVirtualMachineOptions networkId(String id) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.networkId(id); + } + + /** + * @see DeployVirtualMachineOptions#networkIds + */ + public static DeployVirtualMachineOptions networkIds(Iterable<String> networkIds) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.networkIds(networkIds); + } + + /** + * @see DeployVirtualMachineOptions#projectId(String) + */ + public static DeployVirtualMachineOptions projectId(String id) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.projectId(id); + } + + /** + * @see DeployVirtualMachineOptions#securityGroupId + */ + public static DeployVirtualMachineOptions securityGroupId(String id) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.securityGroupId(id); + } + + /** + * @see DeployVirtualMachineOptions#securityGroupIds + */ + public static DeployVirtualMachineOptions securityGroupIds(Iterable<String> securityGroupIds) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.securityGroupIds(securityGroupIds); + } + + /** + * @see DeployVirtualMachineOptions#dataDiskSize + */ + public static DeployVirtualMachineOptions dataDiskSize(long id) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.dataDiskSize(id); + } + + /** + * @see DeployVirtualMachineOptions#userData + */ + public static DeployVirtualMachineOptions userData(byte[] unencodedData) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.userData(unencodedData); + } + + /** + * @see DeployVirtualMachineOptions#accountInDomain + */ + public static DeployVirtualMachineOptions accountInDomain(String account, String domain) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.accountInDomain(account, domain); + } + + /** + * @see DeployVirtualMachineOptions#domainId + */ + public static DeployVirtualMachineOptions domainId(String domainId) { + DeployVirtualMachineOptions options = new DeployVirtualMachineOptions(); + return options.domainId(domainId); + } + } + + /** + * {@inheritDoc} + */ + @Override + public DeployVirtualMachineOptions accountInDomain(String account, String domain) { + return DeployVirtualMachineOptions.class.cast(super.accountInDomain(account, domain)); + } + + /** + * {@inheritDoc} + */ + @Override + public DeployVirtualMachineOptions domainId(String domainId) { + return DeployVirtualMachineOptions.class.cast(super.domainId(domainId)); + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ExtractISOOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ExtractISOOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ExtractISOOptions.java new file mode 100644 index 0000000..5c150a9 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ExtractISOOptions.java @@ -0,0 +1,51 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.http.options.BaseHttpRequestOptions; + +import com.google.common.collect.ImmutableSet; + +/** + * Options for the ISO extractISO method. + * + * @see org.jclouds.cloudstack.features.ISOApi#extractISO + * @see org.jclouds.cloudstack.features.ISOApi#extractISO + */ +public class ExtractISOOptions extends BaseHttpRequestOptions { + + public static final ExtractISOOptions NONE = new ExtractISOOptions(); + + /** + * @param url the url to which the ISO would be extracted + */ + public ExtractISOOptions url(String url) { + this.queryParameters.replaceValues("url", ImmutableSet.of(url + "")); + return this; + } + + public static class Builder { + + /** + * @param url the url to which the ISO would be extracted + */ + public static ExtractISOOptions url(String url) { + return new ExtractISOOptions().url(url); + } + } + +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ExtractTemplateOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ExtractTemplateOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ExtractTemplateOptions.java new file mode 100644 index 0000000..6c81f12 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ExtractTemplateOptions.java @@ -0,0 +1,44 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.http.options.BaseHttpRequestOptions; + +import com.google.common.collect.ImmutableSet; + +public class ExtractTemplateOptions extends BaseHttpRequestOptions { + + public static final ExtractTemplateOptions NONE = new ExtractTemplateOptions(); + + /** + * the url to which the ISO would be extracted + */ + public ExtractTemplateOptions url(String url) { + this.queryParameters.replaceValues("url", ImmutableSet.of(url)); + return this; + } + + public static class Builder { + + public static ExtractTemplateOptions url(String url) { + ExtractTemplateOptions options = new ExtractTemplateOptions(); + return options.url(url); + } + + } + +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/GenerateUsageRecordsOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/GenerateUsageRecordsOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/GenerateUsageRecordsOptions.java new file mode 100644 index 0000000..11cc5ae --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/GenerateUsageRecordsOptions.java @@ -0,0 +1,41 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.http.options.BaseHttpRequestOptions; + +import com.google.common.collect.ImmutableSet; + +/** + * Options to the GlobalUsageApi.generateUsageOptions() API call + */ +public class GenerateUsageRecordsOptions extends BaseHttpRequestOptions { + + public static final GenerateUsageRecordsOptions NONE = new GenerateUsageRecordsOptions(); + + public static class Builder { + public static GenerateUsageRecordsOptions domainId(String domainId) { + GenerateUsageRecordsOptions options = new GenerateUsageRecordsOptions(); + return options.domainId(domainId); + } + } + + public GenerateUsageRecordsOptions domainId(String domainId) { + this.queryParameters.replaceValues("domainid", ImmutableSet.of(domainId + "")); + return this; + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListAccountsOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListAccountsOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListAccountsOptions.java new file mode 100644 index 0000000..d7419eb --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListAccountsOptions.java @@ -0,0 +1,153 @@ +/* + * 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.cloudstack.options; + +import com.google.common.collect.ImmutableSet; + +/** + * Options used to control what account information is returned + * + * @see <a + * href="http://download.cloud.com/releases/2.2.0/api/user/listAccounts.html" + * /> + */ +public class ListAccountsOptions extends AccountInDomainOptions { + + public static final ListAccountsOptions NONE = new ListAccountsOptions(); + + /** + * @param id + * list account by account ID + */ + public ListAccountsOptions id(String id) { + this.queryParameters.replaceValues("id", ImmutableSet.of(id + "")); + return this; + } + + /** + * @param name + * list account by account name + */ + public ListAccountsOptions name(String name) { + this.queryParameters.replaceValues("name", ImmutableSet.of(name)); + return this; + } + + /** + * @param state + * list accounts by state. Valid states are enabled, disabled, and + * locked. + */ + public ListAccountsOptions state(String state) { + this.queryParameters.replaceValues("state", ImmutableSet.of(state)); + return this; + } + + /** + * @param cleanupRequired + * list accounts by cleanuprequred attribute + */ + public ListAccountsOptions cleanupRequired(boolean cleanupRequired) { + this.queryParameters.replaceValues("iscleanuprequired", ImmutableSet.of(cleanupRequired + "")); + return this; + } + + /** + * @param recursive + * defaults to false, but if true, lists all accounts from the + * parent specified by the domain id till leaves. + */ + public ListAccountsOptions recursive(boolean recursive) { + this.queryParameters.replaceValues("isrecursive", ImmutableSet.of(recursive + "")); + return this; + } + + public static class Builder { + + /** + * @see ListAccountsOptions#accountInDomain + */ + public static ListAccountsOptions accountInDomain(String account, String domain) { + ListAccountsOptions options = new ListAccountsOptions(); + return options.accountInDomain(account, domain); + } + + /** + * @see ListAccountsOptions#domainId + */ + public static ListAccountsOptions domainId(String id) { + ListAccountsOptions options = new ListAccountsOptions(); + return options.domainId(id); + } + + /** + * @see ListAccountsOptions#id + */ + public static ListAccountsOptions id(String id) { + ListAccountsOptions options = new ListAccountsOptions(); + return options.id(id); + } + + /** + * @see ListAccountsOptions#name + */ + public static ListAccountsOptions name(String name) { + ListAccountsOptions options = new ListAccountsOptions(); + return options.name(name); + } + + /** + * @see ListAccountsOptions#state + */ + public static ListAccountsOptions state(String state) { + ListAccountsOptions options = new ListAccountsOptions(); + return options.state(state); + } + + /** + * @see ListAccountsOptions#cleanupRequired + */ + public static ListAccountsOptions cleanupRequired(boolean cleanupRequired) { + ListAccountsOptions options = new ListAccountsOptions(); + return options.cleanupRequired(cleanupRequired); + } + + /** + * @see ListAccountsOptions#recursive + */ + public static ListAccountsOptions recursive(boolean recursive) { + ListAccountsOptions options = new ListAccountsOptions(); + return options.recursive(recursive); + } + } + + /** + * {@inheritDoc} + */ + @Override + public ListAccountsOptions accountInDomain(String account, String domain) { + return ListAccountsOptions.class.cast(super.accountInDomain(account, domain)); + } + + /** + * {@inheritDoc} + */ + @Override + public ListAccountsOptions domainId(String domainId) { + return ListAccountsOptions.class.cast(super.domainId(domainId)); + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListAlertsOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListAlertsOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListAlertsOptions.java new file mode 100644 index 0000000..e5d7b10 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListAlertsOptions.java @@ -0,0 +1,65 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.http.options.BaseHttpRequestOptions; + +import com.google.common.collect.ImmutableSet; + +/** + * Options to the listAlerts command. + */ +public class ListAlertsOptions extends BaseHttpRequestOptions { + + public static final ListAlertsOptions NONE = new ListAlertsOptions(); + + public ListAlertsOptions id(String id) { + this.queryParameters.replaceValues("id", ImmutableSet.of(id + "")); + return this; + } + + public ListAlertsOptions keyword(String keyword) { + this.queryParameters.replaceValues("keyword", ImmutableSet.of(keyword)); + return this; + } + + public ListAlertsOptions type(String type) { + this.queryParameters.replaceValues("type", ImmutableSet.of(type)); + return this; + } + + public static class Builder { + + public static ListAlertsOptions id(String id) { + final ListAlertsOptions options = new ListAlertsOptions(); + return options.id(id); + } + + public static ListAlertsOptions keyword(String keyword) { + final ListAlertsOptions options = new ListAlertsOptions(); + return options.keyword(keyword); + } + + public static ListAlertsOptions type(String type) { + final ListAlertsOptions options = new ListAlertsOptions(); + return options.type(type); + } + + } + +} + http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListAsyncJobsOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListAsyncJobsOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListAsyncJobsOptions.java new file mode 100644 index 0000000..e0f81e2 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListAsyncJobsOptions.java @@ -0,0 +1,93 @@ +/* + * 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.cloudstack.options; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.Date; + +import org.jclouds.date.DateService; +import org.jclouds.date.internal.SimpleDateFormatDateService; + +import com.google.common.collect.ImmutableSet; + +/** + * Options used to control what asyncJobs information is returned + * + * @see <a + * href="http://download.cloud.com/releases/2.2.0/api/user/listAsyncJobs.html" + * /> + */ +public class ListAsyncJobsOptions extends AccountInDomainOptions { + private static final DateService dateService = new SimpleDateFormatDateService(); + + public static final ListAsyncJobsOptions NONE = new ListAsyncJobsOptions(); + + /** + * @param startDate + * the start date of the async job + */ + public ListAsyncJobsOptions startDate(Date startDate) { + this.queryParameters.replaceValues("startdate", + ImmutableSet.of(dateService.iso8601SecondsDateFormat(checkNotNull(startDate, "startDate")))); + return this; + } + + public static class Builder { + + /** + * @see ListAsyncJobsOptions#startDate + */ + public static ListAsyncJobsOptions startDate(Date startDate) { + ListAsyncJobsOptions options = new ListAsyncJobsOptions(); + return options.startDate(startDate); + } + + /** + * @see ListAsyncJobsOptions#domainId + */ + public static ListAsyncJobsOptions domainId(String id) { + ListAsyncJobsOptions options = new ListAsyncJobsOptions(); + return options.domainId(id); + } + + /** + * @see ListAsyncJobsOptions#accountInDomain + */ + public static ListAsyncJobsOptions accountInDomain(String account, String domain) { + ListAsyncJobsOptions options = new ListAsyncJobsOptions(); + return options.accountInDomain(account, domain); + } + + } + + /** + * {@inheritDoc} + */ + @Override + public ListAsyncJobsOptions accountInDomain(String account, String domain) { + return ListAsyncJobsOptions.class.cast(super.accountInDomain(account, domain)); + } + + /** + * {@inheritDoc} + */ + @Override + public ListAsyncJobsOptions domainId(String domainId) { + return ListAsyncJobsOptions.class.cast(super.domainId(domainId)); + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListCapacityOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListCapacityOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListCapacityOptions.java new file mode 100644 index 0000000..cfeb605 --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListCapacityOptions.java @@ -0,0 +1,86 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.cloudstack.domain.Capacity; +import org.jclouds.http.options.BaseHttpRequestOptions; + +import com.google.common.collect.ImmutableSet; + +/** + * Options to the listCapacity command. + */ +public class ListCapacityOptions extends BaseHttpRequestOptions { + + public static final ListCapacityOptions NONE = new ListCapacityOptions(); + + public ListCapacityOptions hostId(String hostId) { + this.queryParameters.replaceValues("hostid", ImmutableSet.of(hostId + "")); + return this; + } + + public ListCapacityOptions keyword(String keyword) { + this.queryParameters.replaceValues("keyword", ImmutableSet.of(keyword)); + return this; + } + + public ListCapacityOptions podId(String podId) { + this.queryParameters.replaceValues("podid", ImmutableSet.of(podId + "")); + return this; + } + + public ListCapacityOptions type(Capacity.Type type) { + this.queryParameters.replaceValues("type", ImmutableSet.of(type.ordinal() + "")); + return this; + } + + public ListCapacityOptions zoneId(String zoneId) { + this.queryParameters.replaceValues("zoneid", ImmutableSet.of(zoneId + "")); + return this; + } + + public static class Builder { + + public static ListCapacityOptions hostId(String hostId) { + final ListCapacityOptions options = new ListCapacityOptions(); + return options.hostId(hostId); + } + + public static ListCapacityOptions keyword(String keyword) { + final ListCapacityOptions options = new ListCapacityOptions(); + return options.keyword(keyword); + } + + public static ListCapacityOptions podId(String podId) { + final ListCapacityOptions options = new ListCapacityOptions(); + return options.podId(podId); + } + + public static ListCapacityOptions type(Capacity.Type type) { + final ListCapacityOptions options = new ListCapacityOptions(); + return options.type(type); + } + + public static ListCapacityOptions zoneId(String zoneId) { + final ListCapacityOptions options = new ListCapacityOptions(); + return options.zoneId(zoneId); + } + + } + +} + http://git-wip-us.apache.org/repos/asf/stratos/blob/86fd5cf2/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListClustersOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListClustersOptions.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListClustersOptions.java new file mode 100644 index 0000000..c42f0fb --- /dev/null +++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/main/java/org/jclouds/cloudstack/options/ListClustersOptions.java @@ -0,0 +1,121 @@ +/* + * 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.cloudstack.options; + +import org.jclouds.cloudstack.domain.AllocationState; +import org.jclouds.cloudstack.domain.Cluster; +import org.jclouds.cloudstack.domain.Host; +import org.jclouds.http.options.BaseHttpRequestOptions; + +import com.google.common.collect.ImmutableSet; + +/** + * Options used to control what cluster information is returned + * + * @see <a + * href="http://download.cloud.com/releases/2.2.0/api_2.2.12/global_admin/listClusters.html" + * /> + */ +public class ListClustersOptions extends BaseHttpRequestOptions { + + public static final ListHostsOptions NONE = new ListHostsOptions(); + + public ListClustersOptions allocationState(AllocationState allocationState) { + this.queryParameters.replaceValues("allocationstate", ImmutableSet.of(allocationState.toString())); + return this; + } + + public ListClustersOptions clusterType(Host.ClusterType clusterType) { + this.queryParameters.replaceValues("clustertype", ImmutableSet.of(clusterType.toString())); + return this; + } + + public ListClustersOptions hypervisor(String hypervisor) { + this.queryParameters.replaceValues("hypervisor", ImmutableSet.of(hypervisor)); + return this; + } + + public ListClustersOptions id(String id) { + this.queryParameters.replaceValues("id", ImmutableSet.of(id + "")); + return this; + } + + public ListClustersOptions keyword(String keyword) { + this.queryParameters.replaceValues("keyword", ImmutableSet.of(keyword)); + return this; + } + + public ListClustersOptions managedState(Cluster.ManagedState managedState) { + this.queryParameters.replaceValues("managedstate", ImmutableSet.of(managedState.toString())); + return this; + } + + public ListClustersOptions name(String name) { + this.queryParameters.replaceValues("name", ImmutableSet.of(name)); + return this; + } + + public ListClustersOptions podId(String podId) { + this.queryParameters.replaceValues("podid", ImmutableSet.of(podId + "")); + return this; + } + + public ListClustersOptions zoneId(String zoneId) { + this.queryParameters.replaceValues("zoneid", ImmutableSet.of(zoneId + "")); + return this; + } + + public static class Builder { + + public static ListClustersOptions allocationState(AllocationState allocationState) { + return new ListClustersOptions().allocationState(allocationState); + } + + public static ListClustersOptions clusterType(Host.ClusterType clusterType) { + return new ListClustersOptions().clusterType(clusterType); + } + + public static ListClustersOptions hypervisor(String hypervisor) { + return new ListClustersOptions().hypervisor(hypervisor); + } + + public static ListClustersOptions id(String id) { + return new ListClustersOptions().id(id); + } + + public static ListClustersOptions keyword(String keyword) { + return new ListClustersOptions().keyword(keyword); + } + + public static ListClustersOptions managedState(Cluster.ManagedState managedState) { + return new ListClustersOptions().managedState(managedState); + } + + public static ListClustersOptions name(String name) { + return new ListClustersOptions().name(name); + } + + public static ListClustersOptions podId(String podId) { + return new ListClustersOptions().podId(podId); + } + + public static ListClustersOptions zoneId(String zoneId) { + return new ListClustersOptions().zoneId(zoneId); + } + + } +}
