mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 02:22:52 +01:00
added type to startup commands to be used later
This commit is contained in:
parent
4dd2e6df72
commit
ea59085ae7
@ -61,7 +61,7 @@ public class DummyResource implements ServerResource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StartupCommand[] initialize() {
|
public StartupCommand[] initialize() {
|
||||||
return new StartupCommand[] {new StartupCommand()};
|
return new StartupCommand[] {new StartupCommand(Host.Type.Storage)};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -17,7 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.cloud.agent.api;
|
package com.cloud.agent.api;
|
||||||
|
|
||||||
|
import com.cloud.host.Host;
|
||||||
|
|
||||||
public class StartupCommand extends Command {
|
public class StartupCommand extends Command {
|
||||||
|
Host.Type type;
|
||||||
String dataCenter;
|
String dataCenter;
|
||||||
String pod;
|
String pod;
|
||||||
String cluster;
|
String cluster;
|
||||||
@ -41,10 +44,11 @@ public class StartupCommand extends Command {
|
|||||||
String agentTag;
|
String agentTag;
|
||||||
String resourceName;
|
String resourceName;
|
||||||
|
|
||||||
public StartupCommand() {
|
public StartupCommand(Host.Type type) {
|
||||||
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StartupCommand(Long id, String name, String dataCenter, String pod, String guid, String version) {
|
public StartupCommand(Long id, Host.Type type, String name, String dataCenter, String pod, String guid, String version) {
|
||||||
super();
|
super();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.dataCenter = dataCenter;
|
this.dataCenter = dataCenter;
|
||||||
@ -52,6 +56,11 @@ public class StartupCommand extends Command {
|
|||||||
this.guid = guid;
|
this.guid = guid;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Host.Type getHostType() {
|
||||||
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIqn() {
|
public String getIqn() {
|
||||||
@ -232,9 +241,9 @@ public class StartupCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getGuidWithoutResource() {
|
public String getGuidWithoutResource() {
|
||||||
if (resourceName == null)
|
if (resourceName == null) {
|
||||||
return guid;
|
return guid;
|
||||||
else {
|
} else {
|
||||||
int hyph = guid.lastIndexOf('-');
|
int hyph = guid.lastIndexOf('-');
|
||||||
if (hyph == -1) {
|
if (hyph == -1) {
|
||||||
return guid;
|
return guid;
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
package com.cloud.agent.api;
|
package com.cloud.agent.api;
|
||||||
|
|
||||||
public class StartupExternalFirewallCommand extends StartupCommand {
|
import com.cloud.host.Host;
|
||||||
|
|
||||||
|
public class StartupExternalFirewallCommand extends StartupCommand {
|
||||||
|
|
||||||
|
public StartupExternalFirewallCommand() {
|
||||||
|
super(Host.Type.ExternalFirewall);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
package com.cloud.agent.api;
|
package com.cloud.agent.api;
|
||||||
|
|
||||||
|
import com.cloud.host.Host;
|
||||||
|
|
||||||
public class StartupExternalLoadBalancerCommand extends StartupCommand {
|
public class StartupExternalLoadBalancerCommand extends StartupCommand {
|
||||||
|
public StartupExternalLoadBalancerCommand() {
|
||||||
|
super(Host.Type.ExternalLoadBalancer);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,12 +17,14 @@
|
|||||||
*/
|
*/
|
||||||
package com.cloud.agent.api;
|
package com.cloud.agent.api;
|
||||||
|
|
||||||
|
import com.cloud.host.Host;
|
||||||
|
|
||||||
public class StartupProxyCommand extends StartupCommand {
|
public class StartupProxyCommand extends StartupCommand {
|
||||||
private int proxyPort;
|
private int proxyPort;
|
||||||
private long proxyVmId;
|
private long proxyVmId;
|
||||||
|
|
||||||
public StartupProxyCommand() {
|
public StartupProxyCommand() {
|
||||||
super();
|
super(Host.Type.ConsoleProxy);
|
||||||
setIqn("NoIqn");
|
setIqn("NoIqn");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,7 @@ package com.cloud.agent.api;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.cloud.host.Host;
|
||||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||||
import com.cloud.network.Networks.RouterPrivateIpStrategy;
|
import com.cloud.network.Networks.RouterPrivateIpStrategy;
|
||||||
import com.cloud.vm.VirtualMachine.State;
|
import com.cloud.vm.VirtualMachine.State;
|
||||||
@ -35,7 +36,7 @@ public class StartupRoutingCommand extends StartupCommand {
|
|||||||
Map<String, String> hostDetails; //stuff like host os, cpu capabilities
|
Map<String, String> hostDetails; //stuff like host os, cpu capabilities
|
||||||
|
|
||||||
public StartupRoutingCommand() {
|
public StartupRoutingCommand() {
|
||||||
super();
|
super(Host.Type.Routing);
|
||||||
hostDetails = new HashMap<String, String>();
|
hostDetails = new HashMap<String, String>();
|
||||||
getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), RouterPrivateIpStrategy.DcGlobal.toString());
|
getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), RouterPrivateIpStrategy.DcGlobal.toString());
|
||||||
|
|
||||||
@ -62,7 +63,7 @@ public class StartupRoutingCommand extends StartupCommand {
|
|||||||
|
|
||||||
final Map<String, String> hostDetails,
|
final Map<String, String> hostDetails,
|
||||||
Map<String, State> vms) {
|
Map<String, State> vms) {
|
||||||
super();
|
super(Host.Type.Routing);
|
||||||
this.cpus = cpus;
|
this.cpus = cpus;
|
||||||
this.speed = speed;
|
this.speed = speed;
|
||||||
this.memory = memory;
|
this.memory = memory;
|
||||||
|
|||||||
@ -20,6 +20,7 @@ package com.cloud.agent.api;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.cloud.host.Host;
|
||||||
import com.cloud.storage.Storage;
|
import com.cloud.storage.Storage;
|
||||||
import com.cloud.storage.Storage.StoragePoolType;
|
import com.cloud.storage.Storage.StoragePoolType;
|
||||||
import com.cloud.storage.template.TemplateInfo;
|
import com.cloud.storage.template.TemplateInfo;
|
||||||
@ -37,11 +38,11 @@ public class StartupStorageCommand extends StartupCommand {
|
|||||||
String nfsShare;
|
String nfsShare;
|
||||||
|
|
||||||
public StartupStorageCommand() {
|
public StartupStorageCommand() {
|
||||||
super();
|
super(Host.Type.Storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StartupStorageCommand(String parent, StoragePoolType fsType, long totalSize, Map<String, TemplateInfo> info) {
|
public StartupStorageCommand(String parent, StoragePoolType fsType, long totalSize, Map<String, TemplateInfo> info) {
|
||||||
super();
|
super(Host.Type.Storage);
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.totalSize = totalSize;
|
this.totalSize = totalSize;
|
||||||
this.templateInfo = info;
|
this.templateInfo = info;
|
||||||
@ -51,7 +52,7 @@ public class StartupStorageCommand extends StartupCommand {
|
|||||||
|
|
||||||
|
|
||||||
public StartupStorageCommand(String parent, StoragePoolType fsType, Map<String, TemplateInfo> templateInfo, StoragePoolInfo poolInfo) {
|
public StartupStorageCommand(String parent, StoragePoolType fsType, Map<String, TemplateInfo> templateInfo, StoragePoolInfo poolInfo) {
|
||||||
super();
|
super(Host.Type.Storage);
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.templateInfo = templateInfo;
|
this.templateInfo = templateInfo;
|
||||||
this.totalSize = poolInfo.capacityBytes;
|
this.totalSize = poolInfo.capacityBytes;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user