From 2e984294ac28c6f2ede290c38164c5d536ccaf4a Mon Sep 17 00:00:00 2001 From: ChrisC Date: Tue, 31 Jan 2017 13:57:24 +0100 Subject: Initial OpenECOMP MSO OpenStack SDK lib commit Change-Id: Ieaacb2b2c0dcc469669880e73f0cda9fa59a6c5a Signed-off-by: ChrisC --- .../openstack/nova/model/ServerForCreate.java | 326 +++++++++++++++++++++ 1 file changed, 326 insertions(+) create mode 100644 nova-model/src/main/java/com/woorea/openstack/nova/model/ServerForCreate.java (limited to 'nova-model/src/main/java/com/woorea/openstack/nova/model/ServerForCreate.java') diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerForCreate.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerForCreate.java new file mode 100644 index 0000000..9f28a81 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerForCreate.java @@ -0,0 +1,326 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("server") +public class ServerForCreate implements Serializable { + + public static final class SecurityGroup implements Serializable { + + private String name; + + public SecurityGroup() { + } + + public SecurityGroup(String name) { + this.name = name; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name + * the name to set + */ + public void setName(String name) { + this.name = name; + } + + } + + private String name; + + private String adminPass; + + private String imageRef; + + private String flavorRef; + + private String accessIPv4; + + private String accessIPv6; + + private Integer min; + + private Integer max; + + private String diskConfig; + + @JsonProperty("key_name") + private String keyName; + + private List personality = new ArrayList(); + + private Map metadata = new HashMap(); + + @JsonProperty("security_groups") + private List securityGroups; + + @JsonProperty("user_data") + private String userData; + + @JsonProperty("availability_zone") + private String availabilityZone; + + @JsonProperty("config_drive") + private boolean configDrive; + + @JsonProperty("networks") + private List networks = new ArrayList(); + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name + * the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the adminPass + */ + public String getAdminPass() { + return adminPass; + } + + /** + * @param adminPass + * the adminPass to set + */ + public void setAdminPass(String adminPass) { + this.adminPass = adminPass; + } + + /** + * @return the imageRef + */ + public String getImageRef() { + return imageRef; + } + + /** + * @param imageRef + * the imageRef to set + */ + public void setImageRef(String imageRef) { + this.imageRef = imageRef; + } + + /** + * @return the flavorRef + */ + public String getFlavorRef() { + return flavorRef; + } + + /** + * @param flavorRef + * the flavorRef to set + */ + public void setFlavorRef(String flavorRef) { + this.flavorRef = flavorRef; + } + + /** + * @return the accessIPv4 + */ + public String getAccessIPv4() { + return accessIPv4; + } + + /** + * @param accessIPv4 + * the accessIPv4 to set + */ + public void setAccessIPv4(String accessIPv4) { + this.accessIPv4 = accessIPv4; + } + + /** + * @return the accessIPv6 + */ + public String getAccessIPv6() { + return accessIPv6; + } + + /** + * @param accessIPv6 + * the accessIPv6 to set + */ + public void setAccessIPv6(String accessIPv6) { + this.accessIPv6 = accessIPv6; + } + + /** + * @return the min + */ + public Integer getMin() { + return min; + } + + /** + * @param min + * the min to set + */ + public void setMin(Integer min) { + this.min = min; + } + + /** + * @return the max + */ + public Integer getMax() { + return max; + } + + /** + * @param max + * the max to set + */ + public void setMax(Integer max) { + this.max = max; + } + + /** + * @return the diskConfig + */ + public String getDiskConfig() { + return diskConfig; + } + + /** + * @param diskConfig + * the diskConfig to set + */ + public void setDiskConfig(String diskConfig) { + this.diskConfig = diskConfig; + } + + /** + * @return the keyName + */ + public String getKeyName() { + return keyName; + } + + /** + * @param keyName + * the keyName to set + */ + public void setKeyName(String keyName) { + this.keyName = keyName; + } + + /** + * @return the personality + */ + public List getPersonality() { + return personality; + } + + /** + * @param personality + * the personality to set + */ + public void setPersonality(List personality) { + this.personality = personality; + } + + /** + * @return the metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * @param metadata + * the metadata to set + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + /** + * @return the securityGroups + */ + public List getSecurityGroups() { + if (securityGroups == null) { + securityGroups = new ArrayList(); + } + return securityGroups; + } + + /** + * @return the userData + */ + public String getUserData() { + return userData; + } + + /** + * @param userData + * the userData to set + */ + public void setUserData(String userData) { + this.userData = userData; + } + + /** + * @return the availabilityZone + */ + public String getAvailabilityZone() { + return availabilityZone; + } + + /** + * @param availabilityZone + * the availabilityZone to set + */ + public void setAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + } + + public boolean isConfigDrive() { + return configDrive; + } + + public void setConfigDrive(boolean configDrive) { + this.configDrive = configDrive; + } + + public List getNetworks() { + return networks; + } + + public void setNetworks(List networks) { + this.networks = networks; + } + + public void addNetworks(String id, String fixedIp) { + NetworkForCreate net = new NetworkForCreate(); + net.setId(id); + net.setFixedIp(fixedIp); + this.networks.add(net); + } + +} -- cgit 1.2.3-korg