mirror of https://github.com/apache/cloudstack.git
AutoScale.
All API commands with separate service layer for AutoScale. Not tested.
This commit is contained in:
parent
4dddd76e95
commit
21e13657b4
|
|
@ -1,151 +1,424 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api.to;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.network.lb.LoadBalancingRule.LbDestination;
|
||||
import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy;
|
||||
|
||||
|
||||
public class LoadBalancerTO {
|
||||
String srcIp;
|
||||
int srcPort;
|
||||
String protocol;
|
||||
String algorithm;
|
||||
boolean revoked;
|
||||
boolean alreadyAdded;
|
||||
DestinationTO[] destinations;
|
||||
private StickinessPolicyTO[] stickinessPolicies;
|
||||
final static int MAX_STICKINESS_POLICIES = 1;
|
||||
|
||||
public LoadBalancerTO (String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, List<LbDestination> destinations) {
|
||||
this.srcIp = srcIp;
|
||||
this.srcPort = srcPort;
|
||||
this.protocol = protocol;
|
||||
this.algorithm = algorithm;
|
||||
this.revoked = revoked;
|
||||
this.alreadyAdded = alreadyAdded;
|
||||
this.destinations = new DestinationTO[destinations.size()];
|
||||
this.stickinessPolicies = null;
|
||||
int i = 0;
|
||||
for (LbDestination destination : destinations) {
|
||||
this.destinations[i++] = new DestinationTO(destination.getIpAddress(), destination.getDestinationPortStart(), destination.isRevoked(), false);
|
||||
}
|
||||
}
|
||||
|
||||
public LoadBalancerTO (String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, List<LbDestination> arg_destinations, List<LbStickinessPolicy> stickinessPolicies) {
|
||||
this(srcIp, srcPort, protocol, algorithm, revoked, alreadyAdded, arg_destinations);
|
||||
this.stickinessPolicies = null;
|
||||
if (stickinessPolicies != null && stickinessPolicies.size()>0) {
|
||||
this.stickinessPolicies = new StickinessPolicyTO[MAX_STICKINESS_POLICIES];
|
||||
int index = 0;
|
||||
for (LbStickinessPolicy stickinesspolicy : stickinessPolicies) {
|
||||
if (!stickinesspolicy.isRevoked()) {
|
||||
this.stickinessPolicies[index] = new StickinessPolicyTO(stickinesspolicy.getMethodName(), stickinesspolicy.getParams());
|
||||
index++;
|
||||
if (index == MAX_STICKINESS_POLICIES) break;
|
||||
}
|
||||
}
|
||||
if (index == 0) this.stickinessPolicies = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected LoadBalancerTO() {
|
||||
}
|
||||
|
||||
public String getSrcIp() {
|
||||
return srcIp;
|
||||
}
|
||||
|
||||
public int getSrcPort() {
|
||||
return srcPort;
|
||||
}
|
||||
|
||||
public String getAlgorithm() {
|
||||
return algorithm;
|
||||
}
|
||||
|
||||
public String getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
|
||||
public boolean isRevoked() {
|
||||
return revoked;
|
||||
}
|
||||
|
||||
public boolean isAlreadyAdded() {
|
||||
return alreadyAdded;
|
||||
}
|
||||
|
||||
public StickinessPolicyTO[] getStickinessPolicies() {
|
||||
return stickinessPolicies;
|
||||
}
|
||||
|
||||
public DestinationTO[] getDestinations() {
|
||||
return destinations;
|
||||
}
|
||||
|
||||
public static class StickinessPolicyTO {
|
||||
private String _methodName;
|
||||
private List<Pair<String, String>> _paramsList;
|
||||
|
||||
public String getMethodName() {
|
||||
return _methodName;
|
||||
}
|
||||
|
||||
public List<Pair<String, String>> getParams() {
|
||||
return _paramsList;
|
||||
}
|
||||
|
||||
public StickinessPolicyTO(String methodName, List<Pair<String, String>> paramsList) {
|
||||
this._methodName = methodName;
|
||||
this._paramsList = paramsList;
|
||||
}
|
||||
}
|
||||
|
||||
public static class DestinationTO {
|
||||
String destIp;
|
||||
int destPort;
|
||||
boolean revoked;
|
||||
boolean alreadyAdded;
|
||||
public DestinationTO(String destIp, int destPort, boolean revoked, boolean alreadyAdded) {
|
||||
this.destIp = destIp;
|
||||
this.destPort = destPort;
|
||||
this.revoked = revoked;
|
||||
this.alreadyAdded = alreadyAdded;
|
||||
}
|
||||
|
||||
protected DestinationTO() {
|
||||
}
|
||||
|
||||
public String getDestIp() {
|
||||
return destIp;
|
||||
}
|
||||
|
||||
public int getDestPort() {
|
||||
return destPort;
|
||||
}
|
||||
|
||||
public boolean isRevoked() {
|
||||
return revoked;
|
||||
}
|
||||
|
||||
public boolean isAlreadyAdded() {
|
||||
return alreadyAdded;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api.to;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.network.as.AutoScalePolicy;
|
||||
import com.cloud.network.as.AutoScaleVmGroup;
|
||||
import com.cloud.network.as.AutoScaleVmProfile;
|
||||
import com.cloud.network.as.Condition;
|
||||
import com.cloud.network.as.Counter;
|
||||
import com.cloud.network.lb.LoadBalancingRule.LbAutoScalePolicy;
|
||||
import com.cloud.network.lb.LoadBalancingRule.LbAutoScaleVmGroup;
|
||||
import com.cloud.network.lb.LoadBalancingRule.LbAutoScaleVmProfile;
|
||||
import com.cloud.network.lb.LoadBalancingRule.LbCondition;
|
||||
import com.cloud.network.lb.LoadBalancingRule.LbDestination;
|
||||
import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
|
||||
public class LoadBalancerTO {
|
||||
Long id;
|
||||
String srcIp;
|
||||
int srcPort;
|
||||
String protocol;
|
||||
String algorithm;
|
||||
boolean revoked;
|
||||
boolean alreadyAdded;
|
||||
DestinationTO[] destinations;
|
||||
private StickinessPolicyTO[] stickinessPolicies;
|
||||
private AutoScaleVmGroupTO autoScaleVmGroupTO;
|
||||
final static int MAX_STICKINESS_POLICIES = 1;
|
||||
|
||||
public LoadBalancerTO (Long id, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, List<LbDestination> destinations) {
|
||||
this.id = id;
|
||||
this.srcIp = srcIp;
|
||||
this.srcPort = srcPort;
|
||||
this.protocol = protocol;
|
||||
this.algorithm = algorithm;
|
||||
this.revoked = revoked;
|
||||
this.alreadyAdded = alreadyAdded;
|
||||
this.destinations = new DestinationTO[destinations.size()];
|
||||
this.stickinessPolicies = null;
|
||||
int i = 0;
|
||||
for (LbDestination destination : destinations) {
|
||||
this.destinations[i++] = new DestinationTO(destination.getIpAddress(), destination.getDestinationPortStart(), destination.isRevoked(), false);
|
||||
}
|
||||
}
|
||||
|
||||
public LoadBalancerTO (Long id, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, List<LbDestination> arg_destinations, List<LbStickinessPolicy> stickinessPolicies) {
|
||||
this(id, srcIp, srcPort, protocol, algorithm, revoked, alreadyAdded, arg_destinations);
|
||||
this.stickinessPolicies = null;
|
||||
if (stickinessPolicies != null && stickinessPolicies.size()>0) {
|
||||
this.stickinessPolicies = new StickinessPolicyTO[MAX_STICKINESS_POLICIES];
|
||||
int index = 0;
|
||||
for (LbStickinessPolicy stickinesspolicy : stickinessPolicies) {
|
||||
if (!stickinesspolicy.isRevoked()) {
|
||||
this.stickinessPolicies[index] = new StickinessPolicyTO(stickinesspolicy.getMethodName(), stickinesspolicy.getParams());
|
||||
index++;
|
||||
if (index == MAX_STICKINESS_POLICIES) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (index == 0) {
|
||||
this.stickinessPolicies = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected LoadBalancerTO() {
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getSrcIp() {
|
||||
return srcIp;
|
||||
}
|
||||
|
||||
public int getSrcPort() {
|
||||
return srcPort;
|
||||
}
|
||||
|
||||
public String getAlgorithm() {
|
||||
return algorithm;
|
||||
}
|
||||
|
||||
public String getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
|
||||
public boolean isRevoked() {
|
||||
return revoked;
|
||||
}
|
||||
|
||||
public boolean isAlreadyAdded() {
|
||||
return alreadyAdded;
|
||||
}
|
||||
|
||||
public StickinessPolicyTO[] getStickinessPolicies() {
|
||||
return stickinessPolicies;
|
||||
}
|
||||
|
||||
public DestinationTO[] getDestinations() {
|
||||
return destinations;
|
||||
}
|
||||
|
||||
public AutoScaleVmGroupTO getAutoScaleVmGroupTO() {
|
||||
return autoScaleVmGroupTO;
|
||||
}
|
||||
|
||||
public void setAutoScaleVmGroupTO(AutoScaleVmGroupTO autoScaleVmGroupTO) {
|
||||
this.autoScaleVmGroupTO = autoScaleVmGroupTO;
|
||||
}
|
||||
|
||||
public boolean isAutoScaleVmGroupTO() {
|
||||
return this.autoScaleVmGroupTO != null;
|
||||
}
|
||||
|
||||
public static class StickinessPolicyTO {
|
||||
private final String _methodName;
|
||||
private final List<Pair<String, String>> _paramsList;
|
||||
|
||||
public String getMethodName() {
|
||||
return _methodName;
|
||||
}
|
||||
|
||||
public List<Pair<String, String>> getParams() {
|
||||
return _paramsList;
|
||||
}
|
||||
|
||||
public StickinessPolicyTO(String methodName, List<Pair<String, String>> paramsList) {
|
||||
this._methodName = methodName;
|
||||
this._paramsList = paramsList;
|
||||
}
|
||||
}
|
||||
|
||||
public static class DestinationTO {
|
||||
String destIp;
|
||||
int destPort;
|
||||
boolean revoked;
|
||||
boolean alreadyAdded;
|
||||
public DestinationTO(String destIp, int destPort, boolean revoked, boolean alreadyAdded) {
|
||||
this.destIp = destIp;
|
||||
this.destPort = destPort;
|
||||
this.revoked = revoked;
|
||||
this.alreadyAdded = alreadyAdded;
|
||||
}
|
||||
|
||||
protected DestinationTO() {
|
||||
}
|
||||
|
||||
public String getDestIp() {
|
||||
return destIp;
|
||||
}
|
||||
|
||||
public int getDestPort() {
|
||||
return destPort;
|
||||
}
|
||||
|
||||
public boolean isRevoked() {
|
||||
return revoked;
|
||||
}
|
||||
|
||||
public boolean isAlreadyAdded() {
|
||||
return alreadyAdded;
|
||||
}
|
||||
}
|
||||
|
||||
public static class CounterTO {
|
||||
private final String name;
|
||||
private final String source;
|
||||
private final String value;
|
||||
|
||||
public CounterTO(String name, String source, String value) {
|
||||
this.name = name;
|
||||
this.source = source;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ConditionTO{
|
||||
private final long threshold;
|
||||
private final String relationalOperator;
|
||||
private final CounterTO counter;
|
||||
|
||||
public ConditionTO(long threshold, String relationalOperator, CounterTO counter)
|
||||
{
|
||||
this.threshold = threshold;
|
||||
this.relationalOperator = relationalOperator;
|
||||
this.counter = counter;
|
||||
}
|
||||
|
||||
public long getThreshold() {
|
||||
return threshold;
|
||||
}
|
||||
|
||||
public String getRelationalOperator() {
|
||||
return relationalOperator;
|
||||
}
|
||||
|
||||
public CounterTO getCounter() {
|
||||
return counter;
|
||||
}
|
||||
}
|
||||
|
||||
public static class AutoScalePolicyTO {
|
||||
private final long id;
|
||||
private final int duration;
|
||||
private final int quietTime;
|
||||
private String action;
|
||||
boolean revoked;
|
||||
private final List<ConditionTO> conditions;
|
||||
|
||||
public AutoScalePolicyTO(long id, int duration, int quietTime, String action, List<ConditionTO> conditions, boolean revoked) {
|
||||
this.id = id;
|
||||
this.duration = duration;
|
||||
this.quietTime = quietTime;
|
||||
this.conditions = conditions;
|
||||
this.action = action;
|
||||
this.revoked = revoked;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public int getQuietTime() {
|
||||
return quietTime;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public boolean isRevoked() {
|
||||
return revoked;
|
||||
}
|
||||
|
||||
public List<ConditionTO> getConditions() {
|
||||
return conditions;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class AutoScaleVmProfileTO {
|
||||
private final Long zoneId;
|
||||
private final Long domainId;
|
||||
private final Long serviceOfferingId;
|
||||
private final Long templateId;
|
||||
private final String otherDeployParams;
|
||||
private final String snmpCommunity;
|
||||
private final Integer snmpPort;
|
||||
private final Integer destroyVmGraceperiod;
|
||||
private final String cloudStackApiUrl;
|
||||
private final String autoScaleUserApiKey;
|
||||
private final String autoScaleUserSecretKey;
|
||||
|
||||
public AutoScaleVmProfileTO(Long zoneId, Long domainId, String cloudStackApiUrl, String autoScaleUserApiKey, String autoScaleUserSecretKey,Long serviceOfferingId, Long templateId,
|
||||
String otherDeployParams, String snmpCommunity, Integer snmpPort, Integer destroyVmGraceperiod) {
|
||||
this.zoneId = zoneId;
|
||||
this.domainId = domainId;
|
||||
this.serviceOfferingId = serviceOfferingId;
|
||||
this.templateId = templateId;
|
||||
this.otherDeployParams = otherDeployParams;
|
||||
this.snmpCommunity = snmpCommunity;
|
||||
this.snmpPort = snmpPort;
|
||||
this.destroyVmGraceperiod = destroyVmGraceperiod;
|
||||
this.cloudStackApiUrl = cloudStackApiUrl;
|
||||
this.autoScaleUserApiKey = autoScaleUserApiKey;
|
||||
this.autoScaleUserSecretKey = autoScaleUserSecretKey;
|
||||
}
|
||||
public Long getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
public Long getServiceOfferingId() {
|
||||
return serviceOfferingId;
|
||||
}
|
||||
public Long getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
public String getOtherDeployParams() {
|
||||
return otherDeployParams;
|
||||
}
|
||||
public String getSnmpCommunity() {
|
||||
return snmpCommunity;
|
||||
}
|
||||
public Integer getSnmpPort() {
|
||||
return snmpPort;
|
||||
}
|
||||
public Integer getDestroyVmGraceperiod() {
|
||||
return destroyVmGraceperiod;
|
||||
}
|
||||
public String getCloudStackApiUrl() {
|
||||
return cloudStackApiUrl;
|
||||
}
|
||||
public String getAutoScaleUserApiKey() {
|
||||
return autoScaleUserApiKey;
|
||||
}
|
||||
public String getAutoScaleUserSecretKey() {
|
||||
return autoScaleUserSecretKey;
|
||||
}
|
||||
}
|
||||
|
||||
public static class AutoScaleVmGroupTO {
|
||||
private final int minMembers;
|
||||
private final int maxMembers;
|
||||
private final int memberPort;
|
||||
private final int interval;
|
||||
private final List<AutoScalePolicyTO> policies;
|
||||
private final AutoScaleVmProfileTO profile;
|
||||
private final boolean revoked;
|
||||
private String state;
|
||||
|
||||
AutoScaleVmGroupTO(int minMembers, int maxMembers, int memberPort, int interval, List<AutoScalePolicyTO> policies, AutoScaleVmProfileTO profile, boolean revoked)
|
||||
{
|
||||
this.minMembers = minMembers;
|
||||
this.maxMembers = maxMembers;
|
||||
this.memberPort = memberPort;
|
||||
this.interval = interval;
|
||||
this.policies = policies;
|
||||
this.profile = profile;
|
||||
this.revoked = revoked;
|
||||
}
|
||||
|
||||
public int getMinMembers() {
|
||||
return minMembers;
|
||||
}
|
||||
|
||||
public int getMaxMembers() {
|
||||
return maxMembers;
|
||||
}
|
||||
|
||||
public int getMemberPort() {
|
||||
return memberPort;
|
||||
}
|
||||
|
||||
public int getInterval() {
|
||||
return interval;
|
||||
}
|
||||
|
||||
public List<AutoScalePolicyTO> getPolicies() {
|
||||
return policies;
|
||||
}
|
||||
|
||||
public AutoScaleVmProfileTO getProfile() {
|
||||
return profile;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public boolean isRevoked() {
|
||||
return revoked;
|
||||
}
|
||||
}
|
||||
|
||||
public void setAutoScaleVmGroup(LbAutoScaleVmGroup lbAutoScaleVmGroup)
|
||||
{
|
||||
List<LbAutoScalePolicy> lbAutoScalePolicies = lbAutoScaleVmGroup.getPolicies();
|
||||
List<AutoScalePolicyTO> autoScalePolicyTOs = new ArrayList<AutoScalePolicyTO>(lbAutoScalePolicies.size());
|
||||
for (LbAutoScalePolicy lbAutoScalePolicy : lbAutoScalePolicies) {
|
||||
List<LbCondition> lbConditions = lbAutoScalePolicy.getConditions();
|
||||
List<ConditionTO> conditionTOs = new ArrayList<ConditionTO>(lbConditions.size());
|
||||
for (LbCondition lbCondition : lbConditions) {
|
||||
Counter counter = lbCondition.getCounter();
|
||||
CounterTO counterTO = new CounterTO(counter.getName(), counter.getSource().toString(), "" + counter.getValue());
|
||||
Condition condition = lbCondition.getCondition();
|
||||
ConditionTO conditionTO = new ConditionTO(condition.getThreshold(), condition.getRelationalOperator().toString(), counterTO);
|
||||
conditionTOs.add(conditionTO);
|
||||
}
|
||||
AutoScalePolicy autoScalePolicy = lbAutoScalePolicy.getPolicy();
|
||||
autoScalePolicyTOs.add(new AutoScalePolicyTO(autoScalePolicy.getId(), autoScalePolicy.getDuration(),
|
||||
autoScalePolicy.getQuietTime(), autoScalePolicy.getAction(),
|
||||
conditionTOs, lbAutoScalePolicy.isRevoked()));
|
||||
}
|
||||
LbAutoScaleVmProfile lbAutoScaleVmProfile = lbAutoScaleVmGroup.getProfile();
|
||||
AutoScaleVmProfile autoScaleVmProfile = lbAutoScaleVmProfile.getProfile();
|
||||
AutoScaleVmProfileTO autoScaleVmProfileTO = new AutoScaleVmProfileTO(autoScaleVmProfile.getZoneId(), autoScaleVmProfile.getDomainId(),
|
||||
lbAutoScaleVmProfile.getAutoScaleUserApiKey(), lbAutoScaleVmProfile.getAutoScaleUserSecretKey(), lbAutoScaleVmProfile.getCloudStackApiUrl(),
|
||||
autoScaleVmProfile.getServiceOfferingId(), autoScaleVmProfile.getTemplateId(), autoScaleVmProfile.getOtherDeployParams(),
|
||||
autoScaleVmProfile.getSnmpCommunity(), autoScaleVmProfile.getSnmpPort(), autoScaleVmProfile.getDestroyVmGraceperiod());
|
||||
|
||||
AutoScaleVmGroup autoScaleVmGroup = lbAutoScaleVmGroup.getVmGroup();
|
||||
autoScaleVmGroupTO = new AutoScaleVmGroupTO(autoScaleVmGroup.getMinMembers(), autoScaleVmGroup.getMaxMembers(), autoScaleVmGroup.getMemberPort(),
|
||||
autoScaleVmGroup.getInterval(),autoScalePolicyTOs, autoScaleVmProfileTO, autoScaleVmGroup.isRevoke());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,392 +1,415 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api;
|
||||
|
||||
public class ApiConstants {
|
||||
public static final String ACCOUNT = "account";
|
||||
public static final String ACCOUNTS = "accounts";
|
||||
public static final String ACCOUNT_TYPE = "accounttype";
|
||||
public static final String ACCOUNT_ID = "accountid";
|
||||
public static final String ALGORITHM = "algorithm";
|
||||
public static final String ALLOCATED_ONLY = "allocatedonly";
|
||||
public static final String API_KEY = "userapikey";
|
||||
public static final String APPLIED = "applied";
|
||||
public static final String AVAILABLE = "available";
|
||||
public static final String BITS = "bits";
|
||||
public static final String BOOTABLE = "bootable";
|
||||
public static final String BIND_DN = "binddn";
|
||||
public static final String BIND_PASSWORD = "bindpass";
|
||||
public static final String CATEGORY = "category";
|
||||
public static final String CERTIFICATE = "certificate";
|
||||
public static final String PRIVATE_KEY = "privatekey";
|
||||
public static final String DOMAIN_SUFFIX = "domainsuffix";
|
||||
public static final String DNS_SEARCH_ORDER = "dnssearchorder";
|
||||
public static final String CIDR = "cidr";
|
||||
public static final String CIDR_LIST = "cidrlist";
|
||||
public static final String CLEANUP = "cleanup";
|
||||
public static final String CLUSTER_ID = "clusterid";
|
||||
public static final String CLUSTER_NAME = "clustername";
|
||||
public static final String CLUSTER_TYPE = "clustertype";
|
||||
public static final String COMPONENT = "component";
|
||||
public static final String CPU_NUMBER = "cpunumber";
|
||||
public static final String CPU_SPEED = "cpuspeed";
|
||||
public static final String CREATED = "created";
|
||||
public static final String CUSTOMIZED = "customized";
|
||||
public static final String DESCRIPTION = "description";
|
||||
public static final String DESTINATION_ZONE_ID = "destzoneid";
|
||||
public static final String DETAILS = "details";
|
||||
public static final String DEVICE_ID = "deviceid";
|
||||
public static final String DISK_OFFERING_ID = "diskofferingid";
|
||||
public static final String DISK_SIZE = "disksize";
|
||||
public static final String DISPLAY_NAME = "displayname";
|
||||
public static final String DISPLAY_TEXT = "displaytext";
|
||||
public static final String DNS1 = "dns1";
|
||||
public static final String DNS2 = "dns2";
|
||||
public static final String DOMAIN = "domain";
|
||||
public static final String DOMAIN_ID = "domainid";
|
||||
public static final String DURATION = "duration";
|
||||
public static final String EMAIL = "email";
|
||||
public static final String END_DATE = "enddate";
|
||||
public static final String END_IP = "endip";
|
||||
public static final String END_PORT = "endport";
|
||||
public static final String ENTRY_TIME = "entrytime";
|
||||
public static final String FETCH_LATEST = "fetchlatest";
|
||||
public static final String FIRSTNAME = "firstname";
|
||||
public static final String FORCED = "forced";
|
||||
public static final String FORCED_DESTROY_LOCAL_STORAGE = "forcedestroylocalstorage";
|
||||
public static final String FORMAT = "format";
|
||||
public static final String FOR_VIRTUAL_NETWORK = "forvirtualnetwork";
|
||||
public static final String GATEWAY = "gateway";
|
||||
public static final String GROUP = "group";
|
||||
public static final String GROUP_ID = "groupid";
|
||||
public static final String GUEST_CIDR_ADDRESS = "guestcidraddress";
|
||||
public static final String HA_ENABLE = "haenable";
|
||||
public static final String HOST_ID = "hostid";
|
||||
public static final String HOST_NAME = "hostname";
|
||||
public static final String HYPERVISOR = "hypervisor";
|
||||
public static final String INLINE = "inline";
|
||||
public static final String INSTANCE = "instance";
|
||||
public static final String ICMP_CODE = "icmpcode";
|
||||
public static final String ICMP_TYPE = "icmptype";
|
||||
public static final String ID = "id";
|
||||
public static final String IDS = "ids";
|
||||
public static final String INTERNAL_DNS1 = "internaldns1";
|
||||
public static final String INTERNAL_DNS2 = "internaldns2";
|
||||
public static final String INTERVAL_TYPE = "intervaltype";
|
||||
public static final String IP_ADDRESS = "ipaddress";
|
||||
public static final String IP_ADDRESS_ID = "ipaddressid";
|
||||
public static final String IP_AVAILABLE = "ipavailable";
|
||||
public static final String IP_LIMIT = "iplimit";
|
||||
public static final String IP_TOTAL = "iptotal";
|
||||
public static final String IS_CLEANUP_REQUIRED = "iscleanuprequired";
|
||||
public static final String IS_EXTRACTABLE = "isextractable";
|
||||
public static final String IS_FEATURED = "isfeatured";
|
||||
public static final String IS_PUBLIC = "ispublic";
|
||||
public static final String IS_READY = "isready";
|
||||
public static final String IS_RECURSIVE = "isrecursive";
|
||||
public static final String ISO_FILTER = "isofilter";
|
||||
public static final String ISO_GUEST_OS_NONE = "None";
|
||||
public static final String JOB_ID = "jobid";
|
||||
public static final String JOB_STATUS = "jobstatus";
|
||||
public static final String LASTNAME = "lastname";
|
||||
public static final String LEVEL = "level";
|
||||
public static final String LIMIT_CPU_USE = "limitcpuuse";
|
||||
public static final String LOCK = "lock";
|
||||
public static final String LUN = "lun";
|
||||
public static final String LBID = "lbruleid";
|
||||
public static final String MAX = "max";
|
||||
public static final String MAX_SNAPS = "maxsnaps";
|
||||
public static final String MEMORY = "memory";
|
||||
public static final String MODE = "mode";
|
||||
public static final String NAME = "name";
|
||||
public static final String METHOD_NAME = "methodname";
|
||||
public static final String NETWORK_DOMAIN = "networkdomain";
|
||||
public static final String NETMASK = "netmask";
|
||||
public static final String NEW_NAME = "newname";
|
||||
public static final String NUM_RETRIES = "numretries";
|
||||
public static final String OFFER_HA = "offerha";
|
||||
public static final String IS_SYSTEM_OFFERING = "issystem";
|
||||
public static final String IS_DEFAULT_USE = "defaultuse";
|
||||
public static final String OP = "op";
|
||||
public static final String OS_CATEGORY_ID = "oscategoryid";
|
||||
public static final String OS_TYPE_ID = "ostypeid";
|
||||
public static final String PARENT_DOMAIN_ID = "parentdomainid";
|
||||
public static final String PASSWORD = "password";
|
||||
public static final String NEW_PASSWORD = "new_password";
|
||||
public static final String PASSWORD_ENABLED = "passwordenabled";
|
||||
public static final String SSHKEY_ENABLED = "sshkeyenabled";
|
||||
public static final String PATH = "path";
|
||||
public static final String POD_ID = "podid";
|
||||
public static final String POLICY_ID = "policyid";
|
||||
public static final String PORT = "port";
|
||||
public static final String PORTAL = "portal";
|
||||
public static final String PORT_FORWARDING_SERVICE_ID = "portforwardingserviceid";
|
||||
public static final String PRIVATE_INTERFACE = "privateinterface";
|
||||
public static final String PRIVATE_IP = "privateip";
|
||||
public static final String PRIVATE_PORT = "privateport";
|
||||
public static final String PRIVATE_START_PORT = "privateport";
|
||||
public static final String PRIVATE_END_PORT = "privateendport";
|
||||
public static final String PRIVATE_ZONE = "privatezone";
|
||||
public static final String PROTOCOL = "protocol";
|
||||
public static final String PUBLIC_INTERFACE = "publicinterface";
|
||||
public static final String PUBLIC_IP_ID = "publicipid";
|
||||
public static final String PUBLIC_IP = "publicip";
|
||||
public static final String PUBLIC_PORT = "publicport";
|
||||
public static final String PUBLIC_START_PORT = "publicport";
|
||||
public static final String PUBLIC_END_PORT = "publicendport";
|
||||
public static final String PUBLIC_ZONE = "publiczone";
|
||||
public static final String RECEIVED_BYTES = "receivedbytes";
|
||||
public static final String REQUIRES_HVM = "requireshvm";
|
||||
public static final String RESOURCE_TYPE = "resourcetype";
|
||||
public static final String QUERY_FILTER = "queryfilter";
|
||||
public static final String SCHEDULE = "schedule";
|
||||
public static final String SCOPE = "scope";
|
||||
public static final String SECRET_KEY = "usersecretkey";
|
||||
public static final String KEY = "key";
|
||||
public static final String SEARCH_BASE = "searchbase";
|
||||
public static final String SECURITY_GROUP_IDS = "securitygroupids";
|
||||
public static final String SECURITY_GROUP_NAMES = "securitygroupnames";
|
||||
public static final String SECURITY_GROUP_NAME = "securitygroupname";
|
||||
public static final String SECURITY_GROUP_ID = "securitygroupid";
|
||||
public static final String SENT = "sent";
|
||||
public static final String SENT_BYTES = "sentbytes";
|
||||
public static final String SERVICE_OFFERING_ID = "serviceofferingid";
|
||||
public static final String SHOW_CAPACITIES = "showcapacities";
|
||||
public static final String SIZE = "size";
|
||||
public static final String SNAPSHOT_ID = "snapshotid";
|
||||
public static final String SNAPSHOT_POLICY_ID = "snapshotpolicyid";
|
||||
public static final String SNAPSHOT_TYPE = "snapshottype";
|
||||
public static final String SOURCE_ZONE_ID = "sourcezoneid";
|
||||
public static final String START_DATE = "startdate";
|
||||
public static final String START_IP = "startip";
|
||||
public static final String START_PORT = "startport";
|
||||
public static final String STATE = "state";
|
||||
public static final String STATUS = "status";
|
||||
public static final String STORAGE_TYPE = "storagetype";
|
||||
public static final String SYSTEM_VM_TYPE = "systemvmtype";
|
||||
public static final String TAGS = "tags";
|
||||
public static final String TARGET_IQN = "targetiqn";
|
||||
public static final String TEMPLATE_FILTER = "templatefilter";
|
||||
public static final String TEMPLATE_ID = "templateid";
|
||||
public static final String TIMEOUT = "timeout";
|
||||
public static final String TIMEZONE = "timezone";
|
||||
public static final String TYPE = "type";
|
||||
public static final String TRUST_STORE = "truststore";
|
||||
public static final String TRUST_STORE_PASSWORD = "truststorepass";
|
||||
public static final String URL = "url";
|
||||
public static final String USAGE_INTERFACE = "usageinterface";
|
||||
public static final String USER_DATA = "userdata";
|
||||
public static final String USER_ID = "userid";
|
||||
public static final String USE_SSL = "ssl";
|
||||
public static final String USERNAME = "username";
|
||||
public static final String USER_SECURITY_GROUP_LIST = "usersecuritygrouplist";
|
||||
public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork";
|
||||
public static final String VALUE = "value";
|
||||
public static final String VIRTUAL_MACHINE_ID = "virtualmachineid";
|
||||
public static final String VIRTUAL_MACHINE_IDS = "virtualmachineids";
|
||||
public static final String VLAN = "vlan";
|
||||
public static final String VLAN_ID = "vlanid";
|
||||
public static final String VM_AVAILABLE = "vmavailable";
|
||||
public static final String VM_LIMIT = "vmlimit";
|
||||
public static final String VM_TOTAL = "vmtotal";
|
||||
public static final String VNET = "vnet";
|
||||
public static final String VOLUME_ID = "volumeid";
|
||||
public static final String ZONE_ID = "zoneid";
|
||||
public static final String ZONE_NAME = "zonename";
|
||||
public static final String NETWORK_TYPE = "networktype";
|
||||
public static final String PAGE = "page";
|
||||
public static final String PAGE_SIZE = "pagesize";
|
||||
public static final String COUNT = "count";
|
||||
public static final String TRAFFIC_TYPE = "traffictype";
|
||||
public static final String NETWORK_OFFERING_ID = "networkofferingid";
|
||||
public static final String NETWORK_IDS = "networkids";
|
||||
public static final String NETWORK_ID = "networkid";
|
||||
public static final String SPECIFY_VLAN = "specifyvlan";
|
||||
public static final String IS_DEFAULT = "isdefault";
|
||||
public static final String IS_SYSTEM = "issystem";
|
||||
public static final String AVAILABILITY = "availability";
|
||||
public static final String NETWORKRATE = "networkrate";
|
||||
public static final String HOST_TAGS = "hosttags";
|
||||
public static final String SSH_KEYPAIR = "keypair";
|
||||
public static final String HOST_CPU_CAPACITY = "hostcpucapacity";
|
||||
public static final String HOST_CPU_NUM = "hostcpunum";
|
||||
public static final String HOST_MEM_CAPACITY = "hostmemcapacity";
|
||||
public static final String HOST_MAC = "hostmac";
|
||||
public static final String HOST_TAG = "hosttag";
|
||||
public static final String PXE_SERVER_TYPE = "pxeservertype";
|
||||
public static final String LINMIN_USERNAME = "linminusername";
|
||||
public static final String LINMIN_PASSWORD = "linminpassword";
|
||||
public static final String LINMIN_APID = "linminapid";
|
||||
public static final String DHCP_SERVER_TYPE = "dhcpservertype";
|
||||
public static final String LINK_LOCAL_IP = "linklocalip";
|
||||
public static final String LINK_LOCAL_MAC_ADDRESS = "linklocalmacaddress";
|
||||
public static final String LINK_LOCAL_MAC_NETMASK = "linklocalnetmask";
|
||||
public static final String LINK_LOCAL_NETWORK_ID = "linklocalnetworkid";
|
||||
public static final String PRIVATE_MAC_ADDRESS = "privatemacaddress";
|
||||
public static final String PRIVATE_NETMASK = "privatenetmask";
|
||||
public static final String PRIVATE_NETWORK_ID = "privatenetworkid";
|
||||
public static final String ALLOCATION_STATE = "allocationstate";
|
||||
public static final String MANAGED_STATE = "managedstate";
|
||||
public static final String STORAGE_ID="storageid";
|
||||
public static final String PING_STORAGE_SERVER_IP = "pingstorageserverip";
|
||||
public static final String PING_DIR = "pingdir";
|
||||
public static final String TFTP_DIR = "tftpdir";
|
||||
public static final String PING_CIFS_USERNAME = "pingcifsusername";
|
||||
public static final String PING_CIFS_PASSWORD = "pingcifspassword";
|
||||
public static final String CHECKSUM="checksum";
|
||||
public static final String NETWORK_DEVICE_TYPE = "networkdevicetype";
|
||||
public static final String NETWORK_DEVICE_PARAMETER_LIST = "networkdeviceparameterlist";
|
||||
public static final String ZONE_TOKEN = "zonetoken";
|
||||
public static final String DHCP_PROVIDER = "dhcpprovider";
|
||||
public static final String RESULT = "success";
|
||||
public static final String LUN_ID = "lunId";
|
||||
public static final String IQN = "iqn";
|
||||
public static final String AGGREGATE_NAME = "aggregatename";
|
||||
public static final String POOL_NAME = "poolname";
|
||||
public static final String VOLUME_NAME = "volumename";
|
||||
public static final String SNAPSHOT_POLICY = "snapshotpolicy";
|
||||
public static final String SNAPSHOT_RESERVATION = "snapshotreservation";
|
||||
public static final String IP_NETWORK_LIST = "iptonetworklist";
|
||||
public static final String PARAM_LIST = "param";
|
||||
public static final String FOR_LOAD_BALANCING = "forloadbalancing";
|
||||
public static final String KEYBOARD="keyboard";
|
||||
public static final String OPEN_FIREWALL="openfirewall";
|
||||
public static final String TEMPLATE_TAG = "templatetag";
|
||||
public static final String HYPERVISOR_VERSION = "hypervisorversion";
|
||||
public static final String MAX_GUESTS_LIMIT = "maxguestslimit";
|
||||
public static final String PROJECT_ID = "projectid";
|
||||
public static final String PROJECT_IDS = "projectids";
|
||||
public static final String PROJECT = "project";
|
||||
public static final String ROLE = "role";
|
||||
public static final String USER = "user";
|
||||
public static final String ACTIVE_ONLY = "activeonly";
|
||||
public static final String TOKEN = "token";
|
||||
public static final String ACCEPT = "accept";
|
||||
public static final String SORT_KEY = "sortkey";
|
||||
public static final String ACCOUNT_DETAILS = "accountdetails";
|
||||
public static final String SERVICE_PROVIDER_LIST = "serviceproviderlist";
|
||||
public static final String SERVICE_CAPABILITY_LIST = "servicecapabilitylist";
|
||||
public static final String CAN_CHOOSE_SERVICE_CAPABILITY = "canchooseservicecapability";
|
||||
public static final String PROVIDER = "provider";
|
||||
public static final String NETWORK_SPEED = "networkspeed";
|
||||
public static final String BROADCAST_DOMAIN_RANGE = "broadcastdomainrange";
|
||||
public static final String ISOLATION_METHODS = "isolationmethods";
|
||||
public static final String PHYSICAL_NETWORK_ID = "physicalnetworkid";
|
||||
public static final String DEST_PHYSICAL_NETWORK_ID = "destinationphysicalnetworkid";
|
||||
public static final String ENABLED = "enabled";
|
||||
public static final String SERVICE_NAME = "servicename";
|
||||
public static final String DHCP_RANGE = "dhcprange";
|
||||
public static final String UUID = "uuid";
|
||||
public static final String SECURITY_GROUP_EANBLED = "securitygroupenabled";
|
||||
public static final String GUEST_IP_TYPE = "guestiptype";
|
||||
public static final String XEN_NETWORK_LABEL = "xennetworklabel";
|
||||
public static final String KVM_NETWORK_LABEL = "kvmnetworklabel";
|
||||
public static final String VMWARE_NETWORK_LABEL = "vmwarenetworklabel";
|
||||
public static final String NETWORK_SERVICE_PROVIDER_ID = "nspid";
|
||||
public static final String SERVICE_LIST = "servicelist";
|
||||
public static final String CAN_ENABLE_INDIVIDUAL_SERVICE = "canenableindividualservice";
|
||||
public static final String SUPPORTED_SERVICES = "supportedservices";
|
||||
public static final String NSP_ID= "nspid";
|
||||
public static final String ACL_TYPE= "acltype";
|
||||
public static final String SUBDOMAIN_ACCESS = "subdomainaccess";
|
||||
public static final String LOAD_BALANCER_DEVICE_ID = "lbdeviceid";
|
||||
public static final String LOAD_BALANCER_DEVICE_NAME = "lbdevicename";
|
||||
public static final String LOAD_BALANCER_DEVICE_STATE = "lbdevicestate";
|
||||
public static final String LOAD_BALANCER_DEVICE_CAPACITY = "lbdevicecapacity";
|
||||
public static final String LOAD_BALANCER_DEVICE_DEDICATED = "lbdevicededicated";
|
||||
public static final String FIREWALL_DEVICE_ID = "fwdeviceid";
|
||||
public static final String FIREWALL_DEVICE_NAME = "fwdevicename";
|
||||
public static final String FIREWALL_DEVICE_STATE = "fwdevicestate";
|
||||
public static final String FIREWALL_DEVICE_CAPACITY = "fwdevicecapacity";
|
||||
public static final String FIREWALL_DEVICE_DEDICATED = "fwdevicededicated";
|
||||
public static final String SERVICE = "service";
|
||||
public static final String ASSOCIATED_NETWORK_ID = "associatednetworkid";
|
||||
public static final String SOURCE_NAT_SUPPORTED = "sourcenatsupported";
|
||||
public static final String RESOURCE_STATE = "resourcestate";
|
||||
public static final String PROJECT_INVITE_REQUIRED = "projectinviterequired";
|
||||
public static final String RESTART_REQUIRED = "restartrequired";
|
||||
public static final String ALLOW_USER_CREATE_PROJECTS = "allowusercreateprojects";
|
||||
public static final String CONSERVE_MODE = "conservemode";
|
||||
public static final String TRAFFIC_TYPE_IMPLEMENTOR = "traffictypeimplementor";
|
||||
public static final String KEYWORD = "keyword";
|
||||
public static final String LIST_ALL = "listall";
|
||||
public static final String SPECIFY_IP_RANGES = "specifyipranges";
|
||||
public static final String IS_SOURCE_NAT = "issourcenat";
|
||||
public static final String IS_STATIC_NAT = "isstaticnat";
|
||||
public static final String SORT_BY = "sortby";
|
||||
public static final String CHANGE_CIDR = "changecidr";
|
||||
public static final String PURPOSE = "purpose";
|
||||
public static final String IS_TAGGED = "istagged";
|
||||
public static final String INSTANCE_NAME = "instancename";
|
||||
public static final String START_VM = "startvm";
|
||||
public static final String HA_HOST = "hahost";
|
||||
public static final String CUSTOM_DISK_OFF_MAX_SIZE = "customdiskofferingmaxsize";
|
||||
public static final String DEFAULT_ZONE_ID = "defaultzoneid";
|
||||
public static final String GUID = "guid";
|
||||
|
||||
public static final String EXTERNAL_SWITCH_MGMT_DEVICE_ID = "vsmdeviceid";
|
||||
public static final String EXTERNAL_SWITCH_MGMT_DEVICE_NAME = "vsmdevicename";
|
||||
public static final String EXTERNAL_SWITCH_MGMT_DEVICE_STATE = "vsmdevicestate";
|
||||
// Would we need to have a capacity field for Cisco N1KV VSM? Max hosts managed by it perhaps? May remove this later.
|
||||
public static final String EXTERNAL_SWITCH_MGMT_DEVICE_CAPACITY = "vsmdevicecapacity";
|
||||
public static final String CISCO_NEXUS_VSM_NAME = "vsmname";
|
||||
public static final String VSM_USERNAME = "vsmusername";
|
||||
public static final String VSM_PASSWORD = "vsmpassword";
|
||||
public static final String VSM_IPADDRESS = "vsmipaddress";
|
||||
public static final String VSM_MGMT_VLAN_ID = "vsmmgmtvlanid";
|
||||
public static final String VSM_PKT_VLAN_ID = "vsmpktvlanid";
|
||||
public static final String VSM_CTRL_VLAN_ID = "vsmctrlvlanid";
|
||||
public static final String VSM_STORAGE_VLAN_ID = "vsmstoragevlanid";
|
||||
public static final String VSM_DOMAIN_ID = "vsmdomainid";
|
||||
public static final String VSM_CONFIG_MODE = "vsmconfigmode";
|
||||
public static final String VSM_CONFIG_STATE = "vsmconfigstate";
|
||||
public static final String VSM_DEVICE_STATE = "vsmdevicestate";
|
||||
public static final String INCL_ZONES = "includezones";
|
||||
public static final String EXCL_ZONES = "excludezones";
|
||||
public static final String RESOURCE_IDS = "resourceids";
|
||||
public static final String RESOURCE_ID = "resourceid";
|
||||
public static final String CUSTOMER = "customer";
|
||||
public static final String VPC_OFF_ID = "vpcofferingid";
|
||||
public static final String NETWORK = "network";
|
||||
public static final String VPC_ID = "vpcid";
|
||||
public static final String CAN_USE_FOR_DEPLOY = "canusefordeploy";
|
||||
public static final String GATEWAY_ID = "gatewayid";
|
||||
public static final String S2S_VPN_GATEWAY_ID = "s2svpngatewayid";
|
||||
public static final String S2S_CUSTOMER_GATEWAY_ID = "s2scustomergatewayid";
|
||||
public static final String IPSEC_PSK = "ipsecpsk";
|
||||
public static final String GUEST_IP = "guestip";
|
||||
public static final String REMOVED = "removed";
|
||||
public static final String IKE_POLICY = "ikepolicy";
|
||||
public static final String ESP_POLICY = "esppolicy";
|
||||
public static final String LIFETIME = "lifetime";
|
||||
public static final String FOR_VPC = "forvpc";
|
||||
|
||||
public enum HostDetails {
|
||||
all, capacity, events, stats, min;
|
||||
}
|
||||
|
||||
public enum VMDetails {
|
||||
all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min;
|
||||
}
|
||||
|
||||
public enum LDAPParams {
|
||||
hostname, port, usessl, queryfilter, searchbase, dn, passwd, truststore, truststorepass;
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return "ldap." + name();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api;
|
||||
|
||||
public class ApiConstants {
|
||||
public static final String ACCOUNT = "account";
|
||||
public static final String ACCOUNTS = "accounts";
|
||||
public static final String ACCOUNT_TYPE = "accounttype";
|
||||
public static final String ACCOUNT_ID = "accountid";
|
||||
public static final String ALGORITHM = "algorithm";
|
||||
public static final String ALLOCATED_ONLY = "allocatedonly";
|
||||
public static final String API_KEY = "userapikey";
|
||||
public static final String APPLIED = "applied";
|
||||
public static final String AVAILABLE = "available";
|
||||
public static final String BITS = "bits";
|
||||
public static final String BOOTABLE = "bootable";
|
||||
public static final String BIND_DN = "binddn";
|
||||
public static final String BIND_PASSWORD = "bindpass";
|
||||
public static final String CATEGORY = "category";
|
||||
public static final String CERTIFICATE = "certificate";
|
||||
public static final String PRIVATE_KEY = "privatekey";
|
||||
public static final String DOMAIN_SUFFIX = "domainsuffix";
|
||||
public static final String DNS_SEARCH_ORDER = "dnssearchorder";
|
||||
public static final String CIDR = "cidr";
|
||||
public static final String CIDR_LIST = "cidrlist";
|
||||
public static final String CLEANUP = "cleanup";
|
||||
public static final String CLUSTER_ID = "clusterid";
|
||||
public static final String CLUSTER_NAME = "clustername";
|
||||
public static final String CLUSTER_TYPE = "clustertype";
|
||||
public static final String COMPONENT = "component";
|
||||
public static final String CPU_NUMBER = "cpunumber";
|
||||
public static final String CPU_SPEED = "cpuspeed";
|
||||
public static final String CREATED = "created";
|
||||
public static final String CUSTOMIZED = "customized";
|
||||
public static final String DESCRIPTION = "description";
|
||||
public static final String DESTINATION_ZONE_ID = "destzoneid";
|
||||
public static final String DETAILS = "details";
|
||||
public static final String DEVICE_ID = "deviceid";
|
||||
public static final String DISK_OFFERING_ID = "diskofferingid";
|
||||
public static final String DISK_SIZE = "disksize";
|
||||
public static final String DISPLAY_NAME = "displayname";
|
||||
public static final String DISPLAY_TEXT = "displaytext";
|
||||
public static final String DNS1 = "dns1";
|
||||
public static final String DNS2 = "dns2";
|
||||
public static final String DOMAIN = "domain";
|
||||
public static final String DOMAIN_ID = "domainid";
|
||||
public static final String DURATION = "duration";
|
||||
public static final String EMAIL = "email";
|
||||
public static final String END_DATE = "enddate";
|
||||
public static final String END_IP = "endip";
|
||||
public static final String END_PORT = "endport";
|
||||
public static final String ENTRY_TIME = "entrytime";
|
||||
public static final String FETCH_LATEST = "fetchlatest";
|
||||
public static final String FIRSTNAME = "firstname";
|
||||
public static final String FORCED = "forced";
|
||||
public static final String FORCED_DESTROY_LOCAL_STORAGE = "forcedestroylocalstorage";
|
||||
public static final String FORMAT = "format";
|
||||
public static final String FOR_VIRTUAL_NETWORK = "forvirtualnetwork";
|
||||
public static final String GATEWAY = "gateway";
|
||||
public static final String GROUP = "group";
|
||||
public static final String GROUP_ID = "groupid";
|
||||
public static final String GUEST_CIDR_ADDRESS = "guestcidraddress";
|
||||
public static final String HA_ENABLE = "haenable";
|
||||
public static final String HOST_ID = "hostid";
|
||||
public static final String HOST_NAME = "hostname";
|
||||
public static final String HYPERVISOR = "hypervisor";
|
||||
public static final String INLINE = "inline";
|
||||
public static final String INSTANCE = "instance";
|
||||
public static final String ICMP_CODE = "icmpcode";
|
||||
public static final String ICMP_TYPE = "icmptype";
|
||||
public static final String ID = "id";
|
||||
public static final String IDS = "ids";
|
||||
public static final String INTERNAL_DNS1 = "internaldns1";
|
||||
public static final String INTERNAL_DNS2 = "internaldns2";
|
||||
public static final String INTERVAL_TYPE = "intervaltype";
|
||||
public static final String IP_ADDRESS = "ipaddress";
|
||||
public static final String IP_ADDRESS_ID = "ipaddressid";
|
||||
public static final String IP_AVAILABLE = "ipavailable";
|
||||
public static final String IP_LIMIT = "iplimit";
|
||||
public static final String IP_TOTAL = "iptotal";
|
||||
public static final String IS_CLEANUP_REQUIRED = "iscleanuprequired";
|
||||
public static final String IS_EXTRACTABLE = "isextractable";
|
||||
public static final String IS_FEATURED = "isfeatured";
|
||||
public static final String IS_PUBLIC = "ispublic";
|
||||
public static final String IS_READY = "isready";
|
||||
public static final String IS_RECURSIVE = "isrecursive";
|
||||
public static final String ISO_FILTER = "isofilter";
|
||||
public static final String ISO_GUEST_OS_NONE = "None";
|
||||
public static final String JOB_ID = "jobid";
|
||||
public static final String JOB_STATUS = "jobstatus";
|
||||
public static final String LASTNAME = "lastname";
|
||||
public static final String LEVEL = "level";
|
||||
public static final String LIMIT_CPU_USE = "limitcpuuse";
|
||||
public static final String LOCK = "lock";
|
||||
public static final String LUN = "lun";
|
||||
public static final String LBID = "lbruleid";
|
||||
public static final String MAX = "max";
|
||||
public static final String MAX_SNAPS = "maxsnaps";
|
||||
public static final String MEMORY = "memory";
|
||||
public static final String MODE = "mode";
|
||||
public static final String NAME = "name";
|
||||
public static final String METHOD_NAME = "methodname";
|
||||
public static final String NETWORK_DOMAIN = "networkdomain";
|
||||
public static final String NETMASK = "netmask";
|
||||
public static final String NEW_NAME = "newname";
|
||||
public static final String NUM_RETRIES = "numretries";
|
||||
public static final String OFFER_HA = "offerha";
|
||||
public static final String IS_SYSTEM_OFFERING = "issystem";
|
||||
public static final String IS_DEFAULT_USE = "defaultuse";
|
||||
public static final String OP = "op";
|
||||
public static final String OS_CATEGORY_ID = "oscategoryid";
|
||||
public static final String OS_TYPE_ID = "ostypeid";
|
||||
public static final String PARENT_DOMAIN_ID = "parentdomainid";
|
||||
public static final String PASSWORD = "password";
|
||||
public static final String NEW_PASSWORD = "new_password";
|
||||
public static final String PASSWORD_ENABLED = "passwordenabled";
|
||||
public static final String SSHKEY_ENABLED = "sshkeyenabled";
|
||||
public static final String PATH = "path";
|
||||
public static final String POD_ID = "podid";
|
||||
public static final String POLICY_ID = "policyid";
|
||||
public static final String PORT = "port";
|
||||
public static final String PORTAL = "portal";
|
||||
public static final String PORT_FORWARDING_SERVICE_ID = "portforwardingserviceid";
|
||||
public static final String PRIVATE_INTERFACE = "privateinterface";
|
||||
public static final String PRIVATE_IP = "privateip";
|
||||
public static final String PRIVATE_PORT = "privateport";
|
||||
public static final String PRIVATE_START_PORT = "privateport";
|
||||
public static final String PRIVATE_END_PORT = "privateendport";
|
||||
public static final String PRIVATE_ZONE = "privatezone";
|
||||
public static final String PROTOCOL = "protocol";
|
||||
public static final String PUBLIC_INTERFACE = "publicinterface";
|
||||
public static final String PUBLIC_IP_ID = "publicipid";
|
||||
public static final String PUBLIC_IP = "publicip";
|
||||
public static final String PUBLIC_PORT = "publicport";
|
||||
public static final String PUBLIC_START_PORT = "publicport";
|
||||
public static final String PUBLIC_END_PORT = "publicendport";
|
||||
public static final String PUBLIC_ZONE = "publiczone";
|
||||
public static final String RECEIVED_BYTES = "receivedbytes";
|
||||
public static final String REQUIRES_HVM = "requireshvm";
|
||||
public static final String RESOURCE_TYPE = "resourcetype";
|
||||
public static final String QUERY_FILTER = "queryfilter";
|
||||
public static final String SCHEDULE = "schedule";
|
||||
public static final String SCOPE = "scope";
|
||||
public static final String SECRET_KEY = "usersecretkey";
|
||||
public static final String KEY = "key";
|
||||
public static final String SEARCH_BASE = "searchbase";
|
||||
public static final String SECURITY_GROUP_IDS = "securitygroupids";
|
||||
public static final String SECURITY_GROUP_NAMES = "securitygroupnames";
|
||||
public static final String SECURITY_GROUP_NAME = "securitygroupname";
|
||||
public static final String SECURITY_GROUP_ID = "securitygroupid";
|
||||
public static final String SENT = "sent";
|
||||
public static final String SENT_BYTES = "sentbytes";
|
||||
public static final String SERVICE_OFFERING_ID = "serviceofferingid";
|
||||
public static final String SHOW_CAPACITIES = "showcapacities";
|
||||
public static final String SIZE = "size";
|
||||
public static final String SNAPSHOT_ID = "snapshotid";
|
||||
public static final String SNAPSHOT_POLICY_ID = "snapshotpolicyid";
|
||||
public static final String SNAPSHOT_TYPE = "snapshottype";
|
||||
public static final String SOURCE_ZONE_ID = "sourcezoneid";
|
||||
public static final String START_DATE = "startdate";
|
||||
public static final String START_IP = "startip";
|
||||
public static final String START_PORT = "startport";
|
||||
public static final String STATE = "state";
|
||||
public static final String STATUS = "status";
|
||||
public static final String STORAGE_TYPE = "storagetype";
|
||||
public static final String SYSTEM_VM_TYPE = "systemvmtype";
|
||||
public static final String TAGS = "tags";
|
||||
public static final String TARGET_IQN = "targetiqn";
|
||||
public static final String TEMPLATE_FILTER = "templatefilter";
|
||||
public static final String TEMPLATE_ID = "templateid";
|
||||
public static final String TIMEOUT = "timeout";
|
||||
public static final String TIMEZONE = "timezone";
|
||||
public static final String TYPE = "type";
|
||||
public static final String TRUST_STORE = "truststore";
|
||||
public static final String TRUST_STORE_PASSWORD = "truststorepass";
|
||||
public static final String URL = "url";
|
||||
public static final String USAGE_INTERFACE = "usageinterface";
|
||||
public static final String USER_DATA = "userdata";
|
||||
public static final String USER_ID = "userid";
|
||||
public static final String USE_SSL = "ssl";
|
||||
public static final String USERNAME = "username";
|
||||
public static final String USER_SECURITY_GROUP_LIST = "usersecuritygrouplist";
|
||||
public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork";
|
||||
public static final String VALUE = "value";
|
||||
public static final String VIRTUAL_MACHINE_ID = "virtualmachineid";
|
||||
public static final String VIRTUAL_MACHINE_IDS = "virtualmachineids";
|
||||
public static final String VLAN = "vlan";
|
||||
public static final String VLAN_ID = "vlanid";
|
||||
public static final String VM_AVAILABLE = "vmavailable";
|
||||
public static final String VM_LIMIT = "vmlimit";
|
||||
public static final String VM_TOTAL = "vmtotal";
|
||||
public static final String VNET = "vnet";
|
||||
public static final String VOLUME_ID = "volumeid";
|
||||
public static final String ZONE_ID = "zoneid";
|
||||
public static final String ZONE_NAME = "zonename";
|
||||
public static final String NETWORK_TYPE = "networktype";
|
||||
public static final String PAGE = "page";
|
||||
public static final String PAGE_SIZE = "pagesize";
|
||||
public static final String COUNT = "count";
|
||||
public static final String TRAFFIC_TYPE = "traffictype";
|
||||
public static final String NETWORK_OFFERING_ID = "networkofferingid";
|
||||
public static final String NETWORK_IDS = "networkids";
|
||||
public static final String NETWORK_ID = "networkid";
|
||||
public static final String SPECIFY_VLAN = "specifyvlan";
|
||||
public static final String IS_DEFAULT = "isdefault";
|
||||
public static final String IS_SYSTEM = "issystem";
|
||||
public static final String AVAILABILITY = "availability";
|
||||
public static final String NETWORKRATE = "networkrate";
|
||||
public static final String HOST_TAGS = "hosttags";
|
||||
public static final String SSH_KEYPAIR = "keypair";
|
||||
public static final String HOST_CPU_CAPACITY = "hostcpucapacity";
|
||||
public static final String HOST_CPU_NUM = "hostcpunum";
|
||||
public static final String HOST_MEM_CAPACITY = "hostmemcapacity";
|
||||
public static final String HOST_MAC = "hostmac";
|
||||
public static final String HOST_TAG = "hosttag";
|
||||
public static final String PXE_SERVER_TYPE = "pxeservertype";
|
||||
public static final String LINMIN_USERNAME = "linminusername";
|
||||
public static final String LINMIN_PASSWORD = "linminpassword";
|
||||
public static final String LINMIN_APID = "linminapid";
|
||||
public static final String DHCP_SERVER_TYPE = "dhcpservertype";
|
||||
public static final String LINK_LOCAL_IP = "linklocalip";
|
||||
public static final String LINK_LOCAL_MAC_ADDRESS = "linklocalmacaddress";
|
||||
public static final String LINK_LOCAL_MAC_NETMASK = "linklocalnetmask";
|
||||
public static final String LINK_LOCAL_NETWORK_ID = "linklocalnetworkid";
|
||||
public static final String PRIVATE_MAC_ADDRESS = "privatemacaddress";
|
||||
public static final String PRIVATE_NETMASK = "privatenetmask";
|
||||
public static final String PRIVATE_NETWORK_ID = "privatenetworkid";
|
||||
public static final String ALLOCATION_STATE = "allocationstate";
|
||||
public static final String MANAGED_STATE = "managedstate";
|
||||
public static final String STORAGE_ID="storageid";
|
||||
public static final String PING_STORAGE_SERVER_IP = "pingstorageserverip";
|
||||
public static final String PING_DIR = "pingdir";
|
||||
public static final String TFTP_DIR = "tftpdir";
|
||||
public static final String PING_CIFS_USERNAME = "pingcifsusername";
|
||||
public static final String PING_CIFS_PASSWORD = "pingcifspassword";
|
||||
public static final String CHECKSUM="checksum";
|
||||
public static final String NETWORK_DEVICE_TYPE = "networkdevicetype";
|
||||
public static final String NETWORK_DEVICE_PARAMETER_LIST = "networkdeviceparameterlist";
|
||||
public static final String ZONE_TOKEN = "zonetoken";
|
||||
public static final String DHCP_PROVIDER = "dhcpprovider";
|
||||
public static final String RESULT = "success";
|
||||
public static final String LUN_ID = "lunId";
|
||||
public static final String IQN = "iqn";
|
||||
public static final String AGGREGATE_NAME = "aggregatename";
|
||||
public static final String POOL_NAME = "poolname";
|
||||
public static final String VOLUME_NAME = "volumename";
|
||||
public static final String SNAPSHOT_POLICY = "snapshotpolicy";
|
||||
public static final String SNAPSHOT_RESERVATION = "snapshotreservation";
|
||||
public static final String IP_NETWORK_LIST = "iptonetworklist";
|
||||
public static final String PARAM_LIST = "param";
|
||||
public static final String FOR_LOAD_BALANCING = "forloadbalancing";
|
||||
public static final String KEYBOARD="keyboard";
|
||||
public static final String OPEN_FIREWALL="openfirewall";
|
||||
public static final String TEMPLATE_TAG = "templatetag";
|
||||
public static final String HYPERVISOR_VERSION = "hypervisorversion";
|
||||
public static final String MAX_GUESTS_LIMIT = "maxguestslimit";
|
||||
public static final String PROJECT_ID = "projectid";
|
||||
public static final String PROJECT_IDS = "projectids";
|
||||
public static final String PROJECT = "project";
|
||||
public static final String ROLE = "role";
|
||||
public static final String USER = "user";
|
||||
public static final String ACTIVE_ONLY = "activeonly";
|
||||
public static final String TOKEN = "token";
|
||||
public static final String ACCEPT = "accept";
|
||||
public static final String SORT_KEY = "sortkey";
|
||||
public static final String ACCOUNT_DETAILS = "accountdetails";
|
||||
public static final String SERVICE_PROVIDER_LIST = "serviceproviderlist";
|
||||
public static final String SERVICE_CAPABILITY_LIST = "servicecapabilitylist";
|
||||
public static final String CAN_CHOOSE_SERVICE_CAPABILITY = "canchooseservicecapability";
|
||||
public static final String PROVIDER = "provider";
|
||||
public static final String NETWORK_SPEED = "networkspeed";
|
||||
public static final String BROADCAST_DOMAIN_RANGE = "broadcastdomainrange";
|
||||
public static final String ISOLATION_METHODS = "isolationmethods";
|
||||
public static final String PHYSICAL_NETWORK_ID = "physicalnetworkid";
|
||||
public static final String DEST_PHYSICAL_NETWORK_ID = "destinationphysicalnetworkid";
|
||||
public static final String ENABLED = "enabled";
|
||||
public static final String SERVICE_NAME = "servicename";
|
||||
public static final String DHCP_RANGE = "dhcprange";
|
||||
public static final String UUID = "uuid";
|
||||
public static final String SECURITY_GROUP_EANBLED = "securitygroupenabled";
|
||||
public static final String GUEST_IP_TYPE = "guestiptype";
|
||||
public static final String XEN_NETWORK_LABEL = "xennetworklabel";
|
||||
public static final String KVM_NETWORK_LABEL = "kvmnetworklabel";
|
||||
public static final String VMWARE_NETWORK_LABEL = "vmwarenetworklabel";
|
||||
public static final String NETWORK_SERVICE_PROVIDER_ID = "nspid";
|
||||
public static final String SERVICE_LIST = "servicelist";
|
||||
public static final String CAN_ENABLE_INDIVIDUAL_SERVICE = "canenableindividualservice";
|
||||
public static final String SUPPORTED_SERVICES = "supportedservices";
|
||||
public static final String NSP_ID= "nspid";
|
||||
public static final String ACL_TYPE= "acltype";
|
||||
public static final String SUBDOMAIN_ACCESS = "subdomainaccess";
|
||||
public static final String LOAD_BALANCER_DEVICE_ID = "lbdeviceid";
|
||||
public static final String LOAD_BALANCER_DEVICE_NAME = "lbdevicename";
|
||||
public static final String LOAD_BALANCER_DEVICE_STATE = "lbdevicestate";
|
||||
public static final String LOAD_BALANCER_DEVICE_CAPACITY = "lbdevicecapacity";
|
||||
public static final String LOAD_BALANCER_DEVICE_DEDICATED = "lbdevicededicated";
|
||||
public static final String FIREWALL_DEVICE_ID = "fwdeviceid";
|
||||
public static final String FIREWALL_DEVICE_NAME = "fwdevicename";
|
||||
public static final String FIREWALL_DEVICE_STATE = "fwdevicestate";
|
||||
public static final String FIREWALL_DEVICE_CAPACITY = "fwdevicecapacity";
|
||||
public static final String FIREWALL_DEVICE_DEDICATED = "fwdevicededicated";
|
||||
public static final String SERVICE = "service";
|
||||
public static final String ASSOCIATED_NETWORK_ID = "associatednetworkid";
|
||||
public static final String SOURCE_NAT_SUPPORTED = "sourcenatsupported";
|
||||
public static final String RESOURCE_STATE = "resourcestate";
|
||||
public static final String PROJECT_INVITE_REQUIRED = "projectinviterequired";
|
||||
public static final String RESTART_REQUIRED = "restartrequired";
|
||||
public static final String ALLOW_USER_CREATE_PROJECTS = "allowusercreateprojects";
|
||||
public static final String CONSERVE_MODE = "conservemode";
|
||||
public static final String TRAFFIC_TYPE_IMPLEMENTOR = "traffictypeimplementor";
|
||||
public static final String KEYWORD = "keyword";
|
||||
public static final String LIST_ALL = "listall";
|
||||
public static final String SPECIFY_IP_RANGES = "specifyipranges";
|
||||
public static final String IS_SOURCE_NAT = "issourcenat";
|
||||
public static final String IS_STATIC_NAT = "isstaticnat";
|
||||
public static final String SORT_BY = "sortby";
|
||||
public static final String CHANGE_CIDR = "changecidr";
|
||||
public static final String PURPOSE = "purpose";
|
||||
public static final String IS_TAGGED = "istagged";
|
||||
public static final String INSTANCE_NAME = "instancename";
|
||||
public static final String START_VM = "startvm";
|
||||
public static final String HA_HOST = "hahost";
|
||||
public static final String CUSTOM_DISK_OFF_MAX_SIZE = "customdiskofferingmaxsize";
|
||||
public static final String DEFAULT_ZONE_ID = "defaultzoneid";
|
||||
public static final String GUID = "guid";
|
||||
|
||||
public static final String EXTERNAL_SWITCH_MGMT_DEVICE_ID = "vsmdeviceid";
|
||||
public static final String EXTERNAL_SWITCH_MGMT_DEVICE_NAME = "vsmdevicename";
|
||||
public static final String EXTERNAL_SWITCH_MGMT_DEVICE_STATE = "vsmdevicestate";
|
||||
// Would we need to have a capacity field for Cisco N1KV VSM? Max hosts managed by it perhaps? May remove this
|
||||
// later.
|
||||
public static final String EXTERNAL_SWITCH_MGMT_DEVICE_CAPACITY = "vsmdevicecapacity";
|
||||
public static final String CISCO_NEXUS_VSM_NAME = "vsmname";
|
||||
public static final String VSM_USERNAME = "vsmusername";
|
||||
public static final String VSM_PASSWORD = "vsmpassword";
|
||||
public static final String VSM_IPADDRESS = "vsmipaddress";
|
||||
public static final String VSM_MGMT_VLAN_ID = "vsmmgmtvlanid";
|
||||
public static final String VSM_PKT_VLAN_ID = "vsmpktvlanid";
|
||||
public static final String VSM_CTRL_VLAN_ID = "vsmctrlvlanid";
|
||||
public static final String VSM_STORAGE_VLAN_ID = "vsmstoragevlanid";
|
||||
public static final String VSM_DOMAIN_ID = "vsmdomainid";
|
||||
public static final String VSM_CONFIG_MODE = "vsmconfigmode";
|
||||
public static final String VSM_CONFIG_STATE = "vsmconfigstate";
|
||||
public static final String VSM_DEVICE_STATE = "vsmdevicestate";
|
||||
public static final String INCL_ZONES = "includezones";
|
||||
public static final String EXCL_ZONES = "excludezones";
|
||||
public static final String RESOURCE_IDS = "resourceids";
|
||||
public static final String RESOURCE_ID = "resourceid";
|
||||
public static final String CUSTOMER = "customer";
|
||||
public static final String VPC_OFF_ID = "vpcofferingid";
|
||||
public static final String NETWORK = "network";
|
||||
public static final String VPC_ID = "vpcid";
|
||||
public static final String CAN_USE_FOR_DEPLOY = "canusefordeploy";
|
||||
public static final String GATEWAY_ID = "gatewayid";
|
||||
public static final String S2S_VPN_GATEWAY_ID = "s2svpngatewayid";
|
||||
public static final String S2S_CUSTOMER_GATEWAY_ID = "s2scustomergatewayid";
|
||||
public static final String IPSEC_PSK = "ipsecpsk";
|
||||
public static final String GUEST_IP = "guestip";
|
||||
public static final String REMOVED = "removed";
|
||||
public static final String IKE_POLICY = "ikepolicy";
|
||||
public static final String ESP_POLICY = "esppolicy";
|
||||
public static final String LIFETIME = "lifetime";
|
||||
public static final String FOR_VPC = "forvpc";
|
||||
public static final String SOURCE = "source";
|
||||
public static final String COUNTER_ID = "counterid";
|
||||
public static final String AGGR_OPERATOR = "aggroperator";
|
||||
public static final String AGGR_FUNCTION = "aggrfunction";
|
||||
public static final String AGGR_VALUE = "aggrvalue";
|
||||
public static final String THRESHOLD = "threshold";
|
||||
public static final String RELATIONAL_OPERATOR = "relationaloperator";
|
||||
public static final String SNMP_COMMUNITY = "snmpcommunity";
|
||||
public static final String SNMP_PORT = "snmpport";
|
||||
public static final String OTHER_DEPLOY_PARAMS = "otherdeployparams";
|
||||
public static final String MIN_MEMBERS = "minmembers";
|
||||
public static final String MAX_MEMBERS = "maxmembers";
|
||||
public static final String AUTOSCALE_VM_DESTROY_TIME = "destroyvmgraceperiod";
|
||||
public static final String VMPROFILE_ID = "vmprofileid";
|
||||
public static final String VMGROUP_ID = "vmgroupid";
|
||||
public static final String SCALEUP_POLICY_IDS = "scaleuppolicyids";
|
||||
public static final String SCALEDOWN_POLICY_IDS = "scaledownpolicyids";
|
||||
public static final String INTERVAL = "interval";
|
||||
public static final String QUIETTIME = "quiettime";
|
||||
public static final String ACTION = "action";
|
||||
public static final String CONDITION_ID = "conditionid";
|
||||
public static final String CONDITION_IDS = "conditionids";
|
||||
public static final String AUTOSCALE_USER_ID = "autoscaleuserid";
|
||||
|
||||
public enum HostDetails {
|
||||
all, capacity, events, stats, min;
|
||||
}
|
||||
|
||||
public enum VMDetails {
|
||||
all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min;
|
||||
}
|
||||
|
||||
public enum LDAPParams {
|
||||
hostname, port, usessl, queryfilter, searchbase, dn, passwd, truststore, truststorepass;
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return "ldap." + name();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,339 +1,360 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.api.ApiConstants.HostDetails;
|
||||
import com.cloud.api.ApiConstants.VMDetails;
|
||||
import com.cloud.api.commands.QueryAsyncJobResultCmd;
|
||||
import com.cloud.api.response.AccountResponse;
|
||||
import com.cloud.api.response.AsyncJobResponse;
|
||||
import com.cloud.api.response.CapacityResponse;
|
||||
import com.cloud.api.response.ClusterResponse;
|
||||
import com.cloud.api.response.ConfigurationResponse;
|
||||
import com.cloud.api.response.CreateCmdResponse;
|
||||
import com.cloud.api.response.DiskOfferingResponse;
|
||||
import com.cloud.api.response.DomainResponse;
|
||||
import com.cloud.api.response.DomainRouterResponse;
|
||||
import com.cloud.api.response.EventResponse;
|
||||
import com.cloud.api.response.ExtractResponse;
|
||||
import com.cloud.api.response.FirewallResponse;
|
||||
import com.cloud.api.response.FirewallRuleResponse;
|
||||
import com.cloud.api.response.HostResponse;
|
||||
import com.cloud.api.response.HypervisorCapabilitiesResponse;
|
||||
import com.cloud.api.response.IPAddressResponse;
|
||||
import com.cloud.api.response.InstanceGroupResponse;
|
||||
import com.cloud.api.response.IpForwardingRuleResponse;
|
||||
import com.cloud.api.response.LBStickinessResponse;
|
||||
import com.cloud.api.response.LDAPConfigResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.LoadBalancerResponse;
|
||||
import com.cloud.api.response.NetworkACLResponse;
|
||||
import com.cloud.api.response.NetworkOfferingResponse;
|
||||
import com.cloud.api.response.NetworkResponse;
|
||||
import com.cloud.api.response.PhysicalNetworkResponse;
|
||||
import com.cloud.api.response.PodResponse;
|
||||
import com.cloud.api.response.PrivateGatewayResponse;
|
||||
import com.cloud.api.response.ProjectAccountResponse;
|
||||
import com.cloud.api.response.ProjectInvitationResponse;
|
||||
import com.cloud.api.response.ProjectResponse;
|
||||
import com.cloud.api.response.ProviderResponse;
|
||||
import com.cloud.api.response.RemoteAccessVpnResponse;
|
||||
import com.cloud.api.response.ResourceCountResponse;
|
||||
import com.cloud.api.response.ResourceLimitResponse;
|
||||
import com.cloud.api.response.ResourceTagResponse;
|
||||
import com.cloud.api.response.SecurityGroupResponse;
|
||||
import com.cloud.api.response.ServiceOfferingResponse;
|
||||
import com.cloud.api.response.ServiceResponse;
|
||||
import com.cloud.api.response.Site2SiteCustomerGatewayResponse;
|
||||
import com.cloud.api.response.Site2SiteVpnConnectionResponse;
|
||||
import com.cloud.api.response.Site2SiteVpnGatewayResponse;
|
||||
import com.cloud.api.response.SnapshotPolicyResponse;
|
||||
import com.cloud.api.response.SnapshotResponse;
|
||||
import com.cloud.api.response.StaticRouteResponse;
|
||||
import com.cloud.api.response.StorageNetworkIpRangeResponse;
|
||||
import com.cloud.api.response.StoragePoolResponse;
|
||||
import com.cloud.api.response.SwiftResponse;
|
||||
import com.cloud.api.response.SystemVmInstanceResponse;
|
||||
import com.cloud.api.response.SystemVmResponse;
|
||||
import com.cloud.api.response.TemplatePermissionsResponse;
|
||||
import com.cloud.api.response.TemplateResponse;
|
||||
import com.cloud.api.response.TrafficTypeResponse;
|
||||
import com.cloud.api.response.UserResponse;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.api.response.VirtualRouterProviderResponse;
|
||||
import com.cloud.api.response.VlanIpRangeResponse;
|
||||
import com.cloud.api.response.VolumeResponse;
|
||||
import com.cloud.api.response.VpcOfferingResponse;
|
||||
import com.cloud.api.response.VpcResponse;
|
||||
import com.cloud.api.response.VpnUsersResponse;
|
||||
import com.cloud.api.response.ZoneResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.capacity.Capacity;
|
||||
import com.cloud.configuration.Configuration;
|
||||
import com.cloud.configuration.ResourceCount;
|
||||
import com.cloud.configuration.ResourceLimit;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.Pod;
|
||||
import com.cloud.dc.StorageNetworkIpRange;
|
||||
import com.cloud.dc.Vlan;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.event.Event;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.hypervisor.HypervisorCapabilities;
|
||||
import com.cloud.network.IpAddress;
|
||||
import com.cloud.network.Network;
|
||||
import com.cloud.network.Network.Service;
|
||||
import com.cloud.network.PhysicalNetwork;
|
||||
import com.cloud.network.PhysicalNetworkServiceProvider;
|
||||
import com.cloud.network.PhysicalNetworkTrafficType;
|
||||
import com.cloud.network.RemoteAccessVpn;
|
||||
import com.cloud.network.Site2SiteCustomerGateway;
|
||||
import com.cloud.network.Site2SiteVpnConnection;
|
||||
import com.cloud.network.Site2SiteVpnGateway;
|
||||
import com.cloud.network.VirtualRouterProvider;
|
||||
import com.cloud.network.VpnUser;
|
||||
import com.cloud.network.router.VirtualRouter;
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
import com.cloud.network.rules.LoadBalancer;
|
||||
import com.cloud.network.rules.PortForwardingRule;
|
||||
import com.cloud.network.rules.StaticNatRule;
|
||||
import com.cloud.network.rules.StickinessPolicy;
|
||||
import com.cloud.network.security.SecurityGroup;
|
||||
import com.cloud.network.security.SecurityGroupRules;
|
||||
import com.cloud.network.security.SecurityRule;
|
||||
import com.cloud.network.vpc.PrivateGateway;
|
||||
import com.cloud.network.vpc.StaticRoute;
|
||||
import com.cloud.network.vpc.Vpc;
|
||||
import com.cloud.network.vpc.VpcOffering;
|
||||
import com.cloud.offering.DiskOffering;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.org.Cluster;
|
||||
import com.cloud.projects.Project;
|
||||
import com.cloud.projects.ProjectAccount;
|
||||
import com.cloud.projects.ProjectInvitation;
|
||||
import com.cloud.server.ResourceTag;
|
||||
import com.cloud.storage.Snapshot;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.storage.Swift;
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.storage.snapshot.SnapshotPolicy;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.UserAccount;
|
||||
import com.cloud.uservm.UserVm;
|
||||
import com.cloud.vm.InstanceGroup;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
public interface ResponseGenerator {
|
||||
UserResponse createUserResponse(UserAccount user);
|
||||
|
||||
AccountResponse createAccountResponse(Account account);
|
||||
|
||||
DomainResponse createDomainResponse(Domain domain);
|
||||
|
||||
DiskOfferingResponse createDiskOfferingResponse(DiskOffering offering);
|
||||
|
||||
ResourceLimitResponse createResourceLimitResponse(ResourceLimit limit);
|
||||
|
||||
ResourceCountResponse createResourceCountResponse(ResourceCount resourceCount);
|
||||
|
||||
ServiceOfferingResponse createServiceOfferingResponse(ServiceOffering offering);
|
||||
|
||||
ConfigurationResponse createConfigurationResponse(Configuration cfg);
|
||||
|
||||
SnapshotResponse createSnapshotResponse(Snapshot snapshot);
|
||||
|
||||
SnapshotPolicyResponse createSnapshotPolicyResponse(SnapshotPolicy policy);
|
||||
|
||||
List<UserVmResponse> createUserVmResponse(String objectName, UserVm... userVms);
|
||||
|
||||
List<UserVmResponse> createUserVmResponse(String objectName, EnumSet<VMDetails> details, UserVm... userVms);
|
||||
|
||||
SystemVmResponse createSystemVmResponse(VirtualMachine systemVM);
|
||||
|
||||
DomainRouterResponse createDomainRouterResponse(VirtualRouter router);
|
||||
|
||||
HostResponse createHostResponse(Host host, EnumSet<HostDetails> details);
|
||||
|
||||
HostResponse createHostResponse(Host host);
|
||||
|
||||
VlanIpRangeResponse createVlanIpRangeResponse(Vlan vlan);
|
||||
|
||||
IPAddressResponse createIPAddressResponse(IpAddress ipAddress);
|
||||
|
||||
LoadBalancerResponse createLoadBalancerResponse(LoadBalancer loadBalancer);
|
||||
|
||||
LBStickinessResponse createLBStickinessPolicyResponse(List<? extends StickinessPolicy> stickinessPolicies, LoadBalancer lb);
|
||||
|
||||
LBStickinessResponse createLBStickinessPolicyResponse(StickinessPolicy stickinessPolicy, LoadBalancer lb);
|
||||
|
||||
PodResponse createPodResponse(Pod pod, Boolean showCapacities);
|
||||
|
||||
ZoneResponse createZoneResponse(DataCenter dataCenter, Boolean showCapacities);
|
||||
|
||||
VolumeResponse createVolumeResponse(Volume volume);
|
||||
|
||||
InstanceGroupResponse createInstanceGroupResponse(InstanceGroup group);
|
||||
|
||||
StoragePoolResponse createStoragePoolResponse(StoragePool pool);
|
||||
|
||||
ClusterResponse createClusterResponse(Cluster cluster, Boolean showCapacities);
|
||||
|
||||
FirewallRuleResponse createPortForwardingRuleResponse(PortForwardingRule fwRule);
|
||||
|
||||
IpForwardingRuleResponse createIpForwardingRuleResponse(StaticNatRule fwRule);
|
||||
|
||||
User findUserById(Long userId);
|
||||
|
||||
UserVm findUserVmById(Long vmId);
|
||||
|
||||
Volume findVolumeById(Long volumeId);
|
||||
|
||||
Account findAccountByNameDomain(String accountName, Long domainId);
|
||||
|
||||
VirtualMachineTemplate findTemplateById(Long templateId);
|
||||
|
||||
Host findHostById(Long hostId);
|
||||
|
||||
List<TemplateResponse> createTemplateResponses(long templateId, long zoneId, boolean readyOnly);
|
||||
|
||||
VpnUsersResponse createVpnUserResponse(VpnUser user);
|
||||
|
||||
RemoteAccessVpnResponse createRemoteAccessVpnResponse(RemoteAccessVpn vpn);
|
||||
|
||||
List<TemplateResponse> createTemplateResponses(long templateId, Long zoneId, boolean readyOnly);
|
||||
|
||||
List<TemplateResponse> createTemplateResponses(long templateId, Long snapshotId, Long volumeId, boolean readyOnly);
|
||||
|
||||
ListResponse<SecurityGroupResponse> createSecurityGroupResponses(List<? extends SecurityGroupRules> networkGroups);
|
||||
|
||||
SecurityGroupResponse createSecurityGroupResponseFromSecurityGroupRule(List<? extends SecurityRule> SecurityRules);
|
||||
|
||||
SecurityGroupResponse createSecurityGroupResponse(SecurityGroup group);
|
||||
|
||||
ExtractResponse createExtractResponse(Long uploadId, Long id, Long zoneId, Long accountId, String mode);
|
||||
|
||||
String toSerializedString(CreateCmdResponse response, String responseType);
|
||||
|
||||
AsyncJobResponse createAsyncJobResponse(AsyncJob job);
|
||||
|
||||
EventResponse createEventResponse(Event event);
|
||||
|
||||
TemplateResponse createIsoResponse(VirtualMachineTemplate result);
|
||||
|
||||
List<CapacityResponse> createCapacityResponse(List<? extends Capacity> result, DecimalFormat format);
|
||||
|
||||
TemplatePermissionsResponse createTemplatePermissionsResponse(List<String> accountNames, Long id, boolean isAdmin);
|
||||
|
||||
AsyncJobResponse queryJobResult(QueryAsyncJobResultCmd cmd);
|
||||
|
||||
NetworkOfferingResponse createNetworkOfferingResponse(NetworkOffering offering);
|
||||
|
||||
NetworkResponse createNetworkResponse(Network network);
|
||||
|
||||
UserResponse createUserResponse(User user);
|
||||
|
||||
AccountResponse createUserAccountResponse(UserAccount user);
|
||||
|
||||
Long getSecurityGroupId(String groupName, long accountId);
|
||||
|
||||
List<TemplateResponse> createIsoResponses(long isoId, Long zoneId, boolean readyOnly);
|
||||
|
||||
ProjectResponse createProjectResponse(Project project);
|
||||
|
||||
List<TemplateResponse> createIsoResponses(VirtualMachineTemplate iso, long zoneId, boolean readyOnly);
|
||||
|
||||
List<TemplateResponse> createTemplateResponses(long templateId, Long vmId);
|
||||
|
||||
FirewallResponse createFirewallResponse(FirewallRule fwRule);
|
||||
|
||||
HypervisorCapabilitiesResponse createHypervisorCapabilitiesResponse(HypervisorCapabilities hpvCapabilities);
|
||||
|
||||
ProjectAccountResponse createProjectAccountResponse(ProjectAccount projectAccount);
|
||||
|
||||
ProjectInvitationResponse createProjectInvitationResponse(ProjectInvitation invite);
|
||||
|
||||
SystemVmInstanceResponse createSystemVmInstanceResponse(VirtualMachine systemVM);
|
||||
|
||||
SwiftResponse createSwiftResponse(Swift swift);
|
||||
|
||||
PhysicalNetworkResponse createPhysicalNetworkResponse(PhysicalNetwork result);
|
||||
|
||||
ServiceResponse createNetworkServiceResponse(Service service);
|
||||
|
||||
ProviderResponse createNetworkServiceProviderResponse(PhysicalNetworkServiceProvider result);
|
||||
|
||||
TrafficTypeResponse createTrafficTypeResponse(PhysicalNetworkTrafficType result);
|
||||
|
||||
VirtualRouterProviderResponse createVirtualRouterProviderResponse(VirtualRouterProvider result);
|
||||
|
||||
LDAPConfigResponse createLDAPConfigResponse(String hostname, Integer port, Boolean useSSL, String queryFilter, String baseSearch, String dn);
|
||||
|
||||
StorageNetworkIpRangeResponse createStorageNetworkIpRangeResponse(StorageNetworkIpRange result);
|
||||
|
||||
/**
|
||||
* @param tableName TODO
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
Long getIdentiyId(String tableName, String token);
|
||||
|
||||
/**
|
||||
* @param resourceTag
|
||||
* @param keyValueOnly TODO
|
||||
* @return
|
||||
*/
|
||||
ResourceTagResponse createResourceTagResponse(ResourceTag resourceTag, boolean keyValueOnly);
|
||||
|
||||
Site2SiteVpnGatewayResponse createSite2SiteVpnGatewayResponse(Site2SiteVpnGateway result);
|
||||
|
||||
/**
|
||||
* @param offering
|
||||
* @return
|
||||
*/
|
||||
VpcOfferingResponse createVpcOfferingResponse(VpcOffering offering);
|
||||
|
||||
/**
|
||||
* @param vpc
|
||||
* @return
|
||||
*/
|
||||
VpcResponse createVpcResponse(Vpc vpc);
|
||||
|
||||
/**
|
||||
* @param networkACL
|
||||
* @return
|
||||
*/
|
||||
NetworkACLResponse createNetworkACLResponse(FirewallRule networkACL);
|
||||
|
||||
/**
|
||||
* @param result
|
||||
* @return
|
||||
*/
|
||||
PrivateGatewayResponse createPrivateGatewayResponse(PrivateGateway result);
|
||||
|
||||
/**
|
||||
* @param result
|
||||
* @return
|
||||
*/
|
||||
StaticRouteResponse createStaticRouteResponse(StaticRoute result);
|
||||
|
||||
Site2SiteCustomerGatewayResponse createSite2SiteCustomerGatewayResponse(Site2SiteCustomerGateway result);
|
||||
|
||||
Site2SiteVpnConnectionResponse createSite2SiteVpnConnectionResponse(Site2SiteVpnConnection result);
|
||||
}
|
||||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.api.ApiConstants.HostDetails;
|
||||
import com.cloud.api.ApiConstants.VMDetails;
|
||||
import com.cloud.api.commands.QueryAsyncJobResultCmd;
|
||||
import com.cloud.api.response.AccountResponse;
|
||||
import com.cloud.api.response.AsyncJobResponse;
|
||||
import com.cloud.api.response.AutoScalePolicyResponse;
|
||||
import com.cloud.api.response.AutoScaleVmGroupResponse;
|
||||
import com.cloud.api.response.CapacityResponse;
|
||||
import com.cloud.api.response.ClusterResponse;
|
||||
import com.cloud.api.response.ConditionResponse;
|
||||
import com.cloud.api.response.ConfigurationResponse;
|
||||
import com.cloud.api.response.CounterResponse;
|
||||
import com.cloud.api.response.CreateCmdResponse;
|
||||
import com.cloud.api.response.DiskOfferingResponse;
|
||||
import com.cloud.api.response.DomainResponse;
|
||||
import com.cloud.api.response.DomainRouterResponse;
|
||||
import com.cloud.api.response.EventResponse;
|
||||
import com.cloud.api.response.ExtractResponse;
|
||||
import com.cloud.api.response.FirewallResponse;
|
||||
import com.cloud.api.response.FirewallRuleResponse;
|
||||
import com.cloud.api.response.HostResponse;
|
||||
import com.cloud.api.response.HypervisorCapabilitiesResponse;
|
||||
import com.cloud.api.response.IPAddressResponse;
|
||||
import com.cloud.api.response.InstanceGroupResponse;
|
||||
import com.cloud.api.response.IpForwardingRuleResponse;
|
||||
import com.cloud.api.response.LBStickinessResponse;
|
||||
import com.cloud.api.response.AutoScaleVmProfileResponse;
|
||||
import com.cloud.api.response.LDAPConfigResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.LoadBalancerResponse;
|
||||
import com.cloud.api.response.NetworkACLResponse;
|
||||
import com.cloud.api.response.NetworkOfferingResponse;
|
||||
import com.cloud.api.response.NetworkResponse;
|
||||
import com.cloud.api.response.PhysicalNetworkResponse;
|
||||
import com.cloud.api.response.PodResponse;
|
||||
import com.cloud.api.response.PrivateGatewayResponse;
|
||||
import com.cloud.api.response.ProjectAccountResponse;
|
||||
import com.cloud.api.response.ProjectInvitationResponse;
|
||||
import com.cloud.api.response.ProjectResponse;
|
||||
import com.cloud.api.response.ProviderResponse;
|
||||
import com.cloud.api.response.RemoteAccessVpnResponse;
|
||||
import com.cloud.api.response.ResourceCountResponse;
|
||||
import com.cloud.api.response.ResourceLimitResponse;
|
||||
import com.cloud.api.response.ResourceTagResponse;
|
||||
import com.cloud.api.response.SecurityGroupResponse;
|
||||
import com.cloud.api.response.ServiceOfferingResponse;
|
||||
import com.cloud.api.response.ServiceResponse;
|
||||
import com.cloud.api.response.Site2SiteCustomerGatewayResponse;
|
||||
import com.cloud.api.response.Site2SiteVpnConnectionResponse;
|
||||
import com.cloud.api.response.Site2SiteVpnGatewayResponse;
|
||||
import com.cloud.api.response.SnapshotPolicyResponse;
|
||||
import com.cloud.api.response.SnapshotResponse;
|
||||
import com.cloud.api.response.StaticRouteResponse;
|
||||
import com.cloud.api.response.StorageNetworkIpRangeResponse;
|
||||
import com.cloud.api.response.StoragePoolResponse;
|
||||
import com.cloud.api.response.SwiftResponse;
|
||||
import com.cloud.api.response.SystemVmInstanceResponse;
|
||||
import com.cloud.api.response.SystemVmResponse;
|
||||
import com.cloud.api.response.TemplatePermissionsResponse;
|
||||
import com.cloud.api.response.TemplateResponse;
|
||||
import com.cloud.api.response.TrafficTypeResponse;
|
||||
import com.cloud.api.response.UserResponse;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.api.response.VirtualRouterProviderResponse;
|
||||
import com.cloud.api.response.VlanIpRangeResponse;
|
||||
import com.cloud.api.response.VolumeResponse;
|
||||
import com.cloud.api.response.VpcOfferingResponse;
|
||||
import com.cloud.api.response.VpcResponse;
|
||||
import com.cloud.api.response.VpnUsersResponse;
|
||||
import com.cloud.api.response.ZoneResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.capacity.Capacity;
|
||||
import com.cloud.configuration.Configuration;
|
||||
import com.cloud.configuration.ResourceCount;
|
||||
import com.cloud.configuration.ResourceLimit;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.Pod;
|
||||
import com.cloud.dc.StorageNetworkIpRange;
|
||||
import com.cloud.dc.Vlan;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.event.Event;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.hypervisor.HypervisorCapabilities;
|
||||
import com.cloud.network.IpAddress;
|
||||
import com.cloud.network.Network;
|
||||
import com.cloud.network.Network.Service;
|
||||
import com.cloud.network.PhysicalNetwork;
|
||||
import com.cloud.network.PhysicalNetworkServiceProvider;
|
||||
import com.cloud.network.PhysicalNetworkTrafficType;
|
||||
import com.cloud.network.RemoteAccessVpn;
|
||||
import com.cloud.network.Site2SiteCustomerGateway;
|
||||
import com.cloud.network.Site2SiteVpnConnection;
|
||||
import com.cloud.network.Site2SiteVpnGateway;
|
||||
import com.cloud.network.VirtualRouterProvider;
|
||||
import com.cloud.network.VpnUser;
|
||||
import com.cloud.network.as.AutoScalePolicy;
|
||||
import com.cloud.network.as.AutoScaleVmGroup;
|
||||
import com.cloud.network.as.Condition;
|
||||
import com.cloud.network.as.Counter;
|
||||
import com.cloud.network.router.VirtualRouter;
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
import com.cloud.network.rules.LoadBalancer;
|
||||
import com.cloud.network.rules.PortForwardingRule;
|
||||
import com.cloud.network.rules.StaticNatRule;
|
||||
import com.cloud.network.rules.StickinessPolicy;
|
||||
import com.cloud.network.as.AutoScaleVmProfile;
|
||||
import com.cloud.network.security.SecurityGroup;
|
||||
import com.cloud.network.security.SecurityGroupRules;
|
||||
import com.cloud.network.security.SecurityRule;
|
||||
import com.cloud.network.vpc.PrivateGateway;
|
||||
import com.cloud.network.vpc.StaticRoute;
|
||||
import com.cloud.network.vpc.Vpc;
|
||||
import com.cloud.network.vpc.VpcOffering;
|
||||
import com.cloud.offering.DiskOffering;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.org.Cluster;
|
||||
import com.cloud.projects.Project;
|
||||
import com.cloud.projects.ProjectAccount;
|
||||
import com.cloud.projects.ProjectInvitation;
|
||||
import com.cloud.server.ResourceTag;
|
||||
import com.cloud.storage.Snapshot;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.storage.Swift;
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.storage.snapshot.SnapshotPolicy;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.UserAccount;
|
||||
import com.cloud.uservm.UserVm;
|
||||
import com.cloud.vm.InstanceGroup;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
public interface ResponseGenerator {
|
||||
UserResponse createUserResponse(UserAccount user);
|
||||
|
||||
AccountResponse createAccountResponse(Account account);
|
||||
|
||||
DomainResponse createDomainResponse(Domain domain);
|
||||
|
||||
DiskOfferingResponse createDiskOfferingResponse(DiskOffering offering);
|
||||
|
||||
ResourceLimitResponse createResourceLimitResponse(ResourceLimit limit);
|
||||
|
||||
ResourceCountResponse createResourceCountResponse(ResourceCount resourceCount);
|
||||
|
||||
ServiceOfferingResponse createServiceOfferingResponse(ServiceOffering offering);
|
||||
|
||||
ConfigurationResponse createConfigurationResponse(Configuration cfg);
|
||||
|
||||
SnapshotResponse createSnapshotResponse(Snapshot snapshot);
|
||||
|
||||
SnapshotPolicyResponse createSnapshotPolicyResponse(SnapshotPolicy policy);
|
||||
|
||||
List<UserVmResponse> createUserVmResponse(String objectName, UserVm... userVms);
|
||||
|
||||
List<UserVmResponse> createUserVmResponse(String objectName, EnumSet<VMDetails> details, UserVm... userVms);
|
||||
|
||||
SystemVmResponse createSystemVmResponse(VirtualMachine systemVM);
|
||||
|
||||
DomainRouterResponse createDomainRouterResponse(VirtualRouter router);
|
||||
|
||||
HostResponse createHostResponse(Host host, EnumSet<HostDetails> details);
|
||||
|
||||
HostResponse createHostResponse(Host host);
|
||||
|
||||
VlanIpRangeResponse createVlanIpRangeResponse(Vlan vlan);
|
||||
|
||||
IPAddressResponse createIPAddressResponse(IpAddress ipAddress);
|
||||
|
||||
LoadBalancerResponse createLoadBalancerResponse(LoadBalancer loadBalancer);
|
||||
|
||||
LBStickinessResponse createLBStickinessPolicyResponse(List<? extends StickinessPolicy> stickinessPolicies, LoadBalancer lb);
|
||||
|
||||
LBStickinessResponse createLBStickinessPolicyResponse(StickinessPolicy stickinessPolicy, LoadBalancer lb);
|
||||
|
||||
PodResponse createPodResponse(Pod pod, Boolean showCapacities);
|
||||
|
||||
ZoneResponse createZoneResponse(DataCenter dataCenter, Boolean showCapacities);
|
||||
|
||||
VolumeResponse createVolumeResponse(Volume volume);
|
||||
|
||||
InstanceGroupResponse createInstanceGroupResponse(InstanceGroup group);
|
||||
|
||||
StoragePoolResponse createStoragePoolResponse(StoragePool pool);
|
||||
|
||||
ClusterResponse createClusterResponse(Cluster cluster, Boolean showCapacities);
|
||||
|
||||
FirewallRuleResponse createPortForwardingRuleResponse(PortForwardingRule fwRule);
|
||||
|
||||
IpForwardingRuleResponse createIpForwardingRuleResponse(StaticNatRule fwRule);
|
||||
|
||||
User findUserById(Long userId);
|
||||
|
||||
UserVm findUserVmById(Long vmId);
|
||||
|
||||
Volume findVolumeById(Long volumeId);
|
||||
|
||||
Account findAccountByNameDomain(String accountName, Long domainId);
|
||||
|
||||
VirtualMachineTemplate findTemplateById(Long templateId);
|
||||
|
||||
Host findHostById(Long hostId);
|
||||
|
||||
List<TemplateResponse> createTemplateResponses(long templateId, long zoneId, boolean readyOnly);
|
||||
|
||||
VpnUsersResponse createVpnUserResponse(VpnUser user);
|
||||
|
||||
RemoteAccessVpnResponse createRemoteAccessVpnResponse(RemoteAccessVpn vpn);
|
||||
|
||||
List<TemplateResponse> createTemplateResponses(long templateId, Long zoneId, boolean readyOnly);
|
||||
|
||||
List<TemplateResponse> createTemplateResponses(long templateId, Long snapshotId, Long volumeId, boolean readyOnly);
|
||||
|
||||
ListResponse<SecurityGroupResponse> createSecurityGroupResponses(List<? extends SecurityGroupRules> networkGroups);
|
||||
|
||||
SecurityGroupResponse createSecurityGroupResponseFromSecurityGroupRule(List<? extends SecurityRule> SecurityRules);
|
||||
|
||||
SecurityGroupResponse createSecurityGroupResponse(SecurityGroup group);
|
||||
|
||||
ExtractResponse createExtractResponse(Long uploadId, Long id, Long zoneId, Long accountId, String mode);
|
||||
|
||||
String toSerializedString(CreateCmdResponse response, String responseType);
|
||||
|
||||
AsyncJobResponse createAsyncJobResponse(AsyncJob job);
|
||||
|
||||
EventResponse createEventResponse(Event event);
|
||||
|
||||
TemplateResponse createIsoResponse(VirtualMachineTemplate result);
|
||||
|
||||
List<CapacityResponse> createCapacityResponse(List<? extends Capacity> result, DecimalFormat format);
|
||||
|
||||
TemplatePermissionsResponse createTemplatePermissionsResponse(List<String> accountNames, Long id, boolean isAdmin);
|
||||
|
||||
AsyncJobResponse queryJobResult(QueryAsyncJobResultCmd cmd);
|
||||
|
||||
NetworkOfferingResponse createNetworkOfferingResponse(NetworkOffering offering);
|
||||
|
||||
NetworkResponse createNetworkResponse(Network network);
|
||||
|
||||
UserResponse createUserResponse(User user);
|
||||
|
||||
AccountResponse createUserAccountResponse(UserAccount user);
|
||||
|
||||
Long getSecurityGroupId(String groupName, long accountId);
|
||||
|
||||
List<TemplateResponse> createIsoResponses(long isoId, Long zoneId, boolean readyOnly);
|
||||
|
||||
ProjectResponse createProjectResponse(Project project);
|
||||
|
||||
List<TemplateResponse> createIsoResponses(VirtualMachineTemplate iso, long zoneId, boolean readyOnly);
|
||||
|
||||
List<TemplateResponse> createTemplateResponses(long templateId, Long vmId);
|
||||
|
||||
FirewallResponse createFirewallResponse(FirewallRule fwRule);
|
||||
|
||||
HypervisorCapabilitiesResponse createHypervisorCapabilitiesResponse(HypervisorCapabilities hpvCapabilities);
|
||||
|
||||
ProjectAccountResponse createProjectAccountResponse(ProjectAccount projectAccount);
|
||||
|
||||
ProjectInvitationResponse createProjectInvitationResponse(ProjectInvitation invite);
|
||||
|
||||
SystemVmInstanceResponse createSystemVmInstanceResponse(VirtualMachine systemVM);
|
||||
|
||||
SwiftResponse createSwiftResponse(Swift swift);
|
||||
|
||||
PhysicalNetworkResponse createPhysicalNetworkResponse(PhysicalNetwork result);
|
||||
|
||||
ServiceResponse createNetworkServiceResponse(Service service);
|
||||
|
||||
ProviderResponse createNetworkServiceProviderResponse(PhysicalNetworkServiceProvider result);
|
||||
|
||||
TrafficTypeResponse createTrafficTypeResponse(PhysicalNetworkTrafficType result);
|
||||
|
||||
VirtualRouterProviderResponse createVirtualRouterProviderResponse(VirtualRouterProvider result);
|
||||
|
||||
LDAPConfigResponse createLDAPConfigResponse(String hostname, Integer port, Boolean useSSL, String queryFilter, String baseSearch, String dn);
|
||||
|
||||
StorageNetworkIpRangeResponse createStorageNetworkIpRangeResponse(StorageNetworkIpRange result);
|
||||
|
||||
/**
|
||||
* @param tableName
|
||||
* TODO
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
Long getIdentiyId(String tableName, String token);
|
||||
|
||||
/**
|
||||
* @param resourceTag
|
||||
* @param keyValueOnly TODO
|
||||
* @return
|
||||
*/
|
||||
ResourceTagResponse createResourceTagResponse(ResourceTag resourceTag, boolean keyValueOnly);
|
||||
|
||||
Site2SiteVpnGatewayResponse createSite2SiteVpnGatewayResponse(Site2SiteVpnGateway result);
|
||||
|
||||
/**
|
||||
* @param offering
|
||||
* @return
|
||||
*/
|
||||
VpcOfferingResponse createVpcOfferingResponse(VpcOffering offering);
|
||||
|
||||
/**
|
||||
* @param vpc
|
||||
* @return
|
||||
*/
|
||||
VpcResponse createVpcResponse(Vpc vpc);
|
||||
|
||||
/**
|
||||
* @param networkACL
|
||||
* @return
|
||||
*/
|
||||
NetworkACLResponse createNetworkACLResponse(FirewallRule networkACL);
|
||||
|
||||
/**
|
||||
* @param result
|
||||
* @return
|
||||
*/
|
||||
PrivateGatewayResponse createPrivateGatewayResponse(PrivateGateway result);
|
||||
|
||||
/**
|
||||
* @param result
|
||||
* @return
|
||||
*/
|
||||
StaticRouteResponse createStaticRouteResponse(StaticRoute result);
|
||||
|
||||
Site2SiteCustomerGatewayResponse createSite2SiteCustomerGatewayResponse(Site2SiteCustomerGateway result);
|
||||
|
||||
Site2SiteVpnConnectionResponse createSite2SiteVpnConnectionResponse(Site2SiteVpnConnection result);
|
||||
|
||||
CounterResponse createCounterResponse(Counter ctr);
|
||||
|
||||
ConditionResponse createConditionResponse(Condition cndn);
|
||||
|
||||
AutoScalePolicyResponse createAutoScalePolicyResponse(AutoScalePolicy policy);
|
||||
|
||||
AutoScaleVmProfileResponse createAutoScaleVmProfileResponse(AutoScaleVmProfile profile);
|
||||
|
||||
AutoScaleVmGroupResponse createAutoScaleVmGroupResponse(AutoScaleVmGroup vmGroup);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,156 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCreateCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.AutoScalePolicyResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.network.as.AutoScalePolicy;
|
||||
import com.cloud.network.as.Condition;
|
||||
|
||||
@Implementation(description = "Creates an autoscale policy for a provision or deprovision action, the action is taken when the all the conditions evaluates to true for the specified duration. The policy is in effect once it is attached to a autscale vm group.", responseObject = AutoScalePolicyResponse.class)
|
||||
public class CreateAutoScalePolicyCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateAutoScalePolicyCmd.class.getName());
|
||||
|
||||
private static final String s_name = "autoscalepolicyresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name = ApiConstants.DURATION, type = CommandType.INTEGER, required = true, description = "the duration for which the conditions have to be true before action is taken")
|
||||
private Integer duration;
|
||||
|
||||
@Parameter(name = ApiConstants.QUIETTIME, type = CommandType.INTEGER, description = "the cool down period for which the policy should not be evaluated after the action has been taken")
|
||||
private Integer quietTime;
|
||||
|
||||
@Parameter(name = ApiConstants.ACTION, type = CommandType.STRING, required = true, description = "the action to be executed if all the conditions evaluate to true for the specified duration.")
|
||||
private String action;
|
||||
|
||||
@IdentityMapper(entityTableName = "conditions")
|
||||
@Parameter(name = ApiConstants.CONDITION_IDS, type = CommandType.LIST, collectionType = CommandType.LONG, required = true, description = "the list of IDs of the conditions that are being evaluated on every interval")
|
||||
private List<Long> conditionIds;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
private Long conditionDomainId;
|
||||
private Long conditionAccountId;
|
||||
|
||||
@Override
|
||||
public String getEntityTable() {
|
||||
return "autoscale_policies";
|
||||
}
|
||||
|
||||
public Integer getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public Integer getQuietTime() {
|
||||
return quietTime;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public List<Long> getConditionIds() {
|
||||
return conditionIds;
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getResultObjectName() {
|
||||
return "autoscalepolicy";
|
||||
}
|
||||
|
||||
public long getAccountId()
|
||||
{
|
||||
if (conditionAccountId == null)
|
||||
getEntityOwnerId();
|
||||
return conditionAccountId;
|
||||
}
|
||||
|
||||
public long getDomainId()
|
||||
{
|
||||
if (conditionDomainId == null) {
|
||||
getEntityOwnerId();
|
||||
}
|
||||
|
||||
return conditionDomainId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
if (conditionAccountId != null) {
|
||||
return conditionAccountId;
|
||||
}
|
||||
long conditionId = getConditionIds().get(0);
|
||||
Condition condition = _entityMgr.findById(Condition.class, conditionId);
|
||||
conditionDomainId = condition.getDomainId();
|
||||
conditionAccountId = condition.getAccountId();
|
||||
|
||||
return conditionAccountId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_AUTOSCALEPOLICY_CREATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "creating AutoScale Policy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AutoScalePolicy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create() throws ResourceAllocationException {
|
||||
AutoScalePolicy result = _autoScaleService.createAutoScalePolicy(this);
|
||||
if (result != null) {
|
||||
this.setEntityId(result.getId());
|
||||
AutoScalePolicyResponse response = _responseGenerator.createAutoScalePolicyResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create AutoScale Policy");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,193 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCreateCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.AutoScaleVmGroupResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.network.as.AutoScaleVmGroup;
|
||||
import com.cloud.network.rules.LoadBalancer;
|
||||
|
||||
@Implementation(description="Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.", responseObject=AutoScaleVmGroupResponse.class)
|
||||
public class CreateAutoScaleVmGroupCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateAutoScaleVmGroupCmd.class.getName());
|
||||
|
||||
private static final String s_name = "autoscalevmgroupresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="firewall_rules")
|
||||
@Parameter(name = ApiConstants.LBID, type = CommandType.LONG, required = true, description = "the ID of the load balancer rule")
|
||||
private Long lbRuleId;
|
||||
|
||||
@Parameter(name=ApiConstants.MIN_MEMBERS, type=CommandType.INTEGER, required=true, description="the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.")
|
||||
private int minMembers;
|
||||
|
||||
@Parameter(name=ApiConstants.MAX_MEMBERS, type=CommandType.INTEGER, required=true, description="the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.")
|
||||
private int maxMembers;
|
||||
|
||||
@Parameter(name=ApiConstants.INTERVAL, type=CommandType.INTEGER, description="the frequency at which the conditions have to be evaluated")
|
||||
private Integer interval;
|
||||
|
||||
@IdentityMapper(entityTableName="autoscale_policies")
|
||||
@Parameter(name=ApiConstants.SCALEUP_POLICY_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, required=true, description="list of provision autoscale policies")
|
||||
private List<Long> scaleUpPolicyIds;
|
||||
|
||||
@IdentityMapper(entityTableName="autoscale_policies")
|
||||
@Parameter(name=ApiConstants.SCALEDOWN_POLICY_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, required=true, description="list of de-provision autoscale policies")
|
||||
private List<Long> scaleDownPolicyIds;
|
||||
|
||||
@IdentityMapper(entityTableName="autoscale_vmprofiles")
|
||||
@Parameter(name=ApiConstants.VMPROFILE_ID, type=CommandType.LONG, required=true, description="the autoscale profile that contains information about the vms in the vm group.")
|
||||
private Long profileId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getEntityTable() {
|
||||
return "autoscale_vm_groups";
|
||||
}
|
||||
|
||||
public int getMinMembers() {
|
||||
return minMembers;
|
||||
}
|
||||
|
||||
public int getMaxMembers() {
|
||||
return maxMembers;
|
||||
}
|
||||
|
||||
|
||||
public Integer getInterval() {
|
||||
return interval;
|
||||
}
|
||||
|
||||
public Long getProfileId() {
|
||||
return profileId;
|
||||
}
|
||||
|
||||
public List<Long> getScaleUpPolicyIds() {
|
||||
return scaleUpPolicyIds;
|
||||
}
|
||||
|
||||
public List<Long> getScaleDownPolicyIds() {
|
||||
return scaleDownPolicyIds;
|
||||
}
|
||||
|
||||
public Long getLbRuleId() {
|
||||
return lbRuleId;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getResultObjectName() {
|
||||
return "autoscalevmgroup";
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
LoadBalancer lb = _entityMgr.findById(LoadBalancer.class, getLbRuleId());
|
||||
if(lb == null) {
|
||||
throw new InvalidParameterValueException("Unable to find loadbalancer from lbRuleId=" + getLbRuleId());
|
||||
}
|
||||
return lb.getAccountId();
|
||||
}
|
||||
|
||||
public void setLbRuleId(Long lbRuleId) {
|
||||
this.lbRuleId = lbRuleId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_AUTOSCALEVMGROUP_CREATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateEventType() {
|
||||
return EventTypes.EVENT_AUTOSCALEVMGROUP_CREATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateEventDescription() {
|
||||
return "creating AutoScale Vm Group";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "configuring AutoScale Vm Group. Vm Group Id: "+getEntityId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AutoScaleVmGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create() throws ResourceAllocationException{
|
||||
AutoScaleVmGroup result = _autoScaleService.createAutoScaleVmGroup(this);
|
||||
if (result != null) {
|
||||
this.setEntityId(result.getId());
|
||||
AutoScaleVmGroupResponse response = _responseGenerator.createAutoScaleVmGroupResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create Autoscale Vm Group");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean success = false;
|
||||
AutoScaleVmGroup vmGroup = null;
|
||||
try
|
||||
{
|
||||
success = true; // Temporary, till we call configure.
|
||||
// success = _lbService.configureAutoScaleVmGroup(this);
|
||||
vmGroup = _entityMgr.findById(AutoScaleVmGroup.class, getEntityId());
|
||||
AutoScaleVmGroupResponse responseObject = _responseGenerator.createAutoScaleVmGroupResponse(vmGroup);
|
||||
setResponseObject(responseObject);
|
||||
responseObject.setResponseName(getCommandName());
|
||||
} catch (Exception ex) {
|
||||
//TODO what will happen if Resource Layer fails in a step inbetween
|
||||
s_logger.warn("Failed to create autoscale vm group", ex);
|
||||
} finally {
|
||||
if(!success || vmGroup == null) {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create Autoscale Vm Group");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,256 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCreateCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.AutoScaleVmProfileResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.network.as.AutoScaleVmProfile;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description = "Creates a profile that contains information about the virtual machine which will be provisioned automatically by autoscale feature.", responseObject = AutoScaleVmProfileResponse.class)
|
||||
public class CreateAutoScaleVmProfileCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateAutoScaleVmProfileCmd.class.getName());
|
||||
|
||||
private static final String s_name = "autoscalevmprofileresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "data_center")
|
||||
@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.LONG, required = true, description = "availability zone for the auto deployed virtual machine")
|
||||
private Long zoneId;
|
||||
|
||||
@IdentityMapper(entityTableName = "disk_offering")
|
||||
@Parameter(name = ApiConstants.SERVICE_OFFERING_ID, type = CommandType.LONG, required = true, description = "the service offering of the auto deployed virtual machine")
|
||||
private Long serviceOfferingId;
|
||||
|
||||
@IdentityMapper(entityTableName = "vm_template")
|
||||
@Parameter(name = ApiConstants.TEMPLATE_ID, type = CommandType.LONG, required = true, description = "the template of the auto deployed virtual machine")
|
||||
private Long templateId;
|
||||
|
||||
@Parameter(name = ApiConstants.OTHER_DEPLOY_PARAMS, type = CommandType.STRING, description = "parameters other than zoneId/serviceOfferringId/templateId of the auto deployed virtual machine")
|
||||
private String otherDeployParams;
|
||||
|
||||
@Parameter(name = ApiConstants.AUTOSCALE_VM_DESTROY_TIME, type = CommandType.INTEGER, required = true, description = "the time allowed for existing connections to get closed before a vm is destroyed")
|
||||
private Integer destroyVmGraceperiod;
|
||||
|
||||
@Parameter(name = ApiConstants.SNMP_COMMUNITY, type = CommandType.STRING, description = "snmp community string to be used to contact a virtual machine deployed by this profile")
|
||||
private String snmpCommunity;
|
||||
|
||||
@Parameter(name = ApiConstants.SNMP_PORT, type = CommandType.INTEGER, description = "port at which snmp agent is listening in a virtual machine deployed by this profile")
|
||||
private Integer snmpPort;
|
||||
|
||||
@IdentityMapper(entityTableName = "user")
|
||||
@Parameter(name = ApiConstants.AUTOSCALE_USER_ID, type = CommandType.LONG, description = "the ID of the user used to launch and destroy the VMs")
|
||||
private Long autoscaleUserId;
|
||||
|
||||
private Map<String, String> otherDeployParamMap;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
private Long domainId;
|
||||
private Long accountId;
|
||||
|
||||
@Override
|
||||
public String getEntityTable() {
|
||||
return "autoscale_vmprofiles";
|
||||
}
|
||||
|
||||
public Long getDomainId() {
|
||||
if (domainId == null) {
|
||||
getAccountId();
|
||||
}
|
||||
return domainId;
|
||||
}
|
||||
|
||||
public Long getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public Long getServiceOfferingId() {
|
||||
return serviceOfferingId;
|
||||
}
|
||||
|
||||
public Long getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public Integer getSnmpPort() {
|
||||
return snmpPort;
|
||||
}
|
||||
|
||||
public String getSnmpCommunity() {
|
||||
return snmpCommunity;
|
||||
}
|
||||
|
||||
public String getOtherDeployParams() {
|
||||
return otherDeployParams;
|
||||
}
|
||||
|
||||
public Long getAutoscaleUserId() {
|
||||
if(autoscaleUserId != null) {
|
||||
return autoscaleUserId;
|
||||
} else {
|
||||
return UserContext.current().getCaller().getId();
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getDestroyVmGraceperiod() {
|
||||
return destroyVmGraceperiod;
|
||||
}
|
||||
|
||||
public long getAccountId() {
|
||||
if(accountId != null) {
|
||||
return accountId;
|
||||
}
|
||||
Account account = null;
|
||||
if(autoscaleUserId != null) {
|
||||
User user = _entityMgr.findById(User.class, autoscaleUserId);
|
||||
account = _entityMgr.findById(Account.class, user.getAccountId());
|
||||
} else {
|
||||
account = UserContext.current().getCaller();
|
||||
}
|
||||
accountId = account.getAccountId();
|
||||
domainId = account.getDomainId();
|
||||
return accountId;
|
||||
}
|
||||
|
||||
private void createOtherDeployParamMap()
|
||||
{
|
||||
if (otherDeployParamMap == null) {
|
||||
otherDeployParamMap = new HashMap<String, String>();
|
||||
}
|
||||
if (otherDeployParams == null)
|
||||
return;
|
||||
String[] keyValues = otherDeployParams.split("&"); // hostid=123, hypervisor=xenserver
|
||||
for (String keyValue : keyValues) { // keyValue == "hostid=123"
|
||||
String[] keyAndValue = keyValue.split("="); // keyValue = hostid, 123
|
||||
if (keyAndValue.length != 2) {
|
||||
throw new InvalidParameterValueException("Invalid parameter in otherDeployParam : " + keyValue);
|
||||
}
|
||||
String paramName = keyAndValue[0]; // hostid
|
||||
String paramValue = keyAndValue[1]; // 123
|
||||
otherDeployParamMap.put(paramName, paramValue);
|
||||
}
|
||||
}
|
||||
|
||||
public HashMap<String, String> getDeployParamMap()
|
||||
{
|
||||
createOtherDeployParamMap();
|
||||
HashMap<String, String> deployParams = new HashMap<String, String>(otherDeployParamMap);
|
||||
deployParams.put("command", "deployVirtualMachine");
|
||||
deployParams.put("zoneId", zoneId.toString());
|
||||
deployParams.put("serviceOfferingId", serviceOfferingId.toString());
|
||||
deployParams.put("templateId", templateId.toString());
|
||||
return deployParams;
|
||||
}
|
||||
|
||||
public String getOtherDeployParam(String param)
|
||||
{
|
||||
if (param == null) {
|
||||
return null;
|
||||
}
|
||||
createOtherDeployParamMap();
|
||||
return otherDeployParamMap.get(param);
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getResultObjectName() {
|
||||
return "autoscalevmprofile";
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return getAccountId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_AUTOSCALEVMPROFILE_CREATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "creating AutoScale Vm Profile";
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AutoScaleVmProfile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create() throws ResourceAllocationException {
|
||||
|
||||
DataCenter zone = _configService.getZone(zoneId);
|
||||
if (zone == null) {
|
||||
throw new InvalidParameterValueException("Unable to find zone by id=" + zoneId);
|
||||
}
|
||||
|
||||
ServiceOffering serviceOffering = _configService.getServiceOffering(serviceOfferingId);
|
||||
if (serviceOffering == null) {
|
||||
throw new InvalidParameterValueException("Unable to find service offering: " + serviceOfferingId);
|
||||
}
|
||||
|
||||
VirtualMachineTemplate template = _templateService.getTemplate(templateId);
|
||||
// Make sure a valid template ID was specified
|
||||
if (template == null) {
|
||||
throw new InvalidParameterValueException("Unable to use template " + templateId);
|
||||
}
|
||||
|
||||
AutoScaleVmProfile result = _autoScaleService.createAutoScaleVmProfile(this);
|
||||
if (result != null) {
|
||||
this.setEntityId(result.getId());
|
||||
AutoScaleVmProfileResponse response = _responseGenerator.createAutoScaleVmProfileResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create Autoscale Vm Profile");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCreateCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ConditionResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.network.as.Condition;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description = "Creates a condition", responseObject = ConditionResponse.class)
|
||||
public class CreateConditionCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateConditionCmd.class.getName());
|
||||
private static final String s_name = "conditionresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "counter")
|
||||
@Parameter(name = ApiConstants.COUNTER_ID, type = CommandType.LONG, required = true, description = "ID of the Counter.")
|
||||
private long counterId;
|
||||
|
||||
@Parameter(name = ApiConstants.RELATIONAL_OPERATOR, type = CommandType.STRING, required = true, description = "Relational Operator to be used with threshold.")
|
||||
private String relationalOperator;
|
||||
|
||||
@Parameter(name = ApiConstants.THRESHOLD, type = CommandType.LONG, required = true, description = "Threshold value.")
|
||||
private Long threshold;
|
||||
|
||||
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "the account of the condition. " +
|
||||
"Must be used with the domainId parameter.")
|
||||
private String accountName;
|
||||
|
||||
@IdentityMapper(entityTableName = "domain")
|
||||
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.LONG, description = "the domain ID of the account.")
|
||||
private Long domainId;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void create() throws ResourceAllocationException {
|
||||
Condition condition = null;
|
||||
condition = _autoScaleService.createCondition(this);
|
||||
|
||||
if (condition != null) {
|
||||
this.setEntityId(condition.getId());
|
||||
ConditionResponse response = _responseGenerator.createConditionResponse(condition);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create condition.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
}
|
||||
|
||||
// /////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public Long getCounterId() {
|
||||
return counterId;
|
||||
}
|
||||
|
||||
public String getRelationalOperator() {
|
||||
return relationalOperator;
|
||||
}
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
public Long getThreshold() {
|
||||
return threshold;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "creating a condition";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_CONDITION_CREATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Long accountId = finalyzeAccountId(accountName, domainId, null, true);
|
||||
if (accountId == null) {
|
||||
return UserContext.current().getCaller().getId();
|
||||
}
|
||||
|
||||
return accountId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEntityTable() {
|
||||
return "conditions";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCreateCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.CounterResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.as.Counter;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description = "Adds metric counter", responseObject = CounterResponse.class)
|
||||
public class CreateCounterCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateCounterCmd.class.getName());
|
||||
private static final String s_name = "counterresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "Name of the counter.")
|
||||
private String name;
|
||||
|
||||
@Parameter(name = ApiConstants.SOURCE, type = CommandType.STRING, required = true, description = "Source of the counter.")
|
||||
private String source;
|
||||
|
||||
@Parameter(name = ApiConstants.VALUE, type = CommandType.STRING, required = true, description = "Value of the counter e.g. oid in case of snmp.")
|
||||
private String value;
|
||||
|
||||
// /////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create() {
|
||||
Counter ctr = null;
|
||||
ctr = _autoScaleService.createCounter(this);
|
||||
|
||||
if (ctr != null) {
|
||||
this.setEntityId(ctr.getId());
|
||||
CounterResponse response = _responseGenerator.createCounterResponse(ctr);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create Counter with name " + getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Counter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_COUNTER_CREATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "creating a new Counter";
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEntityTable() {
|
||||
return "counter";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.as.AutoScalePolicy;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes a autoscale policy.", responseObject=SuccessResponse.class)
|
||||
public class DeleteAutoScalePolicyCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteAutoScalePolicyCmd.class.getName());
|
||||
private static final String s_name = "deleteautoscalepolicyresponse";
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="autoscale_policies")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the autoscale policy")
|
||||
private Long id;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
AutoScalePolicy autoScalePolicy = _entityMgr.findById(AutoScalePolicy.class, getId());
|
||||
if (autoScalePolicy != null) {
|
||||
return autoScalePolicy.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_AUTOSCALEPOLICY_DELETE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "deleting AutoScale Policy: " + getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
UserContext.current().setEventDetails("AutoScale Policy Id: "+getId());
|
||||
boolean result = _autoScaleService.deleteAutoScalePolicy(id);
|
||||
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
s_logger.info("Successfully deleted autoscale policy id : " + getId());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
s_logger.warn("Failed to delete autoscale policy " + getId());
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete AutoScale Policy");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AutoScalePolicy;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.as.AutoScaleVmGroup;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes a autoscale vm group.", responseObject=SuccessResponse.class)
|
||||
public class DeleteAutoScaleVmGroupCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteAutoScaleVmGroupCmd.class.getName());
|
||||
private static final String s_name = "deleteautoscalevmgroupresponse";
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="autoscale_vmgroups")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the autoscale group")
|
||||
private Long id;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
AutoScaleVmGroup autoScaleVmGroup = _entityMgr.findById(AutoScaleVmGroup.class, getId());
|
||||
if (autoScaleVmGroup != null) {
|
||||
return autoScaleVmGroup.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_AUTOSCALEVMGROUP_DELETE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "deleting autoscale vm group: " + getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
UserContext.current().setEventDetails("AutoScale Vm Group Id: "+getId());
|
||||
boolean result = _autoScaleService.deleteAutoScaleVmGroup(id);
|
||||
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
s_logger.info("Successfully deleted autoscale vm group id : " + getId());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
s_logger.warn("Failed to delete autoscale vm group " + getId());
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete autoscale vm group");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AutoScalePolicy;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.as.AutoScaleVmProfile;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes a autoscale vm profile.", responseObject=SuccessResponse.class)
|
||||
public class DeleteAutoScaleVmProfileCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteAutoScaleVmProfileCmd.class.getName());
|
||||
private static final String s_name = "deleteautoscalevmprofileresponse";
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="autoscale_vmprofiles")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the autoscale profile")
|
||||
private Long id;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
AutoScaleVmProfile autoScaleVmProfile = _entityMgr.findById(AutoScaleVmProfile.class, getId());
|
||||
if (autoScaleVmProfile != null) {
|
||||
return autoScaleVmProfile.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_AUTOSCALEVMPROFILE_DELETE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "deleting autoscale vm profile: " + getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
UserContext.current().setEventDetails("AutoScale VM Profile Id: "+getId());
|
||||
boolean result = _autoScaleService.deleteAutoScaleVmProfile(id);
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
s_logger.info("Successfully deleted autoscale vm profile id : " + getId());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
s_logger.warn("Failed to delete autoscale vm profile " + getId());
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete autoscale vm profile");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AutoScaleVmProfile;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.network.as.Condition;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description = "Removes a condition", responseObject = SuccessResponse.class)
|
||||
public class DeleteConditionCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteConditionCmd.class.getName());
|
||||
private static final String s_name = "deleteconditionresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "conditions")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the condition.")
|
||||
private Long id;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
boolean result = false;
|
||||
try {
|
||||
result = _autoScaleService.deleteCondition(getId());
|
||||
} catch (ResourceInUseException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.RESOURCE_IN_USE_ERROR, ex.getMessage());
|
||||
}
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
s_logger.info("Successfully deleted condition id : " + getId());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
s_logger.warn("Failed to delete condition " + getId());
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete condition.");
|
||||
}
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Condition condition = _entityMgr.findById(Condition.class, getId());
|
||||
if (condition != null) {
|
||||
return condition.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are
|
||||
// tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_CONDITION_DELETE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Deleting a condition.";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description = "Deletes a counter", responseObject = SuccessResponse.class)
|
||||
public class DeleteCounterCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteCounterCmd.class.getName());
|
||||
private static final String s_name = "deletecounterresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "counter")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the counter")
|
||||
private Long id;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
boolean result = false;
|
||||
try {
|
||||
result = _autoScaleService.deleteCounter(getId());
|
||||
} catch (ResourceInUseException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.RESOURCE_IN_USE_ERROR, ex.getMessage());
|
||||
}
|
||||
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
s_logger.info("Successfully deleted counter id : " + getId());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
s_logger.warn("Failed to delete counter");
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete counter.");
|
||||
}
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Counter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_COUNTER_DELETE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Deleting a counter.";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.AutoScaleVmGroupResponse;
|
||||
import com.cloud.network.as.AutoScaleVmGroup;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description = "Disables an AutoScale Vm Group", responseObject = AutoScaleVmGroupResponse.class)
|
||||
public class DisableAutoScaleVmGroupCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DisableAutoScaleVmGroupCmd.class.getName());
|
||||
private static final String s_name = "disableautoscalevmGroupresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "account")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "Account id")
|
||||
private Long id;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
AutoScaleVmGroup result = _autoScaleService.disableAutoScaleVmGroup(getId());
|
||||
if (result != null) {
|
||||
AutoScaleVmGroupResponse response = _responseGenerator.createAutoScaleVmGroupResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to disable AutoScale Vm Group");
|
||||
}
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
AutoScaleVmGroup autoScaleVmGroup = _entityMgr.findById(AutoScaleVmGroup.class, getId());
|
||||
if (autoScaleVmGroup != null) {
|
||||
return autoScaleVmGroup.getAccountId();
|
||||
}
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are
|
||||
// tracked
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.AutoScaleVmGroupResponse;
|
||||
import com.cloud.network.as.AutoScaleVmGroup;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description = "Enables an AutoScale Vm Group", responseObject = AutoScaleVmGroupResponse.class)
|
||||
public class EnableAutoScaleVmGroupCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(EnableAutoScaleVmGroupCmd.class.getName());
|
||||
private static final String s_name = "enableautoscalevmGroupresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "account")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "Account id")
|
||||
private Long id;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
AutoScaleVmGroup result = _autoScaleService.enableAutoScaleVmGroup(getId());
|
||||
if (result != null) {
|
||||
AutoScaleVmGroupResponse response = _responseGenerator.createAutoScaleVmGroupResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to enable AutoScale Vm Group");
|
||||
}
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
AutoScaleVmGroup autoScaleVmGroup = _entityMgr.findById(AutoScaleVmGroup.class, getId());
|
||||
if (autoScaleVmGroup != null) {
|
||||
return autoScaleVmGroup.getAccountId();
|
||||
}
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are
|
||||
// tracked
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseListAccountResourcesCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.AutoScalePolicyResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.network.as.AutoScalePolicy;
|
||||
|
||||
@Implementation(description = "Lists autoscale policies.", responseObject = AutoScalePolicyResponse.class)
|
||||
public class ListAutoScalePoliciesCmd extends BaseListAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListAutoScalePoliciesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listautoscalepoliciesresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "autoscale_policies")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "the ID of the autoscale policy")
|
||||
private Long id;
|
||||
|
||||
@IdentityMapper(entityTableName = "conditions")
|
||||
@Parameter(name = ApiConstants.CONDITION_ID, type = CommandType.LONG, description = "the ID of the condition of the policy")
|
||||
private Long conditionId;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Long getConditionId() {
|
||||
return conditionId;
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
List<? extends AutoScalePolicy> autoScalePolicies = _autoScaleService.listAutoScalePolicies(this);
|
||||
ListResponse<AutoScalePolicyResponse> response = new ListResponse<AutoScalePolicyResponse>();
|
||||
List<AutoScalePolicyResponse> responses = new ArrayList<AutoScalePolicyResponse>();
|
||||
if (autoScalePolicies != null) {
|
||||
for (AutoScalePolicy autoScalePolicy : autoScalePolicies) {
|
||||
AutoScalePolicyResponse autoScalePolicyResponse = _responseGenerator.createAutoScalePolicyResponse(autoScalePolicy);
|
||||
autoScalePolicyResponse.setObjectName("autoscalepolicy");
|
||||
responses.add(autoScalePolicyResponse);
|
||||
}
|
||||
}
|
||||
response.setResponses(responses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseListProjectAndAccountResourcesCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.AutoScaleVmGroupResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.network.as.AutoScaleVmGroup;
|
||||
|
||||
@Implementation(description = "Lists autoscale vm groups.", responseObject = AutoScaleVmGroupResponse.class)
|
||||
public class ListAutoScaleVmGroupsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListAutoScaleVmGroupsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listautoscalevmgroupsresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="autoscale_vmgroups")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "the ID of the autoscale vm group")
|
||||
private Long id;
|
||||
|
||||
@IdentityMapper(entityTableName="firewall_rules")
|
||||
@Parameter(name = ApiConstants.LBID, type = CommandType.LONG, description = "the ID of the loadbalancer")
|
||||
private Long loadBalancerId;
|
||||
|
||||
@IdentityMapper(entityTableName="autoscale_vmprofiles")
|
||||
@Parameter(name = ApiConstants.VMPROFILE_ID, type = CommandType.LONG, description = "the ID of the profile")
|
||||
private Long profileId;
|
||||
|
||||
@IdentityMapper(entityTableName="autoscale_policies")
|
||||
@Parameter(name = ApiConstants.POLICY_ID, type = CommandType.LONG, description = "the ID of the policy")
|
||||
private Long policyId;
|
||||
|
||||
@IdentityMapper(entityTableName="data_center")
|
||||
@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.LONG, description = "the availability zone ID")
|
||||
private Long zoneId;
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Long getLoadBalancerId() {
|
||||
return loadBalancerId;
|
||||
}
|
||||
|
||||
|
||||
public Long getProfileId() {
|
||||
return profileId;
|
||||
}
|
||||
|
||||
public Long getPolicyId() {
|
||||
return policyId;
|
||||
}
|
||||
|
||||
public Long getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if(id != null && (loadBalancerId != null || profileId != null || policyId != null))
|
||||
throw new InvalidParameterValueException("When id is specified other parameters need not be specified");
|
||||
|
||||
List<? extends AutoScaleVmGroup> autoScaleGroups = _autoScaleService.listAutoScaleVmGroups(this);
|
||||
ListResponse<AutoScaleVmGroupResponse> response = new ListResponse<AutoScaleVmGroupResponse>();
|
||||
List<AutoScaleVmGroupResponse> responses = new ArrayList<AutoScaleVmGroupResponse>();
|
||||
if (autoScaleGroups != null) {
|
||||
for (AutoScaleVmGroup autoScaleVmGroup : autoScaleGroups) {
|
||||
AutoScaleVmGroupResponse autoScaleVmGroupResponse = _responseGenerator.createAutoScaleVmGroupResponse(autoScaleVmGroup);
|
||||
autoScaleVmGroupResponse.setObjectName("autoscalevmgroup");
|
||||
responses.add(autoScaleVmGroupResponse);
|
||||
}
|
||||
}
|
||||
response.setResponses(responses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseListProjectAndAccountResourcesCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.AutoScaleVmProfileResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.network.as.AutoScaleVmProfile;
|
||||
|
||||
@Implementation(description = "Lists autoscale vm profiles.", responseObject = AutoScaleVmProfileResponse.class)
|
||||
public class ListAutoScaleVmProfilesCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListAutoScaleVmProfilesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listautoscalevmprofilesresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="autoscale_vmprofiles")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "the ID of the autoscale vm profile")
|
||||
private Long id;
|
||||
|
||||
@IdentityMapper(entityTableName="vm_template")
|
||||
@Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, description="the templateid of the autoscale vm profile")
|
||||
private Long templateId;
|
||||
|
||||
@Parameter(name=ApiConstants.OTHER_DEPLOY_PARAMS, type=CommandType.STRING, description="the otherdeployparameters of the autoscale vm profile")
|
||||
private String otherDeployParams;
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Long getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public String getOtherDeployParams() {
|
||||
return otherDeployParams;
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
List<? extends AutoScaleVmProfile> autoScaleProfiles = _autoScaleService.listAutoScaleVmProfiles(this);
|
||||
ListResponse<AutoScaleVmProfileResponse> response = new ListResponse<AutoScaleVmProfileResponse>();
|
||||
List<AutoScaleVmProfileResponse> responses = new ArrayList<AutoScaleVmProfileResponse>();
|
||||
if (autoScaleProfiles != null) {
|
||||
for (AutoScaleVmProfile autoScaleVmProfile : autoScaleProfiles) {
|
||||
AutoScaleVmProfileResponse autoScaleVmProfileResponse = _responseGenerator.createAutoScaleVmProfileResponse(autoScaleVmProfile);
|
||||
autoScaleVmProfileResponse.setObjectName("autoscalevmprofile");
|
||||
responses.add(autoScaleVmProfileResponse);
|
||||
}
|
||||
}
|
||||
response.setResponses(responses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseListAccountResourcesCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.ConditionResponse;
|
||||
import com.cloud.api.response.CounterResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.network.as.Condition;
|
||||
|
||||
@Implementation(description = "List Conditions for the specific user", responseObject = CounterResponse.class)
|
||||
public class ListConditionsCmd extends BaseListAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListConditionsCmd.class.getName());
|
||||
private static final String s_name = "listconditionsresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "conditions")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = false, description = "ID of the Condition.")
|
||||
private Long id;
|
||||
|
||||
@Parameter(name = ApiConstants.COUNTER_ID, type = CommandType.LONG, required = false, description = "Counter-id of the condition.")
|
||||
private Long counterId;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
List<? extends Condition> conditions = null;
|
||||
conditions = _autoScaleService.listConditions(this);
|
||||
ListResponse<ConditionResponse> response = new ListResponse<ConditionResponse>();
|
||||
List<ConditionResponse> cndnResponses = new ArrayList<ConditionResponse>();
|
||||
for (Condition cndn : conditions) {
|
||||
ConditionResponse cndnResponse = _responseGenerator.createConditionResponse(cndn);
|
||||
cndnResponses.add(cndnResponse);
|
||||
}
|
||||
|
||||
response.setResponses(cndnResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
|
||||
// /////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Long getCounterId() {
|
||||
return counterId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseListCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.CounterResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.network.as.Counter;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description = "List the counters", responseObject = CounterResponse.class)
|
||||
public class ListCountersCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListCountersCmd.class.getName());
|
||||
private static final String s_name = "counterresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "counter")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "ID of the Counter.")
|
||||
private Long id;
|
||||
|
||||
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "Name of the counter.")
|
||||
private String name;
|
||||
|
||||
@Parameter(name = ApiConstants.SOURCE, type = CommandType.STRING, description = "Source of the counter.")
|
||||
private String source;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
List<? extends Counter> counters = null;
|
||||
counters = _autoScaleService.listCounters(this);
|
||||
ListResponse<CounterResponse> response = new ListResponse<CounterResponse>();
|
||||
List<CounterResponse> ctrResponses = new ArrayList<CounterResponse>();
|
||||
for (Counter ctr : counters) {
|
||||
CounterResponse ctrResponse = _responseGenerator.createCounterResponse(ctr);
|
||||
ctrResponses.add(ctrResponse);
|
||||
}
|
||||
|
||||
response.setResponses(ctrResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
|
||||
// /////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.AutoScalePolicyResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.as.AutoScalePolicy;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description = "Updates an existing autoscale policy.", responseObject = AutoScalePolicyResponse.class)
|
||||
public class UpdateAutoScalePolicyCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(UpdateAutoScalePolicyCmd.class.getName());
|
||||
|
||||
private static final String s_name = "updateautoscalepolicyresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name = ApiConstants.DURATION, type = CommandType.INTEGER, description = "the duration for which the conditions have to be true before action is taken")
|
||||
private Integer duration;
|
||||
|
||||
@Parameter(name = ApiConstants.QUIETTIME, type = CommandType.INTEGER, description = "the cool down period for which the policy should not be evaluated after the action has been taken")
|
||||
private Integer quietTime;
|
||||
|
||||
@IdentityMapper(entityTableName = "autoscale_policies")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the autoscale policy")
|
||||
private Long id;
|
||||
|
||||
@Override
|
||||
public void execute() throws ServerApiException {
|
||||
UserContext.current().setEventDetails("AutoScale Policy Id: " + getId());
|
||||
AutoScalePolicy result = _autoScaleService.updateAutoScalePolicy(this);
|
||||
if (result != null) {
|
||||
AutoScalePolicyResponse response = _responseGenerator.createAutoScalePolicyResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update autoscale policy");
|
||||
}
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Integer getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public Integer getQuietTime() {
|
||||
return quietTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
AutoScalePolicy autoScalePolicy = _entityMgr.findById(AutoScalePolicy.class, getId());
|
||||
if (autoScalePolicy != null) {
|
||||
return autoScalePolicy.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are
|
||||
// tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_AUTOSCALEPOLICY_UPDATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Updating Auto Scale Policy.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AutoScalePolicy;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.AutoScaleVmGroupResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.as.AutoScaleVmGroup;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description = "Updates an existing autoscale vm group.", responseObject = AutoScaleVmGroupResponse.class)
|
||||
public class UpdateAutoScaleVmGroupCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(UpdateAutoScaleVmGroupCmd.class.getName());
|
||||
|
||||
private static final String s_name = "updateautoscalevmgroupresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name = ApiConstants.MIN_MEMBERS, type = CommandType.INTEGER, required = true, description = "the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.")
|
||||
private int minMembers;
|
||||
|
||||
@Parameter(name = ApiConstants.MAX_MEMBERS, type = CommandType.INTEGER, required = true, description = "the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.")
|
||||
private int maxMembers;
|
||||
|
||||
@IdentityMapper(entityTableName = "autoscale_policies")
|
||||
@Parameter(name = ApiConstants.SCALEUP_POLICY_IDS, type = CommandType.LIST, collectionType = CommandType.LONG, description = "list of provision autoscale policies")
|
||||
private List<Long> scaleUpPolicyIds;
|
||||
|
||||
@IdentityMapper(entityTableName = "autoscale_policies")
|
||||
@Parameter(name = ApiConstants.SCALEDOWN_POLICY_IDS, type = CommandType.LIST, collectionType = CommandType.LONG, description = "list of de-provision autoscale policies")
|
||||
private List<Long> scaleDownPolicyIds;
|
||||
|
||||
@IdentityMapper(entityTableName = "autoscale_vmgroups")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the autoscale group")
|
||||
private Long id;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void execute() throws ServerApiException {
|
||||
UserContext.current().setEventDetails("AutoScale Vm Group Id: " + getId());
|
||||
AutoScaleVmGroup result = _autoScaleService.updateAutoScaleVmGroup(this);
|
||||
if (result != null) {
|
||||
AutoScaleVmGroupResponse response = _responseGenerator.createAutoScaleVmGroupResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update autoscale VmGroup");
|
||||
}
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getMinMembers() {
|
||||
return minMembers;
|
||||
}
|
||||
|
||||
public int getMaxMembers() {
|
||||
return maxMembers;
|
||||
}
|
||||
|
||||
public List<Long> getScaleUpPolicyIds() {
|
||||
return scaleUpPolicyIds;
|
||||
}
|
||||
|
||||
public List<Long> getScaleDownPolicyIds() {
|
||||
return scaleDownPolicyIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return "Update AutoScale Vm Group";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return EventTypes.EVENT_AUTOSCALEVMGROUP_UPDATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
AutoScaleVmGroup autoScaleVmGroup = _entityMgr.findById(AutoScaleVmGroup.class, getId());
|
||||
if (autoScaleVmGroup != null) {
|
||||
return autoScaleVmGroup.getAccountId();
|
||||
}
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are
|
||||
// tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AutoScaleVmGroup;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.AutoScaleVmProfileResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.as.AutoScaleVmProfile;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description = "Updates an existing autoscale vm profile.", responseObject = AutoScaleVmProfileResponse.class)
|
||||
public class UpdateAutoScaleVmProfileCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(UpdateAutoScaleVmProfileCmd.class.getName());
|
||||
|
||||
private static final String s_name = "updateautoscalevmprofileresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "autoscale_vmgroups")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the autoscale vm profile")
|
||||
private Long id;
|
||||
|
||||
@IdentityMapper(entityTableName = "vm_template")
|
||||
@Parameter(name = ApiConstants.TEMPLATE_ID, type = CommandType.LONG, required = true, description = "the template of the auto deployed virtual machine")
|
||||
private Long templateId;
|
||||
|
||||
@Parameter(name = ApiConstants.OTHER_DEPLOY_PARAMS, type = CommandType.STRING, description = "parameters other than zoneId/serviceOfferringId/templateId of the auto deployed virtual machine")
|
||||
private String otherDeployParams;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void execute() throws ServerApiException {
|
||||
UserContext.current().setEventDetails("AutoScale Policy Id: " + getId());
|
||||
AutoScaleVmProfile result = _autoScaleService.updateAutoScaleVmProfile(this);
|
||||
if (result != null) {
|
||||
AutoScaleVmProfileResponse response = _responseGenerator.createAutoScaleVmProfileResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update autoscale vm profile");
|
||||
}
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Long getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public String getOtherDeployParams() {
|
||||
return otherDeployParams;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_AUTOSCALEVMPROFILE_UPDATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Updating AutoScale Vm Profile";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
AutoScaleVmProfile vmProfile = _entityMgr.findById(AutoScaleVmProfile.class, getId());
|
||||
if (vmProfile != null) {
|
||||
return vmProfile.getAccountId();
|
||||
}
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are
|
||||
// tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AutoScaleVmProfile;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.response;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.utils.IdentityProxy;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AutoScalePolicyResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
|
||||
@SerializedName(ApiConstants.ID)
|
||||
@Param(description = "the autoscale policy ID")
|
||||
private IdentityProxy id = new IdentityProxy("autoscale_policies");
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_ID)
|
||||
@Param(description = "the availability zone of the autoscale policy")
|
||||
private IdentityProxy zoneId = new IdentityProxy("data_center");
|
||||
|
||||
@SerializedName(ApiConstants.ACTION)
|
||||
@Param(description = "the action to be executed if all the conditions evaluate to true for the specified duration.")
|
||||
private String action;
|
||||
|
||||
@SerializedName(ApiConstants.DURATION)
|
||||
@Param(description = "the duration for which the conditions have to be true before action is taken")
|
||||
private Integer duration;
|
||||
|
||||
@SerializedName(ApiConstants.INTERVAL)
|
||||
@Param(description = "the frequency at which the conditions have to be evaluated")
|
||||
private Integer interval;
|
||||
|
||||
@SerializedName(ApiConstants.QUIETTIME)
|
||||
@Param(description = "the cool down period for which the policy should not be evaluated after the action has been taken")
|
||||
private Integer quietTime;
|
||||
|
||||
@SerializedName("conditions")
|
||||
@Param(description = "the list of IDs of the conditions that are being evaluated on every interval")
|
||||
private List<ConditionResponse> conditions;
|
||||
|
||||
@SerializedName(ApiConstants.ACCOUNT) @Param(description="the account owning the autoscale policy")
|
||||
private String accountName;
|
||||
|
||||
@SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id autoscale policy")
|
||||
private IdentityProxy projectId = new IdentityProxy("projects");
|
||||
|
||||
@SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the autoscale policy")
|
||||
private String projectName;
|
||||
|
||||
@SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID of the autoscale policy")
|
||||
private IdentityProxy domainId = new IdentityProxy("domain");
|
||||
|
||||
@SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the autoscale policy")
|
||||
private String domainName;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id.setValue(id);
|
||||
}
|
||||
|
||||
public void setZoneId(IdentityProxy zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public void setDuration(Integer duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public void setInterval(Integer interval) {
|
||||
this.interval = interval;
|
||||
}
|
||||
|
||||
public void setQuietTime(Integer quietTime) {
|
||||
this.quietTime = quietTime;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public void setConditions(List<ConditionResponse> conditions) {
|
||||
this.conditions = conditions;
|
||||
}
|
||||
|
||||
public void setZoneId(Long zoneId) {
|
||||
this.zoneId.setValue(zoneId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAccountName(String accountName) {
|
||||
this.accountName = accountName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDomainId(Long domainId) {
|
||||
this.domainId.setValue(domainId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDomainName(String domainName) {
|
||||
this.domainName = domainName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId.setValue(projectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.response;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.utils.IdentityProxy;
|
||||
import com.cloud.network.as.AutoScalePolicy;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AutoScaleVmGroupResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
|
||||
@SerializedName(ApiConstants.ID)
|
||||
@Param(description = "the autoscale vm group ID")
|
||||
private IdentityProxy id = new IdentityProxy("autoscale_groups");
|
||||
|
||||
@SerializedName(ApiConstants.LBID)
|
||||
@Param(description = "the load balancer rule ID")
|
||||
private IdentityProxy loadBalancerId = new IdentityProxy("firewall_rules");
|
||||
|
||||
@SerializedName(ApiConstants.VMPROFILE_ID)
|
||||
@Param(description = "the autoscale profile that contains information about the vms in the vm group.")
|
||||
private IdentityProxy profileId = new IdentityProxy("autoscale_vmprofiles");
|
||||
|
||||
@SerializedName(ApiConstants.DURATION)
|
||||
@Param(description = "the duration for which the conditions have to be true before action is taken")
|
||||
private Integer minMembers;
|
||||
|
||||
@SerializedName(ApiConstants.INTERVAL)
|
||||
@Param(description = "the frequency at which the conditions have to be evaluated")
|
||||
private Integer maxMembers;
|
||||
|
||||
@SerializedName(ApiConstants.INTERVAL)
|
||||
@Param(description = "the frequency at which the conditions have to be evaluated")
|
||||
private Integer interval;
|
||||
|
||||
@SerializedName(ApiConstants.SCALEUP_POLICY_IDS)
|
||||
@Param(description = "list of provision autoscale policies")
|
||||
private List<AutoScalePolicyResponse> scaleUpPolicies;
|
||||
|
||||
@SerializedName(ApiConstants.SCALEDOWN_POLICY_IDS)
|
||||
@Param(description = "list of de-provision autoscale policies")
|
||||
private List<AutoScalePolicyResponse> scaleDownPolicies;
|
||||
|
||||
@SerializedName(ApiConstants.ACCOUNT) @Param(description="the account owning the instance group")
|
||||
private String accountName;
|
||||
|
||||
@SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id vm profile")
|
||||
private IdentityProxy projectId = new IdentityProxy("projects");
|
||||
|
||||
@SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the vm profile")
|
||||
private String projectName;
|
||||
|
||||
@SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID of the vm profile")
|
||||
private IdentityProxy domainId = new IdentityProxy("domain");
|
||||
|
||||
@SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the vm profile")
|
||||
private String domainName;
|
||||
|
||||
public AutoScaleVmGroupResponse() {
|
||||
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id.setValue(id);
|
||||
}
|
||||
|
||||
public void setLoadBalancerId(Long loadBalancerId) {
|
||||
this.loadBalancerId.setValue(loadBalancerId);
|
||||
}
|
||||
|
||||
public void setProfileId(Long profileId) {
|
||||
this.profileId.setValue(profileId);
|
||||
}
|
||||
|
||||
public void setMinMembers(Integer minMembers) {
|
||||
this.minMembers = minMembers;
|
||||
}
|
||||
|
||||
public void setMaxMembers(Integer maxMembers) {
|
||||
this.maxMembers = maxMembers;
|
||||
}
|
||||
|
||||
public void setInterval(Integer interval) {
|
||||
this.interval = interval;
|
||||
}
|
||||
|
||||
public void setScaleUpPolicies(List<AutoScalePolicyResponse> scaleUpPolicies) {
|
||||
this.scaleUpPolicies = scaleUpPolicies;
|
||||
}
|
||||
|
||||
public void setScaleDownPolicies(List<AutoScalePolicyResponse> scaleDownPolicies) {
|
||||
this.scaleDownPolicies = scaleDownPolicies;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAccountName(String accountName) {
|
||||
this.accountName = accountName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDomainId(Long domainId) {
|
||||
this.domainId.setValue(domainId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDomainName(String domainName) {
|
||||
this.domainName = domainName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId.setValue(projectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.response;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.cloud.utils.IdentityProxy;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class AutoScaleVmProfileResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
|
||||
@SerializedName(ApiConstants.ID)
|
||||
@Param(description = "the autoscale vm profile ID")
|
||||
private IdentityProxy id = new IdentityProxy("autoscale_vmprofiles");
|
||||
|
||||
/* Parameters related to deploy virtual machine */
|
||||
@SerializedName(ApiConstants.ZONE_ID)
|
||||
@Param(description = "the availability zone to be used while deploying a virtual machine")
|
||||
private IdentityProxy zoneId = new IdentityProxy("data_center");
|
||||
|
||||
@SerializedName(ApiConstants.SERVICE_OFFERING_ID)
|
||||
@Param(description = "the service offering to be used while deploying a virtual machine")
|
||||
private IdentityProxy serviceOfferingId = new IdentityProxy("disk_offering");
|
||||
|
||||
@SerializedName(ApiConstants.TEMPLATE_ID)
|
||||
@Param(description = "the template to be used while deploying a virtual machine")
|
||||
private IdentityProxy templateId = new IdentityProxy("vm_template");
|
||||
|
||||
@SerializedName(ApiConstants.OTHER_DEPLOY_PARAMS)
|
||||
@Param(description = "parameters other than zoneId/serviceOfferringId/templateId to be used while deploying a virtual machine")
|
||||
private String otherDeployParams;
|
||||
|
||||
@SerializedName(ApiConstants.ACCOUNT)
|
||||
@Param(description = "the account owning the instance group")
|
||||
private String accountName;
|
||||
|
||||
@SerializedName(ApiConstants.PROJECT_ID)
|
||||
@Param(description = "the project id vm profile")
|
||||
private IdentityProxy projectId = new IdentityProxy("projects");
|
||||
|
||||
@SerializedName(ApiConstants.PROJECT)
|
||||
@Param(description = "the project name of the vm profile")
|
||||
private String projectName;
|
||||
|
||||
@SerializedName(ApiConstants.DOMAIN_ID)
|
||||
@Param(description = "the domain ID of the vm profile")
|
||||
private IdentityProxy domainId = new IdentityProxy("domain");
|
||||
|
||||
@SerializedName(ApiConstants.DOMAIN)
|
||||
@Param(description = "the domain name of the vm profile")
|
||||
private String domainName;
|
||||
|
||||
/* Parameters related to destroying a virtual machine */
|
||||
@SerializedName(ApiConstants.AUTOSCALE_VM_DESTROY_TIME)
|
||||
@Param(description = "the time allowed for existing connections to get closed before a vm is destroyed")
|
||||
private Integer destroyVmGraceperiod;
|
||||
|
||||
/* Parameters related to a running virtual machine - monitoring aspects */
|
||||
@SerializedName(ApiConstants.SNMP_COMMUNITY)
|
||||
@Param(description = "snmp community string to be used to contact a virtual machine deployed by this profile")
|
||||
private String snmpCommunity;
|
||||
|
||||
@SerializedName(ApiConstants.SNMP_PORT)
|
||||
@Param(description = "port at which the snmp agent is listening in a virtual machine deployed by this profile")
|
||||
private Integer snmpPort;
|
||||
|
||||
@SerializedName(ApiConstants.AUTOSCALE_USER_ID)
|
||||
@Param(description = "the ID of the user used to launch and destroy the VMs")
|
||||
private IdentityProxy autoscaleUserId = new IdentityProxy("user");
|
||||
|
||||
public AutoScaleVmProfileResponse() {
|
||||
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id.setValue(id);
|
||||
}
|
||||
|
||||
public void setZoneId(Long zoneId) {
|
||||
this.zoneId.setValue(zoneId);
|
||||
}
|
||||
|
||||
public void setServiceOfferingId(Long serviceOfferingId) {
|
||||
this.serviceOfferingId.setValue(serviceOfferingId);
|
||||
}
|
||||
|
||||
public void setTemplateId(Long templateId) {
|
||||
this.templateId.setValue(templateId);
|
||||
}
|
||||
|
||||
public void setOtherDeployParams(String otherDeployParams) {
|
||||
this.otherDeployParams = otherDeployParams;
|
||||
}
|
||||
|
||||
public void setSnmpCommunity(String snmpCommunity) {
|
||||
this.snmpCommunity = snmpCommunity;
|
||||
}
|
||||
|
||||
public void setSnmpPort(Integer snmpPort) {
|
||||
this.snmpPort = snmpPort;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAccountName(String accountName) {
|
||||
this.accountName = accountName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDomainId(Long domainId) {
|
||||
this.domainId.setValue(domainId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDomainName(String domainName) {
|
||||
this.domainName = domainName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId.setValue(projectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public void setAutoscaleUserId(Long autoscaleUserId) {
|
||||
this.autoscaleUserId.setValue(autoscaleUserId);
|
||||
}
|
||||
|
||||
public void setDestroyVmGraceperiod(Integer destroyVmGraceperiod) {
|
||||
this.destroyVmGraceperiod = destroyVmGraceperiod;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.api.response;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.cloud.utils.IdentityProxy;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ConditionResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
@SerializedName("id")
|
||||
@Param(description = "the id of the Condition")
|
||||
private final IdentityProxy id = new IdentityProxy("conditions");
|
||||
|
||||
@SerializedName(value = ApiConstants.THRESHOLD)
|
||||
@Param(description = "Threshold Value for the counter.")
|
||||
private long threshold;
|
||||
|
||||
@SerializedName(value = ApiConstants.RELATIONAL_OPERATOR)
|
||||
@Param(description = "Relational Operator to be used with threshold.")
|
||||
private String relationalOperator;
|
||||
|
||||
@SerializedName(value = ApiConstants.COUNTER_ID)
|
||||
@Param(description = "Details of the Counter.")
|
||||
private CounterResponse counter;
|
||||
|
||||
@SerializedName(ApiConstants.DOMAIN_ID)
|
||||
@Param(description = "the domain id of the Condition owner")
|
||||
private final IdentityProxy domainId = new IdentityProxy("domain");
|
||||
|
||||
@SerializedName(ApiConstants.DOMAIN)
|
||||
@Param(description = "the domain name of the owner.")
|
||||
private String domain;
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_ID)
|
||||
@Param(description = "zone id of counter")
|
||||
private final IdentityProxy zoneId = new IdentityProxy("data_center");
|
||||
|
||||
@SerializedName(ApiConstants.PROJECT_ID)
|
||||
@Param(description = "the project id of the Condition.")
|
||||
private final IdentityProxy projectId = new IdentityProxy("projects");
|
||||
|
||||
@SerializedName(ApiConstants.PROJECT)
|
||||
@Param(description = "the project name of the Condition")
|
||||
private String projectName;
|
||||
|
||||
@SerializedName(ApiConstants.ACCOUNT)
|
||||
@Param(description = "the owner of the Condition.")
|
||||
private String accountName;
|
||||
|
||||
// /////////////////////////////////////////////////
|
||||
// ///////////////// Setters ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id.setValue(id);
|
||||
}
|
||||
|
||||
public void setThreshold(long threshold) {
|
||||
this.threshold = threshold;
|
||||
}
|
||||
|
||||
public void setRelationalOperator(String relationalOperator) {
|
||||
this.relationalOperator = relationalOperator;
|
||||
}
|
||||
|
||||
public void setCounter(CounterResponse counter) {
|
||||
this.counter = counter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAccountName(String accountName) {
|
||||
this.accountName = accountName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId.setValue(projectId);
|
||||
}
|
||||
|
||||
public void setZoneId(Long zoneId) {
|
||||
this.zoneId.setValue(zoneId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDomainId(Long domainId) {
|
||||
this.domainId.setValue(domainId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDomainName(String domainName) {
|
||||
this.domain = domainName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.api.response;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.cloud.utils.IdentityProxy;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class CounterResponse extends BaseResponse {
|
||||
@SerializedName("id")
|
||||
@Param(description = "the id of the Counter")
|
||||
private final IdentityProxy id = new IdentityProxy("counter");
|
||||
|
||||
@SerializedName(value = ApiConstants.NAME)
|
||||
@Param(description = "Name of the counter.")
|
||||
private String name;
|
||||
|
||||
@SerializedName(value = ApiConstants.SOURCE)
|
||||
@Param(description = "Source of the counter.")
|
||||
private String source;
|
||||
|
||||
@SerializedName(value = ApiConstants.VALUE)
|
||||
@Param(description = "Value in case of snmp or other specific counters.")
|
||||
private String value;
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_ID)
|
||||
@Param(description = "zone id of counter")
|
||||
private final IdentityProxy zoneId = new IdentityProxy("data_center");
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id.setValue(id);
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,91 +1,96 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.async;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.cloud.api.Identity;
|
||||
|
||||
public interface AsyncJob extends Identity {
|
||||
public enum Type {
|
||||
None,
|
||||
VirtualMachine,
|
||||
DomainRouter,
|
||||
Volume,
|
||||
ConsoleProxy,
|
||||
Snapshot,
|
||||
Template,
|
||||
Iso,
|
||||
SystemVm,
|
||||
Host,
|
||||
StoragePool,
|
||||
IpAddress,
|
||||
SecurityGroup,
|
||||
PhysicalNetwork,
|
||||
TrafficType,
|
||||
PhysicalNetworkServiceProvider,
|
||||
FirewallRule,
|
||||
Account,
|
||||
User,
|
||||
PrivateGateway,
|
||||
StaticRoute
|
||||
}
|
||||
|
||||
Long getId();
|
||||
|
||||
long getUserId();
|
||||
|
||||
long getAccountId();
|
||||
|
||||
String getCmd();
|
||||
|
||||
int getCmdVersion();
|
||||
|
||||
String getCmdInfo();
|
||||
|
||||
int getCallbackType();
|
||||
|
||||
String getCallbackAddress();
|
||||
|
||||
int getStatus();
|
||||
|
||||
int getProcessStatus();
|
||||
|
||||
int getResultCode();
|
||||
|
||||
String getResult();
|
||||
|
||||
Long getInitMsid();
|
||||
|
||||
Long getCompleteMsid();
|
||||
|
||||
Date getCreated();
|
||||
|
||||
Date getLastUpdated();
|
||||
|
||||
Date getLastPolled();
|
||||
|
||||
Date getRemoved();
|
||||
|
||||
Type getInstanceType();
|
||||
|
||||
Long getInstanceId();
|
||||
|
||||
String getSessionKey();
|
||||
|
||||
String getCmdOriginator();
|
||||
|
||||
boolean isFromPreviousSession();
|
||||
|
||||
SyncQueueItem getSyncSource();
|
||||
}
|
||||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.async;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.cloud.api.Identity;
|
||||
|
||||
public interface AsyncJob extends Identity {
|
||||
public enum Type {
|
||||
None,
|
||||
VirtualMachine,
|
||||
DomainRouter,
|
||||
Volume,
|
||||
ConsoleProxy,
|
||||
Snapshot,
|
||||
Template,
|
||||
Iso,
|
||||
SystemVm,
|
||||
Host,
|
||||
StoragePool,
|
||||
IpAddress,
|
||||
SecurityGroup,
|
||||
PhysicalNetwork,
|
||||
TrafficType,
|
||||
PhysicalNetworkServiceProvider,
|
||||
FirewallRule,
|
||||
Account,
|
||||
User,
|
||||
PrivateGateway,
|
||||
StaticRoute,
|
||||
Counter,
|
||||
Condition,
|
||||
AutoScalePolicy,
|
||||
AutoScaleVmProfile,
|
||||
AutoScaleVmGroup
|
||||
}
|
||||
|
||||
Long getId();
|
||||
|
||||
long getUserId();
|
||||
|
||||
long getAccountId();
|
||||
|
||||
String getCmd();
|
||||
|
||||
int getCmdVersion();
|
||||
|
||||
String getCmdInfo();
|
||||
|
||||
int getCallbackType();
|
||||
|
||||
String getCallbackAddress();
|
||||
|
||||
int getStatus();
|
||||
|
||||
int getProcessStatus();
|
||||
|
||||
int getResultCode();
|
||||
|
||||
String getResult();
|
||||
|
||||
Long getInitMsid();
|
||||
|
||||
Long getCompleteMsid();
|
||||
|
||||
Date getCreated();
|
||||
|
||||
Date getLastUpdated();
|
||||
|
||||
Date getLastPolled();
|
||||
|
||||
Date getRemoved();
|
||||
|
||||
Type getInstanceType();
|
||||
|
||||
Long getInstanceId();
|
||||
|
||||
String getSessionKey();
|
||||
|
||||
String getCmdOriginator();
|
||||
|
||||
boolean isFromPreviousSession();
|
||||
|
||||
SyncQueueItem getSyncSource();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,289 +1,303 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.event;
|
||||
|
||||
public class EventTypes {
|
||||
// VM Events
|
||||
public static final String EVENT_VM_CREATE = "VM.CREATE";
|
||||
public static final String EVENT_VM_DESTROY = "VM.DESTROY";
|
||||
public static final String EVENT_VM_START = "VM.START";
|
||||
public static final String EVENT_VM_STOP = "VM.STOP";
|
||||
public static final String EVENT_VM_REBOOT = "VM.REBOOT";
|
||||
public static final String EVENT_VM_UPDATE = "VM.UPDATE";
|
||||
public static final String EVENT_VM_UPGRADE = "VM.UPGRADE";
|
||||
public static final String EVENT_VM_RESETPASSWORD = "VM.RESETPASSWORD";
|
||||
public static final String EVENT_VM_MIGRATE = "VM.MIGRATE";
|
||||
public static final String EVENT_VM_MOVE = "VM.MOVE";
|
||||
public static final String EVENT_VM_RESTORE = "VM.RESTORE";
|
||||
|
||||
// Domain Router
|
||||
public static final String EVENT_ROUTER_CREATE = "ROUTER.CREATE";
|
||||
public static final String EVENT_ROUTER_DESTROY = "ROUTER.DESTROY";
|
||||
public static final String EVENT_ROUTER_START = "ROUTER.START";
|
||||
public static final String EVENT_ROUTER_STOP = "ROUTER.STOP";
|
||||
public static final String EVENT_ROUTER_REBOOT = "ROUTER.REBOOT";
|
||||
public static final String EVENT_ROUTER_HA = "ROUTER.HA";
|
||||
public static final String EVENT_ROUTER_UPGRADE = "ROUTER.UPGRADE";
|
||||
|
||||
// Console proxy
|
||||
public static final String EVENT_PROXY_CREATE = "PROXY.CREATE";
|
||||
public static final String EVENT_PROXY_DESTROY = "PROXY.DESTROY";
|
||||
public static final String EVENT_PROXY_START = "PROXY.START";
|
||||
public static final String EVENT_PROXY_STOP = "PROXY.STOP";
|
||||
public static final String EVENT_PROXY_REBOOT = "PROXY.REBOOT";
|
||||
public static final String EVENT_PROXY_HA = "PROXY.HA";
|
||||
|
||||
// VNC Console Events
|
||||
public static final String EVENT_VNC_CONNECT = "VNC.CONNECT";
|
||||
public static final String EVENT_VNC_DISCONNECT = "VNC.DISCONNECT";
|
||||
|
||||
// Network Events
|
||||
public static final String EVENT_NET_IP_ASSIGN = "NET.IPASSIGN";
|
||||
public static final String EVENT_NET_IP_RELEASE = "NET.IPRELEASE";
|
||||
public static final String EVENT_NET_RULE_ADD = "NET.RULEADD";
|
||||
public static final String EVENT_NET_RULE_DELETE = "NET.RULEDELETE";
|
||||
public static final String EVENT_NET_RULE_MODIFY = "NET.RULEMODIFY";
|
||||
public static final String EVENT_NETWORK_CREATE = "NETWORK.CREATE";
|
||||
public static final String EVENT_NETWORK_DELETE = "NETWORK.DELETE";
|
||||
public static final String EVENT_NETWORK_UPDATE = "NETWORK.UPDATE";
|
||||
public static final String EVENT_FIREWALL_OPEN = "FIREWALL.OPEN";
|
||||
public static final String EVENT_FIREWALL_CLOSE = "FIREWALL.CLOSE";
|
||||
|
||||
// Load Balancers
|
||||
public static final String EVENT_ASSIGN_TO_LOAD_BALANCER_RULE = "LB.ASSIGN.TO.RULE";
|
||||
public static final String EVENT_REMOVE_FROM_LOAD_BALANCER_RULE = "LB.REMOVE.FROM.RULE";
|
||||
public static final String EVENT_LOAD_BALANCER_CREATE = "LB.CREATE";
|
||||
public static final String EVENT_LOAD_BALANCER_DELETE = "LB.DELETE";
|
||||
public static final String EVENT_LB_STICKINESSPOLICY_CREATE = "LB.STICKINESSPOLICY.CREATE";
|
||||
public static final String EVENT_LB_STICKINESSPOLICY_DELETE = "LB.STICKINESSPOLICY.DELETE";
|
||||
public static final String EVENT_LOAD_BALANCER_UPDATE = "LB.UPDATE";
|
||||
|
||||
// Account events
|
||||
public static final String EVENT_ACCOUNT_DISABLE = "ACCOUNT.DISABLE";
|
||||
public static final String EVENT_ACCOUNT_CREATE = "ACCOUNT.CREATE";
|
||||
public static final String EVENT_ACCOUNT_DELETE = "ACCOUNT.DELETE";
|
||||
public static final String EVENT_ACCOUNT_MARK_DEFAULT_ZONE = "ACCOUNT.MARK.DEFAULT.ZONE";
|
||||
|
||||
// UserVO Events
|
||||
public static final String EVENT_USER_LOGIN = "USER.LOGIN";
|
||||
public static final String EVENT_USER_LOGOUT = "USER.LOGOUT";
|
||||
public static final String EVENT_USER_CREATE = "USER.CREATE";
|
||||
public static final String EVENT_USER_DELETE = "USER.DELETE";
|
||||
public static final String EVENT_USER_DISABLE = "USER.DISABLE";
|
||||
public static final String EVENT_USER_UPDATE = "USER.UPDATE";
|
||||
public static final String EVENT_USER_ENABLE = "USER.ENABLE";
|
||||
public static final String EVENT_USER_LOCK = "USER.LOCK";
|
||||
|
||||
// Template Events
|
||||
public static final String EVENT_TEMPLATE_CREATE = "TEMPLATE.CREATE";
|
||||
public static final String EVENT_TEMPLATE_DELETE = "TEMPLATE.DELETE";
|
||||
public static final String EVENT_TEMPLATE_UPDATE = "TEMPLATE.UPDATE";
|
||||
public static final String EVENT_TEMPLATE_DOWNLOAD_START = "TEMPLATE.DOWNLOAD.START";
|
||||
public static final String EVENT_TEMPLATE_DOWNLOAD_SUCCESS = "TEMPLATE.DOWNLOAD.SUCCESS";
|
||||
public static final String EVENT_TEMPLATE_DOWNLOAD_FAILED = "TEMPLATE.DOWNLOAD.FAILED";
|
||||
public static final String EVENT_TEMPLATE_COPY = "TEMPLATE.COPY";
|
||||
public static final String EVENT_TEMPLATE_EXTRACT = "TEMPLATE.EXTRACT";
|
||||
public static final String EVENT_TEMPLATE_UPLOAD = "TEMPLATE.UPLOAD";
|
||||
public static final String EVENT_TEMPLATE_CLEANUP = "TEMPLATE.CLEANUP";
|
||||
|
||||
// Volume Events
|
||||
public static final String EVENT_VOLUME_CREATE = "VOLUME.CREATE";
|
||||
public static final String EVENT_VOLUME_DELETE = "VOLUME.DELETE";
|
||||
public static final String EVENT_VOLUME_ATTACH = "VOLUME.ATTACH";
|
||||
public static final String EVENT_VOLUME_DETACH = "VOLUME.DETACH";
|
||||
public static final String EVENT_VOLUME_EXTRACT = "VOLUME.EXTRACT";
|
||||
public static final String EVENT_VOLUME_UPLOAD = "VOLUME.UPLOAD";
|
||||
public static final String EVENT_VOLUME_MIGRATE = "VOLUME.MIGRATE";
|
||||
|
||||
// Domains
|
||||
public static final String EVENT_DOMAIN_CREATE = "DOMAIN.CREATE";
|
||||
public static final String EVENT_DOMAIN_DELETE = "DOMAIN.DELETE";
|
||||
public static final String EVENT_DOMAIN_UPDATE = "DOMAIN.UPDATE";
|
||||
|
||||
// Snapshots
|
||||
public static final String EVENT_SNAPSHOT_CREATE = "SNAPSHOT.CREATE";
|
||||
public static final String EVENT_SNAPSHOT_DELETE = "SNAPSHOT.DELETE";
|
||||
public static final String EVENT_SNAPSHOT_POLICY_CREATE = "SNAPSHOTPOLICY.CREATE";
|
||||
public static final String EVENT_SNAPSHOT_POLICY_UPDATE = "SNAPSHOTPOLICY.UPDATE";
|
||||
public static final String EVENT_SNAPSHOT_POLICY_DELETE = "SNAPSHOTPOLICY.DELETE";
|
||||
|
||||
// ISO
|
||||
public static final String EVENT_ISO_CREATE = "ISO.CREATE";
|
||||
public static final String EVENT_ISO_DELETE = "ISO.DELETE";
|
||||
public static final String EVENT_ISO_COPY = "ISO.COPY";
|
||||
public static final String EVENT_ISO_ATTACH = "ISO.ATTACH";
|
||||
public static final String EVENT_ISO_DETACH = "ISO.DETACH";
|
||||
public static final String EVENT_ISO_EXTRACT = "ISO.EXTRACT";
|
||||
public static final String EVENT_ISO_UPLOAD = "ISO.UPLOAD";
|
||||
|
||||
// SSVM
|
||||
public static final String EVENT_SSVM_CREATE = "SSVM.CREATE";
|
||||
public static final String EVENT_SSVM_DESTROY = "SSVM.DESTROY";
|
||||
public static final String EVENT_SSVM_START = "SSVM.START";
|
||||
public static final String EVENT_SSVM_STOP = "SSVM.STOP";
|
||||
public static final String EVENT_SSVM_REBOOT = "SSVM.REBOOT";
|
||||
public static final String EVENT_SSVM_HA = "SSVM.HA";
|
||||
|
||||
// Service Offerings
|
||||
public static final String EVENT_SERVICE_OFFERING_CREATE = "SERVICE.OFFERING.CREATE";
|
||||
public static final String EVENT_SERVICE_OFFERING_EDIT = "SERVICE.OFFERING.EDIT";
|
||||
public static final String EVENT_SERVICE_OFFERING_DELETE = "SERVICE.OFFERING.DELETE";
|
||||
|
||||
// Disk Offerings
|
||||
public static final String EVENT_DISK_OFFERING_CREATE = "DISK.OFFERING.CREATE";
|
||||
public static final String EVENT_DISK_OFFERING_EDIT = "DISK.OFFERING.EDIT";
|
||||
public static final String EVENT_DISK_OFFERING_DELETE = "DISK.OFFERING.DELETE";
|
||||
|
||||
// Network offerings
|
||||
public static final String EVENT_NETWORK_OFFERING_CREATE = "NETWORK.OFFERING.CREATE";
|
||||
public static final String EVENT_NETWORK_OFFERING_ASSIGN = "NETWORK.OFFERING.ASSIGN";
|
||||
public static final String EVENT_NETWORK_OFFERING_EDIT = "NETWORK.OFFERING.EDIT";
|
||||
public static final String EVENT_NETWORK_OFFERING_REMOVE = "NETWORK.OFFERING.REMOVE";
|
||||
public static final String EVENT_NETWORK_OFFERING_DELETE = "NETWORK.OFFERING.DELETE";
|
||||
|
||||
// Pods
|
||||
public static final String EVENT_POD_CREATE = "POD.CREATE";
|
||||
public static final String EVENT_POD_EDIT = "POD.EDIT";
|
||||
public static final String EVENT_POD_DELETE = "POD.DELETE";
|
||||
|
||||
// Zones
|
||||
public static final String EVENT_ZONE_CREATE = "ZONE.CREATE";
|
||||
public static final String EVENT_ZONE_EDIT = "ZONE.EDIT";
|
||||
public static final String EVENT_ZONE_DELETE = "ZONE.DELETE";
|
||||
|
||||
// VLANs/IP ranges
|
||||
public static final String EVENT_VLAN_IP_RANGE_CREATE = "VLAN.IP.RANGE.CREATE";
|
||||
public static final String EVENT_VLAN_IP_RANGE_DELETE = "VLAN.IP.RANGE.DELETE";
|
||||
|
||||
public static final String EVENT_STORAGE_IP_RANGE_CREATE = "STORAGE.IP.RANGE.CREATE";
|
||||
public static final String EVENT_STORAGE_IP_RANGE_DELETE = "STORAGE.IP.RANGE.DELETE";
|
||||
public static final String EVENT_STORAGE_IP_RANGE_UPDATE = "STORAGE.IP.RANGE.UPDATE";
|
||||
|
||||
// Configuration Table
|
||||
public static final String EVENT_CONFIGURATION_VALUE_EDIT = "CONFIGURATION.VALUE.EDIT";
|
||||
|
||||
// Security Groups
|
||||
public static final String EVENT_SECURITY_GROUP_AUTHORIZE_INGRESS = "SG.AUTH.INGRESS";
|
||||
public static final String EVENT_SECURITY_GROUP_REVOKE_INGRESS = "SG.REVOKE.INGRESS";
|
||||
public static final String EVENT_SECURITY_GROUP_AUTHORIZE_EGRESS = "SG.AUTH.EGRESS";
|
||||
public static final String EVENT_SECURITY_GROUP_REVOKE_EGRESS = "SG.REVOKE.EGRESS";
|
||||
public static final String EVENT_SECURITY_GROUP_CREATE = "SG.CREATE";
|
||||
public static final String EVENT_SECURITY_GROUP_DELETE = "SG.DELETE";
|
||||
public static final String EVENT_SECURITY_GROUP_ASSIGN = "SG.ASSIGN";
|
||||
public static final String EVENT_SECURITY_GROUP_REMOVE = "SG.REMOVE";
|
||||
|
||||
// Host
|
||||
public static final String EVENT_HOST_RECONNECT = "HOST.RECONNECT";
|
||||
|
||||
// Maintenance
|
||||
public static final String EVENT_MAINTENANCE_CANCEL = "MAINT.CANCEL";
|
||||
public static final String EVENT_MAINTENANCE_CANCEL_PRIMARY_STORAGE = "MAINT.CANCEL.PS";
|
||||
public static final String EVENT_MAINTENANCE_PREPARE = "MAINT.PREPARE";
|
||||
public static final String EVENT_MAINTENANCE_PREPARE_PRIMARY_STORAGE = "MAINT.PREPARE.PS";
|
||||
|
||||
// VPN
|
||||
public static final String EVENT_REMOTE_ACCESS_VPN_CREATE = "VPN.REMOTE.ACCESS.CREATE";
|
||||
public static final String EVENT_REMOTE_ACCESS_VPN_DESTROY = "VPN.REMOTE.ACCESS.DESTROY";
|
||||
public static final String EVENT_VPN_USER_ADD = "VPN.USER.ADD";
|
||||
public static final String EVENT_VPN_USER_REMOVE = "VPN.USER.REMOVE";
|
||||
public static final String EVENT_S2S_VPN_GATEWAY_CREATE = "VPN.S2S.VPN.GATEWAY.CREATE";
|
||||
public static final String EVENT_S2S_VPN_GATEWAY_DELETE = "VPN.S2S.VPN.GATEWAY.DELETE";
|
||||
public static final String EVENT_S2S_CUSTOMER_GATEWAY_CREATE = "VPN.S2S.CUSTOMER.GATEWAY.CREATE";
|
||||
public static final String EVENT_S2S_CUSTOMER_GATEWAY_DELETE = "VPN.S2S.CUSTOMER.GATEWAY.DELETE";
|
||||
public static final String EVENT_S2S_CUSTOMER_GATEWAY_UPDATE = "VPN.S2S.CUSTOMER.GATEWAY.UPDATE";
|
||||
public static final String EVENT_S2S_CONNECTION_CREATE = "VPN.S2S.CONNECTION.CREATE";
|
||||
public static final String EVENT_S2S_CONNECTION_DELETE = "VPN.S2S.CONNECTION.DELETE";
|
||||
public static final String EVENT_S2S_CONNECTION_RESET = "VPN.S2S.CONNECTION.RESET";
|
||||
|
||||
// Network
|
||||
public static final String EVENT_NETWORK_RESTART = "NETWORK.RESTART";
|
||||
|
||||
// Custom certificates
|
||||
public static final String EVENT_UPLOAD_CUSTOM_CERTIFICATE = "UPLOAD.CUSTOM.CERTIFICATE";
|
||||
|
||||
// OneToOnenat
|
||||
public static final String EVENT_ENABLE_STATIC_NAT = "STATICNAT.ENABLE";
|
||||
public static final String EVENT_DISABLE_STATIC_NAT = "STATICNAT.DISABLE";
|
||||
|
||||
public static final String EVENT_ZONE_VLAN_ASSIGN = "ZONE.VLAN.ASSIGN";
|
||||
public static final String EVENT_ZONE_VLAN_RELEASE = "ZONE.VLAN.RELEASE";
|
||||
|
||||
// Projects
|
||||
public static final String EVENT_PROJECT_CREATE = "PROJECT.CREATE";
|
||||
public static final String EVENT_PROJECT_UPDATE = "PROJECT.UPDATE";
|
||||
public static final String EVENT_PROJECT_DELETE = "PROJECT.DELETE";
|
||||
public static final String EVENT_PROJECT_ACTIVATE = "PROJECT.ACTIVATE";
|
||||
public static final String EVENT_PROJECT_SUSPEND = "PROJECT.SUSPEND";
|
||||
public static final String EVENT_PROJECT_ACCOUNT_ADD = "PROJECT.ACCOUNT.ADD";
|
||||
public static final String EVENT_PROJECT_INVITATION_UPDATE = "PROJECT.INVITATION.UPDATE";
|
||||
public static final String EVENT_PROJECT_INVITATION_REMOVE = "PROJECT.INVITATION.REMOVE";
|
||||
public static final String EVENT_PROJECT_ACCOUNT_REMOVE = "PROJECT.ACCOUNT.REMOVE";
|
||||
|
||||
// Network as a Service
|
||||
public static final String EVENT_NETWORK_ELEMENT_CONFIGURE = "NETWORK.ELEMENT.CONFIGURE";
|
||||
|
||||
// Physical Network Events
|
||||
public static final String EVENT_PHYSICAL_NETWORK_CREATE = "PHYSICAL.NETWORK.CREATE";
|
||||
public static final String EVENT_PHYSICAL_NETWORK_DELETE = "PHYSICAL.NETWORK.DELETE";
|
||||
public static final String EVENT_PHYSICAL_NETWORK_UPDATE = "PHYSICAL.NETWORK.UPDATE";
|
||||
|
||||
// Physical Network Service Provider Events
|
||||
public static final String EVENT_SERVICE_PROVIDER_CREATE = "SERVICE.PROVIDER.CREATE";
|
||||
public static final String EVENT_SERVICE_PROVIDER_DELETE = "SERVICE.PROVIDER.DELETE";
|
||||
public static final String EVENT_SERVICE_PROVIDER_UPDATE = "SERVICE.PROVIDER.UPDATE";
|
||||
|
||||
// Physical Network TrafficType Events
|
||||
public static final String EVENT_TRAFFIC_TYPE_CREATE = "TRAFFIC.TYPE.CREATE";
|
||||
public static final String EVENT_TRAFFIC_TYPE_DELETE = "TRAFFIC.TYPE.DELETE";
|
||||
public static final String EVENT_TRAFFIC_TYPE_UPDATE = "TRAFFIC.TYPE.UPDATE";
|
||||
|
||||
// external network device events
|
||||
public static final String EVENT_EXTERNAL_LB_DEVICE_ADD = "PHYSICAL.LOADBALANCER.ADD";
|
||||
public static final String EVENT_EXTERNAL_LB_DEVICE_DELETE = "PHYSICAL.LOADBALANCER.DELETE";
|
||||
public static final String EVENT_EXTERNAL_LB_DEVICE_CONFIGURE = "PHYSICAL.LOADBALANCER.CONFIGURE";
|
||||
|
||||
// external switch management device events (E.g.: Cisco Nexus 1000v Virtual Supervisor Module.
|
||||
public static final String EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_ADD = "SWITCH.MGMT.ADD";
|
||||
public static final String EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_DELETE = "SWITCH.MGMT.DELETE";
|
||||
public static final String EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_CONFIGURE = "SWITCH.MGMT.CONFIGURE";
|
||||
public static final String EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_ENABLE = "SWITCH.MGMT.ENABLE";
|
||||
public static final String EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_DISABLE = "SWITCH.MGMT.DISABLE";
|
||||
|
||||
|
||||
public static final String EVENT_EXTERNAL_FIREWALL_DEVICE_ADD = "PHYSICAL.FIREWALL.ADD";
|
||||
public static final String EVENT_EXTERNAL_FIREWALL_DEVICE_DELETE = "PHYSICAL.FIREWALL.DELETE";
|
||||
public static final String EVENT_EXTERNAL_FIREWALL_DEVICE_CONFIGURE = "PHYSICAL.FIREWALL.CONFIGURE";
|
||||
|
||||
// tag related events
|
||||
public static final String EVENT_TAGS_CREATE = "CREATE_TAGS";
|
||||
public static final String EVENT_TAGS_DELETE = "DELETE_TAGS";
|
||||
|
||||
// VPC
|
||||
public static final String EVENT_VPC_CREATE = "VPC.CREATE";
|
||||
public static final String EVENT_VPC_UPDATE = "VPC.UPDATE";
|
||||
public static final String EVENT_VPC_DELETE = "VPC.DELETE";
|
||||
public static final String EVENT_VPC_RESTART = "VPC.RESTART";
|
||||
|
||||
// VPC offerings
|
||||
public static final String EVENT_VPC_OFFERING_CREATE = "VPC.OFFERING.CREATE";
|
||||
public static final String EVENT_VPC_OFFERING_UPDATE = "VPC.OFFERING.UPDATE";
|
||||
public static final String EVENT_VPC_OFFERING_DELETE = "VPC.OFFERING.DELETE";
|
||||
|
||||
// Private gateway
|
||||
public static final String EVENT_PRIVATE_GATEWAY_CREATE = "PRIVATE.GATEWAY.CREATE";
|
||||
public static final String EVENT_PRIVATE_GATEWAY_DELETE = "PRIVATE.GATEWAY.DELETE";
|
||||
|
||||
// Static routes
|
||||
public static final String EVENT_STATIC_ROUTE_CREATE = "STATIC.ROUTE.CREATE";
|
||||
public static final String EVENT_STATIC_ROUTE_DELETE = "STATIC.ROUTE.DELETE";
|
||||
}
|
||||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.event;
|
||||
|
||||
public class EventTypes {
|
||||
// VM Events
|
||||
public static final String EVENT_VM_CREATE = "VM.CREATE";
|
||||
public static final String EVENT_VM_DESTROY = "VM.DESTROY";
|
||||
public static final String EVENT_VM_START = "VM.START";
|
||||
public static final String EVENT_VM_STOP = "VM.STOP";
|
||||
public static final String EVENT_VM_REBOOT = "VM.REBOOT";
|
||||
public static final String EVENT_VM_UPDATE = "VM.UPDATE";
|
||||
public static final String EVENT_VM_UPGRADE = "VM.UPGRADE";
|
||||
public static final String EVENT_VM_RESETPASSWORD = "VM.RESETPASSWORD";
|
||||
public static final String EVENT_VM_MIGRATE = "VM.MIGRATE";
|
||||
public static final String EVENT_VM_MOVE = "VM.MOVE";
|
||||
public static final String EVENT_VM_RESTORE = "VM.RESTORE";
|
||||
|
||||
// Domain Router
|
||||
public static final String EVENT_ROUTER_CREATE = "ROUTER.CREATE";
|
||||
public static final String EVENT_ROUTER_DESTROY = "ROUTER.DESTROY";
|
||||
public static final String EVENT_ROUTER_START = "ROUTER.START";
|
||||
public static final String EVENT_ROUTER_STOP = "ROUTER.STOP";
|
||||
public static final String EVENT_ROUTER_REBOOT = "ROUTER.REBOOT";
|
||||
public static final String EVENT_ROUTER_HA = "ROUTER.HA";
|
||||
public static final String EVENT_ROUTER_UPGRADE = "ROUTER.UPGRADE";
|
||||
|
||||
// Console proxy
|
||||
public static final String EVENT_PROXY_CREATE = "PROXY.CREATE";
|
||||
public static final String EVENT_PROXY_DESTROY = "PROXY.DESTROY";
|
||||
public static final String EVENT_PROXY_START = "PROXY.START";
|
||||
public static final String EVENT_PROXY_STOP = "PROXY.STOP";
|
||||
public static final String EVENT_PROXY_REBOOT = "PROXY.REBOOT";
|
||||
public static final String EVENT_PROXY_HA = "PROXY.HA";
|
||||
|
||||
// VNC Console Events
|
||||
public static final String EVENT_VNC_CONNECT = "VNC.CONNECT";
|
||||
public static final String EVENT_VNC_DISCONNECT = "VNC.DISCONNECT";
|
||||
|
||||
// Network Events
|
||||
public static final String EVENT_NET_IP_ASSIGN = "NET.IPASSIGN";
|
||||
public static final String EVENT_NET_IP_RELEASE = "NET.IPRELEASE";
|
||||
public static final String EVENT_NET_RULE_ADD = "NET.RULEADD";
|
||||
public static final String EVENT_NET_RULE_DELETE = "NET.RULEDELETE";
|
||||
public static final String EVENT_NET_RULE_MODIFY = "NET.RULEMODIFY";
|
||||
public static final String EVENT_NETWORK_CREATE = "NETWORK.CREATE";
|
||||
public static final String EVENT_NETWORK_DELETE = "NETWORK.DELETE";
|
||||
public static final String EVENT_NETWORK_UPDATE = "NETWORK.UPDATE";
|
||||
public static final String EVENT_FIREWALL_OPEN = "FIREWALL.OPEN";
|
||||
public static final String EVENT_FIREWALL_CLOSE = "FIREWALL.CLOSE";
|
||||
|
||||
// Load Balancers
|
||||
public static final String EVENT_ASSIGN_TO_LOAD_BALANCER_RULE = "LB.ASSIGN.TO.RULE";
|
||||
public static final String EVENT_REMOVE_FROM_LOAD_BALANCER_RULE = "LB.REMOVE.FROM.RULE";
|
||||
public static final String EVENT_LOAD_BALANCER_CREATE = "LB.CREATE";
|
||||
public static final String EVENT_LOAD_BALANCER_DELETE = "LB.DELETE";
|
||||
public static final String EVENT_LB_STICKINESSPOLICY_CREATE = "LB.STICKINESSPOLICY.CREATE";
|
||||
public static final String EVENT_LB_STICKINESSPOLICY_DELETE = "LB.STICKINESSPOLICY.DELETE";
|
||||
public static final String EVENT_LOAD_BALANCER_UPDATE = "LB.UPDATE";
|
||||
|
||||
// Account events
|
||||
public static final String EVENT_ACCOUNT_DISABLE = "ACCOUNT.DISABLE";
|
||||
public static final String EVENT_ACCOUNT_CREATE = "ACCOUNT.CREATE";
|
||||
public static final String EVENT_ACCOUNT_DELETE = "ACCOUNT.DELETE";
|
||||
public static final String EVENT_ACCOUNT_MARK_DEFAULT_ZONE = "ACCOUNT.MARK.DEFAULT.ZONE";
|
||||
|
||||
// UserVO Events
|
||||
public static final String EVENT_USER_LOGIN = "USER.LOGIN";
|
||||
public static final String EVENT_USER_LOGOUT = "USER.LOGOUT";
|
||||
public static final String EVENT_USER_CREATE = "USER.CREATE";
|
||||
public static final String EVENT_USER_DELETE = "USER.DELETE";
|
||||
public static final String EVENT_USER_DISABLE = "USER.DISABLE";
|
||||
public static final String EVENT_USER_UPDATE = "USER.UPDATE";
|
||||
public static final String EVENT_USER_ENABLE = "USER.ENABLE";
|
||||
public static final String EVENT_USER_LOCK = "USER.LOCK";
|
||||
|
||||
// Template Events
|
||||
public static final String EVENT_TEMPLATE_CREATE = "TEMPLATE.CREATE";
|
||||
public static final String EVENT_TEMPLATE_DELETE = "TEMPLATE.DELETE";
|
||||
public static final String EVENT_TEMPLATE_UPDATE = "TEMPLATE.UPDATE";
|
||||
public static final String EVENT_TEMPLATE_DOWNLOAD_START = "TEMPLATE.DOWNLOAD.START";
|
||||
public static final String EVENT_TEMPLATE_DOWNLOAD_SUCCESS = "TEMPLATE.DOWNLOAD.SUCCESS";
|
||||
public static final String EVENT_TEMPLATE_DOWNLOAD_FAILED = "TEMPLATE.DOWNLOAD.FAILED";
|
||||
public static final String EVENT_TEMPLATE_COPY = "TEMPLATE.COPY";
|
||||
public static final String EVENT_TEMPLATE_EXTRACT = "TEMPLATE.EXTRACT";
|
||||
public static final String EVENT_TEMPLATE_UPLOAD = "TEMPLATE.UPLOAD";
|
||||
public static final String EVENT_TEMPLATE_CLEANUP = "TEMPLATE.CLEANUP";
|
||||
|
||||
// Volume Events
|
||||
public static final String EVENT_VOLUME_CREATE = "VOLUME.CREATE";
|
||||
public static final String EVENT_VOLUME_DELETE = "VOLUME.DELETE";
|
||||
public static final String EVENT_VOLUME_ATTACH = "VOLUME.ATTACH";
|
||||
public static final String EVENT_VOLUME_DETACH = "VOLUME.DETACH";
|
||||
public static final String EVENT_VOLUME_EXTRACT = "VOLUME.EXTRACT";
|
||||
public static final String EVENT_VOLUME_UPLOAD = "VOLUME.UPLOAD";
|
||||
public static final String EVENT_VOLUME_MIGRATE = "VOLUME.MIGRATE";
|
||||
|
||||
// Domains
|
||||
public static final String EVENT_DOMAIN_CREATE = "DOMAIN.CREATE";
|
||||
public static final String EVENT_DOMAIN_DELETE = "DOMAIN.DELETE";
|
||||
public static final String EVENT_DOMAIN_UPDATE = "DOMAIN.UPDATE";
|
||||
|
||||
// Snapshots
|
||||
public static final String EVENT_SNAPSHOT_CREATE = "SNAPSHOT.CREATE";
|
||||
public static final String EVENT_SNAPSHOT_DELETE = "SNAPSHOT.DELETE";
|
||||
public static final String EVENT_SNAPSHOT_POLICY_CREATE = "SNAPSHOTPOLICY.CREATE";
|
||||
public static final String EVENT_SNAPSHOT_POLICY_UPDATE = "SNAPSHOTPOLICY.UPDATE";
|
||||
public static final String EVENT_SNAPSHOT_POLICY_DELETE = "SNAPSHOTPOLICY.DELETE";
|
||||
|
||||
// ISO
|
||||
public static final String EVENT_ISO_CREATE = "ISO.CREATE";
|
||||
public static final String EVENT_ISO_DELETE = "ISO.DELETE";
|
||||
public static final String EVENT_ISO_COPY = "ISO.COPY";
|
||||
public static final String EVENT_ISO_ATTACH = "ISO.ATTACH";
|
||||
public static final String EVENT_ISO_DETACH = "ISO.DETACH";
|
||||
public static final String EVENT_ISO_EXTRACT = "ISO.EXTRACT";
|
||||
public static final String EVENT_ISO_UPLOAD = "ISO.UPLOAD";
|
||||
|
||||
// SSVM
|
||||
public static final String EVENT_SSVM_CREATE = "SSVM.CREATE";
|
||||
public static final String EVENT_SSVM_DESTROY = "SSVM.DESTROY";
|
||||
public static final String EVENT_SSVM_START = "SSVM.START";
|
||||
public static final String EVENT_SSVM_STOP = "SSVM.STOP";
|
||||
public static final String EVENT_SSVM_REBOOT = "SSVM.REBOOT";
|
||||
public static final String EVENT_SSVM_HA = "SSVM.HA";
|
||||
|
||||
// Service Offerings
|
||||
public static final String EVENT_SERVICE_OFFERING_CREATE = "SERVICE.OFFERING.CREATE";
|
||||
public static final String EVENT_SERVICE_OFFERING_EDIT = "SERVICE.OFFERING.EDIT";
|
||||
public static final String EVENT_SERVICE_OFFERING_DELETE = "SERVICE.OFFERING.DELETE";
|
||||
|
||||
// Disk Offerings
|
||||
public static final String EVENT_DISK_OFFERING_CREATE = "DISK.OFFERING.CREATE";
|
||||
public static final String EVENT_DISK_OFFERING_EDIT = "DISK.OFFERING.EDIT";
|
||||
public static final String EVENT_DISK_OFFERING_DELETE = "DISK.OFFERING.DELETE";
|
||||
|
||||
// Network offerings
|
||||
public static final String EVENT_NETWORK_OFFERING_CREATE = "NETWORK.OFFERING.CREATE";
|
||||
public static final String EVENT_NETWORK_OFFERING_ASSIGN = "NETWORK.OFFERING.ASSIGN";
|
||||
public static final String EVENT_NETWORK_OFFERING_EDIT = "NETWORK.OFFERING.EDIT";
|
||||
public static final String EVENT_NETWORK_OFFERING_REMOVE = "NETWORK.OFFERING.REMOVE";
|
||||
public static final String EVENT_NETWORK_OFFERING_DELETE = "NETWORK.OFFERING.DELETE";
|
||||
|
||||
// Pods
|
||||
public static final String EVENT_POD_CREATE = "POD.CREATE";
|
||||
public static final String EVENT_POD_EDIT = "POD.EDIT";
|
||||
public static final String EVENT_POD_DELETE = "POD.DELETE";
|
||||
|
||||
// Zones
|
||||
public static final String EVENT_ZONE_CREATE = "ZONE.CREATE";
|
||||
public static final String EVENT_ZONE_EDIT = "ZONE.EDIT";
|
||||
public static final String EVENT_ZONE_DELETE = "ZONE.DELETE";
|
||||
|
||||
// VLANs/IP ranges
|
||||
public static final String EVENT_VLAN_IP_RANGE_CREATE = "VLAN.IP.RANGE.CREATE";
|
||||
public static final String EVENT_VLAN_IP_RANGE_DELETE = "VLAN.IP.RANGE.DELETE";
|
||||
|
||||
public static final String EVENT_STORAGE_IP_RANGE_CREATE = "STORAGE.IP.RANGE.CREATE";
|
||||
public static final String EVENT_STORAGE_IP_RANGE_DELETE = "STORAGE.IP.RANGE.DELETE";
|
||||
public static final String EVENT_STORAGE_IP_RANGE_UPDATE = "STORAGE.IP.RANGE.UPDATE";
|
||||
|
||||
// Configuration Table
|
||||
public static final String EVENT_CONFIGURATION_VALUE_EDIT = "CONFIGURATION.VALUE.EDIT";
|
||||
|
||||
// Security Groups
|
||||
public static final String EVENT_SECURITY_GROUP_AUTHORIZE_INGRESS = "SG.AUTH.INGRESS";
|
||||
public static final String EVENT_SECURITY_GROUP_REVOKE_INGRESS = "SG.REVOKE.INGRESS";
|
||||
public static final String EVENT_SECURITY_GROUP_AUTHORIZE_EGRESS = "SG.AUTH.EGRESS";
|
||||
public static final String EVENT_SECURITY_GROUP_REVOKE_EGRESS = "SG.REVOKE.EGRESS";
|
||||
public static final String EVENT_SECURITY_GROUP_CREATE = "SG.CREATE";
|
||||
public static final String EVENT_SECURITY_GROUP_DELETE = "SG.DELETE";
|
||||
public static final String EVENT_SECURITY_GROUP_ASSIGN = "SG.ASSIGN";
|
||||
public static final String EVENT_SECURITY_GROUP_REMOVE = "SG.REMOVE";
|
||||
|
||||
// Host
|
||||
public static final String EVENT_HOST_RECONNECT = "HOST.RECONNECT";
|
||||
|
||||
// Maintenance
|
||||
public static final String EVENT_MAINTENANCE_CANCEL = "MAINT.CANCEL";
|
||||
public static final String EVENT_MAINTENANCE_CANCEL_PRIMARY_STORAGE = "MAINT.CANCEL.PS";
|
||||
public static final String EVENT_MAINTENANCE_PREPARE = "MAINT.PREPARE";
|
||||
public static final String EVENT_MAINTENANCE_PREPARE_PRIMARY_STORAGE = "MAINT.PREPARE.PS";
|
||||
|
||||
// VPN
|
||||
public static final String EVENT_REMOTE_ACCESS_VPN_CREATE = "VPN.REMOTE.ACCESS.CREATE";
|
||||
public static final String EVENT_REMOTE_ACCESS_VPN_DESTROY = "VPN.REMOTE.ACCESS.DESTROY";
|
||||
public static final String EVENT_VPN_USER_ADD = "VPN.USER.ADD";
|
||||
public static final String EVENT_VPN_USER_REMOVE = "VPN.USER.REMOVE";
|
||||
public static final String EVENT_S2S_VPN_GATEWAY_CREATE = "VPN.S2S.VPN.GATEWAY.CREATE";
|
||||
public static final String EVENT_S2S_VPN_GATEWAY_DELETE = "VPN.S2S.VPN.GATEWAY.DELETE";
|
||||
public static final String EVENT_S2S_CUSTOMER_GATEWAY_CREATE = "VPN.S2S.CUSTOMER.GATEWAY.CREATE";
|
||||
public static final String EVENT_S2S_CUSTOMER_GATEWAY_DELETE = "VPN.S2S.CUSTOMER.GATEWAY.DELETE";
|
||||
public static final String EVENT_S2S_CUSTOMER_GATEWAY_UPDATE = "VPN.S2S.CUSTOMER.GATEWAY.UPDATE";
|
||||
public static final String EVENT_S2S_CONNECTION_CREATE = "VPN.S2S.CONNECTION.CREATE";
|
||||
public static final String EVENT_S2S_CONNECTION_DELETE = "VPN.S2S.CONNECTION.DELETE";
|
||||
public static final String EVENT_S2S_CONNECTION_RESET = "VPN.S2S.CONNECTION.RESET";
|
||||
|
||||
// Network
|
||||
public static final String EVENT_NETWORK_RESTART = "NETWORK.RESTART";
|
||||
|
||||
// Custom certificates
|
||||
public static final String EVENT_UPLOAD_CUSTOM_CERTIFICATE = "UPLOAD.CUSTOM.CERTIFICATE";
|
||||
|
||||
// OneToOnenat
|
||||
public static final String EVENT_ENABLE_STATIC_NAT = "STATICNAT.ENABLE";
|
||||
public static final String EVENT_DISABLE_STATIC_NAT = "STATICNAT.DISABLE";
|
||||
|
||||
public static final String EVENT_ZONE_VLAN_ASSIGN = "ZONE.VLAN.ASSIGN";
|
||||
public static final String EVENT_ZONE_VLAN_RELEASE = "ZONE.VLAN.RELEASE";
|
||||
|
||||
// Projects
|
||||
public static final String EVENT_PROJECT_CREATE = "PROJECT.CREATE";
|
||||
public static final String EVENT_PROJECT_UPDATE = "PROJECT.UPDATE";
|
||||
public static final String EVENT_PROJECT_DELETE = "PROJECT.DELETE";
|
||||
public static final String EVENT_PROJECT_ACTIVATE = "PROJECT.ACTIVATE";
|
||||
public static final String EVENT_PROJECT_SUSPEND = "PROJECT.SUSPEND";
|
||||
public static final String EVENT_PROJECT_ACCOUNT_ADD = "PROJECT.ACCOUNT.ADD";
|
||||
public static final String EVENT_PROJECT_INVITATION_UPDATE = "PROJECT.INVITATION.UPDATE";
|
||||
public static final String EVENT_PROJECT_INVITATION_REMOVE = "PROJECT.INVITATION.REMOVE";
|
||||
public static final String EVENT_PROJECT_ACCOUNT_REMOVE = "PROJECT.ACCOUNT.REMOVE";
|
||||
|
||||
// Network as a Service
|
||||
public static final String EVENT_NETWORK_ELEMENT_CONFIGURE = "NETWORK.ELEMENT.CONFIGURE";
|
||||
|
||||
// Physical Network Events
|
||||
public static final String EVENT_PHYSICAL_NETWORK_CREATE = "PHYSICAL.NETWORK.CREATE";
|
||||
public static final String EVENT_PHYSICAL_NETWORK_DELETE = "PHYSICAL.NETWORK.DELETE";
|
||||
public static final String EVENT_PHYSICAL_NETWORK_UPDATE = "PHYSICAL.NETWORK.UPDATE";
|
||||
|
||||
// Physical Network Service Provider Events
|
||||
public static final String EVENT_SERVICE_PROVIDER_CREATE = "SERVICE.PROVIDER.CREATE";
|
||||
public static final String EVENT_SERVICE_PROVIDER_DELETE = "SERVICE.PROVIDER.DELETE";
|
||||
public static final String EVENT_SERVICE_PROVIDER_UPDATE = "SERVICE.PROVIDER.UPDATE";
|
||||
|
||||
// Physical Network TrafficType Events
|
||||
public static final String EVENT_TRAFFIC_TYPE_CREATE = "TRAFFIC.TYPE.CREATE";
|
||||
public static final String EVENT_TRAFFIC_TYPE_DELETE = "TRAFFIC.TYPE.DELETE";
|
||||
public static final String EVENT_TRAFFIC_TYPE_UPDATE = "TRAFFIC.TYPE.UPDATE";
|
||||
|
||||
// external network device events
|
||||
public static final String EVENT_EXTERNAL_LB_DEVICE_ADD = "PHYSICAL.LOADBALANCER.ADD";
|
||||
public static final String EVENT_EXTERNAL_LB_DEVICE_DELETE = "PHYSICAL.LOADBALANCER.DELETE";
|
||||
public static final String EVENT_EXTERNAL_LB_DEVICE_CONFIGURE = "PHYSICAL.LOADBALANCER.CONFIGURE";
|
||||
|
||||
// external switch management device events (E.g.: Cisco Nexus 1000v Virtual Supervisor Module.
|
||||
public static final String EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_ADD = "SWITCH.MGMT.ADD";
|
||||
public static final String EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_DELETE = "SWITCH.MGMT.DELETE";
|
||||
public static final String EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_CONFIGURE = "SWITCH.MGMT.CONFIGURE";
|
||||
public static final String EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_ENABLE = "SWITCH.MGMT.ENABLE";
|
||||
public static final String EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_DISABLE = "SWITCH.MGMT.DISABLE";
|
||||
|
||||
public static final String EVENT_EXTERNAL_FIREWALL_DEVICE_ADD = "PHYSICAL.FIREWALL.ADD";
|
||||
public static final String EVENT_EXTERNAL_FIREWALL_DEVICE_DELETE = "PHYSICAL.FIREWALL.DELETE";
|
||||
public static final String EVENT_EXTERNAL_FIREWALL_DEVICE_CONFIGURE = "PHYSICAL.FIREWALL.CONFIGURE";
|
||||
|
||||
// tag related events
|
||||
public static final String EVENT_TAGS_CREATE = "CREATE_TAGS";
|
||||
public static final String EVENT_TAGS_DELETE = "DELETE_TAGS";
|
||||
|
||||
// VPC
|
||||
public static final String EVENT_VPC_CREATE = "VPC.CREATE";
|
||||
public static final String EVENT_VPC_UPDATE = "VPC.UPDATE";
|
||||
public static final String EVENT_VPC_DELETE = "VPC.DELETE";
|
||||
public static final String EVENT_VPC_RESTART = "VPC.RESTART";
|
||||
|
||||
// VPC offerings
|
||||
public static final String EVENT_VPC_OFFERING_CREATE = "VPC.OFFERING.CREATE";
|
||||
public static final String EVENT_VPC_OFFERING_UPDATE = "VPC.OFFERING.UPDATE";
|
||||
public static final String EVENT_VPC_OFFERING_DELETE = "VPC.OFFERING.DELETE";
|
||||
|
||||
// Private gateway
|
||||
public static final String EVENT_PRIVATE_GATEWAY_CREATE = "PRIVATE.GATEWAY.CREATE";
|
||||
public static final String EVENT_PRIVATE_GATEWAY_DELETE = "PRIVATE.GATEWAY.DELETE";
|
||||
|
||||
// Static routes
|
||||
public static final String EVENT_STATIC_ROUTE_CREATE = "STATIC.ROUTE.CREATE";
|
||||
public static final String EVENT_STATIC_ROUTE_DELETE = "STATIC.ROUTE.DELETE";
|
||||
|
||||
// AutoScale
|
||||
public static final String EVENT_COUNTER_CREATE = "COUNTER.CREATE";
|
||||
public static final String EVENT_COUNTER_DELETE = "COUNTER.DELETE";
|
||||
public static final String EVENT_CONDITION_CREATE = "CONDITION.CREATE";
|
||||
public static final String EVENT_CONDITION_DELETE = "CONDITION.DELETE";
|
||||
public static final String EVENT_AUTOSCALEPOLICY_CREATE = "AUTOSCALEPOLICY.CREATE";
|
||||
public static final String EVENT_AUTOSCALEPOLICY_UPDATE = "AUTOSCALEPOLICY.UPDATE";
|
||||
public static final String EVENT_AUTOSCALEPOLICY_DELETE = "AUTOSCALEPOLICY.DELETE";
|
||||
public static final String EVENT_AUTOSCALEVMPROFILE_CREATE = "AUTOSCALEVMPROFILE.CREATE";
|
||||
public static final String EVENT_AUTOSCALEVMPROFILE_DELETE = "AUTOSCALEVMPROFILE.DELETE";
|
||||
public static final String EVENT_AUTOSCALEVMPROFILE_UPDATE = "AUTOSCALEVMPROFILE.UPDATE";
|
||||
public static final String EVENT_AUTOSCALEVMGROUP_CREATE = "AUTOSCALEVMGROUP.CREATE";
|
||||
public static final String EVENT_AUTOSCALEVMGROUP_DELETE = "AUTOSCALEVMGROUP.DELETE";
|
||||
public static final String EVENT_AUTOSCALEVMGROUP_UPDATE = "AUTOSCALEVMGROUP.UPDATE";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,293 +1,295 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.cloud.acl.ControlledEntity;
|
||||
import com.cloud.network.Networks.BroadcastDomainType;
|
||||
import com.cloud.network.Networks.Mode;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import com.cloud.utils.fsm.FiniteState;
|
||||
import com.cloud.utils.fsm.StateMachine;
|
||||
|
||||
/**
|
||||
* owned by an account.
|
||||
*/
|
||||
public interface Network extends ControlledEntity {
|
||||
|
||||
public enum GuestType {
|
||||
Shared,
|
||||
Isolated
|
||||
}
|
||||
|
||||
public static class Service {
|
||||
private static List<Service> supportedServices = new ArrayList<Service>();
|
||||
|
||||
public static final Service Vpn = new Service("Vpn", Capability.SupportedVpnProtocols, Capability.VpnTypes);
|
||||
public static final Service Dhcp = new Service("Dhcp");
|
||||
public static final Service Dns = new Service("Dns", Capability.AllowDnsSuffixModification);
|
||||
public static final Service Gateway = new Service("Gateway");
|
||||
public static final Service Firewall = new Service("Firewall", Capability.SupportedProtocols,
|
||||
Capability.MultipleIps, Capability.TrafficStatistics);
|
||||
public static final Service Lb = new Service("Lb", Capability.SupportedLBAlgorithms, Capability.SupportedLBIsolation,
|
||||
Capability.SupportedProtocols, Capability.TrafficStatistics, Capability.LoadBalancingSupportedIps,
|
||||
Capability.SupportedStickinessMethods, Capability.ElasticLb);
|
||||
public static final Service UserData = new Service("UserData");
|
||||
public static final Service SourceNat = new Service("SourceNat", Capability.SupportedSourceNatTypes, Capability.RedundantRouter);
|
||||
public static final Service StaticNat = new Service("StaticNat", Capability.ElasticIp);
|
||||
public static final Service PortForwarding = new Service("PortForwarding");
|
||||
public static final Service SecurityGroup = new Service("SecurityGroup");
|
||||
public static final Service NetworkACL = new Service("NetworkACL", Capability.SupportedProtocols);
|
||||
|
||||
private String name;
|
||||
private Capability[] caps;
|
||||
|
||||
public Service(String name, Capability... caps) {
|
||||
this.name = name;
|
||||
this.caps = caps;
|
||||
supportedServices.add(this);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Capability[] getCapabilities() {
|
||||
return caps;
|
||||
}
|
||||
|
||||
public boolean containsCapability(Capability cap) {
|
||||
boolean success = false;
|
||||
if (caps != null) {
|
||||
int length = caps.length;
|
||||
for (int i = 0; i< length; i++) {
|
||||
if (caps[i].getName().equalsIgnoreCase(cap.getName())) {
|
||||
success = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
public static Service getService(String serviceName) {
|
||||
for (Service service : supportedServices) {
|
||||
if (service.getName().equalsIgnoreCase(serviceName)) {
|
||||
return service;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<Service> listAllServices(){
|
||||
return supportedServices;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Provider -> NetworkElement must always be one-to-one mapping. Thus for each NetworkElement we need a separate Provider added in here.
|
||||
*/
|
||||
public static class Provider {
|
||||
private static List<Provider> supportedProviders = new ArrayList<Provider>();
|
||||
|
||||
public static final Provider VirtualRouter = new Provider("VirtualRouter", false);
|
||||
public static final Provider JuniperSRX = new Provider("JuniperSRX", true);
|
||||
public static final Provider F5BigIp = new Provider("F5BigIp", true);
|
||||
public static final Provider Netscaler = new Provider("Netscaler", true);
|
||||
public static final Provider ExternalDhcpServer = new Provider("ExternalDhcpServer", true);
|
||||
public static final Provider ExternalGateWay = new Provider("ExternalGateWay", true);
|
||||
public static final Provider ElasticLoadBalancerVm = new Provider("ElasticLoadBalancerVm", false);
|
||||
public static final Provider SecurityGroupProvider = new Provider("SecurityGroupProvider", false);
|
||||
public static final Provider VPCVirtualRouter = new Provider("VpcVirtualRouter", false);
|
||||
public static final Provider None = new Provider("None", false);
|
||||
|
||||
private String name;
|
||||
private boolean isExternal;
|
||||
|
||||
public Provider(String name, boolean isExternal) {
|
||||
this.name = name;
|
||||
this.isExternal = isExternal;
|
||||
supportedProviders.add(this);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public boolean isExternal() {
|
||||
return isExternal;
|
||||
}
|
||||
|
||||
public static Provider getProvider(String providerName) {
|
||||
for (Provider provider : supportedProviders) {
|
||||
if (provider.getName().equalsIgnoreCase(providerName)) {
|
||||
return provider;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Capability {
|
||||
|
||||
private static List<Capability> supportedCapabilities = new ArrayList<Capability>();
|
||||
|
||||
public static final Capability SupportedProtocols = new Capability("SupportedProtocols");
|
||||
public static final Capability SupportedLBAlgorithms = new Capability("SupportedLbAlgorithms");
|
||||
public static final Capability SupportedLBIsolation = new Capability("SupportedLBIsolation");
|
||||
public static final Capability SupportedStickinessMethods = new Capability("SupportedStickinessMethods");
|
||||
public static final Capability MultipleIps = new Capability("MultipleIps");
|
||||
public static final Capability SupportedSourceNatTypes = new Capability("SupportedSourceNatTypes");
|
||||
public static final Capability SupportedVpnProtocols = new Capability("SupportedVpnTypes");
|
||||
public static final Capability VpnTypes = new Capability("VpnTypes");
|
||||
public static final Capability TrafficStatistics = new Capability("TrafficStatistics");
|
||||
public static final Capability LoadBalancingSupportedIps = new Capability("LoadBalancingSupportedIps");
|
||||
public static final Capability AllowDnsSuffixModification = new Capability("AllowDnsSuffixModification");
|
||||
public static final Capability RedundantRouter = new Capability("RedundantRouter");
|
||||
public static final Capability ElasticIp = new Capability("ElasticIp");
|
||||
public static final Capability ElasticLb = new Capability("ElasticLb");
|
||||
|
||||
private String name;
|
||||
|
||||
public Capability(String name) {
|
||||
this.name = name;
|
||||
supportedCapabilities.add(this);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static Capability getCapability(String capabilityName) {
|
||||
for (Capability capability : supportedCapabilities) {
|
||||
if (capability.getName().equalsIgnoreCase(capabilityName)) {
|
||||
return capability;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
enum Event {
|
||||
ImplementNetwork,
|
||||
DestroyNetwork,
|
||||
OperationSucceeded,
|
||||
OperationFailed;
|
||||
}
|
||||
|
||||
enum State implements FiniteState<State, Event> {
|
||||
Allocated("Indicates the network configuration is in allocated but not setup"),
|
||||
Setup("Indicates the network configuration is setup"),
|
||||
Implementing("Indicates the network configuration is being implemented"),
|
||||
Implemented("Indicates the network configuration is in use"),
|
||||
Shutdown("Indicates the network configuration is being destroyed"),
|
||||
Destroy("Indicates that the network is destroyed");
|
||||
|
||||
|
||||
@Override
|
||||
public StateMachine<State, Event> getStateMachine() {
|
||||
return s_fsm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public State getNextState(Event event) {
|
||||
return s_fsm.getNextState(this, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<State> getFromStates(Event event) {
|
||||
return s_fsm.getFromStates(this, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Event> getPossibleEvents() {
|
||||
return s_fsm.getPossibleEvents(this);
|
||||
}
|
||||
|
||||
String _description;
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return _description;
|
||||
}
|
||||
|
||||
private State(String description) {
|
||||
_description = description;
|
||||
}
|
||||
|
||||
private static StateMachine<State, Event> s_fsm = new StateMachine<State, Event>();
|
||||
static {
|
||||
s_fsm.addTransition(State.Allocated, Event.ImplementNetwork, State.Implementing);
|
||||
s_fsm.addTransition(State.Implementing, Event.OperationSucceeded, State.Implemented);
|
||||
s_fsm.addTransition(State.Implementing, Event.OperationFailed, State.Shutdown);
|
||||
s_fsm.addTransition(State.Implemented, Event.DestroyNetwork, State.Shutdown);
|
||||
s_fsm.addTransition(State.Shutdown, Event.OperationSucceeded, State.Allocated);
|
||||
s_fsm.addTransition(State.Shutdown, Event.OperationFailed, State.Implemented);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return id of the network profile. Null means the network profile is not from the database.
|
||||
*/
|
||||
long getId();
|
||||
|
||||
String getName();
|
||||
|
||||
Mode getMode();
|
||||
|
||||
BroadcastDomainType getBroadcastDomainType();
|
||||
|
||||
TrafficType getTrafficType();
|
||||
|
||||
String getGateway();
|
||||
|
||||
String getCidr();
|
||||
|
||||
long getDataCenterId();
|
||||
|
||||
long getNetworkOfferingId();
|
||||
|
||||
State getState();
|
||||
|
||||
long getRelated();
|
||||
|
||||
URI getBroadcastUri();
|
||||
|
||||
String getDisplayText();
|
||||
|
||||
String getReservationId();
|
||||
|
||||
String getNetworkDomain();
|
||||
|
||||
GuestType getGuestType();
|
||||
|
||||
Long getPhysicalNetworkId();
|
||||
|
||||
void setPhysicalNetworkId(Long physicalNetworkId);
|
||||
|
||||
ACLType getAclType();
|
||||
|
||||
boolean isRestartRequired();
|
||||
|
||||
boolean getSpecifyIpRanges();
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
Long getVpcId();
|
||||
}
|
||||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.cloud.acl.ControlledEntity;
|
||||
import com.cloud.network.Networks.BroadcastDomainType;
|
||||
import com.cloud.network.Networks.Mode;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import com.cloud.utils.fsm.FiniteState;
|
||||
import com.cloud.utils.fsm.StateMachine;
|
||||
|
||||
/**
|
||||
* owned by an account.
|
||||
*/
|
||||
public interface Network extends ControlledEntity {
|
||||
|
||||
public enum GuestType {
|
||||
Shared,
|
||||
Isolated
|
||||
}
|
||||
|
||||
public static class Service {
|
||||
private static List<Service> supportedServices = new ArrayList<Service>();
|
||||
|
||||
public static final Service Vpn = new Service("Vpn", Capability.SupportedVpnProtocols, Capability.VpnTypes);
|
||||
public static final Service Dhcp = new Service("Dhcp");
|
||||
public static final Service Dns = new Service("Dns", Capability.AllowDnsSuffixModification);
|
||||
public static final Service Gateway = new Service("Gateway");
|
||||
public static final Service Firewall = new Service("Firewall", Capability.SupportedProtocols,
|
||||
Capability.MultipleIps, Capability.TrafficStatistics);
|
||||
public static final Service Lb = new Service("Lb", Capability.SupportedLBAlgorithms, Capability.SupportedLBIsolation,
|
||||
Capability.SupportedProtocols, Capability.TrafficStatistics, Capability.LoadBalancingSupportedIps,
|
||||
Capability.SupportedStickinessMethods, Capability.ElasticLb);
|
||||
public static final Service UserData = new Service("UserData");
|
||||
public static final Service SourceNat = new Service("SourceNat", Capability.SupportedSourceNatTypes, Capability.RedundantRouter);
|
||||
public static final Service StaticNat = new Service("StaticNat", Capability.ElasticIp);
|
||||
public static final Service PortForwarding = new Service("PortForwarding");
|
||||
public static final Service SecurityGroup = new Service("SecurityGroup");
|
||||
public static final Service NetworkACL = new Service("NetworkACL", Capability.SupportedProtocols);
|
||||
|
||||
private String name;
|
||||
private Capability[] caps;
|
||||
|
||||
public Service(String name, Capability... caps) {
|
||||
this.name = name;
|
||||
this.caps = caps;
|
||||
supportedServices.add(this);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Capability[] getCapabilities() {
|
||||
return caps;
|
||||
}
|
||||
|
||||
public boolean containsCapability(Capability cap) {
|
||||
boolean success = false;
|
||||
if (caps != null) {
|
||||
int length = caps.length;
|
||||
for (int i = 0; i< length; i++) {
|
||||
if (caps[i].getName().equalsIgnoreCase(cap.getName())) {
|
||||
success = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
public static Service getService(String serviceName) {
|
||||
for (Service service : supportedServices) {
|
||||
if (service.getName().equalsIgnoreCase(serviceName)) {
|
||||
return service;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<Service> listAllServices(){
|
||||
return supportedServices;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Provider -> NetworkElement must always be one-to-one mapping. Thus for each NetworkElement we need a separate Provider added in here.
|
||||
*/
|
||||
public static class Provider {
|
||||
private static List<Provider> supportedProviders = new ArrayList<Provider>();
|
||||
|
||||
public static final Provider VirtualRouter = new Provider("VirtualRouter", false);
|
||||
public static final Provider JuniperSRX = new Provider("JuniperSRX", true);
|
||||
public static final Provider F5BigIp = new Provider("F5BigIp", true);
|
||||
public static final Provider Netscaler = new Provider("Netscaler", true);
|
||||
public static final Provider ExternalDhcpServer = new Provider("ExternalDhcpServer", true);
|
||||
public static final Provider ExternalGateWay = new Provider("ExternalGateWay", true);
|
||||
public static final Provider ElasticLoadBalancerVm = new Provider("ElasticLoadBalancerVm", false);
|
||||
public static final Provider SecurityGroupProvider = new Provider("SecurityGroupProvider", false);
|
||||
public static final Provider VPCVirtualRouter = new Provider("VpcVirtualRouter", false);
|
||||
public static final Provider None = new Provider("None", false);
|
||||
|
||||
private String name;
|
||||
private boolean isExternal;
|
||||
|
||||
public Provider(String name, boolean isExternal) {
|
||||
this.name = name;
|
||||
this.isExternal = isExternal;
|
||||
supportedProviders.add(this);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public boolean isExternal() {
|
||||
return isExternal;
|
||||
}
|
||||
|
||||
public static Provider getProvider(String providerName) {
|
||||
for (Provider provider : supportedProviders) {
|
||||
if (provider.getName().equalsIgnoreCase(providerName)) {
|
||||
return provider;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Capability {
|
||||
|
||||
private static List<Capability> supportedCapabilities = new ArrayList<Capability>();
|
||||
|
||||
public static final Capability SupportedProtocols = new Capability("SupportedProtocols");
|
||||
public static final Capability SupportedLBAlgorithms = new Capability("SupportedLbAlgorithms");
|
||||
public static final Capability SupportedLBIsolation = new Capability("SupportedLBIsolation");
|
||||
public static final Capability SupportedStickinessMethods = new Capability("SupportedStickinessMethods");
|
||||
public static final Capability MultipleIps = new Capability("MultipleIps");
|
||||
public static final Capability SupportedSourceNatTypes = new Capability("SupportedSourceNatTypes");
|
||||
public static final Capability SupportedVpnProtocols = new Capability("SupportedVpnTypes");
|
||||
public static final Capability VpnTypes = new Capability("VpnTypes");
|
||||
public static final Capability TrafficStatistics = new Capability("TrafficStatistics");
|
||||
public static final Capability LoadBalancingSupportedIps = new Capability("LoadBalancingSupportedIps");
|
||||
public static final Capability AllowDnsSuffixModification = new Capability("AllowDnsSuffixModification");
|
||||
public static final Capability RedundantRouter = new Capability("RedundantRouter");
|
||||
public static final Capability ElasticIp = new Capability("ElasticIp");
|
||||
public static final Capability ElasticLb = new Capability("ElasticLb");
|
||||
public static final Capability AutoScaleCounters = new Capability("AutoScaleCounters");
|
||||
|
||||
|
||||
private String name;
|
||||
|
||||
public Capability(String name) {
|
||||
this.name = name;
|
||||
supportedCapabilities.add(this);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static Capability getCapability(String capabilityName) {
|
||||
for (Capability capability : supportedCapabilities) {
|
||||
if (capability.getName().equalsIgnoreCase(capabilityName)) {
|
||||
return capability;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
enum Event {
|
||||
ImplementNetwork,
|
||||
DestroyNetwork,
|
||||
OperationSucceeded,
|
||||
OperationFailed;
|
||||
}
|
||||
|
||||
enum State implements FiniteState<State, Event> {
|
||||
Allocated("Indicates the network configuration is in allocated but not setup"),
|
||||
Setup("Indicates the network configuration is setup"),
|
||||
Implementing("Indicates the network configuration is being implemented"),
|
||||
Implemented("Indicates the network configuration is in use"),
|
||||
Shutdown("Indicates the network configuration is being destroyed"),
|
||||
Destroy("Indicates that the network is destroyed");
|
||||
|
||||
|
||||
@Override
|
||||
public StateMachine<State, Event> getStateMachine() {
|
||||
return s_fsm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public State getNextState(Event event) {
|
||||
return s_fsm.getNextState(this, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<State> getFromStates(Event event) {
|
||||
return s_fsm.getFromStates(this, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Event> getPossibleEvents() {
|
||||
return s_fsm.getPossibleEvents(this);
|
||||
}
|
||||
|
||||
String _description;
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return _description;
|
||||
}
|
||||
|
||||
private State(String description) {
|
||||
_description = description;
|
||||
}
|
||||
|
||||
private static StateMachine<State, Event> s_fsm = new StateMachine<State, Event>();
|
||||
static {
|
||||
s_fsm.addTransition(State.Allocated, Event.ImplementNetwork, State.Implementing);
|
||||
s_fsm.addTransition(State.Implementing, Event.OperationSucceeded, State.Implemented);
|
||||
s_fsm.addTransition(State.Implementing, Event.OperationFailed, State.Shutdown);
|
||||
s_fsm.addTransition(State.Implemented, Event.DestroyNetwork, State.Shutdown);
|
||||
s_fsm.addTransition(State.Shutdown, Event.OperationSucceeded, State.Allocated);
|
||||
s_fsm.addTransition(State.Shutdown, Event.OperationFailed, State.Implemented);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return id of the network profile. Null means the network profile is not from the database.
|
||||
*/
|
||||
long getId();
|
||||
|
||||
String getName();
|
||||
|
||||
Mode getMode();
|
||||
|
||||
BroadcastDomainType getBroadcastDomainType();
|
||||
|
||||
TrafficType getTrafficType();
|
||||
|
||||
String getGateway();
|
||||
|
||||
String getCidr();
|
||||
|
||||
long getDataCenterId();
|
||||
|
||||
long getNetworkOfferingId();
|
||||
|
||||
State getState();
|
||||
|
||||
long getRelated();
|
||||
|
||||
URI getBroadcastUri();
|
||||
|
||||
String getDisplayText();
|
||||
|
||||
String getReservationId();
|
||||
|
||||
String getNetworkDomain();
|
||||
|
||||
GuestType getGuestType();
|
||||
|
||||
Long getPhysicalNetworkId();
|
||||
|
||||
void setPhysicalNetworkId(Long physicalNetworkId);
|
||||
|
||||
ACLType getAclType();
|
||||
|
||||
boolean isRestartRequired();
|
||||
|
||||
boolean getSpecifyIpRanges();
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
Long getVpcId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.network.as;
|
||||
|
||||
import com.cloud.acl.ControlledEntity;
|
||||
|
||||
public interface AutoScalePolicy extends ControlledEntity {
|
||||
|
||||
long getId();
|
||||
|
||||
public Integer getDuration();
|
||||
|
||||
public Integer getQuietTime();
|
||||
|
||||
public String getAction();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.api.commands.CreateAutoScalePolicyCmd;
|
||||
import com.cloud.api.commands.CreateAutoScaleVmGroupCmd;
|
||||
import com.cloud.api.commands.CreateAutoScaleVmProfileCmd;
|
||||
import com.cloud.api.commands.CreateConditionCmd;
|
||||
import com.cloud.api.commands.CreateCounterCmd;
|
||||
import com.cloud.api.commands.ListAutoScalePoliciesCmd;
|
||||
import com.cloud.api.commands.ListAutoScaleVmGroupsCmd;
|
||||
import com.cloud.api.commands.ListAutoScaleVmProfilesCmd;
|
||||
import com.cloud.api.commands.ListConditionsCmd;
|
||||
import com.cloud.api.commands.ListCountersCmd;
|
||||
import com.cloud.api.commands.UpdateAutoScalePolicyCmd;
|
||||
import com.cloud.api.commands.UpdateAutoScaleVmGroupCmd;
|
||||
import com.cloud.api.commands.UpdateAutoScaleVmProfileCmd;
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.network.as.AutoScalePolicy;
|
||||
import com.cloud.network.as.AutoScaleVmGroup;
|
||||
import com.cloud.network.as.AutoScaleVmProfile;
|
||||
import com.cloud.network.as.Condition;
|
||||
import com.cloud.network.as.Counter;
|
||||
|
||||
public interface AutoScaleService {
|
||||
|
||||
public AutoScalePolicy createAutoScalePolicy(CreateAutoScalePolicyCmd createAutoScalePolicyCmd);
|
||||
|
||||
public boolean deleteAutoScalePolicy(long autoScalePolicyId);
|
||||
|
||||
List<? extends AutoScalePolicy> listAutoScalePolicies(ListAutoScalePoliciesCmd cmd);
|
||||
|
||||
AutoScalePolicy updateAutoScalePolicy(UpdateAutoScalePolicyCmd cmd);
|
||||
|
||||
AutoScaleVmProfile createAutoScaleVmProfile(CreateAutoScaleVmProfileCmd cmd);
|
||||
|
||||
boolean deleteAutoScaleVmProfile(long profileId);
|
||||
|
||||
List<? extends AutoScaleVmProfile> listAutoScaleVmProfiles(ListAutoScaleVmProfilesCmd listAutoScaleVmProfilesCmd);
|
||||
|
||||
AutoScaleVmProfile updateAutoScaleVmProfile(UpdateAutoScaleVmProfileCmd cmd);
|
||||
|
||||
AutoScaleVmGroup createAutoScaleVmGroup(CreateAutoScaleVmGroupCmd cmd);
|
||||
|
||||
boolean configureAutoScaleVmGroup(CreateAutoScaleVmGroupCmd cmd);
|
||||
|
||||
boolean deleteAutoScaleVmGroup(long vmGroupId);
|
||||
|
||||
AutoScaleVmGroup updateAutoScaleVmGroup(UpdateAutoScaleVmGroupCmd cmd);
|
||||
|
||||
AutoScaleVmGroup enableAutoScaleVmGroup(Long id);
|
||||
|
||||
AutoScaleVmGroup disableAutoScaleVmGroup(Long id);
|
||||
|
||||
List<? extends AutoScaleVmGroup> listAutoScaleVmGroups(ListAutoScaleVmGroupsCmd listAutoScaleVmGroupsCmd);
|
||||
|
||||
Counter createCounter(CreateCounterCmd cmd);
|
||||
|
||||
boolean deleteCounter(long counterId) throws ResourceInUseException;
|
||||
|
||||
List<? extends Counter> listCounters(ListCountersCmd cmd);
|
||||
|
||||
Condition createCondition(CreateConditionCmd cmd);
|
||||
|
||||
List<? extends Condition> listConditions(ListConditionsCmd cmd);
|
||||
|
||||
boolean deleteCondition(long conditionId) throws ResourceInUseException;
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.network.as;
|
||||
|
||||
import com.cloud.acl.ControlledEntity;
|
||||
|
||||
/**
|
||||
* @author Deepak Garg
|
||||
*/
|
||||
|
||||
public interface AutoScaleVmGroup extends ControlledEntity {
|
||||
|
||||
static enum Operator {
|
||||
EQ, GT, LT, GE, LE
|
||||
};
|
||||
|
||||
long getId();
|
||||
|
||||
@Override
|
||||
long getAccountId();
|
||||
|
||||
long getLoadBalancerId();
|
||||
|
||||
long getProfileId();
|
||||
|
||||
int getMinMembers();
|
||||
|
||||
int getMaxMembers();
|
||||
|
||||
int getMemberPort();
|
||||
|
||||
int getInterval();
|
||||
|
||||
boolean isRevoke();
|
||||
|
||||
String getState();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
package com.cloud.network.as;
|
||||
|
||||
import com.cloud.acl.ControlledEntity;
|
||||
|
||||
/**
|
||||
* AutoScaleVmProfile
|
||||
*/
|
||||
public interface AutoScaleVmProfile extends ControlledEntity {
|
||||
|
||||
public long getId();
|
||||
|
||||
public Long getZoneId();
|
||||
|
||||
public Long getServiceOfferingId();
|
||||
|
||||
public Long getTemplateId();
|
||||
|
||||
public String getOtherDeployParams();
|
||||
|
||||
public String getSnmpCommunity();
|
||||
|
||||
public Integer getSnmpPort();
|
||||
|
||||
public Integer getDestroyVmGraceperiod();
|
||||
|
||||
public long getAutoScaleUserId();
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.network.as;
|
||||
|
||||
import com.cloud.acl.ControlledEntity;
|
||||
|
||||
public interface Condition extends ControlledEntity {
|
||||
|
||||
static enum Operator {
|
||||
EQ, GT, LT, GE, LE
|
||||
};
|
||||
|
||||
long getCounterid();
|
||||
|
||||
long getThreshold();
|
||||
|
||||
Operator getRelationalOperator();
|
||||
|
||||
String getUuid();
|
||||
|
||||
long getId();
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.network.as;
|
||||
|
||||
public interface Counter {
|
||||
|
||||
public static enum Source {
|
||||
netscaler,
|
||||
snmp
|
||||
}
|
||||
|
||||
String getName();
|
||||
|
||||
String getValue();
|
||||
|
||||
Source getSource();
|
||||
|
||||
String getUuid();
|
||||
|
||||
long getId();
|
||||
}
|
||||
|
|
@ -1,222 +1,443 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.lb;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
import com.cloud.network.rules.LoadBalancer;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
public class LoadBalancingRule implements FirewallRule, LoadBalancer{
|
||||
private LoadBalancer lb;
|
||||
private List<LbDestination> destinations;
|
||||
private List<LbStickinessPolicy> stickinessPolicies;
|
||||
|
||||
public LoadBalancingRule(LoadBalancer lb, List<LbDestination> destinations, List<LbStickinessPolicy> stickinessPolicies) {
|
||||
this.lb = lb;
|
||||
this.destinations = destinations;
|
||||
this.stickinessPolicies = stickinessPolicies;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
return lb.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAccountId() {
|
||||
return lb.getAccountId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDomainId() {
|
||||
return lb.getDomainId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return lb.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return lb.getDescription();
|
||||
}
|
||||
|
||||
public int getDefaultPortStart() {
|
||||
return lb.getDefaultPortStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultPortEnd() {
|
||||
return lb.getDefaultPortEnd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAlgorithm() {
|
||||
return lb.getAlgorithm();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getXid() {
|
||||
return lb.getXid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getSourceIpAddressId() {
|
||||
return lb.getSourceIpAddressId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getSourcePortStart() {
|
||||
return lb.getSourcePortStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getSourcePortEnd() {
|
||||
return lb.getSourcePortEnd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProtocol() {
|
||||
return lb.getProtocol();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Purpose getPurpose() {
|
||||
return Purpose.LoadBalancing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public State getState() {
|
||||
return lb.getState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getNetworkId() {
|
||||
return lb.getNetworkId();
|
||||
}
|
||||
|
||||
public LoadBalancer getLb() {
|
||||
return lb;
|
||||
}
|
||||
|
||||
public List<LbDestination> getDestinations() {
|
||||
return destinations;
|
||||
}
|
||||
|
||||
public List<LbStickinessPolicy> getStickinessPolicies() {
|
||||
return stickinessPolicies;
|
||||
}
|
||||
|
||||
|
||||
public interface Destination {
|
||||
String getIpAddress();
|
||||
int getDestinationPortStart();
|
||||
int getDestinationPortEnd();
|
||||
boolean isRevoked();
|
||||
}
|
||||
|
||||
public static class LbStickinessPolicy {
|
||||
private String _methodName;
|
||||
private List<Pair<String, String>> _params;
|
||||
private boolean _revoke;
|
||||
|
||||
public LbStickinessPolicy(String methodName, List<Pair<String, String>> params, boolean revoke) {
|
||||
this._methodName = methodName;
|
||||
this._params = params;
|
||||
this._revoke = revoke;
|
||||
}
|
||||
|
||||
public LbStickinessPolicy(String methodName, List<Pair<String, String>> params) {
|
||||
this._methodName = methodName;
|
||||
this._params = params;
|
||||
this._revoke = false;
|
||||
}
|
||||
|
||||
public String getMethodName() {
|
||||
return _methodName;
|
||||
}
|
||||
|
||||
public List<Pair<String, String>> getParams() {
|
||||
return _params;
|
||||
}
|
||||
|
||||
public boolean isRevoked() {
|
||||
return _revoke;
|
||||
}
|
||||
}
|
||||
|
||||
public static class LbDestination implements Destination {
|
||||
private int portStart;
|
||||
private int portEnd;
|
||||
private String ip;
|
||||
boolean revoked;
|
||||
|
||||
public LbDestination(int portStart, int portEnd, String ip, boolean revoked) {
|
||||
this.portStart = portStart;
|
||||
this.portEnd = portEnd;
|
||||
this.ip = ip;
|
||||
this.revoked = revoked;
|
||||
}
|
||||
|
||||
public String getIpAddress() {
|
||||
return ip;
|
||||
}
|
||||
public int getDestinationPortStart() {
|
||||
return portStart;
|
||||
}
|
||||
public int getDestinationPortEnd() {
|
||||
return portEnd;
|
||||
}
|
||||
|
||||
public boolean isRevoked() {
|
||||
return revoked;
|
||||
}
|
||||
|
||||
public void setRevoked(boolean revoked) {
|
||||
this.revoked = revoked;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getIcmpCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getIcmpType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSourceCidrList() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getRelated() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FirewallRuleType getType() {
|
||||
return FirewallRuleType.User;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrafficType getTrafficType() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.lb;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.network.as.AutoScalePolicy;
|
||||
import com.cloud.network.as.AutoScaleVmGroup;
|
||||
import com.cloud.network.as.AutoScaleVmProfile;
|
||||
import com.cloud.network.as.Condition;
|
||||
import com.cloud.network.as.Counter;
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
import com.cloud.network.rules.LoadBalancer;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
public class LoadBalancingRule implements FirewallRule, LoadBalancer{
|
||||
private final LoadBalancer lb;
|
||||
private final List<LbDestination> destinations;
|
||||
private final List<LbStickinessPolicy> stickinessPolicies;
|
||||
private LbAutoScaleVmGroup autoScaleVmGroup;
|
||||
|
||||
public LoadBalancingRule(LoadBalancer lb, List<LbDestination> destinations, List<LbStickinessPolicy> stickinessPolicies) {
|
||||
this.lb = lb;
|
||||
this.destinations = destinations;
|
||||
this.stickinessPolicies = stickinessPolicies;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
return lb.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAccountId() {
|
||||
return lb.getAccountId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDomainId() {
|
||||
return lb.getDomainId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return lb.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return lb.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultPortStart() {
|
||||
return lb.getDefaultPortStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultPortEnd() {
|
||||
return lb.getDefaultPortEnd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAlgorithm() {
|
||||
return lb.getAlgorithm();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getXid() {
|
||||
return lb.getXid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getSourceIpAddressId() {
|
||||
return lb.getSourceIpAddressId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getSourcePortStart() {
|
||||
return lb.getSourcePortStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getSourcePortEnd() {
|
||||
return lb.getSourcePortEnd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProtocol() {
|
||||
return lb.getProtocol();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Purpose getPurpose() {
|
||||
return Purpose.LoadBalancing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public State getState() {
|
||||
return lb.getState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getNetworkId() {
|
||||
return lb.getNetworkId();
|
||||
}
|
||||
|
||||
public LoadBalancer getLb() {
|
||||
return lb;
|
||||
}
|
||||
|
||||
public List<LbDestination> getDestinations() {
|
||||
return destinations;
|
||||
}
|
||||
|
||||
public List<LbStickinessPolicy> getStickinessPolicies() {
|
||||
return stickinessPolicies;
|
||||
}
|
||||
|
||||
|
||||
public interface Destination {
|
||||
String getIpAddress();
|
||||
int getDestinationPortStart();
|
||||
int getDestinationPortEnd();
|
||||
boolean isRevoked();
|
||||
}
|
||||
|
||||
public static class LbStickinessPolicy {
|
||||
private final String _methodName;
|
||||
private final List<Pair<String, String>> _params;
|
||||
private final boolean _revoke;
|
||||
|
||||
public LbStickinessPolicy(String methodName, List<Pair<String, String>> params, boolean revoke) {
|
||||
this._methodName = methodName;
|
||||
this._params = params;
|
||||
this._revoke = revoke;
|
||||
}
|
||||
|
||||
public LbStickinessPolicy(String methodName, List<Pair<String, String>> params) {
|
||||
this._methodName = methodName;
|
||||
this._params = params;
|
||||
this._revoke = false;
|
||||
}
|
||||
|
||||
public String getMethodName() {
|
||||
return _methodName;
|
||||
}
|
||||
|
||||
public List<Pair<String, String>> getParams() {
|
||||
return _params;
|
||||
}
|
||||
|
||||
public boolean isRevoked() {
|
||||
return _revoke;
|
||||
}
|
||||
}
|
||||
|
||||
public static class LbDestination implements Destination {
|
||||
private final int portStart;
|
||||
private final int portEnd;
|
||||
private final String ip;
|
||||
boolean revoked;
|
||||
|
||||
public LbDestination(int portStart, int portEnd, String ip, boolean revoked) {
|
||||
this.portStart = portStart;
|
||||
this.portEnd = portEnd;
|
||||
this.ip = ip;
|
||||
this.revoked = revoked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIpAddress() {
|
||||
return ip;
|
||||
}
|
||||
@Override
|
||||
public int getDestinationPortStart() {
|
||||
return portStart;
|
||||
}
|
||||
@Override
|
||||
public int getDestinationPortEnd() {
|
||||
return portEnd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRevoked() {
|
||||
return revoked;
|
||||
}
|
||||
|
||||
public void setRevoked(boolean revoked) {
|
||||
this.revoked = revoked;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getIcmpCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getIcmpType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSourceCidrList() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getRelated() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FirewallRuleType getType() {
|
||||
return FirewallRuleType.User;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrafficType getTrafficType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public LbAutoScaleVmGroup getAutoScaleVmGroup() {
|
||||
return autoScaleVmGroup;
|
||||
}
|
||||
|
||||
public boolean isAutoScaleConfig() {
|
||||
return this.autoScaleVmGroup != null;
|
||||
}
|
||||
|
||||
public void setAutoScaleVmGroup(LbAutoScaleVmGroup autoScaleVmGroup) {
|
||||
this.autoScaleVmGroup = autoScaleVmGroup;
|
||||
}
|
||||
|
||||
|
||||
public static class LbCondition {
|
||||
private final Condition condition;
|
||||
private final Counter counter;
|
||||
public LbCondition(Counter counter, Condition condition) {
|
||||
this.condition = condition;
|
||||
this.counter = counter;
|
||||
}
|
||||
public Condition getCondition() {
|
||||
return condition;
|
||||
}
|
||||
public Counter getCounter() {
|
||||
return counter;
|
||||
}
|
||||
}
|
||||
|
||||
public static class LbAutoScalePolicy {
|
||||
private final List<LbCondition> conditions;
|
||||
private final AutoScalePolicy policy;
|
||||
private boolean revoked;
|
||||
public LbAutoScalePolicy(AutoScalePolicy policy, List<LbCondition> conditions)
|
||||
{
|
||||
this.policy = policy;
|
||||
this.conditions = conditions;
|
||||
}
|
||||
public List<LbCondition> getConditions() {
|
||||
return conditions;
|
||||
}
|
||||
public AutoScalePolicy getPolicy() {
|
||||
return policy;
|
||||
}
|
||||
|
||||
public boolean isRevoked() {
|
||||
return revoked;
|
||||
}
|
||||
public void setRevoked(boolean revoked) {
|
||||
this.revoked = revoked;
|
||||
}
|
||||
}
|
||||
|
||||
public static class LbAutoScaleVmProfile {
|
||||
AutoScaleVmProfile profile;
|
||||
private final String cloudStackApiUrl;
|
||||
private final String autoScaleUserApiKey;
|
||||
private final String autoScaleUserSecretKey;
|
||||
|
||||
public LbAutoScaleVmProfile(AutoScaleVmProfile profile, String cloudStackApiUrl, String autoScaleUserApiKey, String autoScaleUserSecretKey) {
|
||||
this.profile = profile;
|
||||
this.cloudStackApiUrl = cloudStackApiUrl;
|
||||
this.autoScaleUserApiKey = autoScaleUserApiKey;
|
||||
this.autoScaleUserSecretKey = autoScaleUserSecretKey;
|
||||
}
|
||||
public AutoScaleVmProfile getProfile() {
|
||||
return profile;
|
||||
}
|
||||
public String getCloudStackApiUrl() {
|
||||
return cloudStackApiUrl;
|
||||
}
|
||||
public String getAutoScaleUserApiKey() {
|
||||
return autoScaleUserApiKey;
|
||||
}
|
||||
public String getAutoScaleUserSecretKey() {
|
||||
return autoScaleUserSecretKey;
|
||||
}
|
||||
}
|
||||
|
||||
public static class LbAutoScaleVmGroup {
|
||||
AutoScaleVmGroup vmGroup;
|
||||
private final List<LbAutoScalePolicy> policies;
|
||||
private final LbAutoScaleVmProfile profile;
|
||||
|
||||
public LbAutoScaleVmGroup(AutoScaleVmGroup vmGroup, List<LbAutoScalePolicy> policies, LbAutoScaleVmProfile profile) {
|
||||
this.vmGroup = vmGroup;
|
||||
this.policies = policies;
|
||||
this.profile = profile;
|
||||
}
|
||||
|
||||
public AutoScaleVmGroup getVmGroup() {
|
||||
return vmGroup;
|
||||
}
|
||||
|
||||
public List<LbAutoScalePolicy> getPolicies() {
|
||||
return policies;
|
||||
}
|
||||
|
||||
public LbAutoScaleVmProfile getProfile() {
|
||||
return profile;
|
||||
}
|
||||
}
|
||||
//public static class LbCounter{
|
||||
//private String name;
|
||||
//private String source;
|
||||
//private String value;
|
||||
//
|
||||
//public LbCounter(String name, String source, String value)
|
||||
//{
|
||||
// this.name = name;
|
||||
// this.source = source;
|
||||
// this.value = value;
|
||||
//}
|
||||
//
|
||||
//public String getName() {
|
||||
// return name;
|
||||
//}
|
||||
//public String getSource() {
|
||||
// return source;
|
||||
//}
|
||||
//public String getValue() {
|
||||
// return value;
|
||||
//}
|
||||
//}
|
||||
//
|
||||
//public static class LbCondition{
|
||||
//private long threshold;
|
||||
//private String relationalOperator;
|
||||
//private LbCounter counter;
|
||||
//public LbCondition(int threshold, String relationalOperator, LbCounter counter)
|
||||
//{
|
||||
// this.threshold = threshold;
|
||||
// this.relationalOperator = relationalOperator;
|
||||
// this.counter = counter;
|
||||
//}
|
||||
//public long getThreshold() {
|
||||
// return threshold;
|
||||
//}
|
||||
//public String getRelationalOperator() {
|
||||
// return relationalOperator;
|
||||
//}
|
||||
//public LbCounter getCounter() {
|
||||
// return counter;
|
||||
//}
|
||||
//}
|
||||
//
|
||||
//public static class AutoScaleVmGroup {
|
||||
//private int minMembers;
|
||||
//private int maxMembers;
|
||||
//private List<AutoscalePolicy> scaleUpPolicies;
|
||||
//private List<AutoscalePolicy> scaleDownPolicies;
|
||||
//private List<AutoScaleVmProfile> profile;
|
||||
//private boolean revoked;
|
||||
//
|
||||
//public boolean isRevoked() {
|
||||
// return revoked;
|
||||
//}
|
||||
//
|
||||
//public void setRevoked(boolean revoked) {
|
||||
// this.revoked = revoked;
|
||||
//}
|
||||
//}
|
||||
//
|
||||
//public static class AutoScaleVmProfile {
|
||||
//private Long zoneId;
|
||||
//private long domainId;
|
||||
//private long accountId;
|
||||
//private Long serviceOfferingId;
|
||||
//private Long templateId;
|
||||
//private String otherDeployParams;
|
||||
//private String snmpCommunity;
|
||||
//private Integer snmpPort;
|
||||
//
|
||||
//}
|
||||
//
|
||||
//public static class AutoscalePolicy {
|
||||
//private int interval;
|
||||
//
|
||||
//private int duration;
|
||||
//private int quietTime;
|
||||
//private String action;
|
||||
//private List<LbCondition> conditions;
|
||||
//
|
||||
//public AutoscalePolicy(int interval, int duration, int quietTime, String action, List<LbCondition> conditions) {
|
||||
// this.interval = interval;
|
||||
// this.duration = duration;
|
||||
// this.quietTime = quietTime;
|
||||
// this.conditions = conditions;
|
||||
//}
|
||||
//
|
||||
//public int getInterval() {
|
||||
// return interval;
|
||||
//}
|
||||
//
|
||||
//public int getDuration() {
|
||||
// return duration;
|
||||
//}
|
||||
//
|
||||
//public int getQuietTime() {
|
||||
// return quietTime;
|
||||
//}
|
||||
//
|
||||
//public String getAction() {
|
||||
// return action;
|
||||
//}
|
||||
//
|
||||
//public List<LbCondition> getConditions() {
|
||||
// return conditions;
|
||||
//}
|
||||
//}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,104 +1,104 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.lb;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.api.commands.CreateLBStickinessPolicyCmd;
|
||||
import com.cloud.api.commands.CreateLoadBalancerRuleCmd;
|
||||
import com.cloud.api.commands.ListLBStickinessPoliciesCmd;
|
||||
import com.cloud.api.commands.ListLoadBalancerRuleInstancesCmd;
|
||||
import com.cloud.api.commands.ListLoadBalancerRulesCmd;
|
||||
import com.cloud.api.commands.UpdateLoadBalancerRuleCmd;
|
||||
import com.cloud.exception.InsufficientAddressCapacityException;
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.rules.LoadBalancer;
|
||||
import com.cloud.network.rules.StickinessPolicy;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
public interface LoadBalancingRulesService {
|
||||
/**
|
||||
* Create a load balancer rule from the given ipAddress/port to the given private port
|
||||
*
|
||||
* @param openFirewall
|
||||
* TODO
|
||||
* @param cmd
|
||||
* the command specifying the ip address, public port, protocol, private port, and algorithm
|
||||
* @return the newly created LoadBalancerVO if successful, null otherwise
|
||||
* @throws InsufficientAddressCapacityException
|
||||
*/
|
||||
LoadBalancer createLoadBalancerRule(CreateLoadBalancerRuleCmd lb, boolean openFirewall) throws NetworkRuleConflictException, InsufficientAddressCapacityException;
|
||||
|
||||
LoadBalancer updateLoadBalancerRule(UpdateLoadBalancerRuleCmd cmd);
|
||||
|
||||
boolean deleteLoadBalancerRule(long lbRuleId, boolean apply);
|
||||
|
||||
/**
|
||||
* Create a stickiness policy to a load balancer from the given stickiness method name and parameters in
|
||||
* (name,value) pairs.
|
||||
*
|
||||
* @param cmd
|
||||
* the command specifying the stickiness method name, params (name,value pairs), policy name and
|
||||
* description.
|
||||
* @return the newly created stickiness policy if successfull, null otherwise
|
||||
* @thows NetworkRuleConflictException
|
||||
*/
|
||||
public StickinessPolicy createLBStickinessPolicy(CreateLBStickinessPolicyCmd cmd) throws NetworkRuleConflictException;
|
||||
|
||||
public boolean applyLBStickinessPolicy(CreateLBStickinessPolicyCmd cmd) throws ResourceUnavailableException;
|
||||
|
||||
boolean deleteLBStickinessPolicy(long stickinessPolicyId, boolean apply);
|
||||
/**
|
||||
* Assign a virtual machine, or list of virtual machines, to a load balancer.
|
||||
*/
|
||||
boolean assignToLoadBalancer(long lbRuleId, List<Long> vmIds);
|
||||
|
||||
boolean removeFromLoadBalancer(long lbRuleId, List<Long> vmIds);
|
||||
|
||||
boolean applyLoadBalancerConfig(long lbRuleId) throws ResourceUnavailableException;
|
||||
|
||||
/**
|
||||
* List instances that have either been applied to a load balancer or are eligible to be assigned to a load
|
||||
* balancer.
|
||||
*
|
||||
* @param cmd
|
||||
* @return list of vm instances that have been or can be applied to a load balancer
|
||||
*/
|
||||
List<? extends UserVm> listLoadBalancerInstances(ListLoadBalancerRuleInstancesCmd cmd);
|
||||
|
||||
/**
|
||||
* List load balancer rules based on the given criteria
|
||||
*
|
||||
* @param cmd
|
||||
* the command that specifies the criteria to use for listing load balancers. Load balancers can be
|
||||
* listed
|
||||
* by id, name, public ip, and vm instance id
|
||||
* @return list of load balancers that match the criteria
|
||||
*/
|
||||
List<? extends LoadBalancer> searchForLoadBalancers(ListLoadBalancerRulesCmd cmd);
|
||||
|
||||
/**
|
||||
* List stickiness policies based on the given criteria
|
||||
*
|
||||
* @param cmd
|
||||
* the command specifies the load balancing rule id.
|
||||
* @return list of stickiness policies that match the criteria.
|
||||
*/
|
||||
List<? extends StickinessPolicy> searchForLBStickinessPolicies(ListLBStickinessPoliciesCmd cmd);
|
||||
|
||||
List<LoadBalancingRule> listByNetworkId(long networkId);
|
||||
|
||||
LoadBalancer findById(long LoadBalancer);
|
||||
|
||||
}
|
||||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.lb;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.api.commands.CreateLBStickinessPolicyCmd;
|
||||
import com.cloud.api.commands.CreateLoadBalancerRuleCmd;
|
||||
import com.cloud.api.commands.ListLBStickinessPoliciesCmd;
|
||||
import com.cloud.api.commands.ListLoadBalancerRuleInstancesCmd;
|
||||
import com.cloud.api.commands.ListLoadBalancerRulesCmd;
|
||||
import com.cloud.api.commands.UpdateLoadBalancerRuleCmd;
|
||||
import com.cloud.exception.InsufficientAddressCapacityException;
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.rules.LoadBalancer;
|
||||
import com.cloud.network.rules.StickinessPolicy;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
public interface LoadBalancingRulesService {
|
||||
/**
|
||||
* Create a load balancer rule from the given ipAddress/port to the given private port
|
||||
*
|
||||
* @param openFirewall
|
||||
* TODO
|
||||
* @param cmd
|
||||
* the command specifying the ip address, public port, protocol, private port, and algorithm
|
||||
* @return the newly created LoadBalancerVO if successful, null otherwise
|
||||
* @throws InsufficientAddressCapacityException
|
||||
*/
|
||||
LoadBalancer createLoadBalancerRule(CreateLoadBalancerRuleCmd lb, boolean openFirewall) throws NetworkRuleConflictException, InsufficientAddressCapacityException;
|
||||
|
||||
LoadBalancer updateLoadBalancerRule(UpdateLoadBalancerRuleCmd cmd);
|
||||
|
||||
boolean deleteLoadBalancerRule(long lbRuleId, boolean apply);
|
||||
|
||||
/**
|
||||
* Create a stickiness policy to a load balancer from the given stickiness method name and parameters in
|
||||
* (name,value) pairs.
|
||||
*
|
||||
* @param cmd
|
||||
* the command specifying the stickiness method name, params (name,value pairs), policy name and
|
||||
* description.
|
||||
* @return the newly created stickiness policy if successfull, null otherwise
|
||||
* @thows NetworkRuleConflictException
|
||||
*/
|
||||
public StickinessPolicy createLBStickinessPolicy(CreateLBStickinessPolicyCmd cmd) throws NetworkRuleConflictException;
|
||||
|
||||
public boolean applyLBStickinessPolicy(CreateLBStickinessPolicyCmd cmd) throws ResourceUnavailableException;
|
||||
|
||||
boolean deleteLBStickinessPolicy(long stickinessPolicyId, boolean apply);
|
||||
|
||||
/**
|
||||
* Assign a virtual machine, or list of virtual machines, to a load balancer.
|
||||
*/
|
||||
boolean assignToLoadBalancer(long lbRuleId, List<Long> vmIds);
|
||||
|
||||
boolean removeFromLoadBalancer(long lbRuleId, List<Long> vmIds);
|
||||
|
||||
boolean applyLoadBalancerConfig(long lbRuleId) throws ResourceUnavailableException;
|
||||
|
||||
/**
|
||||
* List instances that have either been applied to a load balancer or are eligible to be assigned to a load
|
||||
* balancer.
|
||||
*
|
||||
* @param cmd
|
||||
* @return list of vm instances that have been or can be applied to a load balancer
|
||||
*/
|
||||
List<? extends UserVm> listLoadBalancerInstances(ListLoadBalancerRuleInstancesCmd cmd);
|
||||
|
||||
/**
|
||||
* List load balancer rules based on the given criteria
|
||||
*
|
||||
* @param cmd
|
||||
* the command that specifies the criteria to use for listing load balancers. Load balancers can be
|
||||
* listed
|
||||
* by id, name, public ip, and vm instance id
|
||||
* @return list of load balancers that match the criteria
|
||||
*/
|
||||
List<? extends LoadBalancer> searchForLoadBalancers(ListLoadBalancerRulesCmd cmd);
|
||||
|
||||
/**
|
||||
* List stickiness policies based on the given criteria
|
||||
*
|
||||
* @param cmd
|
||||
* the command specifies the load balancing rule id.
|
||||
* @return list of stickiness policies that match the criteria.
|
||||
*/
|
||||
List<? extends StickinessPolicy> searchForLBStickinessPolicies(ListLBStickinessPoliciesCmd cmd);
|
||||
|
||||
List<LoadBalancingRule> listByNetworkId(long networkId);
|
||||
|
||||
LoadBalancer findById(long LoadBalancer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
<echo message="Compiling @{top.dir}/src"/>
|
||||
<javac srcdir="@{top.dir}/src" debug="${debug}" debuglevel="${debuglevel}" deprecation="${deprecation}" destdir="${classes.dir}/@{jar.name}"
|
||||
source="${source.compat.version}" target="${target.compat.version}" includeantruntime="false" compiler="javac1.6"
|
||||
memoryinitialsize="512m" memorymaximumsize="1024m" fork="true">
|
||||
memoryinitialsize="256m" memorymaximumsize="512m" fork="true">
|
||||
<!-- compilerarg line="-processor com.cloud.annotation.LocalProcessor -processorpath ${base.dir}/tools/src -Xlint:all"/ -->
|
||||
<!-- compilerarg line="-processor com.cloud.utils.LocalProcessor -processorpath ${base.dir}/utils/src -Xlint:all"/ -->
|
||||
<compilerarg line="-Xlint:-path"/>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ listVirtualMachines=com.cloud.api.commands.ListVMsCmd;15
|
|||
getVMPassword=com.cloud.api.commands.GetVMPasswordCmd;15
|
||||
migrateVirtualMachine=com.cloud.api.commands.MigrateVMCmd;1
|
||||
assignVirtualMachine=com.cloud.api.commands.AssignVMCmd;1
|
||||
restoreVirtualMachine=com.cloud.api.commands.RestoreVMCmd;15
|
||||
restoreVirtualMachine=com.cloud.api.commands.RestoreVMCmd;15
|
||||
|
||||
#### snapshot commands
|
||||
createSnapshot=com.cloud.api.commands.CreateSnapshotCmd;15
|
||||
|
|
@ -128,12 +128,30 @@ createLoadBalancerRule=com.cloud.api.commands.CreateLoadBalancerRuleCmd;15
|
|||
deleteLoadBalancerRule=com.cloud.api.commands.DeleteLoadBalancerRuleCmd;15
|
||||
removeFromLoadBalancerRule=com.cloud.api.commands.RemoveFromLoadBalancerRuleCmd;15
|
||||
assignToLoadBalancerRule=com.cloud.api.commands.AssignToLoadBalancerRuleCmd;15
|
||||
createLBStickinessPolicy=com.cloud.api.commands.CreateLBStickinessPolicyCmd;15
|
||||
deleteLBStickinessPolicy=com.cloud.api.commands.DeleteLBStickinessPolicyCmd;15
|
||||
createLBStickinessPolicy=com.cloud.api.commands.CreateLBStickinessPolicyCmd;15
|
||||
deleteLBStickinessPolicy=com.cloud.api.commands.DeleteLBStickinessPolicyCmd;15
|
||||
listLoadBalancerRules=com.cloud.api.commands.ListLoadBalancerRulesCmd;15
|
||||
listLBStickinessPolicies=com.cloud.api.commands.ListLBStickinessPoliciesCmd;15
|
||||
listLoadBalancerRuleInstances=com.cloud.api.commands.ListLoadBalancerRuleInstancesCmd;15
|
||||
updateLoadBalancerRule=com.cloud.api.commands.UpdateLoadBalancerRuleCmd;15
|
||||
#### autoscale commands
|
||||
createCounter = com.cloud.api.commands.CreateCounterCmd;1
|
||||
createCondition = com.cloud.api.commands.CreateConditionCmd;15
|
||||
createAutoScalePolicy=com.cloud.api.commands.CreateAutoScalePolicyCmd;15
|
||||
createAutoScaleVmProfile=com.cloud.api.commands.CreateAutoScaleVmProfileCmd;15
|
||||
createAutoScaleVmGroup=com.cloud.api.commands.CreateAutoScaleVmGroupCmd;15
|
||||
deleteCounter = com.cloud.api.commands.DeleteCounterCmd;1
|
||||
deleteCondition = com.cloud.api.commands.DeleteConditionCmd;15
|
||||
deleteAutoScalePolicy=com.cloud.api.commands.DeleteAutoScalePolicyCmd;15
|
||||
deleteAutoScaleVmProfile=com.cloud.api.commands.DeleteAutoScaleVmProfileCmd;15
|
||||
deleteAutoScaleVmGroup=com.cloud.api.commands.DeleteAutoScaleVmGroupCmd;15
|
||||
listCounters = com.cloud.api.commands.ListCountersCmd;15
|
||||
listConditions = com.cloud.api.commands.ListConditionsCmd;15
|
||||
listAutoScalePolicies=com.cloud.api.commands.ListAutoScalePoliciesCmd;15
|
||||
listAutoScaleVmProfiles=com.cloud.api.commands.ListAutoScaleVmProfilesCmd;15
|
||||
listAutoScaleVmGroups=com.cloud.api.commands.ListAutoScaleVmGroupsCmd;15
|
||||
enableAutoScaleVmGroup=com.cloud.api.commands.EnableAutoScaleVmGroupCmd;15
|
||||
disableAutoScaleVmGroup=com.cloud.api.commands.DisableAutoScaleVmGroupCmd;15
|
||||
|
||||
#### router commands
|
||||
startRouter=com.cloud.api.commands.StartRouterCmd;7
|
||||
|
|
@ -180,11 +198,11 @@ listAlerts=com.cloud.api.commands.ListAlertsCmd;3
|
|||
|
||||
#### system capacity commands
|
||||
listCapacity=com.cloud.api.commands.ListCapacityCmd;3
|
||||
|
||||
#### swift commands^M
|
||||
addSwift=com.cloud.api.commands.AddSwiftCmd;1
|
||||
listSwifts=com.cloud.api.commands.ListSwiftsCmd;1
|
||||
|
||||
|
||||
#### swift commands^M
|
||||
addSwift=com.cloud.api.commands.AddSwiftCmd;1
|
||||
listSwifts=com.cloud.api.commands.ListSwiftsCmd;1
|
||||
|
||||
|
||||
#### host commands
|
||||
addHost=com.cloud.api.commands.AddHostCmd;3
|
||||
|
|
@ -277,21 +295,21 @@ updateNetwork=com.cloud.api.commands.UpdateNetworkCmd;15
|
|||
registerSSHKeyPair=com.cloud.api.commands.RegisterSSHKeyPairCmd;15
|
||||
createSSHKeyPair=com.cloud.api.commands.CreateSSHKeyPairCmd;15
|
||||
deleteSSHKeyPair=com.cloud.api.commands.DeleteSSHKeyPairCmd;15
|
||||
listSSHKeyPairs=com.cloud.api.commands.ListSSHKeyPairsCmd;15
|
||||
|
||||
listSSHKeyPairs=com.cloud.api.commands.ListSSHKeyPairsCmd;15
|
||||
|
||||
#### Projects commands
|
||||
createProject=com.cloud.api.commands.CreateProjectCmd;15
|
||||
deleteProject=com.cloud.api.commands.DeleteProjectCmd;15
|
||||
updateProject=com.cloud.api.commands.UpdateProjectCmd;15
|
||||
activateProject=com.cloud.api.commands.ActivateProjectCmd;15
|
||||
suspendProject=com.cloud.api.commands.SuspendProjectCmd;15
|
||||
listProjects=com.cloud.api.commands.ListProjectsCmd;15
|
||||
listProjects=com.cloud.api.commands.ListProjectsCmd;15
|
||||
addAccountToProject=com.cloud.api.commands.AddAccountToProjectCmd;15
|
||||
deleteAccountFromProject=com.cloud.api.commands.DeleteAccountFromProjectCmd;15
|
||||
listProjectAccounts=com.cloud.api.commands.ListProjectAccountsCmd;15
|
||||
listProjectInvitations=com.cloud.api.commands.ListProjectInvitationsCmd;15
|
||||
updateProjectInvitation=com.cloud.api.commands.UpdateProjectInvitationCmd;15
|
||||
deleteProjectInvitation=com.cloud.api.commands.DeleteProjectInvitationCmd;15
|
||||
deleteProjectInvitation=com.cloud.api.commands.DeleteProjectInvitationCmd;15
|
||||
|
||||
####
|
||||
createFirewallRule=com.cloud.api.commands.CreateFirewallRuleCmd;15
|
||||
|
|
@ -307,7 +325,7 @@ createPhysicalNetwork=com.cloud.api.commands.CreatePhysicalNetworkCmd;1
|
|||
deletePhysicalNetwork=com.cloud.api.commands.DeletePhysicalNetworkCmd;1
|
||||
listPhysicalNetworks=com.cloud.api.commands.ListPhysicalNetworksCmd;1
|
||||
updatePhysicalNetwork=com.cloud.api.commands.UpdatePhysicalNetworkCmd;1
|
||||
|
||||
|
||||
#### Physical Network Service Provider commands
|
||||
listSupportedNetworkServices=com.cloud.api.commands.ListSupportedNetworkServicesCmd;1
|
||||
addNetworkServiceProvider=com.cloud.api.commands.AddNetworkServiceProviderCmd;1
|
||||
|
|
@ -320,13 +338,13 @@ addTrafficType=com.cloud.api.commands.AddTrafficTypeCmd;1
|
|||
deleteTrafficType=com.cloud.api.commands.DeleteTrafficTypeCmd;1
|
||||
listTrafficTypes=com.cloud.api.commands.ListTrafficTypesCmd;1
|
||||
updateTrafficType=com.cloud.api.commands.UpdateTrafficTypeCmd;1
|
||||
listTrafficTypeImplementors=com.cloud.api.commands.ListTrafficTypeImplementorsCmd;1
|
||||
listTrafficTypeImplementors=com.cloud.api.commands.ListTrafficTypeImplementorsCmd;1
|
||||
|
||||
#### Storage Network commands
|
||||
createStorageNetworkIpRange=com.cloud.api.commands.CreateStorageNetworkIpRangeCmd;1
|
||||
deleteStorageNetworkIpRange=com.cloud.api.commands.DeleteStorageNetworkIpRangeCmd;1
|
||||
listStorageNetworkIpRange=com.cloud.api.commands.listStorageNetworkIpRangeCmd;1
|
||||
updateStorageNetworkIpRange=com.cloud.api.commands.UpdateStorageNetworkIpRangeCmd;1
|
||||
updateStorageNetworkIpRange=com.cloud.api.commands.UpdateStorageNetworkIpRangeCmd;1
|
||||
|
||||
#### Network Devices commands
|
||||
addNetworkDevice=com.cloud.api.commands.AddNetworkDeviceCmd;1
|
||||
|
|
@ -365,16 +383,16 @@ listNetworkACLs=com.cloud.api.commands.ListNetworkACLsCmd;15
|
|||
createStaticRoute=com.cloud.api.commands.CreateStaticRouteCmd;15
|
||||
deleteStaticRoute=com.cloud.api.commands.DeleteStaticRouteCmd;15
|
||||
listStaticRoutes=com.cloud.api.commands.ListStaticRoutesCmd;15
|
||||
|
||||
### Site-to-site VPN commands
|
||||
createVpnCustomerGateway=com.cloud.api.commands.CreateVpnCustomerGatewayCmd;1
|
||||
createVpnGateway=com.cloud.api.commands.CreateVpnGatewayCmd;1
|
||||
createVpnConnection=com.cloud.api.commands.CreateVpnConnectionCmd;1
|
||||
deleteVpnCustomerGateway=com.cloud.api.commands.DeleteVpnCustomerGatewayCmd;1
|
||||
deleteVpnGateway=com.cloud.api.commands.DeleteVpnGatewayCmd;1
|
||||
deleteVpnConnection=com.cloud.api.commands.DeleteVpnConnectionCmd;1
|
||||
updateVpnCustomerGateway=com.cloud.api.commands.UpdateVpnCustomerGatewayCmd;1
|
||||
resetVpnConnection=com.cloud.api.commands.ResetVpnConnectionCmd;1
|
||||
listVpnCustomerGateways=com.cloud.api.commands.ListVpnCustomerGatewaysCmd;15
|
||||
listVpnGateways=com.cloud.api.commands.ListVpnGatewaysCmd;15
|
||||
listVpnConnections=com.cloud.api.commands.ListVpnConnectionsCmd;15
|
||||
|
||||
### Site-to-site VPN commands
|
||||
createVpnCustomerGateway=com.cloud.api.commands.CreateVpnCustomerGatewayCmd;1
|
||||
createVpnGateway=com.cloud.api.commands.CreateVpnGatewayCmd;1
|
||||
createVpnConnection=com.cloud.api.commands.CreateVpnConnectionCmd;1
|
||||
deleteVpnCustomerGateway=com.cloud.api.commands.DeleteVpnCustomerGatewayCmd;1
|
||||
deleteVpnGateway=com.cloud.api.commands.DeleteVpnGatewayCmd;1
|
||||
deleteVpnConnection=com.cloud.api.commands.DeleteVpnConnectionCmd;1
|
||||
updateVpnCustomerGateway=com.cloud.api.commands.UpdateVpnCustomerGatewayCmd;1
|
||||
resetVpnConnection=com.cloud.api.commands.ResetVpnConnectionCmd;1
|
||||
listVpnCustomerGateways=com.cloud.api.commands.ListVpnCustomerGatewaysCmd;15
|
||||
listVpnGateways=com.cloud.api.commands.ListVpnGatewaysCmd;15
|
||||
listVpnConnections=com.cloud.api.commands.ListVpnConnectionsCmd;15
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,460 +1,475 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.configuration;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.cloud.agent.manager.ClusteredAgentManagerImpl;
|
||||
import com.cloud.alert.AlertManagerImpl;
|
||||
import com.cloud.alert.dao.AlertDaoImpl;
|
||||
import com.cloud.async.AsyncJobExecutorContextImpl;
|
||||
import com.cloud.async.AsyncJobManagerImpl;
|
||||
import com.cloud.async.SyncQueueManagerImpl;
|
||||
import com.cloud.async.dao.AsyncJobDaoImpl;
|
||||
import com.cloud.async.dao.SyncQueueDaoImpl;
|
||||
import com.cloud.async.dao.SyncQueueItemDaoImpl;
|
||||
import com.cloud.capacity.CapacityManagerImpl;
|
||||
import com.cloud.capacity.dao.CapacityDaoImpl;
|
||||
import com.cloud.certificate.dao.CertificateDaoImpl;
|
||||
import com.cloud.cluster.CheckPointManagerImpl;
|
||||
import com.cloud.cluster.ClusterFenceManagerImpl;
|
||||
import com.cloud.cluster.ClusterManagerImpl;
|
||||
import com.cloud.cluster.agentlb.dao.HostTransferMapDaoImpl;
|
||||
import com.cloud.cluster.dao.ManagementServerHostDaoImpl;
|
||||
import com.cloud.cluster.dao.ManagementServerHostPeerDaoImpl;
|
||||
import com.cloud.cluster.dao.StackMaidDaoImpl;
|
||||
import com.cloud.configuration.dao.ConfigurationDaoImpl;
|
||||
import com.cloud.configuration.dao.ResourceCountDaoImpl;
|
||||
import com.cloud.configuration.dao.ResourceLimitDaoImpl;
|
||||
import com.cloud.consoleproxy.ConsoleProxyManagerImpl;
|
||||
import com.cloud.dao.EntityManager;
|
||||
import com.cloud.dao.EntityManagerImpl;
|
||||
import com.cloud.dc.ClusterDetailsDaoImpl;
|
||||
import com.cloud.dc.dao.AccountVlanMapDaoImpl;
|
||||
import com.cloud.dc.dao.ClusterDaoImpl;
|
||||
import com.cloud.dc.dao.ClusterVSMMapDaoImpl;
|
||||
import com.cloud.dc.dao.DataCenterDaoImpl;
|
||||
import com.cloud.dc.dao.DataCenterIpAddressDaoImpl;
|
||||
import com.cloud.dc.dao.DcDetailsDaoImpl;
|
||||
import com.cloud.dc.dao.HostPodDaoImpl;
|
||||
import com.cloud.dc.dao.PodVlanMapDaoImpl;
|
||||
import com.cloud.dc.dao.StorageNetworkIpAddressDaoImpl;
|
||||
import com.cloud.dc.dao.StorageNetworkIpRangeDaoImpl;
|
||||
import com.cloud.dc.dao.VlanDaoImpl;
|
||||
import com.cloud.domain.dao.DomainDaoImpl;
|
||||
import com.cloud.event.dao.EventDaoImpl;
|
||||
import com.cloud.event.dao.UsageEventDaoImpl;
|
||||
import com.cloud.ha.HighAvailabilityManagerImpl;
|
||||
import com.cloud.ha.dao.HighAvailabilityDaoImpl;
|
||||
import com.cloud.host.dao.HostDaoImpl;
|
||||
import com.cloud.host.dao.HostDetailsDaoImpl;
|
||||
import com.cloud.host.dao.HostTagsDaoImpl;
|
||||
import com.cloud.hypervisor.HypervisorGuruManagerImpl;
|
||||
import com.cloud.hypervisor.dao.HypervisorCapabilitiesDaoImpl;
|
||||
import com.cloud.keystore.KeystoreDaoImpl;
|
||||
import com.cloud.keystore.KeystoreManagerImpl;
|
||||
import com.cloud.maint.UpgradeManagerImpl;
|
||||
import com.cloud.maint.dao.AgentUpgradeDaoImpl;
|
||||
import com.cloud.network.ExternalLoadBalancerUsageManagerImpl;
|
||||
import com.cloud.network.NetworkManagerImpl;
|
||||
import com.cloud.network.StorageNetworkManagerImpl;
|
||||
import com.cloud.network.dao.CiscoNexusVSMDeviceDaoImpl;
|
||||
import com.cloud.network.dao.ExternalFirewallDeviceDaoImpl;
|
||||
import com.cloud.network.dao.ExternalLoadBalancerDeviceDaoImpl;
|
||||
import com.cloud.network.dao.FirewallRulesCidrsDaoImpl;
|
||||
import com.cloud.network.dao.FirewallRulesDaoImpl;
|
||||
import com.cloud.network.dao.IPAddressDaoImpl;
|
||||
import com.cloud.network.dao.InlineLoadBalancerNicMapDaoImpl;
|
||||
import com.cloud.network.dao.LBStickinessPolicyDaoImpl;
|
||||
import com.cloud.network.dao.LoadBalancerDaoImpl;
|
||||
import com.cloud.network.dao.LoadBalancerVMMapDaoImpl;
|
||||
import com.cloud.network.dao.NetworkDaoImpl;
|
||||
import com.cloud.network.dao.NetworkDomainDaoImpl;
|
||||
import com.cloud.network.dao.NetworkExternalFirewallDaoImpl;
|
||||
import com.cloud.network.dao.NetworkExternalLoadBalancerDaoImpl;
|
||||
import com.cloud.network.dao.NetworkRuleConfigDaoImpl;
|
||||
import com.cloud.network.dao.NetworkServiceMapDaoImpl;
|
||||
import com.cloud.network.dao.PhysicalNetworkDaoImpl;
|
||||
import com.cloud.network.dao.PhysicalNetworkServiceProviderDaoImpl;
|
||||
import com.cloud.network.dao.PhysicalNetworkTrafficTypeDaoImpl;
|
||||
import com.cloud.network.dao.PortProfileDaoImpl;
|
||||
import com.cloud.network.dao.RemoteAccessVpnDaoImpl;
|
||||
import com.cloud.network.dao.Site2SiteCustomerGatewayDaoImpl;
|
||||
import com.cloud.network.dao.Site2SiteVpnConnectionDaoImpl;
|
||||
import com.cloud.network.dao.Site2SiteVpnGatewayDaoImpl;
|
||||
import com.cloud.network.dao.VirtualRouterProviderDaoImpl;
|
||||
import com.cloud.network.dao.VpnUserDaoImpl;
|
||||
import com.cloud.network.element.CiscoNexusVSMElement;
|
||||
import com.cloud.network.element.CiscoNexusVSMElementService;
|
||||
import com.cloud.network.element.F5ExternalLoadBalancerElement;
|
||||
import com.cloud.network.element.F5ExternalLoadBalancerElementService;
|
||||
import com.cloud.network.element.JuniperSRXExternalFirewallElement;
|
||||
import com.cloud.network.element.JuniperSRXFirewallElementService;
|
||||
import com.cloud.network.element.NetscalerElement;
|
||||
import com.cloud.network.element.NetscalerLoadBalancerElementService;
|
||||
import com.cloud.network.element.VirtualRouterElement;
|
||||
import com.cloud.network.element.VirtualRouterElementService;
|
||||
import com.cloud.network.firewall.FirewallManagerImpl;
|
||||
import com.cloud.network.lb.ElasticLoadBalancerManagerImpl;
|
||||
import com.cloud.network.lb.LoadBalancingRulesManagerImpl;
|
||||
import com.cloud.network.lb.dao.ElasticLbVmMapDaoImpl;
|
||||
import com.cloud.network.ovs.OvsTunnelManagerImpl;
|
||||
import com.cloud.network.ovs.dao.OvsTunnelInterfaceDaoImpl;
|
||||
import com.cloud.network.ovs.dao.OvsTunnelNetworkDaoImpl;
|
||||
import com.cloud.network.router.VirtualNetworkApplianceManagerImpl;
|
||||
import com.cloud.network.router.VpcVirtualNetworkApplianceManagerImpl;
|
||||
import com.cloud.network.rules.RulesManagerImpl;
|
||||
import com.cloud.network.rules.dao.PortForwardingRulesDaoImpl;
|
||||
import com.cloud.network.security.SecurityGroupManagerImpl2;
|
||||
import com.cloud.network.security.dao.SecurityGroupDaoImpl;
|
||||
import com.cloud.network.security.dao.SecurityGroupRuleDaoImpl;
|
||||
import com.cloud.network.security.dao.SecurityGroupRulesDaoImpl;
|
||||
import com.cloud.network.security.dao.SecurityGroupVMMapDaoImpl;
|
||||
import com.cloud.network.security.dao.SecurityGroupWorkDaoImpl;
|
||||
import com.cloud.network.security.dao.VmRulesetLogDaoImpl;
|
||||
import com.cloud.network.vpc.NetworkACLManagerImpl;
|
||||
import com.cloud.network.vpc.VpcManagerImpl;
|
||||
import com.cloud.network.vpc.Dao.PrivateIpDaoImpl;
|
||||
import com.cloud.network.vpc.Dao.StaticRouteDaoImpl;
|
||||
import com.cloud.network.vpc.Dao.VpcDaoImpl;
|
||||
import com.cloud.network.vpc.Dao.VpcGatewayDaoImpl;
|
||||
import com.cloud.network.vpc.Dao.VpcOfferingDaoImpl;
|
||||
import com.cloud.network.vpc.Dao.VpcOfferingServiceMapDaoImpl;
|
||||
import com.cloud.network.vpn.RemoteAccessVpnManagerImpl;
|
||||
import com.cloud.network.vpn.Site2SiteVpnManagerImpl;
|
||||
import com.cloud.offerings.dao.NetworkOfferingDaoImpl;
|
||||
import com.cloud.offerings.dao.NetworkOfferingServiceMapDaoImpl;
|
||||
import com.cloud.projects.ProjectManagerImpl;
|
||||
import com.cloud.projects.dao.ProjectAccountDaoImpl;
|
||||
import com.cloud.projects.dao.ProjectDaoImpl;
|
||||
import com.cloud.projects.dao.ProjectInvitationDaoImpl;
|
||||
import com.cloud.resource.ResourceManagerImpl;
|
||||
import com.cloud.resourcelimit.ResourceLimitManagerImpl;
|
||||
import com.cloud.service.dao.ServiceOfferingDaoImpl;
|
||||
import com.cloud.storage.OCFS2ManagerImpl;
|
||||
import com.cloud.storage.StorageManagerImpl;
|
||||
import com.cloud.storage.dao.DiskOfferingDaoImpl;
|
||||
import com.cloud.storage.dao.GuestOSCategoryDaoImpl;
|
||||
import com.cloud.storage.dao.GuestOSDaoImpl;
|
||||
import com.cloud.storage.dao.LaunchPermissionDaoImpl;
|
||||
import com.cloud.storage.dao.SnapshotDaoImpl;
|
||||
import com.cloud.storage.dao.SnapshotPolicyDaoImpl;
|
||||
import com.cloud.storage.dao.SnapshotScheduleDaoImpl;
|
||||
import com.cloud.storage.dao.StoragePoolDaoImpl;
|
||||
import com.cloud.storage.dao.StoragePoolHostDaoImpl;
|
||||
import com.cloud.storage.dao.StoragePoolWorkDaoImpl;
|
||||
import com.cloud.storage.dao.SwiftDaoImpl;
|
||||
import com.cloud.storage.dao.UploadDaoImpl;
|
||||
import com.cloud.storage.dao.VMTemplateDaoImpl;
|
||||
import com.cloud.storage.dao.VMTemplateDetailsDaoImpl;
|
||||
import com.cloud.storage.dao.VMTemplateHostDaoImpl;
|
||||
import com.cloud.storage.dao.VMTemplatePoolDaoImpl;
|
||||
import com.cloud.storage.dao.VMTemplateSwiftDaoImpl;
|
||||
import com.cloud.storage.dao.VMTemplateZoneDaoImpl;
|
||||
import com.cloud.storage.dao.VolumeDaoImpl;
|
||||
import com.cloud.storage.dao.VolumeHostDaoImpl;
|
||||
import com.cloud.storage.download.DownloadMonitorImpl;
|
||||
import com.cloud.storage.secondary.SecondaryStorageManagerImpl;
|
||||
import com.cloud.storage.snapshot.SnapshotManagerImpl;
|
||||
import com.cloud.storage.snapshot.SnapshotSchedulerImpl;
|
||||
import com.cloud.storage.swift.SwiftManagerImpl;
|
||||
import com.cloud.storage.upload.UploadMonitorImpl;
|
||||
import com.cloud.tags.TaggedResourceManagerImpl;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
import com.cloud.template.HyervisorTemplateAdapter;
|
||||
import com.cloud.template.TemplateAdapter;
|
||||
import com.cloud.template.TemplateAdapter.TemplateAdapterType;
|
||||
import com.cloud.template.TemplateManagerImpl;
|
||||
import com.cloud.user.AccountDetailsDaoImpl;
|
||||
import com.cloud.user.AccountManagerImpl;
|
||||
import com.cloud.user.DomainManagerImpl;
|
||||
import com.cloud.user.dao.AccountDaoImpl;
|
||||
import com.cloud.user.dao.SSHKeyPairDaoImpl;
|
||||
import com.cloud.user.dao.UserAccountDaoImpl;
|
||||
import com.cloud.user.dao.UserDaoImpl;
|
||||
import com.cloud.user.dao.UserStatisticsDaoImpl;
|
||||
import com.cloud.user.dao.UserStatsLogDaoImpl;
|
||||
import com.cloud.utils.component.Adapter;
|
||||
import com.cloud.utils.component.ComponentLibrary;
|
||||
import com.cloud.utils.component.ComponentLibraryBase;
|
||||
import com.cloud.utils.component.ComponentLocator.ComponentInfo;
|
||||
import com.cloud.utils.component.Manager;
|
||||
import com.cloud.utils.component.PluggableService;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
import com.cloud.uuididentity.IdentityServiceImpl;
|
||||
import com.cloud.uuididentity.dao.IdentityDaoImpl;
|
||||
import com.cloud.vm.ClusteredVirtualMachineManagerImpl;
|
||||
import com.cloud.vm.ItWorkDaoImpl;
|
||||
import com.cloud.vm.UserVmManagerImpl;
|
||||
import com.cloud.vm.dao.ConsoleProxyDaoImpl;
|
||||
import com.cloud.vm.dao.DomainRouterDaoImpl;
|
||||
import com.cloud.vm.dao.InstanceGroupDaoImpl;
|
||||
import com.cloud.vm.dao.InstanceGroupVMMapDaoImpl;
|
||||
import com.cloud.vm.dao.NicDaoImpl;
|
||||
import com.cloud.vm.dao.SecondaryStorageVmDaoImpl;
|
||||
import com.cloud.vm.dao.UserVmDaoImpl;
|
||||
import com.cloud.vm.dao.UserVmDetailsDaoImpl;
|
||||
import com.cloud.vm.dao.VMInstanceDaoImpl;
|
||||
|
||||
|
||||
public class DefaultComponentLibrary extends ComponentLibraryBase implements ComponentLibrary {
|
||||
protected void populateDaos() {
|
||||
addDao("StackMaidDao", StackMaidDaoImpl.class);
|
||||
addDao("VMTemplateZoneDao", VMTemplateZoneDaoImpl.class);
|
||||
addDao("VMTemplateDetailsDao", VMTemplateDetailsDaoImpl.class);
|
||||
addDao("DomainRouterDao", DomainRouterDaoImpl.class);
|
||||
addDao("HostDao", HostDaoImpl.class);
|
||||
addDao("VMInstanceDao", VMInstanceDaoImpl.class);
|
||||
addDao("UserVmDao", UserVmDaoImpl.class);
|
||||
ComponentInfo<? extends GenericDao<?, ? extends Serializable>> info = addDao("ServiceOfferingDao", ServiceOfferingDaoImpl.class);
|
||||
info.addParameter("cache.size", "50");
|
||||
info.addParameter("cache.time.to.live", "600");
|
||||
info = addDao("DiskOfferingDao", DiskOfferingDaoImpl.class);
|
||||
info.addParameter("cache.size", "50");
|
||||
info.addParameter("cache.time.to.live", "600");
|
||||
info = addDao("DataCenterDao", DataCenterDaoImpl.class);
|
||||
info.addParameter("cache.size", "50");
|
||||
info.addParameter("cache.time.to.live", "600");
|
||||
info = addDao("HostPodDao", HostPodDaoImpl.class);
|
||||
info.addParameter("cache.size", "50");
|
||||
info.addParameter("cache.time.to.live", "600");
|
||||
addDao("IPAddressDao", IPAddressDaoImpl.class);
|
||||
info = addDao("VlanDao", VlanDaoImpl.class);
|
||||
info.addParameter("cache.size", "30");
|
||||
info.addParameter("cache.time.to.live", "3600");
|
||||
addDao("PodVlanMapDao", PodVlanMapDaoImpl.class);
|
||||
addDao("AccountVlanMapDao", AccountVlanMapDaoImpl.class);
|
||||
addDao("VolumeDao", VolumeDaoImpl.class);
|
||||
addDao("EventDao", EventDaoImpl.class);
|
||||
info = addDao("UserDao", UserDaoImpl.class);
|
||||
info.addParameter("cache.size", "5000");
|
||||
info.addParameter("cache.time.to.live", "300");
|
||||
addDao("UserStatisticsDao", UserStatisticsDaoImpl.class);
|
||||
addDao("UserStatsLogDao", UserStatsLogDaoImpl.class);
|
||||
addDao("FirewallRulesDao", FirewallRulesDaoImpl.class);
|
||||
addDao("LoadBalancerDao", LoadBalancerDaoImpl.class);
|
||||
addDao("NetworkRuleConfigDao", NetworkRuleConfigDaoImpl.class);
|
||||
addDao("LoadBalancerVMMapDao", LoadBalancerVMMapDaoImpl.class);
|
||||
addDao("LBStickinessPolicyDao", LBStickinessPolicyDaoImpl.class);
|
||||
addDao("DataCenterIpAddressDao", DataCenterIpAddressDaoImpl.class);
|
||||
addDao("SecurityGroupDao", SecurityGroupDaoImpl.class);
|
||||
addDao("SecurityGroupRuleDao", SecurityGroupRuleDaoImpl.class);
|
||||
addDao("SecurityGroupVMMapDao", SecurityGroupVMMapDaoImpl.class);
|
||||
addDao("SecurityGroupRulesDao", SecurityGroupRulesDaoImpl.class);
|
||||
addDao("SecurityGroupWorkDao", SecurityGroupWorkDaoImpl.class);
|
||||
addDao("VmRulesetLogDao", VmRulesetLogDaoImpl.class);
|
||||
addDao("AlertDao", AlertDaoImpl.class);
|
||||
addDao("CapacityDao", CapacityDaoImpl.class);
|
||||
addDao("DomainDao", DomainDaoImpl.class);
|
||||
addDao("AccountDao", AccountDaoImpl.class);
|
||||
addDao("ResourceLimitDao", ResourceLimitDaoImpl.class);
|
||||
addDao("ResourceCountDao", ResourceCountDaoImpl.class);
|
||||
addDao("UserAccountDao", UserAccountDaoImpl.class);
|
||||
addDao("VMTemplateHostDao", VMTemplateHostDaoImpl.class);
|
||||
addDao("VolumeHostDao", VolumeHostDaoImpl.class);
|
||||
addDao("VMTemplateSwiftDao", VMTemplateSwiftDaoImpl.class);
|
||||
addDao("UploadDao", UploadDaoImpl.class);
|
||||
addDao("VMTemplatePoolDao", VMTemplatePoolDaoImpl.class);
|
||||
addDao("LaunchPermissionDao", LaunchPermissionDaoImpl.class);
|
||||
addDao("ConfigurationDao", ConfigurationDaoImpl.class);
|
||||
info = addDao("VMTemplateDao", VMTemplateDaoImpl.class);
|
||||
info.addParameter("cache.size", "100");
|
||||
info.addParameter("cache.time.to.live", "600");
|
||||
info.addParameter("routing.uniquename", "routing");
|
||||
addDao("HighAvailabilityDao", HighAvailabilityDaoImpl.class);
|
||||
addDao("ConsoleProxyDao", ConsoleProxyDaoImpl.class);
|
||||
addDao("SecondaryStorageVmDao", SecondaryStorageVmDaoImpl.class);
|
||||
addDao("ManagementServerHostDao", ManagementServerHostDaoImpl.class);
|
||||
addDao("ManagementServerHostPeerDao", ManagementServerHostPeerDaoImpl.class);
|
||||
addDao("AgentUpgradeDao", AgentUpgradeDaoImpl.class);
|
||||
addDao("SnapshotDao", SnapshotDaoImpl.class);
|
||||
addDao("AsyncJobDao", AsyncJobDaoImpl.class);
|
||||
addDao("SyncQueueDao", SyncQueueDaoImpl.class);
|
||||
addDao("SyncQueueItemDao", SyncQueueItemDaoImpl.class);
|
||||
addDao("GuestOSDao", GuestOSDaoImpl.class);
|
||||
addDao("GuestOSCategoryDao", GuestOSCategoryDaoImpl.class);
|
||||
addDao("StoragePoolDao", StoragePoolDaoImpl.class);
|
||||
addDao("StoragePoolHostDao", StoragePoolHostDaoImpl.class);
|
||||
addDao("DetailsDao", HostDetailsDaoImpl.class);
|
||||
addDao("SnapshotPolicyDao", SnapshotPolicyDaoImpl.class);
|
||||
addDao("SnapshotScheduleDao", SnapshotScheduleDaoImpl.class);
|
||||
addDao("ClusterDao", ClusterDaoImpl.class);
|
||||
addDao("CertificateDao", CertificateDaoImpl.class);
|
||||
addDao("NetworkConfigurationDao", NetworkDaoImpl.class);
|
||||
addDao("NetworkOfferingDao", NetworkOfferingDaoImpl.class);
|
||||
addDao("NicDao", NicDaoImpl.class);
|
||||
addDao("InstanceGroupDao", InstanceGroupDaoImpl.class);
|
||||
addDao("InstanceGroupVMMapDao", InstanceGroupVMMapDaoImpl.class);
|
||||
addDao("RemoteAccessVpnDao", RemoteAccessVpnDaoImpl.class);
|
||||
addDao("VpnUserDao", VpnUserDaoImpl.class);
|
||||
addDao("ItWorkDao", ItWorkDaoImpl.class);
|
||||
addDao("FirewallRulesDao", FirewallRulesDaoImpl.class);
|
||||
addDao("PortForwardingRulesDao", PortForwardingRulesDaoImpl.class);
|
||||
addDao("FirewallRulesCidrsDao", FirewallRulesCidrsDaoImpl.class);
|
||||
addDao("SSHKeyPairDao", SSHKeyPairDaoImpl.class);
|
||||
addDao("UsageEventDao", UsageEventDaoImpl.class);
|
||||
addDao("ClusterDetailsDao", ClusterDetailsDaoImpl.class);
|
||||
addDao("UserVmDetailsDao", UserVmDetailsDaoImpl.class);
|
||||
addDao("OvsTunnelInterfaceDao", OvsTunnelInterfaceDaoImpl.class);
|
||||
addDao("OvsTunnelAccountDao", OvsTunnelNetworkDaoImpl.class);
|
||||
addDao("StoragePoolWorkDao", StoragePoolWorkDaoImpl.class);
|
||||
addDao("HostTagsDao", HostTagsDaoImpl.class);
|
||||
addDao("NetworkDomainDao", NetworkDomainDaoImpl.class);
|
||||
addDao("KeystoreDao", KeystoreDaoImpl.class);
|
||||
addDao("DcDetailsDao", DcDetailsDaoImpl.class);
|
||||
addDao("SwiftDao", SwiftDaoImpl.class);
|
||||
addDao("AgentTransferMapDao", HostTransferMapDaoImpl.class);
|
||||
addDao("ProjectDao", ProjectDaoImpl.class);
|
||||
addDao("InlineLoadBalancerNicMapDao", InlineLoadBalancerNicMapDaoImpl.class);
|
||||
addDao("ElasticLbVmMap", ElasticLbVmMapDaoImpl.class);
|
||||
addDao("ProjectsAccountDao", ProjectAccountDaoImpl.class);
|
||||
addDao("ProjectInvitationDao", ProjectInvitationDaoImpl.class);
|
||||
addDao("IdentityDao", IdentityDaoImpl.class);
|
||||
addDao("AccountDetailsDao", AccountDetailsDaoImpl.class);
|
||||
addDao("NetworkOfferingServiceMapDao", NetworkOfferingServiceMapDaoImpl.class);
|
||||
info = addDao("HypervisorCapabilitiesDao",HypervisorCapabilitiesDaoImpl.class);
|
||||
info.addParameter("cache.size", "100");
|
||||
info.addParameter("cache.time.to.live", "600");
|
||||
addDao("PhysicalNetworkDao", PhysicalNetworkDaoImpl.class);
|
||||
addDao("PhysicalNetworkServiceProviderDao", PhysicalNetworkServiceProviderDaoImpl.class);
|
||||
addDao("VirtualRouterProviderDao", VirtualRouterProviderDaoImpl.class);
|
||||
addDao("ExternalLoadBalancerDeviceDao", ExternalLoadBalancerDeviceDaoImpl.class);
|
||||
addDao("ExternalFirewallDeviceDao", ExternalFirewallDeviceDaoImpl.class);
|
||||
addDao("NetworkExternalLoadBalancerDao", NetworkExternalLoadBalancerDaoImpl.class);
|
||||
addDao("NetworkExternalFirewallDao", NetworkExternalFirewallDaoImpl.class);
|
||||
addDao("CiscoNexusVSMDeviceDao", CiscoNexusVSMDeviceDaoImpl.class);
|
||||
addDao("ClusterVSMMapDao", ClusterVSMMapDaoImpl.class);
|
||||
addDao("PortProfileDao", PortProfileDaoImpl.class);
|
||||
addDao("PhysicalNetworkTrafficTypeDao", PhysicalNetworkTrafficTypeDaoImpl.class);
|
||||
addDao("NetworkServiceMapDao", NetworkServiceMapDaoImpl.class);
|
||||
addDao("StorageNetworkIpAddressDao", StorageNetworkIpAddressDaoImpl.class);
|
||||
addDao("StorageNetworkIpRangeDao", StorageNetworkIpRangeDaoImpl.class);
|
||||
addDao("TagsDao", ResourceTagsDaoImpl.class);
|
||||
addDao("VpcDao", VpcDaoImpl.class);
|
||||
addDao("VpcOfferingDao", VpcOfferingDaoImpl.class);
|
||||
addDao("VpcOfferingServiceMapDao", VpcOfferingServiceMapDaoImpl.class);
|
||||
addDao("PrivateIpDao", PrivateIpDaoImpl.class);
|
||||
addDao("VpcGatewayDao", VpcGatewayDaoImpl.class);
|
||||
addDao("StaticRouteDao", StaticRouteDaoImpl.class);
|
||||
addDao("Site2SiteVpnGatewayDao", Site2SiteVpnGatewayDaoImpl.class);
|
||||
addDao("Site2SiteCustomerGatewayDao", Site2SiteCustomerGatewayDaoImpl.class);
|
||||
addDao("Site2SiteVpnConnnectionDao", Site2SiteVpnConnectionDaoImpl.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Map<String, ComponentInfo<GenericDao<?, ?>>> getDaos() {
|
||||
if (_daos.size() == 0) {
|
||||
populateDaos();
|
||||
}
|
||||
return _daos;
|
||||
}
|
||||
|
||||
protected void populateManagers() {
|
||||
addManager("StackMaidManager", CheckPointManagerImpl.class);
|
||||
addManager("Cluster Manager", ClusterManagerImpl.class);
|
||||
addManager("ClusterFenceManager", ClusterFenceManagerImpl.class);
|
||||
addManager("ClusteredAgentManager", ClusteredAgentManagerImpl.class);
|
||||
addManager("SyncQueueManager", SyncQueueManagerImpl.class);
|
||||
addManager("AsyncJobManager", AsyncJobManagerImpl.class);
|
||||
addManager("AsyncJobExecutorContext", AsyncJobExecutorContextImpl.class);
|
||||
addManager("configuration manager", ConfigurationManagerImpl.class);
|
||||
addManager("account manager", AccountManagerImpl.class);
|
||||
addManager("domain manager", DomainManagerImpl.class);
|
||||
addManager("resource limit manager", ResourceLimitManagerImpl.class);
|
||||
addManager("network manager", NetworkManagerImpl.class);
|
||||
addManager("download manager", DownloadMonitorImpl.class);
|
||||
addManager("upload manager", UploadMonitorImpl.class);
|
||||
addManager("keystore manager", KeystoreManagerImpl.class);
|
||||
addManager("secondary storage vm manager", SecondaryStorageManagerImpl.class);
|
||||
addManager("vm manager", UserVmManagerImpl.class);
|
||||
addManager("upgrade manager", UpgradeManagerImpl.class);
|
||||
addManager("StorageManager", StorageManagerImpl.class);
|
||||
addManager("Alert Manager", AlertManagerImpl.class);
|
||||
addManager("Template Manager", TemplateManagerImpl.class);
|
||||
addManager("Snapshot Manager", SnapshotManagerImpl.class);
|
||||
addManager("SnapshotScheduler", SnapshotSchedulerImpl.class);
|
||||
addManager("SecurityGroupManager", SecurityGroupManagerImpl2.class);
|
||||
addManager("DomainRouterManager", VirtualNetworkApplianceManagerImpl.class);
|
||||
addManager("EntityManager", EntityManagerImpl.class);
|
||||
addManager("LoadBalancingRulesManager", LoadBalancingRulesManagerImpl.class);
|
||||
addManager("RulesManager", RulesManagerImpl.class);
|
||||
addManager("RemoteAccessVpnManager", RemoteAccessVpnManagerImpl.class);
|
||||
addManager("OvsTunnelManager", OvsTunnelManagerImpl.class);
|
||||
addManager("Capacity Manager", CapacityManagerImpl.class);
|
||||
addManager("VirtualMachineManager", ClusteredVirtualMachineManagerImpl.class);
|
||||
addManager("HypervisorGuruManager", HypervisorGuruManagerImpl.class);
|
||||
addManager("ResourceManager", ResourceManagerImpl.class);
|
||||
addManager("IdentityManager", IdentityServiceImpl.class);
|
||||
addManager("OCFS2Manager", OCFS2ManagerImpl.class);
|
||||
addManager("FirewallManager", FirewallManagerImpl.class);
|
||||
ComponentInfo<? extends Manager> info = addManager("ConsoleProxyManager", ConsoleProxyManagerImpl.class);
|
||||
info.addParameter("consoleproxy.sslEnabled", "true");
|
||||
addManager("ProjectManager", ProjectManagerImpl.class);
|
||||
addManager("ElasticLoadBalancerManager", ElasticLoadBalancerManagerImpl.class);
|
||||
addManager("SwiftManager", SwiftManagerImpl.class);
|
||||
addManager("StorageNetworkManager", StorageNetworkManagerImpl.class);
|
||||
addManager("ExternalLoadBalancerUsageManager", ExternalLoadBalancerUsageManagerImpl.class);
|
||||
addManager("HA Manager", HighAvailabilityManagerImpl.class);
|
||||
addManager("TaggedResourcesManager", TaggedResourceManagerImpl.class);
|
||||
addManager("VPC Manager", VpcManagerImpl.class);
|
||||
addManager("VpcVirtualRouterManager", VpcVirtualNetworkApplianceManagerImpl.class);
|
||||
addManager("NetworkACLManager", NetworkACLManagerImpl.class);
|
||||
addManager("Site2SiteVpnManager", Site2SiteVpnManagerImpl.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Map<String, ComponentInfo<Manager>> getManagers() {
|
||||
if (_managers.size() == 0) {
|
||||
populateManagers();
|
||||
}
|
||||
return _managers;
|
||||
}
|
||||
|
||||
protected void populateAdapters() {
|
||||
addAdapter(TemplateAdapter.class, TemplateAdapterType.Hypervisor.getName(), HyervisorTemplateAdapter.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Map<String, List<ComponentInfo<Adapter>>> getAdapters() {
|
||||
if (_adapters.size() == 0) {
|
||||
populateAdapters();
|
||||
}
|
||||
return _adapters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Map<Class<?>, Class<?>> getFactories() {
|
||||
HashMap<Class<?>, Class<?>> factories = new HashMap<Class<?>, Class<?>>();
|
||||
factories.put(EntityManager.class, EntityManagerImpl.class);
|
||||
return factories;
|
||||
}
|
||||
|
||||
protected void populateServices() {
|
||||
addService("VirtualRouterElementService", VirtualRouterElementService.class, VirtualRouterElement.class);
|
||||
addService("NetscalerExternalLoadBalancerElementService", NetscalerLoadBalancerElementService.class, NetscalerElement.class);
|
||||
addService("F5LoadBalancerElementService", F5ExternalLoadBalancerElementService.class, F5ExternalLoadBalancerElement.class);
|
||||
addService("JuniperSRXFirewallElementService", JuniperSRXFirewallElementService.class, JuniperSRXExternalFirewallElement.class);
|
||||
addService("CiscoNexusVSMElementService", CiscoNexusVSMElementService.class, CiscoNexusVSMElement.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Map<String, ComponentInfo<PluggableService>> getPluggableServices() {
|
||||
if (_pluggableServices.size() == 0) {
|
||||
populateServices();
|
||||
}
|
||||
return _pluggableServices;
|
||||
}
|
||||
}
|
||||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.configuration;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.cloud.agent.manager.ClusteredAgentManagerImpl;
|
||||
import com.cloud.alert.AlertManagerImpl;
|
||||
import com.cloud.alert.dao.AlertDaoImpl;
|
||||
import com.cloud.async.AsyncJobExecutorContextImpl;
|
||||
import com.cloud.async.AsyncJobManagerImpl;
|
||||
import com.cloud.async.SyncQueueManagerImpl;
|
||||
import com.cloud.async.dao.AsyncJobDaoImpl;
|
||||
import com.cloud.async.dao.SyncQueueDaoImpl;
|
||||
import com.cloud.async.dao.SyncQueueItemDaoImpl;
|
||||
import com.cloud.capacity.CapacityManagerImpl;
|
||||
import com.cloud.capacity.dao.CapacityDaoImpl;
|
||||
import com.cloud.certificate.dao.CertificateDaoImpl;
|
||||
import com.cloud.cluster.CheckPointManagerImpl;
|
||||
import com.cloud.cluster.ClusterFenceManagerImpl;
|
||||
import com.cloud.cluster.ClusterManagerImpl;
|
||||
import com.cloud.cluster.agentlb.dao.HostTransferMapDaoImpl;
|
||||
import com.cloud.cluster.dao.ManagementServerHostDaoImpl;
|
||||
import com.cloud.cluster.dao.ManagementServerHostPeerDaoImpl;
|
||||
import com.cloud.cluster.dao.StackMaidDaoImpl;
|
||||
import com.cloud.configuration.dao.ConfigurationDaoImpl;
|
||||
import com.cloud.configuration.dao.ResourceCountDaoImpl;
|
||||
import com.cloud.configuration.dao.ResourceLimitDaoImpl;
|
||||
import com.cloud.consoleproxy.ConsoleProxyManagerImpl;
|
||||
import com.cloud.dao.EntityManager;
|
||||
import com.cloud.dao.EntityManagerImpl;
|
||||
import com.cloud.dc.ClusterDetailsDaoImpl;
|
||||
import com.cloud.dc.dao.AccountVlanMapDaoImpl;
|
||||
import com.cloud.dc.dao.ClusterDaoImpl;
|
||||
import com.cloud.dc.dao.ClusterVSMMapDaoImpl;
|
||||
import com.cloud.dc.dao.DataCenterDaoImpl;
|
||||
import com.cloud.dc.dao.DataCenterIpAddressDaoImpl;
|
||||
import com.cloud.dc.dao.DcDetailsDaoImpl;
|
||||
import com.cloud.dc.dao.HostPodDaoImpl;
|
||||
import com.cloud.dc.dao.PodVlanMapDaoImpl;
|
||||
import com.cloud.dc.dao.StorageNetworkIpAddressDaoImpl;
|
||||
import com.cloud.dc.dao.StorageNetworkIpRangeDaoImpl;
|
||||
import com.cloud.dc.dao.VlanDaoImpl;
|
||||
import com.cloud.domain.dao.DomainDaoImpl;
|
||||
import com.cloud.event.dao.EventDaoImpl;
|
||||
import com.cloud.event.dao.UsageEventDaoImpl;
|
||||
import com.cloud.ha.HighAvailabilityManagerImpl;
|
||||
import com.cloud.ha.dao.HighAvailabilityDaoImpl;
|
||||
import com.cloud.host.dao.HostDaoImpl;
|
||||
import com.cloud.host.dao.HostDetailsDaoImpl;
|
||||
import com.cloud.host.dao.HostTagsDaoImpl;
|
||||
import com.cloud.hypervisor.HypervisorGuruManagerImpl;
|
||||
import com.cloud.hypervisor.dao.HypervisorCapabilitiesDaoImpl;
|
||||
import com.cloud.keystore.KeystoreDaoImpl;
|
||||
import com.cloud.keystore.KeystoreManagerImpl;
|
||||
import com.cloud.maint.UpgradeManagerImpl;
|
||||
import com.cloud.maint.dao.AgentUpgradeDaoImpl;
|
||||
import com.cloud.network.ExternalLoadBalancerUsageManagerImpl;
|
||||
import com.cloud.network.NetworkManagerImpl;
|
||||
import com.cloud.network.StorageNetworkManagerImpl;
|
||||
import com.cloud.network.as.AutoScaleManagerImpl;
|
||||
import com.cloud.network.as.dao.AutoScalePolicyConditionMapDaoImpl;
|
||||
import com.cloud.network.as.dao.AutoScalePolicyDaoImpl;
|
||||
import com.cloud.network.as.dao.AutoScaleVmGroupDaoImpl;
|
||||
import com.cloud.network.as.dao.AutoScaleVmGroupPolicyMapDaoImpl;
|
||||
import com.cloud.network.as.dao.ConditionDaoImpl;
|
||||
import com.cloud.network.as.dao.CounterDaoImpl;
|
||||
import com.cloud.network.dao.CiscoNexusVSMDeviceDaoImpl;
|
||||
import com.cloud.network.dao.ExternalFirewallDeviceDaoImpl;
|
||||
import com.cloud.network.dao.ExternalLoadBalancerDeviceDaoImpl;
|
||||
import com.cloud.network.dao.FirewallRulesCidrsDaoImpl;
|
||||
import com.cloud.network.dao.FirewallRulesDaoImpl;
|
||||
import com.cloud.network.dao.IPAddressDaoImpl;
|
||||
import com.cloud.network.dao.InlineLoadBalancerNicMapDaoImpl;
|
||||
import com.cloud.network.dao.LBStickinessPolicyDaoImpl;
|
||||
import com.cloud.network.as.dao.AutoScaleVmProfileDaoImpl;
|
||||
import com.cloud.network.dao.LoadBalancerDaoImpl;
|
||||
import com.cloud.network.dao.LoadBalancerVMMapDaoImpl;
|
||||
import com.cloud.network.dao.NetworkDaoImpl;
|
||||
import com.cloud.network.dao.NetworkDomainDaoImpl;
|
||||
import com.cloud.network.dao.NetworkExternalFirewallDaoImpl;
|
||||
import com.cloud.network.dao.NetworkExternalLoadBalancerDaoImpl;
|
||||
import com.cloud.network.dao.NetworkRuleConfigDaoImpl;
|
||||
import com.cloud.network.dao.NetworkServiceMapDaoImpl;
|
||||
import com.cloud.network.dao.PhysicalNetworkDaoImpl;
|
||||
import com.cloud.network.dao.PhysicalNetworkServiceProviderDaoImpl;
|
||||
import com.cloud.network.dao.PhysicalNetworkTrafficTypeDaoImpl;
|
||||
import com.cloud.network.dao.PortProfileDaoImpl;
|
||||
import com.cloud.network.dao.RemoteAccessVpnDaoImpl;
|
||||
import com.cloud.network.dao.Site2SiteCustomerGatewayDaoImpl;
|
||||
import com.cloud.network.dao.Site2SiteVpnConnectionDaoImpl;
|
||||
import com.cloud.network.dao.Site2SiteVpnGatewayDaoImpl;
|
||||
import com.cloud.network.dao.VirtualRouterProviderDaoImpl;
|
||||
import com.cloud.network.dao.VpnUserDaoImpl;
|
||||
import com.cloud.network.element.CiscoNexusVSMElement;
|
||||
import com.cloud.network.element.CiscoNexusVSMElementService;
|
||||
import com.cloud.network.element.F5ExternalLoadBalancerElement;
|
||||
import com.cloud.network.element.F5ExternalLoadBalancerElementService;
|
||||
import com.cloud.network.element.JuniperSRXExternalFirewallElement;
|
||||
import com.cloud.network.element.JuniperSRXFirewallElementService;
|
||||
import com.cloud.network.element.NetscalerElement;
|
||||
import com.cloud.network.element.NetscalerLoadBalancerElementService;
|
||||
import com.cloud.network.element.VirtualRouterElement;
|
||||
import com.cloud.network.element.VirtualRouterElementService;
|
||||
import com.cloud.network.firewall.FirewallManagerImpl;
|
||||
import com.cloud.network.lb.ElasticLoadBalancerManagerImpl;
|
||||
import com.cloud.network.lb.LoadBalancingRulesManagerImpl;
|
||||
import com.cloud.network.lb.dao.ElasticLbVmMapDaoImpl;
|
||||
import com.cloud.network.ovs.OvsTunnelManagerImpl;
|
||||
import com.cloud.network.ovs.dao.OvsTunnelInterfaceDaoImpl;
|
||||
import com.cloud.network.ovs.dao.OvsTunnelNetworkDaoImpl;
|
||||
import com.cloud.network.router.VirtualNetworkApplianceManagerImpl;
|
||||
import com.cloud.network.router.VpcVirtualNetworkApplianceManagerImpl;
|
||||
import com.cloud.network.rules.RulesManagerImpl;
|
||||
import com.cloud.network.rules.dao.PortForwardingRulesDaoImpl;
|
||||
import com.cloud.network.security.SecurityGroupManagerImpl2;
|
||||
import com.cloud.network.security.dao.SecurityGroupDaoImpl;
|
||||
import com.cloud.network.security.dao.SecurityGroupRuleDaoImpl;
|
||||
import com.cloud.network.security.dao.SecurityGroupRulesDaoImpl;
|
||||
import com.cloud.network.security.dao.SecurityGroupVMMapDaoImpl;
|
||||
import com.cloud.network.security.dao.SecurityGroupWorkDaoImpl;
|
||||
import com.cloud.network.security.dao.VmRulesetLogDaoImpl;
|
||||
import com.cloud.network.vpc.NetworkACLManagerImpl;
|
||||
import com.cloud.network.vpc.VpcManagerImpl;
|
||||
import com.cloud.network.vpc.Dao.PrivateIpDaoImpl;
|
||||
import com.cloud.network.vpc.Dao.StaticRouteDaoImpl;
|
||||
import com.cloud.network.vpc.Dao.VpcDaoImpl;
|
||||
import com.cloud.network.vpc.Dao.VpcGatewayDaoImpl;
|
||||
import com.cloud.network.vpc.Dao.VpcOfferingDaoImpl;
|
||||
import com.cloud.network.vpc.Dao.VpcOfferingServiceMapDaoImpl;
|
||||
import com.cloud.network.vpn.RemoteAccessVpnManagerImpl;
|
||||
import com.cloud.network.vpn.Site2SiteVpnManagerImpl;
|
||||
import com.cloud.offerings.dao.NetworkOfferingDaoImpl;
|
||||
import com.cloud.offerings.dao.NetworkOfferingServiceMapDaoImpl;
|
||||
import com.cloud.projects.ProjectManagerImpl;
|
||||
import com.cloud.projects.dao.ProjectAccountDaoImpl;
|
||||
import com.cloud.projects.dao.ProjectDaoImpl;
|
||||
import com.cloud.projects.dao.ProjectInvitationDaoImpl;
|
||||
import com.cloud.resource.ResourceManagerImpl;
|
||||
import com.cloud.resourcelimit.ResourceLimitManagerImpl;
|
||||
import com.cloud.service.dao.ServiceOfferingDaoImpl;
|
||||
import com.cloud.storage.OCFS2ManagerImpl;
|
||||
import com.cloud.storage.StorageManagerImpl;
|
||||
import com.cloud.storage.dao.DiskOfferingDaoImpl;
|
||||
import com.cloud.storage.dao.GuestOSCategoryDaoImpl;
|
||||
import com.cloud.storage.dao.GuestOSDaoImpl;
|
||||
import com.cloud.storage.dao.LaunchPermissionDaoImpl;
|
||||
import com.cloud.storage.dao.SnapshotDaoImpl;
|
||||
import com.cloud.storage.dao.SnapshotPolicyDaoImpl;
|
||||
import com.cloud.storage.dao.SnapshotScheduleDaoImpl;
|
||||
import com.cloud.storage.dao.StoragePoolDaoImpl;
|
||||
import com.cloud.storage.dao.StoragePoolHostDaoImpl;
|
||||
import com.cloud.storage.dao.StoragePoolWorkDaoImpl;
|
||||
import com.cloud.storage.dao.SwiftDaoImpl;
|
||||
import com.cloud.storage.dao.UploadDaoImpl;
|
||||
import com.cloud.storage.dao.VMTemplateDaoImpl;
|
||||
import com.cloud.storage.dao.VMTemplateDetailsDaoImpl;
|
||||
import com.cloud.storage.dao.VMTemplateHostDaoImpl;
|
||||
import com.cloud.storage.dao.VMTemplatePoolDaoImpl;
|
||||
import com.cloud.storage.dao.VMTemplateSwiftDaoImpl;
|
||||
import com.cloud.storage.dao.VMTemplateZoneDaoImpl;
|
||||
import com.cloud.storage.dao.VolumeDaoImpl;
|
||||
import com.cloud.storage.dao.VolumeHostDaoImpl;
|
||||
import com.cloud.storage.download.DownloadMonitorImpl;
|
||||
import com.cloud.storage.secondary.SecondaryStorageManagerImpl;
|
||||
import com.cloud.storage.snapshot.SnapshotManagerImpl;
|
||||
import com.cloud.storage.snapshot.SnapshotSchedulerImpl;
|
||||
import com.cloud.storage.swift.SwiftManagerImpl;
|
||||
import com.cloud.storage.upload.UploadMonitorImpl;
|
||||
import com.cloud.tags.TaggedResourceManagerImpl;
|
||||
import com.cloud.tags.dao.ResourceTagsDaoImpl;
|
||||
import com.cloud.template.HyervisorTemplateAdapter;
|
||||
import com.cloud.template.TemplateAdapter;
|
||||
import com.cloud.template.TemplateAdapter.TemplateAdapterType;
|
||||
import com.cloud.template.TemplateManagerImpl;
|
||||
import com.cloud.user.AccountDetailsDaoImpl;
|
||||
import com.cloud.user.AccountManagerImpl;
|
||||
import com.cloud.user.DomainManagerImpl;
|
||||
import com.cloud.user.dao.AccountDaoImpl;
|
||||
import com.cloud.user.dao.SSHKeyPairDaoImpl;
|
||||
import com.cloud.user.dao.UserAccountDaoImpl;
|
||||
import com.cloud.user.dao.UserDaoImpl;
|
||||
import com.cloud.user.dao.UserStatisticsDaoImpl;
|
||||
import com.cloud.user.dao.UserStatsLogDaoImpl;
|
||||
import com.cloud.utils.component.Adapter;
|
||||
import com.cloud.utils.component.ComponentLibrary;
|
||||
import com.cloud.utils.component.ComponentLibraryBase;
|
||||
import com.cloud.utils.component.ComponentLocator.ComponentInfo;
|
||||
import com.cloud.utils.component.Manager;
|
||||
import com.cloud.utils.component.PluggableService;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
import com.cloud.uuididentity.IdentityServiceImpl;
|
||||
import com.cloud.uuididentity.dao.IdentityDaoImpl;
|
||||
import com.cloud.vm.ClusteredVirtualMachineManagerImpl;
|
||||
import com.cloud.vm.ItWorkDaoImpl;
|
||||
import com.cloud.vm.UserVmManagerImpl;
|
||||
import com.cloud.vm.dao.ConsoleProxyDaoImpl;
|
||||
import com.cloud.vm.dao.DomainRouterDaoImpl;
|
||||
import com.cloud.vm.dao.InstanceGroupDaoImpl;
|
||||
import com.cloud.vm.dao.InstanceGroupVMMapDaoImpl;
|
||||
import com.cloud.vm.dao.NicDaoImpl;
|
||||
import com.cloud.vm.dao.SecondaryStorageVmDaoImpl;
|
||||
import com.cloud.vm.dao.UserVmDaoImpl;
|
||||
import com.cloud.vm.dao.UserVmDetailsDaoImpl;
|
||||
import com.cloud.vm.dao.VMInstanceDaoImpl;
|
||||
|
||||
public class DefaultComponentLibrary extends ComponentLibraryBase implements ComponentLibrary {
|
||||
protected void populateDaos() {
|
||||
addDao("StackMaidDao", StackMaidDaoImpl.class);
|
||||
addDao("VMTemplateZoneDao", VMTemplateZoneDaoImpl.class);
|
||||
addDao("VMTemplateDetailsDao", VMTemplateDetailsDaoImpl.class);
|
||||
addDao("DomainRouterDao", DomainRouterDaoImpl.class);
|
||||
addDao("HostDao", HostDaoImpl.class);
|
||||
addDao("VMInstanceDao", VMInstanceDaoImpl.class);
|
||||
addDao("UserVmDao", UserVmDaoImpl.class);
|
||||
ComponentInfo<? extends GenericDao<?, ? extends Serializable>> info = addDao("ServiceOfferingDao", ServiceOfferingDaoImpl.class);
|
||||
info.addParameter("cache.size", "50");
|
||||
info.addParameter("cache.time.to.live", "600");
|
||||
info = addDao("DiskOfferingDao", DiskOfferingDaoImpl.class);
|
||||
info.addParameter("cache.size", "50");
|
||||
info.addParameter("cache.time.to.live", "600");
|
||||
info = addDao("DataCenterDao", DataCenterDaoImpl.class);
|
||||
info.addParameter("cache.size", "50");
|
||||
info.addParameter("cache.time.to.live", "600");
|
||||
info = addDao("HostPodDao", HostPodDaoImpl.class);
|
||||
info.addParameter("cache.size", "50");
|
||||
info.addParameter("cache.time.to.live", "600");
|
||||
addDao("IPAddressDao", IPAddressDaoImpl.class);
|
||||
info = addDao("VlanDao", VlanDaoImpl.class);
|
||||
info.addParameter("cache.size", "30");
|
||||
info.addParameter("cache.time.to.live", "3600");
|
||||
addDao("PodVlanMapDao", PodVlanMapDaoImpl.class);
|
||||
addDao("AccountVlanMapDao", AccountVlanMapDaoImpl.class);
|
||||
addDao("VolumeDao", VolumeDaoImpl.class);
|
||||
addDao("EventDao", EventDaoImpl.class);
|
||||
info = addDao("UserDao", UserDaoImpl.class);
|
||||
info.addParameter("cache.size", "5000");
|
||||
info.addParameter("cache.time.to.live", "300");
|
||||
addDao("UserStatisticsDao", UserStatisticsDaoImpl.class);
|
||||
addDao("UserStatsLogDao", UserStatsLogDaoImpl.class);
|
||||
addDao("FirewallRulesDao", FirewallRulesDaoImpl.class);
|
||||
addDao("LoadBalancerDao", LoadBalancerDaoImpl.class);
|
||||
addDao("NetworkRuleConfigDao", NetworkRuleConfigDaoImpl.class);
|
||||
addDao("LoadBalancerVMMapDao", LoadBalancerVMMapDaoImpl.class);
|
||||
addDao("LBStickinessPolicyDao", LBStickinessPolicyDaoImpl.class);
|
||||
addDao("AutoScalePolicyDao", AutoScalePolicyDaoImpl.class);
|
||||
addDao("AutoScalePolicyConditionMapDao", AutoScalePolicyConditionMapDaoImpl.class);
|
||||
addDao("AutoScaleVmProfileDao", AutoScaleVmProfileDaoImpl.class);
|
||||
addDao("AutoScaleVmGroupDao", AutoScaleVmGroupDaoImpl.class);
|
||||
addDao("AutoScaleVmGroupPolicyMapDao", AutoScaleVmGroupPolicyMapDaoImpl.class);
|
||||
addDao("DataCenterIpAddressDao", DataCenterIpAddressDaoImpl.class);
|
||||
addDao("SecurityGroupDao", SecurityGroupDaoImpl.class);
|
||||
addDao("SecurityGroupRuleDao", SecurityGroupRuleDaoImpl.class);
|
||||
addDao("SecurityGroupVMMapDao", SecurityGroupVMMapDaoImpl.class);
|
||||
addDao("SecurityGroupRulesDao", SecurityGroupRulesDaoImpl.class);
|
||||
addDao("SecurityGroupWorkDao", SecurityGroupWorkDaoImpl.class);
|
||||
addDao("VmRulesetLogDao", VmRulesetLogDaoImpl.class);
|
||||
addDao("AlertDao", AlertDaoImpl.class);
|
||||
addDao("CapacityDao", CapacityDaoImpl.class);
|
||||
addDao("DomainDao", DomainDaoImpl.class);
|
||||
addDao("AccountDao", AccountDaoImpl.class);
|
||||
addDao("ResourceLimitDao", ResourceLimitDaoImpl.class);
|
||||
addDao("ResourceCountDao", ResourceCountDaoImpl.class);
|
||||
addDao("UserAccountDao", UserAccountDaoImpl.class);
|
||||
addDao("VMTemplateHostDao", VMTemplateHostDaoImpl.class);
|
||||
addDao("VolumeHostDao", VolumeHostDaoImpl.class);
|
||||
addDao("VMTemplateSwiftDao", VMTemplateSwiftDaoImpl.class);
|
||||
addDao("UploadDao", UploadDaoImpl.class);
|
||||
addDao("VMTemplatePoolDao", VMTemplatePoolDaoImpl.class);
|
||||
addDao("LaunchPermissionDao", LaunchPermissionDaoImpl.class);
|
||||
addDao("ConfigurationDao", ConfigurationDaoImpl.class);
|
||||
info = addDao("VMTemplateDao", VMTemplateDaoImpl.class);
|
||||
info.addParameter("cache.size", "100");
|
||||
info.addParameter("cache.time.to.live", "600");
|
||||
info.addParameter("routing.uniquename", "routing");
|
||||
addDao("HighAvailabilityDao", HighAvailabilityDaoImpl.class);
|
||||
addDao("ConsoleProxyDao", ConsoleProxyDaoImpl.class);
|
||||
addDao("SecondaryStorageVmDao", SecondaryStorageVmDaoImpl.class);
|
||||
addDao("ManagementServerHostDao", ManagementServerHostDaoImpl.class);
|
||||
addDao("ManagementServerHostPeerDao", ManagementServerHostPeerDaoImpl.class);
|
||||
addDao("AgentUpgradeDao", AgentUpgradeDaoImpl.class);
|
||||
addDao("SnapshotDao", SnapshotDaoImpl.class);
|
||||
addDao("AsyncJobDao", AsyncJobDaoImpl.class);
|
||||
addDao("SyncQueueDao", SyncQueueDaoImpl.class);
|
||||
addDao("SyncQueueItemDao", SyncQueueItemDaoImpl.class);
|
||||
addDao("GuestOSDao", GuestOSDaoImpl.class);
|
||||
addDao("GuestOSCategoryDao", GuestOSCategoryDaoImpl.class);
|
||||
addDao("StoragePoolDao", StoragePoolDaoImpl.class);
|
||||
addDao("StoragePoolHostDao", StoragePoolHostDaoImpl.class);
|
||||
addDao("DetailsDao", HostDetailsDaoImpl.class);
|
||||
addDao("SnapshotPolicyDao", SnapshotPolicyDaoImpl.class);
|
||||
addDao("SnapshotScheduleDao", SnapshotScheduleDaoImpl.class);
|
||||
addDao("ClusterDao", ClusterDaoImpl.class);
|
||||
addDao("CertificateDao", CertificateDaoImpl.class);
|
||||
addDao("NetworkConfigurationDao", NetworkDaoImpl.class);
|
||||
addDao("NetworkOfferingDao", NetworkOfferingDaoImpl.class);
|
||||
addDao("NicDao", NicDaoImpl.class);
|
||||
addDao("InstanceGroupDao", InstanceGroupDaoImpl.class);
|
||||
addDao("InstanceGroupVMMapDao", InstanceGroupVMMapDaoImpl.class);
|
||||
addDao("RemoteAccessVpnDao", RemoteAccessVpnDaoImpl.class);
|
||||
addDao("VpnUserDao", VpnUserDaoImpl.class);
|
||||
addDao("ItWorkDao", ItWorkDaoImpl.class);
|
||||
addDao("FirewallRulesDao", FirewallRulesDaoImpl.class);
|
||||
addDao("PortForwardingRulesDao", PortForwardingRulesDaoImpl.class);
|
||||
addDao("FirewallRulesCidrsDao", FirewallRulesCidrsDaoImpl.class);
|
||||
addDao("SSHKeyPairDao", SSHKeyPairDaoImpl.class);
|
||||
addDao("UsageEventDao", UsageEventDaoImpl.class);
|
||||
addDao("ClusterDetailsDao", ClusterDetailsDaoImpl.class);
|
||||
addDao("UserVmDetailsDao", UserVmDetailsDaoImpl.class);
|
||||
addDao("OvsTunnelInterfaceDao", OvsTunnelInterfaceDaoImpl.class);
|
||||
addDao("OvsTunnelAccountDao", OvsTunnelNetworkDaoImpl.class);
|
||||
addDao("StoragePoolWorkDao", StoragePoolWorkDaoImpl.class);
|
||||
addDao("HostTagsDao", HostTagsDaoImpl.class);
|
||||
addDao("NetworkDomainDao", NetworkDomainDaoImpl.class);
|
||||
addDao("KeystoreDao", KeystoreDaoImpl.class);
|
||||
addDao("DcDetailsDao", DcDetailsDaoImpl.class);
|
||||
addDao("SwiftDao", SwiftDaoImpl.class);
|
||||
addDao("AgentTransferMapDao", HostTransferMapDaoImpl.class);
|
||||
addDao("ProjectDao", ProjectDaoImpl.class);
|
||||
addDao("InlineLoadBalancerNicMapDao", InlineLoadBalancerNicMapDaoImpl.class);
|
||||
addDao("ElasticLbVmMap", ElasticLbVmMapDaoImpl.class);
|
||||
addDao("ProjectsAccountDao", ProjectAccountDaoImpl.class);
|
||||
addDao("ProjectInvitationDao", ProjectInvitationDaoImpl.class);
|
||||
addDao("IdentityDao", IdentityDaoImpl.class);
|
||||
addDao("AccountDetailsDao", AccountDetailsDaoImpl.class);
|
||||
addDao("NetworkOfferingServiceMapDao", NetworkOfferingServiceMapDaoImpl.class);
|
||||
info = addDao("HypervisorCapabilitiesDao",HypervisorCapabilitiesDaoImpl.class);
|
||||
info.addParameter("cache.size", "100");
|
||||
info.addParameter("cache.time.to.live", "600");
|
||||
addDao("PhysicalNetworkDao", PhysicalNetworkDaoImpl.class);
|
||||
addDao("PhysicalNetworkServiceProviderDao", PhysicalNetworkServiceProviderDaoImpl.class);
|
||||
addDao("VirtualRouterProviderDao", VirtualRouterProviderDaoImpl.class);
|
||||
addDao("ExternalLoadBalancerDeviceDao", ExternalLoadBalancerDeviceDaoImpl.class);
|
||||
addDao("ExternalFirewallDeviceDao", ExternalFirewallDeviceDaoImpl.class);
|
||||
addDao("NetworkExternalLoadBalancerDao", NetworkExternalLoadBalancerDaoImpl.class);
|
||||
addDao("NetworkExternalFirewallDao", NetworkExternalFirewallDaoImpl.class);
|
||||
addDao("CiscoNexusVSMDeviceDao", CiscoNexusVSMDeviceDaoImpl.class);
|
||||
addDao("ClusterVSMMapDao", ClusterVSMMapDaoImpl.class);
|
||||
addDao("PortProfileDao", PortProfileDaoImpl.class);
|
||||
addDao("PhysicalNetworkTrafficTypeDao", PhysicalNetworkTrafficTypeDaoImpl.class);
|
||||
addDao("NetworkServiceMapDao", NetworkServiceMapDaoImpl.class);
|
||||
addDao("StorageNetworkIpAddressDao", StorageNetworkIpAddressDaoImpl.class);
|
||||
addDao("StorageNetworkIpRangeDao", StorageNetworkIpRangeDaoImpl.class);
|
||||
addDao("TagsDao", ResourceTagsDaoImpl.class);
|
||||
addDao("VpcDao", VpcDaoImpl.class);
|
||||
addDao("VpcOfferingDao", VpcOfferingDaoImpl.class);
|
||||
addDao("VpcOfferingServiceMapDao", VpcOfferingServiceMapDaoImpl.class);
|
||||
addDao("PrivateIpDao", PrivateIpDaoImpl.class);
|
||||
addDao("VpcGatewayDao", VpcGatewayDaoImpl.class);
|
||||
addDao("StaticRouteDao", StaticRouteDaoImpl.class);
|
||||
addDao("Site2SiteVpnGatewayDao", Site2SiteVpnGatewayDaoImpl.class);
|
||||
addDao("Site2SiteCustomerGatewayDao", Site2SiteCustomerGatewayDaoImpl.class);
|
||||
addDao("Site2SiteVpnConnnectionDao", Site2SiteVpnConnectionDaoImpl.class);
|
||||
addDao("CounterDao", CounterDaoImpl.class);
|
||||
addDao("ConditionDao", ConditionDaoImpl.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Map<String, ComponentInfo<GenericDao<?, ?>>> getDaos() {
|
||||
if (_daos.size() == 0) {
|
||||
populateDaos();
|
||||
}
|
||||
return _daos;
|
||||
}
|
||||
|
||||
protected void populateManagers() {
|
||||
addManager("StackMaidManager", CheckPointManagerImpl.class);
|
||||
addManager("Cluster Manager", ClusterManagerImpl.class);
|
||||
addManager("ClusterFenceManager", ClusterFenceManagerImpl.class);
|
||||
addManager("ClusteredAgentManager", ClusteredAgentManagerImpl.class);
|
||||
addManager("SyncQueueManager", SyncQueueManagerImpl.class);
|
||||
addManager("AsyncJobManager", AsyncJobManagerImpl.class);
|
||||
addManager("AsyncJobExecutorContext", AsyncJobExecutorContextImpl.class);
|
||||
addManager("configuration manager", ConfigurationManagerImpl.class);
|
||||
addManager("account manager", AccountManagerImpl.class);
|
||||
addManager("domain manager", DomainManagerImpl.class);
|
||||
addManager("resource limit manager", ResourceLimitManagerImpl.class);
|
||||
addManager("network manager", NetworkManagerImpl.class);
|
||||
addManager("download manager", DownloadMonitorImpl.class);
|
||||
addManager("upload manager", UploadMonitorImpl.class);
|
||||
addManager("keystore manager", KeystoreManagerImpl.class);
|
||||
addManager("secondary storage vm manager", SecondaryStorageManagerImpl.class);
|
||||
addManager("vm manager", UserVmManagerImpl.class);
|
||||
addManager("upgrade manager", UpgradeManagerImpl.class);
|
||||
addManager("StorageManager", StorageManagerImpl.class);
|
||||
addManager("Alert Manager", AlertManagerImpl.class);
|
||||
addManager("Template Manager", TemplateManagerImpl.class);
|
||||
addManager("Snapshot Manager", SnapshotManagerImpl.class);
|
||||
addManager("SnapshotScheduler", SnapshotSchedulerImpl.class);
|
||||
addManager("SecurityGroupManager", SecurityGroupManagerImpl2.class);
|
||||
addManager("DomainRouterManager", VirtualNetworkApplianceManagerImpl.class);
|
||||
addManager("EntityManager", EntityManagerImpl.class);
|
||||
addManager("LoadBalancingRulesManager", LoadBalancingRulesManagerImpl.class);
|
||||
addManager("AutoScaleManager", AutoScaleManagerImpl.class);
|
||||
addManager("RulesManager", RulesManagerImpl.class);
|
||||
addManager("RemoteAccessVpnManager", RemoteAccessVpnManagerImpl.class);
|
||||
addManager("OvsTunnelManager", OvsTunnelManagerImpl.class);
|
||||
addManager("Capacity Manager", CapacityManagerImpl.class);
|
||||
addManager("VirtualMachineManager", ClusteredVirtualMachineManagerImpl.class);
|
||||
addManager("HypervisorGuruManager", HypervisorGuruManagerImpl.class);
|
||||
addManager("ResourceManager", ResourceManagerImpl.class);
|
||||
addManager("IdentityManager", IdentityServiceImpl.class);
|
||||
addManager("OCFS2Manager", OCFS2ManagerImpl.class);
|
||||
addManager("FirewallManager", FirewallManagerImpl.class);
|
||||
ComponentInfo<? extends Manager> info = addManager("ConsoleProxyManager", ConsoleProxyManagerImpl.class);
|
||||
info.addParameter("consoleproxy.sslEnabled", "true");
|
||||
addManager("ProjectManager", ProjectManagerImpl.class);
|
||||
addManager("ElasticLoadBalancerManager", ElasticLoadBalancerManagerImpl.class);
|
||||
addManager("SwiftManager", SwiftManagerImpl.class);
|
||||
addManager("StorageNetworkManager", StorageNetworkManagerImpl.class);
|
||||
addManager("ExternalLoadBalancerUsageManager", ExternalLoadBalancerUsageManagerImpl.class);
|
||||
addManager("HA Manager", HighAvailabilityManagerImpl.class);
|
||||
addManager("TaggedResourcesManager", TaggedResourceManagerImpl.class);
|
||||
addManager("VPC Manager", VpcManagerImpl.class);
|
||||
addManager("VpcVirtualRouterManager", VpcVirtualNetworkApplianceManagerImpl.class);
|
||||
addManager("NetworkACLManager", NetworkACLManagerImpl.class);
|
||||
addManager("Site2SiteVpnManager", Site2SiteVpnManagerImpl.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Map<String, ComponentInfo<Manager>> getManagers() {
|
||||
if (_managers.size() == 0) {
|
||||
populateManagers();
|
||||
}
|
||||
return _managers;
|
||||
}
|
||||
|
||||
protected void populateAdapters() {
|
||||
addAdapter(TemplateAdapter.class, TemplateAdapterType.Hypervisor.getName(), HyervisorTemplateAdapter.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Map<String, List<ComponentInfo<Adapter>>> getAdapters() {
|
||||
if (_adapters.size() == 0) {
|
||||
populateAdapters();
|
||||
}
|
||||
return _adapters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Map<Class<?>, Class<?>> getFactories() {
|
||||
HashMap<Class<?>, Class<?>> factories = new HashMap<Class<?>, Class<?>>();
|
||||
factories.put(EntityManager.class, EntityManagerImpl.class);
|
||||
return factories;
|
||||
}
|
||||
|
||||
protected void populateServices() {
|
||||
addService("VirtualRouterElementService", VirtualRouterElementService.class, VirtualRouterElement.class);
|
||||
addService("NetscalerExternalLoadBalancerElementService", NetscalerLoadBalancerElementService.class, NetscalerElement.class);
|
||||
addService("F5LoadBalancerElementService", F5ExternalLoadBalancerElementService.class, F5ExternalLoadBalancerElement.class);
|
||||
addService("JuniperSRXFirewallElementService", JuniperSRXFirewallElementService.class, JuniperSRXExternalFirewallElement.class);
|
||||
addService("CiscoNexusVSMElementService", CiscoNexusVSMElementService.class, CiscoNexusVSMElement.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Map<String, ComponentInfo<PluggableService>> getPluggableServices() {
|
||||
if (_pluggableServices.size() == 0) {
|
||||
populateServices();
|
||||
}
|
||||
return _pluggableServices;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as;
|
||||
|
||||
public interface AutoScaleManager extends AutoScaleService {
|
||||
}
|
||||
|
|
@ -0,0 +1,909 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.acl.ControlledEntity;
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.ApiDispatcher;
|
||||
import com.cloud.api.BaseListAccountResourcesCmd;
|
||||
import com.cloud.api.commands.CreateAutoScalePolicyCmd;
|
||||
import com.cloud.api.commands.CreateAutoScaleVmGroupCmd;
|
||||
import com.cloud.api.commands.CreateAutoScaleVmProfileCmd;
|
||||
import com.cloud.api.commands.CreateConditionCmd;
|
||||
import com.cloud.api.commands.CreateCounterCmd;
|
||||
import com.cloud.api.commands.DeployVMCmd;
|
||||
import com.cloud.api.commands.ListAutoScalePoliciesCmd;
|
||||
import com.cloud.api.commands.ListAutoScaleVmGroupsCmd;
|
||||
import com.cloud.api.commands.ListAutoScaleVmProfilesCmd;
|
||||
import com.cloud.api.commands.ListConditionsCmd;
|
||||
import com.cloud.api.commands.ListCountersCmd;
|
||||
import com.cloud.api.commands.UpdateAutoScalePolicyCmd;
|
||||
import com.cloud.api.commands.UpdateAutoScaleVmGroupCmd;
|
||||
import com.cloud.api.commands.UpdateAutoScaleVmProfileCmd;
|
||||
import com.cloud.dc.dao.DataCenterDao;
|
||||
import com.cloud.event.ActionEvent;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.network.LoadBalancerVMMapVO;
|
||||
import com.cloud.network.LoadBalancerVO;
|
||||
import com.cloud.network.Network.Capability;
|
||||
import com.cloud.network.as.AutoScalePolicy;
|
||||
import com.cloud.network.as.AutoScalePolicyConditionMapVO;
|
||||
import com.cloud.network.as.AutoScalePolicyVO;
|
||||
import com.cloud.network.as.AutoScaleVmGroup;
|
||||
import com.cloud.network.as.AutoScaleVmGroupPolicyMapVO;
|
||||
import com.cloud.network.as.AutoScaleVmGroupVO;
|
||||
import com.cloud.network.as.AutoScaleVmProfile;
|
||||
import com.cloud.network.as.AutoScaleVmProfileVO;
|
||||
import com.cloud.network.as.Condition;
|
||||
import com.cloud.network.as.ConditionVO;
|
||||
import com.cloud.network.as.Counter;
|
||||
import com.cloud.network.as.CounterVO;
|
||||
import com.cloud.network.as.dao.AutoScalePolicyConditionMapDao;
|
||||
import com.cloud.network.as.dao.AutoScalePolicyDao;
|
||||
import com.cloud.network.as.dao.AutoScaleVmGroupDao;
|
||||
import com.cloud.network.as.dao.AutoScaleVmGroupPolicyMapDao;
|
||||
import com.cloud.network.as.dao.AutoScaleVmProfileDao;
|
||||
import com.cloud.network.as.dao.ConditionDao;
|
||||
import com.cloud.network.as.dao.CounterDao;
|
||||
import com.cloud.network.dao.IPAddressDao;
|
||||
import com.cloud.network.dao.LoadBalancerDao;
|
||||
import com.cloud.network.dao.LoadBalancerVMMapDao;
|
||||
import com.cloud.network.dao.NetworkDao;
|
||||
import com.cloud.network.lb.LoadBalancingRulesManager;
|
||||
import com.cloud.projects.Project.ListProjectResourcesCriteria;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.AccountManager;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.UserContext;
|
||||
import com.cloud.user.dao.AccountDao;
|
||||
import com.cloud.user.dao.UserDao;
|
||||
import com.cloud.utils.Ternary;
|
||||
import com.cloud.utils.component.Inject;
|
||||
import com.cloud.utils.component.Manager;
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.Filter;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
import com.cloud.utils.db.JoinBuilder;
|
||||
import com.cloud.utils.db.SearchBuilder;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
import com.cloud.utils.db.SearchCriteria.Op;
|
||||
import com.cloud.utils.db.Transaction;
|
||||
import com.cloud.utils.net.NetUtils;
|
||||
|
||||
@Local(value = { AutoScaleService.class })
|
||||
public class AutoScaleManagerImpl<Type> implements AutoScaleService, Manager {
|
||||
private static final Logger s_logger = Logger.getLogger(AutoScaleManagerImpl.class);
|
||||
|
||||
String _name;
|
||||
@Inject
|
||||
AccountDao _accountDao;
|
||||
@Inject
|
||||
AccountManager _accountMgr;
|
||||
@Inject
|
||||
LoadBalancingRulesManager _lbRulesMgr;
|
||||
@Inject
|
||||
NetworkDao _networkDao;
|
||||
@Inject
|
||||
CounterDao _counterDao;
|
||||
@Inject
|
||||
ConditionDao _conditionDao;
|
||||
@Inject
|
||||
LoadBalancerVMMapDao _lb2VmMapDao;
|
||||
@Inject
|
||||
LoadBalancerDao _lbDao;
|
||||
@Inject
|
||||
AutoScaleVmProfileDao _autoScaleVmProfileDao;
|
||||
@Inject
|
||||
AutoScalePolicyDao _autoScalePolicyDao;
|
||||
@Inject
|
||||
AutoScalePolicyConditionMapDao _autoScalePolicyConditionMapDao;
|
||||
@Inject
|
||||
AutoScaleVmGroupDao _autoScaleVmGroupDao;
|
||||
@Inject
|
||||
AutoScaleVmGroupPolicyMapDao _autoScaleVmGroupPolicyMapDao;
|
||||
@Inject
|
||||
DataCenterDao _dcDao = null;
|
||||
@Inject
|
||||
UserDao _userDao;
|
||||
@Inject
|
||||
IPAddressDao _ipAddressDao;
|
||||
|
||||
@Override
|
||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||
_name = name;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean start() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stop() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return _name;
|
||||
}
|
||||
|
||||
public List<String> getSupportedAutoScaleCounters(long networkid)
|
||||
{
|
||||
String autoScaleCapability = _lbRulesMgr.getLBCapability(networkid, Capability.AutoScaleCounters.getName());
|
||||
if (autoScaleCapability == null || autoScaleCapability.length() == 0) {
|
||||
return null;
|
||||
}
|
||||
return Arrays.asList(autoScaleCapability.split(","));
|
||||
}
|
||||
|
||||
public void validateAutoScaleCounters(long networkid, List<Counter> counters)
|
||||
{
|
||||
List<String> supportedCounters = getSupportedAutoScaleCounters(networkid);
|
||||
if (supportedCounters == null) {
|
||||
throw new InvalidParameterException("AutoScale is not supported in the network");
|
||||
}
|
||||
for (Counter counter : counters) {
|
||||
if (!supportedCounters.contains(counter.getSource())) {
|
||||
throw new InvalidParameterException("AutoScale counter with source='" + counter.getSource() + "' is not supported " +
|
||||
"in the network where lb is configured");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private <VO extends ControlledEntity> VO getEntityInDatabase(String paramName, Long id, GenericDao<VO, Long> dao)
|
||||
{
|
||||
|
||||
VO vo = dao.findById(id);
|
||||
|
||||
if (vo == null) {
|
||||
throw new InvalidParameterValueException("Unable to find " + paramName);
|
||||
}
|
||||
|
||||
_accountMgr.checkAccess(UserContext.current().getCaller(), null, true, (ControlledEntity) vo);
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
private boolean isAutoScaleScaleUpPolicy(AutoScalePolicy policyVO)
|
||||
{
|
||||
return policyVO.getAction().equals("scaleup");
|
||||
}
|
||||
|
||||
private List<AutoScalePolicyVO> getAutoScalePolicies(String paramName, List<Long> policyIds, List<Counter> counters, Integer interval, boolean scaleUpPolicies)
|
||||
{
|
||||
SearchBuilder<AutoScalePolicyVO> policySearch = _autoScalePolicyDao.createSearchBuilder();
|
||||
policySearch.and("ids", policySearch.entity().getId(), Op.IN);
|
||||
policySearch.done();
|
||||
SearchCriteria<AutoScalePolicyVO> sc = policySearch.create();
|
||||
|
||||
sc.setParameters("ids", policyIds.toArray(new Object[0]));
|
||||
List<AutoScalePolicyVO> policies = _autoScalePolicyDao.search(sc, null);
|
||||
|
||||
Integer prevQuietTime = 0;
|
||||
|
||||
for (AutoScalePolicyVO policy : policies) {
|
||||
Integer quietTime = policy.getQuietTime();
|
||||
if (prevQuietTime == 0)
|
||||
prevQuietTime = quietTime;
|
||||
Integer duration = policy.getDuration();
|
||||
if (interval != null && duration < interval) {
|
||||
throw new InvalidParameterValueException("duration - " + duration + " specified in a policy cannot be less than vm group's interval - " + interval);
|
||||
}
|
||||
|
||||
if (interval != null && quietTime < interval) {
|
||||
throw new InvalidParameterValueException("quietTime - " + quietTime + " specified in a policy cannot be less than vm group's interval - " + interval);
|
||||
}
|
||||
|
||||
if (quietTime != prevQuietTime) {
|
||||
throw new InvalidParameterValueException("quietTime should be same for all the policies specified in " + paramName);
|
||||
}
|
||||
|
||||
if (scaleUpPolicies) {
|
||||
if (!isAutoScaleScaleUpPolicy(policy)) {
|
||||
throw new InvalidParameterValueException("Only provision policies can be specified in scaleuppolicyids");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (isAutoScaleScaleUpPolicy(policy)) {
|
||||
throw new InvalidParameterValueException("Only de-provision policies can be specified in scaledownpolicyids");
|
||||
}
|
||||
}
|
||||
List<AutoScalePolicyConditionMapVO> policyConditionMapVOs = _autoScalePolicyConditionMapDao.listByAll(policy.getId(), null);
|
||||
for (AutoScalePolicyConditionMapVO policyConditionMapVO : policyConditionMapVOs) {
|
||||
long conditionid = policyConditionMapVO.getConditionId();
|
||||
Condition condition = _conditionDao.findById(conditionid);
|
||||
Counter counter = _counterDao.findById(condition.getCounterid());
|
||||
counters.add(counter);
|
||||
}
|
||||
policies.add(policy);
|
||||
}
|
||||
return policies;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DB
|
||||
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMPROFILE_CREATE, eventDescription = "creating autoscale vm profile")
|
||||
public AutoScaleVmProfile createAutoScaleVmProfile(CreateAutoScaleVmProfileCmd cmd) {
|
||||
|
||||
Account owner = _accountDao.findById(cmd.getAccountId());
|
||||
Account caller = UserContext.current().getCaller();
|
||||
_accountMgr.checkAccess(caller, null, true, owner);
|
||||
|
||||
// validations
|
||||
HashMap<String, String> deployParams = cmd.getDeployParamMap();
|
||||
/*
|
||||
* Just for making sure the values are right in other deploy params.
|
||||
* For ex. if projectId is given as a string instead of an long value, this
|
||||
* will be throwing an error.
|
||||
*/
|
||||
ApiDispatcher.setupParameters(new DeployVMCmd(), deployParams);
|
||||
Long autoscaleUserId = cmd.getAutoscaleUserId();
|
||||
|
||||
if (autoscaleUserId != null) {
|
||||
User autoscaleUser = _userDao.findById(autoscaleUserId);
|
||||
if (autoscaleUser.getAccountId() != cmd.getEntityOwnerId()) {
|
||||
throw new InvalidParameterValueException("AutoScale User id does not belong to the same account");
|
||||
}
|
||||
}
|
||||
else {
|
||||
autoscaleUserId = UserContext.current().getCallerUserId();
|
||||
}
|
||||
AutoScaleVmProfileVO profileVO = new AutoScaleVmProfileVO(cmd.getZoneId(), cmd.getDomainId(), cmd.getAccountId(), cmd.getServiceOfferingId(), cmd.getTemplateId(), cmd.getOtherDeployParams(),
|
||||
cmd.getSnmpCommunity(), cmd.getSnmpPort(), cmd.getDestroyVmGraceperiod(), autoscaleUserId);
|
||||
_autoScaleVmProfileDao.persist(profileVO);
|
||||
return profileVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DB
|
||||
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMPROFILE_DELETE, eventDescription = "deleting autoscale vm profile")
|
||||
public boolean deleteAutoScaleVmProfile(long id) {
|
||||
/* Check if entity is in database */
|
||||
getEntityInDatabase("AutoScale Vm Profile", id, _autoScaleVmProfileDao);
|
||||
if (_autoScaleVmGroupDao.isProfileInUse(id)) {
|
||||
throw new InvalidParameterValueException("Cannot delete AutoScale Vm Profile when it is in use by one more vm groups");
|
||||
}
|
||||
return _autoScaleVmProfileDao.remove(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends AutoScaleVmProfile> listAutoScaleVmProfiles(ListAutoScaleVmProfilesCmd cmd) {
|
||||
Long id = cmd.getId();
|
||||
Long templateId = cmd.getTemplateId();
|
||||
String otherDeployParams = cmd.getOtherDeployParams();
|
||||
|
||||
SearchWrapper<AutoScaleVmProfileVO> searchWrapper = new SearchWrapper<AutoScaleVmProfileVO>(_autoScaleVmProfileDao, AutoScaleVmProfileVO.class, cmd, cmd.getId());
|
||||
SearchBuilder<AutoScaleVmProfileVO> sb = searchWrapper.getSearchBuilder();
|
||||
|
||||
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
|
||||
sb.and("templateId", sb.entity().getTemplateId(), SearchCriteria.Op.EQ);
|
||||
sb.and("otherDeployParams", sb.entity().getOtherDeployParams(), SearchCriteria.Op.LIKE);
|
||||
SearchCriteria<AutoScaleVmProfileVO> sc = searchWrapper.buildSearchCriteria();
|
||||
|
||||
if (id != null) {
|
||||
sc.setParameters("id", id);
|
||||
}
|
||||
if (templateId != null) {
|
||||
sc.setParameters("templateId", templateId);
|
||||
}
|
||||
if (otherDeployParams != null) {
|
||||
sc.addAnd("otherDeployParams", SearchCriteria.Op.LIKE, "%" + otherDeployParams + "%");
|
||||
}
|
||||
return searchWrapper.search();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AutoScaleVmProfile updateAutoScaleVmProfile(UpdateAutoScaleVmProfileCmd cmd) {
|
||||
Long profileId = cmd.getId();
|
||||
Long templateId = cmd.getTemplateId();
|
||||
String otherDeployParams = cmd.getOtherDeployParams();
|
||||
AutoScaleVmProfileVO vmProfile = getEntityInDatabase("Auto Scale Vm Profile", profileId, _autoScaleVmProfileDao);
|
||||
|
||||
if (templateId != null) {
|
||||
vmProfile.setTemplateId(templateId);
|
||||
}
|
||||
|
||||
if (otherDeployParams != null) {
|
||||
vmProfile.setOtherDeployParams(otherDeployParams);
|
||||
}
|
||||
|
||||
List<AutoScaleVmGroupVO> vmGroupList = _autoScaleVmGroupDao.listByAll(null, profileId);
|
||||
for (AutoScaleVmGroupVO vmGroupVO : vmGroupList) {
|
||||
if (vmGroupVO.getState() != "disabled") {
|
||||
throw new InvalidParameterValueException("Cannot delete AutoScale Vm Profile when it is being used in one or more Enabled AutoScale Vm Groups.");
|
||||
}
|
||||
}
|
||||
boolean success = _autoScaleVmProfileDao.update(profileId, vmProfile);
|
||||
|
||||
if (success) {
|
||||
s_logger.debug("Updated Auto Scale Vm Profile id=" + profileId);
|
||||
return vmProfile;
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DB
|
||||
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEPOLICY_CREATE, eventDescription = "creating autoscale policy")
|
||||
public AutoScalePolicy createAutoScalePolicy(CreateAutoScalePolicyCmd cmd) {
|
||||
|
||||
// Account owner = _accountDao.findById(cmd.getAccountId());
|
||||
// Account caller = UserContext.current().getCaller();
|
||||
// _accountMgr.checkAccess(caller, null, true, owner);
|
||||
|
||||
Integer duration = cmd.getDuration();
|
||||
Integer quietTime = cmd.getQuietTime();
|
||||
String action = cmd.getAction();
|
||||
|
||||
if (duration != null && duration < 0) {
|
||||
throw new InvalidParameterValueException("duration is an invalid value: " + duration);
|
||||
}
|
||||
|
||||
if (quietTime != null && quietTime < 0) {
|
||||
throw new InvalidParameterValueException("quiettime is an invalid value: " + quietTime);
|
||||
}
|
||||
|
||||
if (!NetUtils.isValidAutoScaleAction(action)) {
|
||||
throw new InvalidParameterValueException("action is invalid, only 'provision' and 'de-provision' is supported");
|
||||
}
|
||||
action = action.toLowerCase();
|
||||
|
||||
SearchBuilder<ConditionVO> policySearch = _conditionDao.createSearchBuilder();
|
||||
policySearch.and("ids", policySearch.entity().getId(), Op.IN);
|
||||
policySearch.done();
|
||||
SearchCriteria<ConditionVO> sc = policySearch.create();
|
||||
|
||||
List<Long> conditionIds = cmd.getConditionIds();
|
||||
sc.setParameters("ids", conditionIds.toArray(new Object[0]));
|
||||
List<ConditionVO> conditions = _conditionDao.search(sc, null);
|
||||
|
||||
ArrayList<Long> counterIds = new ArrayList<Long>();
|
||||
ControlledEntity[] sameOwnerEntities = conditions.toArray(new ControlledEntity[conditions.size() + 1]);
|
||||
AutoScalePolicyVO policyVO = new AutoScalePolicyVO(cmd.getDomainId(), cmd.getAccountId(), duration, quietTime, action);
|
||||
sameOwnerEntities[sameOwnerEntities.length - 1] = policyVO;
|
||||
_accountMgr.checkAccess(UserContext.current().getCaller(), null, true, sameOwnerEntities);
|
||||
|
||||
if (conditionIds.size() != conditions.size()) {
|
||||
// TODO report the condition id which could not be found
|
||||
throw new InvalidParameterValueException("Unable to find a condition specified");
|
||||
}
|
||||
for (ConditionVO condition : conditions) {
|
||||
if (counterIds.contains(condition.getCounterid())) {
|
||||
throw new InvalidParameterValueException("atleast two conditions in the conditionids have the same counter. It is not right to apply two different conditions for the same counter");
|
||||
}
|
||||
}
|
||||
|
||||
final Transaction txn = Transaction.currentTxn();
|
||||
txn.start();
|
||||
|
||||
policyVO = _autoScalePolicyDao.persist(policyVO);
|
||||
|
||||
for (Long conditionId : conditionIds) {
|
||||
AutoScalePolicyConditionMapVO policyConditionMapVO = new AutoScalePolicyConditionMapVO(policyVO.getId(), conditionId);
|
||||
_autoScalePolicyConditionMapDao.persist(policyConditionMapVO);
|
||||
}
|
||||
|
||||
txn.commit();
|
||||
|
||||
return policyVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DB
|
||||
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEPOLICY_DELETE, eventDescription = "deleting autoscale policy")
|
||||
public boolean deleteAutoScalePolicy(long id) {
|
||||
/* Check if entity is in database */
|
||||
getEntityInDatabase("AutoScale Policy", id, _autoScalePolicyDao);
|
||||
|
||||
if (_autoScaleVmGroupPolicyMapDao.isAutoScalePolicyInUse(id)) {
|
||||
throw new InvalidParameterValueException("Cannot delete AutoScale Policy when it is in use by one or more AutoScale Vm Groups");
|
||||
}
|
||||
|
||||
Transaction txn = Transaction.currentTxn();
|
||||
txn.start();
|
||||
|
||||
boolean success = true;
|
||||
success = _autoScalePolicyDao.remove(id);
|
||||
if (success) {
|
||||
success = _autoScalePolicyConditionMapDao.removeByAutoScalePolicyId(id);
|
||||
}
|
||||
if (success) {
|
||||
txn.commit();
|
||||
}
|
||||
return success; // successful
|
||||
}
|
||||
|
||||
public void checkCallerAccess(String accountName, Long domainId)
|
||||
{
|
||||
Account caller = UserContext.current().getCaller();
|
||||
Account owner = _accountDao.findActiveAccount(accountName, domainId);
|
||||
if (owner == null) {
|
||||
throw new InvalidParameterValueException("Unable to find account " + accountName + " in domain " + domainId);
|
||||
}
|
||||
_accountMgr.checkAccess(caller, null, true, owner);
|
||||
}
|
||||
|
||||
private class SearchWrapper<VO extends ControlledEntity> {
|
||||
GenericDao<VO, Long> dao;
|
||||
SearchBuilder<VO> searchBuilder;
|
||||
SearchCriteria<VO> searchCriteria;
|
||||
Long domainId;
|
||||
boolean isRecursive;
|
||||
List<Long> permittedAccounts = new ArrayList<Long>();
|
||||
ListProjectResourcesCriteria listProjectResourcesCriteria;
|
||||
Filter searchFilter;
|
||||
|
||||
public SearchWrapper(GenericDao<VO, Long> dao, Class<VO> entityClass, BaseListAccountResourcesCmd cmd, Long id)
|
||||
{
|
||||
this.dao = dao;
|
||||
this.searchBuilder = dao.createSearchBuilder();
|
||||
domainId = cmd.getDomainId();
|
||||
String accountName = cmd.getAccountName();
|
||||
isRecursive = cmd.isRecursive();
|
||||
boolean listAll = cmd.listAll();
|
||||
long startIndex = cmd.getStartIndex();
|
||||
long pageSizeVal = cmd.getPageSizeVal();
|
||||
Account caller = UserContext.current().getCaller();
|
||||
|
||||
Ternary<Long, Boolean, ListProjectResourcesCriteria> domainIdRecursiveListProject = new Ternary<Long, Boolean,
|
||||
ListProjectResourcesCriteria>(domainId, isRecursive, null);
|
||||
_accountMgr.buildACLSearchParameters(caller, id, accountName, null, permittedAccounts, domainIdRecursiveListProject,
|
||||
listAll, false);
|
||||
domainId = domainIdRecursiveListProject.first();
|
||||
isRecursive = domainIdRecursiveListProject.second();
|
||||
ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third();
|
||||
_accountMgr.buildACLSearchBuilder(searchBuilder, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria);
|
||||
searchFilter = new Filter(entityClass, "id", false, startIndex, pageSizeVal);
|
||||
}
|
||||
|
||||
public SearchBuilder<VO> getSearchBuilder() {
|
||||
return searchBuilder;
|
||||
}
|
||||
|
||||
public SearchCriteria<VO> buildSearchCriteria()
|
||||
{
|
||||
searchCriteria = searchBuilder.create();
|
||||
_accountMgr.buildACLSearchCriteria(searchCriteria, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria);
|
||||
return searchCriteria;
|
||||
}
|
||||
|
||||
public List<VO> search() {
|
||||
return dao.search(searchCriteria, searchFilter);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends AutoScalePolicy> listAutoScalePolicies(ListAutoScalePoliciesCmd cmd) {
|
||||
SearchWrapper<AutoScalePolicyVO> searchWrapper = new SearchWrapper<AutoScalePolicyVO>(_autoScalePolicyDao, AutoScalePolicyVO.class, cmd, cmd.getId());
|
||||
SearchBuilder<AutoScalePolicyVO> sb = searchWrapper.getSearchBuilder();
|
||||
Long id = cmd.getId();
|
||||
Long conditionId = cmd.getConditionId();
|
||||
|
||||
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
|
||||
|
||||
if (conditionId != null) {
|
||||
SearchBuilder<AutoScalePolicyConditionMapVO> asPolicyConditionSearch = _autoScalePolicyConditionMapDao.createSearchBuilder();
|
||||
asPolicyConditionSearch.and("conditionId", asPolicyConditionSearch.entity().getConditionId(), SearchCriteria.Op.EQ);
|
||||
sb.join("asPolicyConditionSearch", asPolicyConditionSearch, sb.entity().getId(), asPolicyConditionSearch.entity().getPolicyId(), JoinBuilder.JoinType.INNER);
|
||||
}
|
||||
|
||||
SearchCriteria<AutoScalePolicyVO> sc = searchWrapper.buildSearchCriteria();
|
||||
|
||||
if (id != null) {
|
||||
sc.setParameters("id", id);
|
||||
}
|
||||
|
||||
if (conditionId != null) {
|
||||
sc.setJoinParameters("asPolicyConditionSearch", "conditionId", conditionId);
|
||||
}
|
||||
return searchWrapper.search();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AutoScalePolicy updateAutoScalePolicy(UpdateAutoScalePolicyCmd cmd) {
|
||||
Long policyId = cmd.getId();
|
||||
Integer duration = cmd.getDuration();
|
||||
Integer quietTime = cmd.getQuietTime();
|
||||
AutoScalePolicyVO policy = getEntityInDatabase("Auto Scale Policy", policyId, _autoScalePolicyDao);
|
||||
|
||||
if (duration != null) {
|
||||
policy.setDuration(duration);
|
||||
}
|
||||
|
||||
if (quietTime != null) {
|
||||
policy.setQuietTime(quietTime);
|
||||
}
|
||||
|
||||
List<AutoScaleVmGroupPolicyMapVO> vmGroupPolicyList = _autoScaleVmGroupPolicyMapDao.listByPolicyId(policyId);
|
||||
for (AutoScaleVmGroupPolicyMapVO vmGroupPolicy : vmGroupPolicyList) {
|
||||
AutoScaleVmGroupVO vmGroupVO = _autoScaleVmGroupDao.findById(vmGroupPolicy.getVmGroupId());
|
||||
if (vmGroupVO.getState() != "disabled") {
|
||||
throw new InvalidParameterValueException("Cannot delete AutoScale Policy when it is being used in one or more Enabled AutoScale Vm Groups.");
|
||||
}
|
||||
}
|
||||
boolean success = _autoScalePolicyDao.update(policyId, policy);
|
||||
|
||||
if (success) {
|
||||
s_logger.debug("Updated Auto Scale Policy id=" + policyId);
|
||||
return policy;
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DB
|
||||
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_CREATE, eventDescription = "creating autoscale vm group")
|
||||
public AutoScaleVmGroup createAutoScaleVmGroup(CreateAutoScaleVmGroupCmd cmd) {
|
||||
int minMembers = cmd.getMinMembers();
|
||||
int maxMembers = cmd.getMaxMembers();
|
||||
|
||||
if (minMembers < 0) {
|
||||
throw new InvalidParameterValueException(ApiConstants.MIN_MEMBERS + " is an invalid value: " + minMembers);
|
||||
}
|
||||
|
||||
if (maxMembers < 0) {
|
||||
throw new InvalidParameterValueException(ApiConstants.MAX_MEMBERS + " is an invalid value: " + maxMembers);
|
||||
}
|
||||
if (minMembers > maxMembers) {
|
||||
throw new InvalidParameterValueException(ApiConstants.MIN_MEMBERS + " cannot be greater than " + ApiConstants.MAX_MEMBERS + ", range is invalid: " + minMembers + "-" + maxMembers);
|
||||
}
|
||||
|
||||
Integer interval = cmd.getInterval();
|
||||
if (interval != null && interval < 0) {
|
||||
throw new InvalidParameterValueException("interval is an invalid value: " + interval);
|
||||
}
|
||||
|
||||
LoadBalancerVO loadBalancer = getEntityInDatabase(ApiConstants.LBID, cmd.getLbRuleId(), _lbDao);
|
||||
|
||||
// Account owner = _accountDao.findById(loadBalancer.getAccountId());
|
||||
// Account caller = UserContext.current().getCaller();
|
||||
// _accountMgr.checkAccess(caller, null, true, owner);
|
||||
|
||||
Long zoneId = _ipAddressDao.findById(loadBalancer.getSourceIpAddressId()).getDataCenterId();
|
||||
|
||||
AutoScaleVmProfileVO profileVO = getEntityInDatabase(ApiConstants.VMPROFILE_ID, cmd.getProfileId(), _autoScaleVmProfileDao);
|
||||
|
||||
List<AutoScaleVmGroupVO> existingVmGroupVO = _autoScaleVmGroupDao.listByAll(loadBalancer.getId(), null);
|
||||
if (existingVmGroupVO.size() > 0) {
|
||||
throw new InvalidParameterValueException("an AutoScaleVmGroup is already attached to the lb rule, the existing vm group has to be first deleted");
|
||||
}
|
||||
|
||||
List<LoadBalancerVMMapVO> mappedInstances = _lb2VmMapDao.listByLoadBalancerId(loadBalancer.getId(), false);
|
||||
if (mappedInstances.size() > 0) {
|
||||
throw new InvalidParameterValueException("there are Vms already bound to the specified LoadBalancing Rule. User bound Vms and AutoScaled Vm Group cannot co-exist on a Load Balancing Rule");
|
||||
}
|
||||
|
||||
List<Counter> counters = new ArrayList<Counter>();
|
||||
List<AutoScalePolicyVO> policies = new ArrayList<AutoScalePolicyVO>();
|
||||
policies.addAll(getAutoScalePolicies("scaleuppolicyid", cmd.getScaleUpPolicyIds(), counters, interval, true));
|
||||
policies.addAll(getAutoScalePolicies("scaledownpolicyid", cmd.getScaleDownPolicyIds(), counters, interval, false));
|
||||
|
||||
ControlledEntity[] sameOwnerEntities = policies.toArray(new ControlledEntity[policies.size() + 2]);
|
||||
sameOwnerEntities[sameOwnerEntities.length - 2] = loadBalancer;
|
||||
sameOwnerEntities[sameOwnerEntities.length - 1] = profileVO;
|
||||
_accountMgr.checkAccess(UserContext.current().getCaller(), null, true, sameOwnerEntities);
|
||||
|
||||
// validateAutoScaleCounters(loadBalancer.getNetworkId(), counters);
|
||||
|
||||
final Transaction txn = Transaction.currentTxn();
|
||||
txn.start();
|
||||
|
||||
AutoScaleVmGroupVO vmGroupVO = new AutoScaleVmGroupVO(cmd.getLbRuleId(), zoneId, loadBalancer.getDomainId(), loadBalancer.getAccountId(), minMembers, maxMembers, loadBalancer.getDefaultPortStart(), interval,
|
||||
cmd.getProfileId(), "enabled");
|
||||
vmGroupVO = _autoScaleVmGroupDao.persist(vmGroupVO);
|
||||
|
||||
for (AutoScalePolicyVO autoScalePolicyVO : policies) {
|
||||
_autoScaleVmGroupPolicyMapDao.persist(new AutoScaleVmGroupPolicyMapVO(vmGroupVO.getId(), autoScalePolicyVO.getId()));
|
||||
}
|
||||
txn.commit();
|
||||
return vmGroupVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean configureAutoScaleVmGroup(CreateAutoScaleVmGroupCmd cmd) {
|
||||
return _lbRulesMgr.configureLbAutoScaleVmGroup(cmd.getEntityId(), true);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@DB
|
||||
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_DELETE, eventDescription = "deleting autoscale vm group")
|
||||
public boolean deleteAutoScaleVmGroup(long id) {
|
||||
/* Check if entity is in database */
|
||||
AutoScaleVmGroupVO autoScaleVmGroupVO = getEntityInDatabase("AutoScale Vm Group", id, _autoScaleVmGroupDao);
|
||||
autoScaleVmGroupVO.setRevoke(true);
|
||||
|
||||
// TODO: call configureAutoScaleVmGroup
|
||||
|
||||
Transaction txn = Transaction.currentTxn();
|
||||
txn.start();
|
||||
boolean success = _autoScaleVmGroupDao.remove(id);
|
||||
if (success)
|
||||
success = _autoScaleVmGroupPolicyMapDao.remove(id);
|
||||
if (success)
|
||||
txn.commit();
|
||||
return success;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends AutoScaleVmGroup> listAutoScaleVmGroups(ListAutoScaleVmGroupsCmd cmd) {
|
||||
Long id = cmd.getId();
|
||||
Long policyId = cmd.getPolicyId();
|
||||
Long loadBalancerId = cmd.getLoadBalancerId();
|
||||
Long profileId = cmd.getProfileId();
|
||||
Long zoneId = cmd.getZoneId();
|
||||
|
||||
SearchWrapper<AutoScaleVmGroupVO> searchWrapper = new SearchWrapper<AutoScaleVmGroupVO>(_autoScaleVmGroupDao, AutoScaleVmGroupVO.class, cmd, cmd.getId());
|
||||
SearchBuilder<AutoScaleVmGroupVO> sb = searchWrapper.getSearchBuilder();
|
||||
|
||||
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
|
||||
sb.and("loadBalancerId", sb.entity().getLoadBalancerId(), SearchCriteria.Op.EQ);
|
||||
sb.and("profileId", sb.entity().getProfileId(), SearchCriteria.Op.EQ);
|
||||
sb.and("zoneId", sb.entity().getZoneId(), SearchCriteria.Op.EQ);
|
||||
|
||||
if (policyId != null) {
|
||||
SearchBuilder<AutoScaleVmGroupPolicyMapVO> asVmGroupPolicySearch = _autoScaleVmGroupPolicyMapDao.createSearchBuilder();
|
||||
asVmGroupPolicySearch.and("policyId", asVmGroupPolicySearch.entity().getPolicyId(), SearchCriteria.Op.EQ);
|
||||
sb.join("asVmGroupPolicySearch", asVmGroupPolicySearch, sb.entity().getId(), asVmGroupPolicySearch.entity().getVmGroupId(), JoinBuilder.JoinType.INNER);
|
||||
}
|
||||
|
||||
SearchCriteria<AutoScaleVmGroupVO> sc = searchWrapper.buildSearchCriteria();
|
||||
if (id != null) {
|
||||
sc.setParameters("id", id);
|
||||
}
|
||||
if (loadBalancerId != null) {
|
||||
sc.setParameters("loadBalancerId", loadBalancerId);
|
||||
}
|
||||
if (profileId != null) {
|
||||
sc.setParameters("profileId", profileId);
|
||||
}
|
||||
if (zoneId != null) {
|
||||
sc.setParameters("zoneId", zoneId);
|
||||
}
|
||||
if (policyId != null) {
|
||||
sc.setJoinParameters("asVmGroupPolicySearch", "policyId", policyId);
|
||||
}
|
||||
return searchWrapper.search();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AutoScaleVmGroup updateAutoScaleVmGroup(UpdateAutoScaleVmGroupCmd cmd) {
|
||||
Long vmGroupId = cmd.getId();
|
||||
Integer minMembers = cmd.getMinMembers();
|
||||
Integer maxMembers = cmd.getMaxMembers();
|
||||
List<Long> scaleUpPolicyIds = cmd.getScaleUpPolicyIds();
|
||||
List<Long> scaleDownPolicyIds = cmd.getScaleDownPolicyIds();
|
||||
|
||||
AutoScaleVmGroupVO vmGroupVO = getEntityInDatabase("Auto Scale Vm Group", vmGroupId, _autoScaleVmGroupDao);
|
||||
|
||||
if (minMembers < 0) {
|
||||
throw new InvalidParameterValueException(ApiConstants.MIN_MEMBERS + " is an invalid value: " + minMembers);
|
||||
}
|
||||
|
||||
if (maxMembers < 0) {
|
||||
throw new InvalidParameterValueException(ApiConstants.MAX_MEMBERS + " is an invalid value: " + maxMembers);
|
||||
}
|
||||
if (minMembers > maxMembers) {
|
||||
throw new InvalidParameterValueException(ApiConstants.MIN_MEMBERS + " cannot be greater than " + ApiConstants.MAX_MEMBERS + ", range is invalid: " + minMembers + "-" + maxMembers);
|
||||
}
|
||||
|
||||
if (vmGroupVO.getState() == "enabled") {
|
||||
throw new InvalidParameterValueException("Cannot delete AutoScale Vm Groups when it is in Enabled state.");
|
||||
}
|
||||
|
||||
if (minMembers != null) {
|
||||
vmGroupVO.setMinMembers(minMembers);
|
||||
}
|
||||
|
||||
if (maxMembers != null) {
|
||||
vmGroupVO.setMaxMembers(maxMembers);
|
||||
}
|
||||
if (scaleDownPolicyIds != null) {
|
||||
// TODO - checkIDs and set
|
||||
}
|
||||
|
||||
if (scaleUpPolicyIds != null) {
|
||||
// TODO - checkIDs and set
|
||||
}
|
||||
|
||||
boolean success = _autoScaleVmGroupDao.update(vmGroupId, vmGroupVO);
|
||||
|
||||
if (success) {
|
||||
s_logger.debug("Updated Auto Scale VmGroup id=" + vmGroupId);
|
||||
return vmGroupVO;
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AutoScaleVmGroup enableAutoScaleVmGroup(Long id) {
|
||||
AutoScaleVmGroupVO vmGroup = getEntityInDatabase("Auto Scale Vm Group", id, _autoScaleVmGroupDao);
|
||||
boolean success = false;
|
||||
if (vmGroup.getState() == "enabled") {
|
||||
throw new InvalidParameterValueException("The AutoScale Vm Group is already in Enabled state.");
|
||||
} else {
|
||||
vmGroup.setState("enabled");
|
||||
success = _lbRulesMgr.configureLbAutoScaleVmGroup(id, false);
|
||||
}
|
||||
if (success)
|
||||
return vmGroup;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AutoScaleVmGroup disableAutoScaleVmGroup(Long id) {
|
||||
AutoScaleVmGroupVO vmGroup = getEntityInDatabase("Auto Scale Vm Group", id, _autoScaleVmGroupDao);
|
||||
boolean success = false;
|
||||
if (vmGroup.getState() == "disabled") {
|
||||
throw new InvalidParameterValueException("The AutoScale Vm Group is already in Disabled state.");
|
||||
} else {
|
||||
vmGroup.setState("disabled");
|
||||
success = _lbRulesMgr.configureLbAutoScaleVmGroup(id, false);
|
||||
}
|
||||
if (success)
|
||||
return vmGroup;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ActionEvent(eventType = EventTypes.EVENT_COUNTER_CREATE, eventDescription = "Counter", create = true)
|
||||
@DB
|
||||
public Counter createCounter(CreateCounterCmd cmd) {
|
||||
String source = cmd.getSource().toLowerCase();
|
||||
String name = cmd.getName();
|
||||
Counter.Source src;
|
||||
// Validate Source
|
||||
try {
|
||||
src = Counter.Source.valueOf(source);
|
||||
} catch (Exception ex) {
|
||||
throw new InvalidParameterValueException("The Source " + source + " does not exist; Unable to create Counter");
|
||||
}
|
||||
|
||||
CounterVO counter = null;
|
||||
|
||||
s_logger.debug("Adding Counter " + name);
|
||||
counter = _counterDao.persist(new CounterVO(src, name, cmd.getValue()));
|
||||
|
||||
UserContext.current().setEventDetails(" Id: " + counter.getId() + " Name: " + name);
|
||||
return counter;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ActionEvent(eventType = EventTypes.EVENT_CONDITION_CREATE, eventDescription = "Condition", create = true)
|
||||
@DB
|
||||
public Condition createCondition(CreateConditionCmd cmd) {
|
||||
checkCallerAccess(cmd.getAccountName(), cmd.getDomainId());
|
||||
String opr = cmd.getRelationalOperator().toUpperCase();
|
||||
long cid = cmd.getCounterId();
|
||||
long threshold = cmd.getThreshold();
|
||||
Condition.Operator op;
|
||||
// Validate Relational Operator
|
||||
try {
|
||||
op = Condition.Operator.valueOf(opr);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
throw new InvalidParameterValueException("The Operator " + opr + " does not exist; Unable to create Condition.");
|
||||
}
|
||||
// TODO - Validate threshold
|
||||
|
||||
CounterVO counter = _counterDao.findById(cid);
|
||||
|
||||
if (counter == null) {
|
||||
throw new InvalidParameterValueException("Unable to find condition - " + cid);
|
||||
}
|
||||
ConditionVO condition = null;
|
||||
|
||||
s_logger.debug("Adding Condition ");
|
||||
condition = _conditionDao.persist(new ConditionVO(cid, threshold, cmd.getEntityOwnerId(), cmd.getDomainId(), op));
|
||||
|
||||
UserContext.current().setEventDetails(" Id: " + condition.getId());
|
||||
return condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Counter> listCounters(ListCountersCmd cmd) {
|
||||
String name = cmd.getName();
|
||||
Long id = cmd.getId();
|
||||
String source = cmd.getSource();
|
||||
if(source != null )
|
||||
source = source.toLowerCase();
|
||||
|
||||
Filter searchFilter = new Filter(CounterVO.class, "created", false, cmd.getStartIndex(), cmd.getPageSizeVal());
|
||||
|
||||
List<CounterVO> counters = _counterDao.listCounters(id, name, source, cmd.getKeyword(), searchFilter);
|
||||
|
||||
return counters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Condition> listConditions(ListConditionsCmd cmd) {
|
||||
Long id = cmd.getId();
|
||||
Long counterId = cmd.getCounterId();
|
||||
SearchWrapper<ConditionVO> searchWrapper = new SearchWrapper<ConditionVO>(_conditionDao, ConditionVO.class, cmd, cmd.getId());
|
||||
SearchBuilder<ConditionVO> sb = searchWrapper.getSearchBuilder();
|
||||
|
||||
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
|
||||
sb.and("counterId", sb.entity().getCounterid(), SearchCriteria.Op.EQ);
|
||||
|
||||
// now set the SC criteria...
|
||||
SearchCriteria<ConditionVO> sc = searchWrapper.buildSearchCriteria();
|
||||
|
||||
if (id != null) {
|
||||
sc.addAnd("id", SearchCriteria.Op.EQ, id);
|
||||
}
|
||||
|
||||
if (counterId != null) {
|
||||
sc.addAnd("counterId", SearchCriteria.Op.EQ, counterId);
|
||||
}
|
||||
|
||||
return searchWrapper.search();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ActionEvent(eventType = EventTypes.EVENT_COUNTER_DELETE, eventDescription = "counter")
|
||||
public boolean deleteCounter(long counterId) throws ResourceInUseException {
|
||||
// Verify Counter id
|
||||
CounterVO counter = _counterDao.findById(counterId);
|
||||
if (counter == null) {
|
||||
throw new InvalidParameterValueException("Unable to find Counter");
|
||||
}
|
||||
|
||||
// Verify if it is used in any Condition
|
||||
|
||||
ConditionVO condition = _conditionDao.findByCounterId(counterId);
|
||||
if (condition != null) {
|
||||
s_logger.info("Cannot delete counter " + counter.getName() + " as it is being used in a condition.");
|
||||
throw new ResourceInUseException("Counter is in use.");
|
||||
}
|
||||
|
||||
s_logger.debug("Deleting Counter " + counter.getName());
|
||||
return _counterDao.remove(counterId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ActionEvent(eventType = EventTypes.EVENT_COUNTER_DELETE, eventDescription = "condition")
|
||||
public boolean deleteCondition(long conditionId) throws ResourceInUseException {
|
||||
/* Check if entity is in database */
|
||||
ConditionVO condition = getEntityInDatabase("Condition", conditionId, _conditionDao);
|
||||
if (condition == null) {
|
||||
throw new InvalidParameterValueException("Unable to find Condition");
|
||||
}
|
||||
|
||||
// Verify if condition is used in any autoscale policy
|
||||
if (_autoScalePolicyConditionMapDao.isConditionInUse(conditionId)) {
|
||||
s_logger.info("Cannot delete condition " + conditionId + " as it is being used in a condition.");
|
||||
throw new ResourceInUseException("Cannot delete Condition when it is in use by one or more AutoScale Policies.");
|
||||
}
|
||||
s_logger.debug("Deleting Condition " + condition.getId());
|
||||
return _conditionDao.remove(conditionId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name=("autoscale_policy_condition_map"))
|
||||
public class AutoScalePolicyConditionMapVO {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
@Column(name="id")
|
||||
private long id;
|
||||
|
||||
@Column(name="policy_id")
|
||||
private long policyId;
|
||||
|
||||
@Column(name="condition_id")
|
||||
private long conditionId;
|
||||
|
||||
@Column(name="revoke")
|
||||
private boolean revoke = false;
|
||||
|
||||
public AutoScalePolicyConditionMapVO() { }
|
||||
|
||||
public AutoScalePolicyConditionMapVO(long policyId, long conditionId) {
|
||||
this.policyId = policyId;
|
||||
this.conditionId = conditionId;
|
||||
}
|
||||
|
||||
public AutoScalePolicyConditionMapVO(long policyId, long conditionId, boolean revoke) {
|
||||
this(policyId, conditionId);
|
||||
this.revoke = revoke;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public long getPolicyId() {
|
||||
return policyId;
|
||||
}
|
||||
|
||||
public long getConditionId() {
|
||||
return conditionId;
|
||||
}
|
||||
|
||||
public boolean isRevoke() {
|
||||
return revoke;
|
||||
}
|
||||
|
||||
public void setRevoke(boolean revoke) {
|
||||
this.revoke = revoke;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Inheritance;
|
||||
import javax.persistence.InheritanceType;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
import com.cloud.utils.net.NetUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "autoscale_policies")
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
public class AutoScalePolicyVO implements AutoScalePolicy {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
long id;
|
||||
|
||||
@Column(name = "uuid")
|
||||
String uuid;
|
||||
|
||||
@Column(name = "domain_id")
|
||||
private long domainId;
|
||||
|
||||
@Column(name = "account_id")
|
||||
private long accountId;
|
||||
|
||||
@Column(name = "duration")
|
||||
private Integer duration;
|
||||
|
||||
@Column(name = "quiet_time", updatable = true, nullable = false)
|
||||
private Integer quietTime = NetUtils.DEFAULT_AUTOSCALE_POLICY_QUIET_TIME;
|
||||
|
||||
@Column(name = "action", updatable = false, nullable = false)
|
||||
private String action;
|
||||
|
||||
@Column(name = GenericDao.REMOVED_COLUMN)
|
||||
protected Date removed;
|
||||
|
||||
@Column(name = GenericDao.CREATED_COLUMN)
|
||||
protected Date created;
|
||||
|
||||
public AutoScalePolicyVO() {
|
||||
}
|
||||
|
||||
public AutoScalePolicyVO(long domainId, long accountId, Integer duration, Integer quietTime, String action) {
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
this.domainId = domainId;
|
||||
this.accountId = accountId;
|
||||
this.duration = duration;
|
||||
if (quietTime != null) {
|
||||
this.quietTime = quietTime;
|
||||
}
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("AutoScalePolicy[").append("id-").append(id).append("]").toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getQuietTime() {
|
||||
return quietTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public Date getRemoved() {
|
||||
return removed;
|
||||
}
|
||||
|
||||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setDuration(Integer duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public void setQuietTime(Integer quietTime) {
|
||||
this.quietTime = quietTime;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name=("autoscale_vmgroup_policy_map"))
|
||||
public class AutoScaleVmGroupPolicyMapVO {
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
@Column(name="id")
|
||||
private long id;
|
||||
|
||||
@Column(name="vmgroup_id")
|
||||
private long vmGroupId;
|
||||
|
||||
@Column(name="policy_id")
|
||||
private long policyId;
|
||||
|
||||
@Column(name="revoke")
|
||||
private boolean revoke = false;
|
||||
|
||||
public AutoScaleVmGroupPolicyMapVO() { }
|
||||
|
||||
public AutoScaleVmGroupPolicyMapVO(long vmGroupId, long policyId) {
|
||||
this.vmGroupId = vmGroupId;
|
||||
this.policyId = policyId;
|
||||
}
|
||||
|
||||
public AutoScaleVmGroupPolicyMapVO(long vmgroupId, long policyId, boolean revoke) {
|
||||
this(vmgroupId, policyId);
|
||||
this.revoke = revoke;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public long getVmGroupId() {
|
||||
return vmGroupId;
|
||||
}
|
||||
|
||||
public long getPolicyId() {
|
||||
return policyId;
|
||||
}
|
||||
|
||||
public boolean isRevoke() {
|
||||
return revoke;
|
||||
}
|
||||
|
||||
public void setRevoke(boolean revoke) {
|
||||
this.revoke = revoke;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Inheritance;
|
||||
import javax.persistence.InheritanceType;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
import com.cloud.utils.net.NetUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "autoscale_vmgroups")
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
public class AutoScaleVmGroupVO implements AutoScaleVmGroup {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
long id;
|
||||
|
||||
@Column(name = "uuid")
|
||||
String uuid;
|
||||
|
||||
@Column(name = "zone_id", updatable = false)
|
||||
private long zoneId;
|
||||
|
||||
@Column(name = "domain_id", updatable = false)
|
||||
private long domainId;
|
||||
|
||||
@Column(name = "account_id")
|
||||
private long accountId;
|
||||
|
||||
@Column(name = "load_balancer_id")
|
||||
private long loadBalancerId;
|
||||
|
||||
@Column(name = "min_members", updatable = true)
|
||||
private int minMembers;
|
||||
|
||||
@Column(name = "max_members", updatable = true)
|
||||
private int maxMembers;
|
||||
|
||||
@Column(name = "member_port")
|
||||
private int memberPort;
|
||||
|
||||
@Column(name = "interval")
|
||||
private Integer interval = NetUtils.DEFAULT_AUTOSCALE_POLICY_INTERVAL_TIME;
|
||||
|
||||
@Column(name = "profile_id")
|
||||
private long profileId;
|
||||
|
||||
@Column(name = GenericDao.REMOVED_COLUMN)
|
||||
protected Date removed;
|
||||
|
||||
@Column(name = GenericDao.CREATED_COLUMN)
|
||||
protected Date created;
|
||||
|
||||
@Column(name = "revoke")
|
||||
private boolean revoke = false;
|
||||
|
||||
@Column(name = "state")
|
||||
private String state;
|
||||
|
||||
public AutoScaleVmGroupVO() {
|
||||
}
|
||||
|
||||
public AutoScaleVmGroupVO(long lbRuleId, long zoneId, long domainId, long accountId, Integer minMembers, Integer maxMembers, Integer memberPort, Integer interval, long profileId, String state) {
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
this.minMembers = minMembers;
|
||||
this.maxMembers = maxMembers;
|
||||
this.memberPort = memberPort;
|
||||
this.profileId = profileId;
|
||||
this.accountId = accountId;
|
||||
this.domainId = domainId;
|
||||
this.zoneId = zoneId;
|
||||
this.state = state;
|
||||
if (interval != null) {
|
||||
this.interval = interval;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("AutoScaleVmGroupVO[").append("id").append("]").toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public long getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLoadBalancerId() {
|
||||
return loadBalancerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinMembers() {
|
||||
return minMembers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMembers() {
|
||||
return maxMembers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMemberPort() {
|
||||
return memberPort;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInterval() {
|
||||
return interval;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getProfileId() {
|
||||
return profileId;
|
||||
}
|
||||
|
||||
public Date getRemoved() {
|
||||
return removed;
|
||||
}
|
||||
|
||||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRevoke() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setRevoke(boolean revoke) {
|
||||
this.revoke = revoke;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public void setMinMembers(int minMembers) {
|
||||
this.minMembers = minMembers;
|
||||
}
|
||||
|
||||
public void setMaxMembers(int maxMembers) {
|
||||
this.maxMembers = maxMembers;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,212 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Inheritance;
|
||||
import javax.persistence.InheritanceType;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.cloud.api.Identity;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
import com.cloud.utils.net.NetUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "autoscale_vmprofiles")
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
public class AutoScaleVmProfileVO implements AutoScaleVmProfile, Identity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
protected long id;
|
||||
|
||||
@Column(name = "uuid")
|
||||
protected String uuid;
|
||||
|
||||
@Column(name = "zone_id", updatable = true, nullable = false)
|
||||
protected Long zoneId;
|
||||
|
||||
@Column(name = "domain_id", updatable = true)
|
||||
private long domainId;
|
||||
|
||||
@Column(name = "account_id")
|
||||
private long accountId;
|
||||
|
||||
@Column(name = "autoscale_user_id")
|
||||
private long autoscaleUserId;
|
||||
|
||||
@Column(name = "service_offering_id", updatable = true, nullable = false)
|
||||
private Long serviceOfferingId;
|
||||
|
||||
@Column(name = "template_id", updatable = true, nullable = false, length = 17)
|
||||
private Long templateId;
|
||||
|
||||
@Column(name = "other_deploy_params", updatable = true, length = 1024)
|
||||
private String otherDeployParams;
|
||||
|
||||
@Column(name = "destroy_vm_grace_period", updatable = true)
|
||||
private Integer destroyVmGraceperiod = NetUtils.DEFAULT_AUTOSCALE_VM_DESTROY_TIME;
|
||||
|
||||
@Column(name = "snmp_community", updatable = true)
|
||||
private String snmpCommunity = NetUtils.DEFAULT_SNMP_COMMUNITY;
|
||||
|
||||
@Column(name = "snmp_port", updatable = true)
|
||||
private Integer snmpPort = NetUtils.DEFAULT_SNMP_PORT;
|
||||
|
||||
@Column(name = GenericDao.REMOVED_COLUMN)
|
||||
protected Date removed;
|
||||
|
||||
@Column(name = GenericDao.CREATED_COLUMN)
|
||||
protected Date created;
|
||||
|
||||
public AutoScaleVmProfileVO() {
|
||||
}
|
||||
|
||||
public AutoScaleVmProfileVO(long zoneId, long domainId, long accountId, long serviceOfferingId, long templateId, String otherDeployParams, String snmpCommunity, Integer snmpPort, Integer destroyVmGraceperiod,
|
||||
long autoscaleUserId) {
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
setZoneId(zoneId);
|
||||
setDomainId(domainId);
|
||||
setAccountId(accountId);
|
||||
setServiceOfferingId(serviceOfferingId);
|
||||
setTemplateId(templateId);
|
||||
setOtherDeployParams(otherDeployParams);
|
||||
setAutoscaleUserId(autoscaleUserId);
|
||||
if (destroyVmGraceperiod != null) {
|
||||
setDestroyVmGraceperiod(destroyVmGraceperiod);
|
||||
}
|
||||
if (snmpCommunity != null) {
|
||||
setSnmpCommunity(snmpCommunity);
|
||||
}
|
||||
if (snmpPort != null) {
|
||||
setSnmpPort(snmpPort);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("AutoScaleVMProfileVO[").append("id").append(id).append("-").append("templateId").append("-").append(templateId).append("]").toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public void setTemplateId(Long templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getServiceOfferingId() {
|
||||
return serviceOfferingId;
|
||||
}
|
||||
|
||||
public void setServiceOfferingId(Long serviceOfferingId) {
|
||||
this.serviceOfferingId = serviceOfferingId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOtherDeployParams() {
|
||||
return otherDeployParams;
|
||||
}
|
||||
|
||||
public void setOtherDeployParams(String otherDeployParams) {
|
||||
this.otherDeployParams = otherDeployParams;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSnmpCommunity() {
|
||||
return snmpCommunity;
|
||||
}
|
||||
|
||||
public void setSnmpCommunity(String snmpCommunity) {
|
||||
this.snmpCommunity = snmpCommunity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getSnmpPort() {
|
||||
return snmpPort;
|
||||
}
|
||||
|
||||
public void setSnmpPort(Integer snmpPort) {
|
||||
this.snmpPort = snmpPort;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public void setZoneId(long zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public void setAutoscaleUserId(long autoscaleUserId) {
|
||||
this.autoscaleUserId = autoscaleUserId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public void setAccountId(long accountId) {
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
public void setDomainId(Long domainId) {
|
||||
this.domainId = domainId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDestroyVmGraceperiod() {
|
||||
return destroyVmGraceperiod;
|
||||
}
|
||||
|
||||
public void setDestroyVmGraceperiod(Integer destroyVmGraceperiod) {
|
||||
this.destroyVmGraceperiod = destroyVmGraceperiod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAutoScaleUserId() {
|
||||
return autoscaleUserId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.network.as;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.cloud.api.Identity;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
@Entity
|
||||
@Table(name = "conditions")
|
||||
public class ConditionVO implements Condition, Identity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private long id;
|
||||
|
||||
@Column(name = "counter_id")
|
||||
private long counterid;
|
||||
|
||||
@Column(name = "threshold")
|
||||
private long threshold;
|
||||
|
||||
@Column(name = "relational_operator")
|
||||
@Enumerated(value = EnumType.STRING)
|
||||
private Operator relationalOperator;
|
||||
|
||||
@Column(name = "domain_id")
|
||||
protected long domainId;
|
||||
|
||||
@Column(name = "account_id")
|
||||
protected long accountId;
|
||||
|
||||
@Column(name = "uuid")
|
||||
private String uuid;
|
||||
|
||||
@Column(name = GenericDao.REMOVED_COLUMN)
|
||||
Date removed;
|
||||
|
||||
@Column(name = GenericDao.CREATED_COLUMN)
|
||||
Date created;
|
||||
|
||||
public ConditionVO() {
|
||||
}
|
||||
|
||||
public ConditionVO(long counterid, long threshold, long accountId, long domainId, Operator relationalOperator) {
|
||||
this.counterid = counterid;
|
||||
this.threshold = threshold;
|
||||
this.relationalOperator = relationalOperator;
|
||||
this.accountId = accountId;
|
||||
this.domainId = domainId;
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("Condition[").append("id-").append(id).append("]").toString();
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getCounterid() {
|
||||
return counterid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getThreshold() {
|
||||
return threshold;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Operator getRelationalOperator() {
|
||||
return relationalOperator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return this.uuid;
|
||||
}
|
||||
|
||||
public Date getRemoved() {
|
||||
return removed;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.network.as;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.cloud.api.Identity;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
@Entity
|
||||
@Table(name = "counter")
|
||||
public class CounterVO implements Counter, Identity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private long id;
|
||||
|
||||
@Column(name = "source")
|
||||
@Enumerated(value = EnumType.STRING)
|
||||
private Source source;
|
||||
|
||||
@Column(name = "name")
|
||||
private String name;
|
||||
|
||||
@Column(name = "value")
|
||||
private String value;
|
||||
|
||||
@Column(name = "uuid")
|
||||
private String uuid;
|
||||
|
||||
@Column(name = GenericDao.REMOVED_COLUMN)
|
||||
Date removed;
|
||||
|
||||
@Column(name = GenericDao.CREATED_COLUMN)
|
||||
Date created;
|
||||
|
||||
public CounterVO() {
|
||||
}
|
||||
|
||||
public CounterVO(Source source, String name, String value) {
|
||||
this.source = source;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("Counter[").append("id-").append(id).append("]").toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Source getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return this.uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public Date getRemoved() {
|
||||
return removed;
|
||||
}
|
||||
|
||||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.network.as.AutoScalePolicyConditionMapVO;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface AutoScalePolicyConditionMapDao extends GenericDao<AutoScalePolicyConditionMapVO, Long> {
|
||||
List<AutoScalePolicyConditionMapVO> listByAll(Long policyId, Long conditionId);
|
||||
public boolean isConditionInUse(Long conditionId);
|
||||
boolean removeByAutoScalePolicyId(long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import com.cloud.network.as.AutoScalePolicyConditionMapVO;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
|
||||
@Local(value={AutoScalePolicyConditionMapDao.class})
|
||||
public class AutoScalePolicyConditionMapDaoImpl extends GenericDaoBase<AutoScalePolicyConditionMapVO, Long> implements AutoScalePolicyConditionMapDao {
|
||||
|
||||
private SearchCriteria<AutoScalePolicyConditionMapVO> getSearchCriteria(Long policyId, Long conditionId)
|
||||
{
|
||||
SearchCriteria<AutoScalePolicyConditionMapVO> sc = createSearchCriteria();
|
||||
|
||||
if(policyId != null)
|
||||
sc.addAnd("policyId", SearchCriteria.Op.EQ, policyId);
|
||||
|
||||
if(conditionId != null)
|
||||
sc.addAnd("conditionId", SearchCriteria.Op.EQ, conditionId);
|
||||
|
||||
return sc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AutoScalePolicyConditionMapVO> listByAll(Long policyId, Long conditionId) {
|
||||
return listBy(getSearchCriteria(policyId, conditionId));
|
||||
}
|
||||
|
||||
public boolean isConditionInUse(Long conditionId) {
|
||||
return findOneBy(getSearchCriteria(null, conditionId)) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeByAutoScalePolicyId(long policyId) {
|
||||
SearchCriteria<AutoScalePolicyConditionMapVO> sc = createSearchCriteria();
|
||||
sc.addAnd("policyId", SearchCriteria.Op.EQ, policyId);
|
||||
return expunge(sc) > 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import com.cloud.network.as.AutoScalePolicyVO;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface AutoScalePolicyDao extends GenericDao<AutoScalePolicyVO, Long> {
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import com.cloud.network.as.AutoScalePolicyVO;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
|
||||
@Local(value = { AutoScalePolicyDao.class })
|
||||
public class AutoScalePolicyDaoImpl extends GenericDaoBase<AutoScalePolicyVO, Long> implements AutoScalePolicyDao {
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.network.as.AutoScaleVmGroupVO;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface AutoScaleVmGroupDao extends GenericDao<AutoScaleVmGroupVO, Long> {
|
||||
List<AutoScaleVmGroupVO> listByAll(Long loadBalancerId, Long profileId);
|
||||
boolean isProfileInUse(long profileId);
|
||||
boolean isAutoScaleLoadBalancer(Long loadBalancerId);
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import com.cloud.network.as.AutoScaleVmGroupVO;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.GenericSearchBuilder;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
import com.cloud.utils.db.SearchCriteria.Func;
|
||||
|
||||
@Local(value = { AutoScaleVmGroupDao.class })
|
||||
public class AutoScaleVmGroupDaoImpl extends GenericDaoBase<AutoScaleVmGroupVO, Long> implements AutoScaleVmGroupDao {
|
||||
|
||||
@Override
|
||||
public List<AutoScaleVmGroupVO> listByAll(Long loadBalancerId, Long profileId) {
|
||||
SearchCriteria<AutoScaleVmGroupVO> sc = createSearchCriteria();
|
||||
|
||||
if(loadBalancerId != null)
|
||||
sc.addAnd("loadBalancerId", SearchCriteria.Op.EQ, loadBalancerId);
|
||||
|
||||
if(profileId != null)
|
||||
sc.addAnd("profileId", SearchCriteria.Op.EQ, profileId);
|
||||
|
||||
return listBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isProfileInUse(long profileId) {
|
||||
SearchCriteria<AutoScaleVmGroupVO> sc = createSearchCriteria();
|
||||
sc.addAnd("profileId", SearchCriteria.Op.EQ, profileId);
|
||||
return findOneBy(sc) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoScaleLoadBalancer(Long loadBalancerId) {
|
||||
GenericSearchBuilder<AutoScaleVmGroupVO, Long> CountByAccount = createSearchBuilder(Long.class);
|
||||
CountByAccount.select(null, Func.COUNT, null);
|
||||
CountByAccount.and("loadBalancerId", CountByAccount.entity().getLoadBalancerId(), SearchCriteria.Op.EQ);
|
||||
|
||||
SearchCriteria<Long> sc = CountByAccount.create();
|
||||
sc.setParameters("loadBalancerId", loadBalancerId);
|
||||
return customSearch(sc, null).get(0) > 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.network.LoadBalancerVMMapVO;
|
||||
import com.cloud.network.as.AutoScaleVmGroupPolicyMapVO;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface AutoScaleVmGroupPolicyMapDao extends GenericDao<AutoScaleVmGroupPolicyMapVO, Long> {
|
||||
boolean removeByGroupId(long vmGroupId);
|
||||
List<AutoScaleVmGroupPolicyMapVO> listByVmGroupId(long vmGroupId);
|
||||
List<AutoScaleVmGroupPolicyMapVO> listByPolicyId(long policyId);
|
||||
public boolean isAutoScalePolicyInUse(long policyId);
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import com.cloud.network.as.AutoScaleVmGroupPolicyMapVO;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
|
||||
@Local(value={AutoScaleVmGroupPolicyMapDao.class})
|
||||
public class AutoScaleVmGroupPolicyMapDaoImpl extends GenericDaoBase<AutoScaleVmGroupPolicyMapVO, Long> implements AutoScaleVmGroupPolicyMapDao {
|
||||
|
||||
@Override
|
||||
public boolean removeByGroupId(long vmGroupId) {
|
||||
SearchCriteria<AutoScaleVmGroupPolicyMapVO> sc = createSearchCriteria();
|
||||
sc.addAnd("vmGroupId", SearchCriteria.Op.EQ, vmGroupId);
|
||||
|
||||
return expunge(sc) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AutoScaleVmGroupPolicyMapVO> listByVmGroupId(long vmGroupId) {
|
||||
SearchCriteria<AutoScaleVmGroupPolicyMapVO> sc = createSearchCriteria();
|
||||
sc.addAnd("vmGroupId", SearchCriteria.Op.EQ, vmGroupId);
|
||||
return listBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AutoScaleVmGroupPolicyMapVO> listByPolicyId(long policyId) {
|
||||
SearchCriteria<AutoScaleVmGroupPolicyMapVO> sc = createSearchCriteria();
|
||||
sc.addAnd("policyId", SearchCriteria.Op.EQ, policyId);
|
||||
|
||||
return listBy(sc);
|
||||
}
|
||||
|
||||
public boolean isAutoScalePolicyInUse(long policyId) {
|
||||
SearchCriteria<AutoScaleVmGroupPolicyMapVO> sc = createSearchCriteria();
|
||||
sc.addAnd("policyId", SearchCriteria.Op.EQ, policyId);
|
||||
return findOneBy(sc) != null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import com.cloud.network.as.AutoScaleVmProfileVO;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface AutoScaleVmProfileDao extends GenericDao<AutoScaleVmProfileVO, Long> {
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
// Apache License, Version 2.0 (the "License"); you may not use this
|
||||
// file except in compliance with the License. Citrix Systems, Inc.
|
||||
// reserves all rights not expressly granted by the License.
|
||||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import com.cloud.network.as.AutoScaleVmProfileVO;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
|
||||
@Local(value = { AutoScaleVmProfileDao.class })
|
||||
public class AutoScaleVmProfileDaoImpl extends GenericDaoBase<AutoScaleVmProfileVO, Long> implements AutoScaleVmProfileDao {
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import com.cloud.network.as.ConditionVO;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface ConditionDao extends GenericDao<ConditionVO, Long> {
|
||||
|
||||
ConditionVO findByCounterId(long ctrId);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import com.cloud.network.as.ConditionVO;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.SearchBuilder;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
import com.cloud.utils.db.SearchCriteria.Op;
|
||||
|
||||
@Local(value = ConditionDao.class)
|
||||
public class ConditionDaoImpl extends GenericDaoBase<ConditionVO, Long> implements ConditionDao {
|
||||
final SearchBuilder<ConditionVO> AllFieldsSearch;
|
||||
|
||||
protected ConditionDaoImpl() {
|
||||
AllFieldsSearch = createSearchBuilder();
|
||||
AllFieldsSearch.and("id", AllFieldsSearch.entity().getId(), Op.EQ);
|
||||
AllFieldsSearch.and("counterId", AllFieldsSearch.entity().getCounterid(), Op.EQ);
|
||||
AllFieldsSearch.done();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConditionVO findByCounterId(long ctrId) {
|
||||
// TODO - may consider indexing counterId field in db-schema
|
||||
SearchCriteria<ConditionVO> sc = AllFieldsSearch.create();
|
||||
sc.setParameters("counterId", ctrId);
|
||||
return findOneBy(sc);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.network.as.CounterVO;
|
||||
import com.cloud.utils.db.Filter;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface CounterDao extends GenericDao<CounterVO, Long> {
|
||||
public List<CounterVO> listCounters(Long id, String name, String source, String keyword, Filter filter);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
package com.cloud.network.as.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import com.cloud.network.as.CounterVO;
|
||||
import com.cloud.utils.db.Filter;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.SearchBuilder;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
import com.cloud.utils.db.SearchCriteria.Op;
|
||||
|
||||
@Local(value = CounterDao.class)
|
||||
public class CounterDaoImpl extends GenericDaoBase<CounterVO, Long> implements CounterDao {
|
||||
final SearchBuilder<CounterVO> AllFieldsSearch;
|
||||
|
||||
protected CounterDaoImpl() {
|
||||
AllFieldsSearch = createSearchBuilder();
|
||||
AllFieldsSearch.and("id", AllFieldsSearch.entity().getId(), Op.EQ);
|
||||
AllFieldsSearch.and("name", AllFieldsSearch.entity().getName(), Op.LIKE);
|
||||
AllFieldsSearch.and("source", AllFieldsSearch.entity().getSource(), Op.EQ);
|
||||
AllFieldsSearch.done();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CounterVO> listCounters(Long id, String name, String source, String keyword, Filter filter) {
|
||||
SearchCriteria<CounterVO> sc = AllFieldsSearch.create();
|
||||
|
||||
if (keyword != null) {
|
||||
SearchCriteria<CounterVO> ssc = createSearchCriteria();
|
||||
ssc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");
|
||||
sc.addAnd("name", SearchCriteria.Op.SC, ssc);
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
sc.addAnd("name", SearchCriteria.Op.LIKE, "%" + name + "%");
|
||||
}
|
||||
|
||||
if (id != null) {
|
||||
sc.addAnd("id", SearchCriteria.Op.EQ, id);
|
||||
}
|
||||
|
||||
if (source != null) {
|
||||
sc.addAnd("source", SearchCriteria.Op.EQ, source);
|
||||
}
|
||||
return listBy(sc, filter);
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -8,7 +8,7 @@
|
|||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.network.lb;
|
||||
|
||||
|
|
@ -24,21 +24,23 @@ import com.cloud.network.rules.LoadBalancer;
|
|||
import com.cloud.user.Account;
|
||||
|
||||
public interface LoadBalancingRulesManager extends LoadBalancingRulesService {
|
||||
|
||||
|
||||
LoadBalancer createLoadBalancer(CreateLoadBalancerRuleCmd lb, boolean openFirewall) throws NetworkRuleConflictException;
|
||||
|
||||
|
||||
boolean removeAllLoadBalanacersForIp(long ipId, Account caller, long callerUserId);
|
||||
boolean removeAllLoadBalanacersForNetwork(long networkId, Account caller, long callerUserId);
|
||||
List<LbDestination> getExistingDestinations(long lbId);
|
||||
List<LbStickinessPolicy> getStickinessPolicies(long lbId);
|
||||
List<LbStickinessMethod> getStickinessMethods(long networkid);
|
||||
|
||||
|
||||
/**
|
||||
* Remove vm from all load balancers
|
||||
* @param vmId
|
||||
* @return true if removal is successful
|
||||
*/
|
||||
boolean removeVmFromLoadBalancers(long vmId);
|
||||
|
||||
|
||||
boolean applyLoadBalancersForNetwork(long networkId) throws ResourceUnavailableException;
|
||||
String getLBCapability(long networkid, String capabilityName);
|
||||
boolean configureLbAutoScaleVmGroup(long vmGroupid, boolean vmGroupCreation);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue