Skip to content

extensions: framework changes #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: ExternalDeploymentIntegration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class ApiConstants {
public static final String ALLOCATED_DATE = "allocateddate";
public static final String ALLOCATED_ONLY = "allocatedonly";
public static final String ALLOCATED_TIME = "allocated";
public static final String ALLOWED_ROLE_TYPES = "allowedroletypes";
public static final String ALLOW_USER_FORCE_STOP_VM = "allowuserforcestopvm";
public static final String ANNOTATION = "annotation";
public static final String API_KEY = "apikey";
Expand Down Expand Up @@ -198,7 +199,7 @@ public class ApiConstants {
public static final String END_IPV6 = "endipv6";
public static final String END_PORT = "endport";
public static final String ENTRY_POINT = "entrypoint";
public static final String ENTRY_POINT_SYNC = "entrypointsync";
public static final String ENTRY_POINT_READY = "entrypointready";
public static final String ENTRY_TIME = "entrytime";
public static final String ERROR_MESSAGE = "errormessage";
public static final String EVENT_ID = "eventid";
Expand Down Expand Up @@ -559,7 +560,9 @@ public class ApiConstants {
public static final String USER_SECRET_KEY = "usersecretkey";
public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork";
public static final String UPDATE_IN_SEQUENCE = "updateinsequence";
public static final String VALIDATION_FORMAT = "validationformat";
public static final String VALUE = "value";
public static final String VALUE_OPTIONS = "valueoptions";
public static final String VIRTUAL_MACHINE_ID = "virtualmachineid";
public static final String VIRTUAL_MACHINE_IDS = "virtualmachineids";
public static final String VIRTUAL_MACHINE_NAME = "virtualmachinename";
Expand Down Expand Up @@ -682,7 +685,6 @@ public class ApiConstants {
public static final String PROJECT_ROLE_NAME = "projectrolename";
public static final String ROLE_TYPE = "roletype";
public static final String ROLE_NAME = "rolename";
public static final String ROLES = "roles";
public static final String PERMISSION = "permission";
public static final String RULE = "rule";
public static final String RULES = "rules";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ public class ExtensionCustomActionParameterResponse extends BaseResponse {
@Param(description = "Type of the parameter")
private String type;

@SerializedName(ApiConstants.FORMAT)
@Param(description = "Format for value of the parameter. Available for specific types")
private String format;
@SerializedName(ApiConstants.VALIDATION_FORMAT)
@Param(description = "Validation format for value of the parameter. Available for specific types")
private String validationFormat;

@SerializedName(ApiConstants.OPTIONS)
@Param(description = "Options for value of the parameter")
private List<Object> options;
@SerializedName(ApiConstants.VALUE_OPTIONS)
@Param(description = "Comma-separated list of options for value of the parameter")
private List<Object> valueOptions;

@SerializedName(ApiConstants.REQUIRED)
@Param(description = "Whether the parameter is required or not")
private Boolean required;

public ExtensionCustomActionParameterResponse(String name, String type, String format, List<Object> options,
boolean required) {
public ExtensionCustomActionParameterResponse(String name, String type, String validationFormat, List<Object> valueOptions,
boolean required) {
this.name = name;
this.type = type;
this.format = format;
this.options = options;
this.validationFormat = validationFormat;
this.valueOptions = valueOptions;
this.required = required;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,32 @@
public class ExtensionCustomActionResponse extends BaseResponse {

@SerializedName(ApiConstants.ID)
@Param(description = "ID of the extension custom action")
@Param(description = "ID of the custom action")
private String id;

@SerializedName(ApiConstants.NAME)
@Param(description = "Name of the extension custom action")
@Param(description = "Name of the custom action")
private String name;

@SerializedName(ApiConstants.DESCRIPTION)
@Param(description = "Description of the extension custom action")
@Param(description = "Description of the custom action")
private String description;

@SerializedName(ApiConstants.EXTENSION_ID)
@Param(description = "ID of the extension that this extension custom action belongs to")
@Param(description = "ID of the extension that this custom action belongs to")
private String extensionId;

@SerializedName(ApiConstants.EXTENSION_NAME)
@Param(description = "Name of the extension that this extension custom action belongs to")
@Param(description = "Name of the extension that this custom action belongs to")
private String extensionName;

@SerializedName(ApiConstants.RESOURCE_TYPE)
@Param(description = "Resource type for which the action is available")
private String resourceType;

@SerializedName(ApiConstants.ROLES)
@Param(description = "List of roles associated with the extension custom action")
private List<String> roles;
@SerializedName(ApiConstants.ALLOWED_ROLE_TYPES)
@Param(description = "List of role types allowed for the custom action")
private List<String> allowedRoleTypes;

@SerializedName(ApiConstants.SUCCESS_MESSAGE)
@Param(description = "Message that will be used on successful execution of the action")
Expand All @@ -69,20 +69,24 @@ public class ExtensionCustomActionResponse extends BaseResponse {
@Param(description = "Message that will be used on failure during execution of the action")
private String errorMessage;

@SerializedName(ApiConstants.TIMEOUT)
@Param(description = "Specifies the timeout in seconds to wait for the action to complete before failing")
private Integer timeout;

@SerializedName(ApiConstants.ENABLED)
@Param(description = "Whether the extension custom action is enabled or not")
@Param(description = "Whether the custom action is enabled or not")
private Boolean enabled;

@SerializedName(ApiConstants.DETAILS)
@Param(description = "Details of the extension custom action")
@Param(description = "Details of the custom action")
private Map<String, String> details;

@SerializedName(ApiConstants.PARAMETERS)
@Param(description = "List of the parameters for the action", responseObject = ExtensionCustomActionParameterResponse.class)
private Set<ExtensionCustomActionParameterResponse> parameters;

@SerializedName(ApiConstants.CREATED)
@Param(description = "Creation timestamp of the extension custom action")
@Param(description = "Creation timestamp of the custom action")
private Date created;

public ExtensionCustomActionResponse(String id, String name, String description) {
Expand Down Expand Up @@ -131,12 +135,12 @@ public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}

public List<String> getRoles() {
return roles;
public List<String> getAllowedRoleTypes() {
return allowedRoleTypes;
}

public void setRoles(List<String> roles) {
this.roles = roles;
public void setAllowedRoleTypes(List<String> allowedRoleTypes) {
this.allowedRoleTypes = allowedRoleTypes;
}

public void setSuccessMessage(String successMessage) {
Expand All @@ -147,6 +151,10 @@ public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}

public void setTimeout(Integer timeout) {
this.timeout = timeout;
}

public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public class ExtensionResponse extends BaseResponse {
@Param(description = "The path of the entry point fo the extension")
private String entryPoint;

@SerializedName(ApiConstants.ENTRY_POINT_SYNC)
@Param(description = "True if the extension entry point is in sync across management servers")
private Boolean entryPointSync;
@SerializedName(ApiConstants.ENTRY_POINT_READY)
@Param(description = "True if the extension entry point is in ready state across management servers")
private Boolean entryPointReady;

@SerializedName(ApiConstants.IS_USER_DEFINED)
@Param(description = "True if the extension is added by admin")
Expand Down Expand Up @@ -90,8 +90,8 @@ public void setEntryPoint(String entryPoint) {
this.entryPoint = entryPoint;
}

public void setEntryPointSync(Boolean entryPointSync) {
this.entryPointSync = entryPointSync;
public void setEntryPointReady(Boolean entryPointReady) {
this.entryPointReady = entryPointReady;
}

public void setUserDefined(Boolean userDefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ enum State {
String getDescription();
Type getType();
String getRelativeEntryPoint();
boolean isEntryPointSync();
boolean isEntryPointReady();
boolean isUserDefined();
State getState();
Date getCreated();
Expand Down
Loading