blob: 77c55c8ba47ee6f6373a88e234060660fb36e21a [file] [log] [blame]
// 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 org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.api.InternalIdentity;
import org.apache.commons.lang3.StringUtils;
public interface AutoScalePolicy extends ControlledEntity, InternalIdentity {
enum Action {
SCALEUP, SCALEDOWN;
public static Action fromValue(String action) {
if (StringUtils.isBlank(action)) {
return null;
} else if (action.equalsIgnoreCase("ScaleUp")) {
return SCALEUP;
} else if (action.equalsIgnoreCase("ScaleDown")) {
return SCALEDOWN;
} else {
throw new IllegalArgumentException("Unexpected AutoScale action : " + action);
}
}
}
@Override
long getId();
String getUuid();
public int getDuration();
public int getQuietTime();
public Date getLastQuietTime();
public Action getAction();
}