Shahar Havivi has uploaded a new change for review.

Change subject: VMInit
......................................................................

VMInit

Change-Id: I3b7076eab221bf24a779e3e03fc9437d1db238a7
Signed-off-by: Shahar Havivi <[email protected]>
---
A 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMInit.java
A 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMInitFile.java
A 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMInitInterface.java
A packaging/dbscripts/upgrade/03_04_0105_add_vm_init_table.sql
4 files changed, 195 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/98/21098/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMInit.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMInit.java
new file mode 100644
index 0000000..0914588
--- /dev/null
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMInit.java
@@ -0,0 +1,95 @@
+package org.ovirt.engine.core.common.businessentities;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class VMInit implements Serializable {
+    private static final long serialVersionUID = 1416726976934454559L;
+    private String hostname;
+    private String domain;
+    private String authorizedKeys;
+    private Boolean regenerateKeys;
+
+    private List<String> dnsServers;
+    private List<String> dnsSearch;
+    private List<VMInitInterface> interfaces;
+
+    private String timeZone;
+    private String rootPassword;
+
+    private List<VMInitFile> files;
+
+    public VMInit() {
+    }
+
+
+    public void setDomain(String domain) {
+        this.domain = domain;
+    }
+    public String getDomain() {
+        return domain;
+    }
+
+    public void setHostname(String hostname) {
+        this.hostname = hostname;
+    }
+    public String getHostname() {
+        return hostname;
+    }
+
+    public void setAuthorizedKeys(String authorizedKeys) {
+        this.authorizedKeys = authorizedKeys;
+    }
+    public String getAuthorizedKeys() {
+        return authorizedKeys;
+    }
+
+    public void setRegenerateKeys(Boolean regenerateKeys) {
+        this.regenerateKeys = regenerateKeys;
+    }
+    public Boolean getRegenerateKeys() {
+        return regenerateKeys;
+    }
+
+    public void setDnsServers(List<String> dnsServers) {
+        this.dnsServers = dnsServers;
+    }
+    public List<String> getDnsServers() {
+        return dnsServers;
+    }
+
+    public void setDnsSearch(List<String> dnsSearch) {
+        this.dnsSearch = dnsSearch;
+    }
+    public List<String> getDnsSearch() {
+        return dnsSearch;
+    }
+
+    public void setInterfaces(List<VMInitInterface> interfaces) {
+        this.interfaces = interfaces;
+    }
+    public List<VMInitInterface> getInterfaces() {
+        return interfaces;
+    }
+
+    public void setTimeZone(String timeZone) {
+        this.timeZone = timeZone;
+    }
+    public String getTimeZone() {
+        return timeZone;
+    }
+
+    public void setRootPassword(String password) {
+        this.rootPassword = password;
+    }
+    public String getRootPassword() {
+        return rootPassword;
+    }
+
+    public void setFiels(List<VMInitFile> files) {
+        this.files = files;
+    }
+    public List<VMInitFile> getFiles() {
+        return files;
+    }
+}
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMInitFile.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMInitFile.java
new file mode 100644
index 0000000..fe52a19
--- /dev/null
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMInitFile.java
@@ -0,0 +1,37 @@
+package org.ovirt.engine.core.common.businessentities;
+
+import java.io.Serializable;
+
+public class VMInitFile implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    public static enum FileType {
+        BASE64,
+        PLAINTEXT,
+    }
+
+    private FileType type;
+    private String content;
+    private String name;
+
+    public void setFileType(FileType type) {
+        this.type = type;
+    }
+    public FileType getFileType() {
+        return type;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+    public String getContent() {
+        return content;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public String getName() {
+        return name;
+    }
+}
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMInitInterface.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMInitInterface.java
new file mode 100644
index 0000000..fd23792
--- /dev/null
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMInitInterface.java
@@ -0,0 +1,24 @@
+package org.ovirt.engine.core.common.businessentities;
+
+import java.io.Serializable;
+import 
org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface;
+
+public class VMInitInterface implements Serializable {
+    private static final long serialVersionUID = 1257388375049806155L;
+    private VdsNetworkInterface iface;
+    private Boolean startOnBoot;
+
+    public void setInterface(VdsNetworkInterface iface) {
+        this.iface = iface;
+    }
+    public VdsNetworkInterface getInterface() {
+        return iface;
+    }
+
+    public void setStartOnBoot(Boolean startOnBoot) {
+        this.startOnBoot = startOnBoot;
+    }
+    public Boolean getStartOnBoot() {
+        return startOnBoot;
+    }
+}
diff --git a/packaging/dbscripts/upgrade/03_04_0105_add_vm_init_table.sql 
b/packaging/dbscripts/upgrade/03_04_0105_add_vm_init_table.sql
new file mode 100644
index 0000000..62a62aa
--- /dev/null
+++ b/packaging/dbscripts/upgrade/03_04_0105_add_vm_init_table.sql
@@ -0,0 +1,39 @@
+-- ----------------------------------------------------------------------
+-- Add table "vm_init"
+-- ----------------------------------------------------------------------
+
+CREATE TABLE vm_init
+(
+    vm_id UUID NOT NULL,
+    host_name TEXT,
+    domain TEXT,
+    authorized_keys TEXT,
+    regenerate_keys BOOLEAN DEFAULT false,
+    time_zone VARCHAR(40),
+    custom_script TEXT,
+    dns_servers TEXT,
+    dns_search_domains TEXT,
+) WITH OIDS;
+
+-- ----------------------------------------------------------------------
+-- Add table "vm_init_networks"
+-- ----------------------------------------------------------------------
+
+CREATE TABLE vm_init_interfaces
+{
+    vm_id UUID NOT NULL,
+    iface_id UUID NOT NULL,
+    start_on_boot BOOLEAN DEFAULT false,
+) WITH OIDS;
+
+-- ----------------------------------------------------------------------
+-- Add table "vm_init_files"
+-- ----------------------------------------------------------------------
+
+CREATE TABLE vm_init_files
+{
+    vm_id UUID NOT NULL,
+    path TEXT,
+    content_type VARCHAR(32),
+    content TEXT
+) WITH OIDS;


-- 
To view, visit http://gerrit.ovirt.org/21098
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b7076eab221bf24a779e3e03fc9437d1db238a7
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to