mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Store all parameters of url call to BaseCmd.fullUrlParams so there will be no
changes in future API because all parameters can be retrieve from API command itself
This commit is contained in:
parent
7768ab4176
commit
379cbc1d55
@ -89,7 +89,8 @@ public abstract class BaseCmd {
|
||||
private static final DateFormat _outputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
|
||||
|
||||
private Object _responseObject = null;
|
||||
|
||||
private Map<String, String> fullUrlParams;
|
||||
|
||||
@Parameter(name="response", type=CommandType.STRING)
|
||||
private String responseType;
|
||||
|
||||
@ -112,7 +113,7 @@ public abstract class BaseCmd {
|
||||
public static LoadBalancingRulesService _lbService;
|
||||
public static RemoteAccessVpnService _ravService;
|
||||
public static BareMetalVmService _bareMetalVmService;
|
||||
|
||||
|
||||
|
||||
static void setComponents(ResponseGenerator generator) {
|
||||
ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
|
||||
@ -546,5 +547,13 @@ public abstract class BaseCmd {
|
||||
(accountType == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) ||
|
||||
(accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) ||
|
||||
(accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN));
|
||||
}
|
||||
}
|
||||
|
||||
public void setFullUrlParams(Map<String, String> map) {
|
||||
this.fullUrlParams = map;
|
||||
}
|
||||
|
||||
public Map<String, String> getFullUrlParams() {
|
||||
return this.fullUrlParams;
|
||||
}
|
||||
}
|
||||
|
||||
@ -815,7 +815,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS
|
||||
allocationState = Host.HostAllocationState.Enabled.toString();
|
||||
}
|
||||
|
||||
return discoverHostsFull(dcId, podId, clusterId, clusterName, url, username, password, cmd.getHypervisor(), hostTags, bareMetalParams, allocationState);
|
||||
return discoverHostsFull(dcId, podId, clusterId, clusterName, url, username, password, cmd.getHypervisor(), hostTags, cmd.getFullUrlParams(), allocationState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -342,7 +342,7 @@ public class ApiServer implements HttpRequestHandler {
|
||||
if (cmdClassName != null) {
|
||||
Class<?> cmdClass = Class.forName(cmdClassName);
|
||||
BaseCmd cmdObj = (BaseCmd) cmdClass.newInstance();
|
||||
|
||||
cmdObj.setFullUrlParams(paramMap);
|
||||
cmdObj.setResponseType(responseType);
|
||||
// This is where the command is either serialized, or directly dispatched
|
||||
response = queueCommand(cmdObj, paramMap);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user