mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +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
|
||||
public StartupCommand[] initialize() {
|
||||
return new StartupCommand[] {new StartupCommand()};
|
||||
return new StartupCommand[] {new StartupCommand(Host.Type.Storage)};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -17,7 +17,10 @@
|
||||
*/
|
||||
package com.cloud.agent.api;
|
||||
|
||||
import com.cloud.host.Host;
|
||||
|
||||
public class StartupCommand extends Command {
|
||||
Host.Type type;
|
||||
String dataCenter;
|
||||
String pod;
|
||||
String cluster;
|
||||
@ -41,10 +44,11 @@ public class StartupCommand extends Command {
|
||||
String agentTag;
|
||||
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();
|
||||
this.id = id;
|
||||
this.dataCenter = dataCenter;
|
||||
@ -52,6 +56,11 @@ public class StartupCommand extends Command {
|
||||
this.guid = guid;
|
||||
this.name = name;
|
||||
this.version = version;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Host.Type getHostType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getIqn() {
|
||||
@ -232,9 +241,9 @@ public class StartupCommand extends Command {
|
||||
}
|
||||
|
||||
public String getGuidWithoutResource() {
|
||||
if (resourceName == null)
|
||||
return guid;
|
||||
else {
|
||||
if (resourceName == null) {
|
||||
return guid;
|
||||
} else {
|
||||
int hyph = guid.lastIndexOf('-');
|
||||
if (hyph == -1) {
|
||||
return guid;
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
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;
|
||||
|
||||
import com.cloud.host.Host;
|
||||
|
||||
public class StartupExternalLoadBalancerCommand extends StartupCommand {
|
||||
public StartupExternalLoadBalancerCommand() {
|
||||
super(Host.Type.ExternalLoadBalancer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -17,12 +17,14 @@
|
||||
*/
|
||||
package com.cloud.agent.api;
|
||||
|
||||
import com.cloud.host.Host;
|
||||
|
||||
public class StartupProxyCommand extends StartupCommand {
|
||||
private int proxyPort;
|
||||
private long proxyVmId;
|
||||
|
||||
public StartupProxyCommand() {
|
||||
super();
|
||||
super(Host.Type.ConsoleProxy);
|
||||
setIqn("NoIqn");
|
||||
}
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ package com.cloud.agent.api;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.network.Networks.RouterPrivateIpStrategy;
|
||||
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
|
||||
|
||||
public StartupRoutingCommand() {
|
||||
super();
|
||||
super(Host.Type.Routing);
|
||||
hostDetails = new HashMap<String, String>();
|
||||
getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), RouterPrivateIpStrategy.DcGlobal.toString());
|
||||
|
||||
@ -62,7 +63,7 @@ public class StartupRoutingCommand extends StartupCommand {
|
||||
|
||||
final Map<String, String> hostDetails,
|
||||
Map<String, State> vms) {
|
||||
super();
|
||||
super(Host.Type.Routing);
|
||||
this.cpus = cpus;
|
||||
this.speed = speed;
|
||||
this.memory = memory;
|
||||
|
||||
@ -20,6 +20,7 @@ package com.cloud.agent.api;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.storage.Storage;
|
||||
import com.cloud.storage.Storage.StoragePoolType;
|
||||
import com.cloud.storage.template.TemplateInfo;
|
||||
@ -37,11 +38,11 @@ public class StartupStorageCommand extends StartupCommand {
|
||||
String nfsShare;
|
||||
|
||||
public StartupStorageCommand() {
|
||||
super();
|
||||
super(Host.Type.Storage);
|
||||
}
|
||||
|
||||
public StartupStorageCommand(String parent, StoragePoolType fsType, long totalSize, Map<String, TemplateInfo> info) {
|
||||
super();
|
||||
super(Host.Type.Storage);
|
||||
this.parent = parent;
|
||||
this.totalSize = totalSize;
|
||||
this.templateInfo = info;
|
||||
@ -51,7 +52,7 @@ public class StartupStorageCommand extends StartupCommand {
|
||||
|
||||
|
||||
public StartupStorageCommand(String parent, StoragePoolType fsType, Map<String, TemplateInfo> templateInfo, StoragePoolInfo poolInfo) {
|
||||
super();
|
||||
super(Host.Type.Storage);
|
||||
this.parent = parent;
|
||||
this.templateInfo = templateInfo;
|
||||
this.totalSize = poolInfo.capacityBytes;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user