Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions api/src/main/java/org/apache/cloudstack/api/Parameter.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@

ApiArgValidator[] validations() default {};

String[] allowedValues() default {};
boolean acceptedOnAdminPort() default true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,15 @@ public class CreateDiskOfferingCmd extends BaseCmd {
@Parameter(name = ApiConstants.STORAGE_TYPE, type = CommandType.STRING, description = "The storage type of the disk offering. Values are local and shared.")
private String storageType = ServiceOffering.StorageType.shared.toString();

@Parameter(name = ApiConstants.PROVISIONINGTYPE,
type = CommandType.STRING,
description = "Provisioning type used to create volumes. Valid values are thin, sparse, fat.")
@Parameter(
name = ApiConstants.PROVISIONINGTYPE,
type = CommandType.STRING,
description = "Provisioning type used to create volumes. Valid values are thin, sparse, fat.",
allowedValues = {
"thin",
"sparse",
"fat"
})
private String provisioningType = ProvisioningType.THIN.toString();

@Parameter(name = ApiConstants.DISPLAY_OFFERING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@ public class CreateServiceOfferingCmd extends BaseCmd {
@Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, description = "The display text of the service offering, defaults to 'name'.")
private String displayText;

@Parameter(name = ApiConstants.PROVISIONINGTYPE, type = CommandType.STRING, description = "Provisioning type used to create volumes. Valid values are thin, sparse, fat.")
@Parameter(
name = ApiConstants.PROVISIONINGTYPE,
type = CommandType.STRING,
description = "Provisioning type used to create volumes. Valid values are thin, sparse, fat.",
allowedValues = {
"thin",
"sparse",
"fat"
})
private String provisioningType = Storage.ProvisioningType.THIN.toString();

@Parameter(name = ApiConstants.MEMORY, type = CommandType.INTEGER, required = false, description = "The total memory of the service offering in MB")
private Integer memory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,17 @@ public class ListUsersCmd extends BaseListAccountResourcesCmd implements UserCmd
description = "Flag to display the resource icon for users")
private Boolean showIcon;

@Parameter(name = ApiConstants.USER_SOURCE, type = CommandType.STRING, since = "4.21.0.0",
description = "List users by their authentication source. Valid values are: native, ldap, saml2 and saml2disabled.")
@Parameter(
name = ApiConstants.USER_SOURCE,
type = CommandType.STRING,
since = "4.21.0.0",
description = "List users by their authentication source. Valid values are: native, ldap, saml2 and saml2disabled.",
allowedValues = {
"native",
"ldap",
"saml2",
"saml2disabled"
})
private String userSource;

/////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,15 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.SERVICE_CAPABILITY_LIST, type = CommandType.MAP, description = "Desired service capabilities as part of VPC offering", since = "4.4")
private Map<String, List<String>> serviceCapabilityList;

@Parameter(name = ApiConstants.INTERNET_PROTOCOL,
type = CommandType.STRING,
description = "The internet protocol of the offering. Options are IPv4 and dualstack. Default is IPv4. dualstack will create an offering that supports both IPv4 and IPv6",
since = "4.17.0")
@Parameter(
name = ApiConstants.INTERNET_PROTOCOL,
type = CommandType.STRING,
description = "The internet protocol of the offering. Options are IPv4 and dualstack. Default is IPv4. dualstack will create an offering that supports both IPv4 and IPv6",
since = "4.17.0",
allowedValues = {
"IPv4",
"DualStack"
})
Comment on lines +98 to +103
private String internetProtocol;

@Parameter(name = ApiConstants.SERVICE_OFFERING_ID,
Expand Down Expand Up @@ -144,10 +149,15 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd {
since = "4.16")
private Boolean enable;

@Parameter(name = ApiConstants.NETWORK_MODE,
type = CommandType.STRING,
description = "Indicates the mode with which the network will operate. Valid option: NATTED or ROUTED",
since = "4.20.0")
@Parameter(
name = ApiConstants.NETWORK_MODE,
type = CommandType.STRING,
description = "Indicates the mode with which the network will operate. Valid option: NATTED or ROUTED",
since = "4.20.0",
allowedValues = {
"NATTED",
"ROUTED"
})
private String networkMode;

@Parameter(name = ApiConstants.SPECIFY_AS_NUMBER, type = CommandType.BOOLEAN, since = "4.20.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,18 @@ public class CreateConditionCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.COUNTER_ID, type = CommandType.UUID, entityType = CounterResponse.class, 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. Valid values are EQ, GT, LT, GE, LE.")
@Parameter(
name = ApiConstants.RELATIONAL_OPERATOR,
type = CommandType.STRING,
required = true,
description = "Relational Operator to be used with threshold. Valid values are EQ, GT, LT, GE, LE.",
allowedValues = {
"EQ",
"GT",
"LT",
"GE",
"LE"
})
private String relationalOperator;

@Parameter(name = ApiConstants.THRESHOLD, type = CommandType.LONG, required = true, description = "Value for which the Counter will be evaluated with the Operator selected.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,18 @@ public class UpdateConditionCmd extends BaseAsyncCmd {
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ConditionResponse.class, required = true, description = "The ID of the condition.")
private Long id;

@Parameter(name = ApiConstants.RELATIONAL_OPERATOR, type = CommandType.STRING, required = true, description = "Relational Operator to be used with threshold. Valid values are EQ, GT, LT, GE, LE.")
@Parameter(
name = ApiConstants.RELATIONAL_OPERATOR,
type = CommandType.STRING,
required = true,
description = "Relational Operator to be used with threshold. Valid values are EQ, GT, LT, GE, LE.",
allowedValues = {
"EQ",
"GT",
"LT",
"GE",
"LE"
})
private String relationalOperator;

@Parameter(name = ApiConstants.THRESHOLD, type = CommandType.LONG, required = true, description = "Value for which the Counter will be evaluated with the Operator selected.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,15 @@ public class CreateBackupScheduleCmd extends BaseCmd {
private Long vmId;

@Parameter(name = ApiConstants.INTERVAL_TYPE,
type = CommandType.STRING,
required = true,
description = "Valid values are HOURLY, DAILY, WEEKLY, and MONTHLY")
type = CommandType.STRING,
required = true,
description = "Valid values are HOURLY, DAILY, WEEKLY, and MONTHLY",
allowedValues = {
"HOURLY",
"DAILY",
"WEEKLY",
"MONTHLY"
})
private String intervalType;

@Parameter(name = ApiConstants.SCHEDULE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
private Long ipAddressId;

@Parameter(name = ApiConstants.PROTOCOL,
type = CommandType.STRING,
required = true,
description = "The protocol for the firewall rule. Valid values are TCP/UDP/ICMP.")
type = CommandType.STRING,
required = true,
description = "The protocol for the firewall rule. Valid values are TCP/UDP/ICMP.",
allowedValues = {"TCP", "UDP", "ICMP"})
private String protocol;

@Parameter(name = ApiConstants.START_PORT, type = CommandType.INTEGER, description = "The starting port of firewall rule")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,14 @@ public class CreateIpv6FirewallRuleCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.NETWORK_ID, type = CommandType.UUID, entityType = NetworkResponse.class, description = "The Network of the Instance the Ipv6 firewall rule will be created for", required = true)
private Long networkId;

@Parameter(name = ApiConstants.TRAFFIC_TYPE, type = CommandType.STRING, description = "The traffic type for the Ipv6 firewall rule, can be ingress or egress, defaulted to ingress if not specified")
@Parameter(
name = ApiConstants.TRAFFIC_TYPE,
type = CommandType.STRING,
description = "The traffic type for the Ipv6 firewall rule, can be ingress or egress, defaulted to ingress if not specified",
allowedValues = {
"Ingress",
"Egress"
})
Comment on lines +85 to +89
private String trafficType;

@Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "An optional field, whether to the display the rule to the end User or not", authorized = {RoleType.Admin})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,24 @@ public class ListIsosCmd extends BaseListTaggedResourcesCmd implements UserCmd {
private Boolean ready;

@Parameter(name = ApiConstants.ISO_FILTER,
type = CommandType.STRING,
description = "Possible values are \"featured\", \"self\", \"selfexecutable\",\"sharedexecutable\",\"executable\", and \"community\". "
+ "* featured : Templates that have been marked as featured and public. "
+ "* self : Templates that have been registered or created by the calling User. "
+ "* selfexecutable : same as self, but only returns Templates that can be used to deploy a new Instance. "
+ "* sharedexecutable : Templates ready to be deployed that have been granted to the calling User by another User. "
+ "* executable : Templates that are owned by the calling User, or public Templates, that can be used to deploy an Instance. "
+ "* community : Templates that have been marked as public but not featured. " + "* all : all Templates (only usable by admins).")
type = CommandType.STRING,
description = "Possible values are \"featured\", \"self\", \"selfexecutable\",\"sharedexecutable\",\"executable\", and \"community\". "
+ "* featured : Templates that have been marked as featured and public. "
+ "* self : Templates that have been registered or created by the calling User. "
+ "* selfexecutable : same as self, but only returns Templates that can be used to deploy a new Instance. "
+ "* sharedexecutable : Templates ready to be deployed that have been granted to the calling User by another User. "
+ "* executable : Templates that are owned by the calling User, or public Templates, that can be used to deploy an Instance. "
+ "* community : Templates that have been marked as public but not featured. "
+ "* all : all Templates (only usable by admins).",
allowedValues = {
"featured",
"self",
"selfexecutable",
"sharedexecutable",
"executable",
"community",
"all"
})
private String isoFilter = TemplateFilter.selfexecutable.toString();

@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "List all ISOs by name")
Expand All @@ -86,9 +96,15 @@ public class ListIsosCmd extends BaseListTaggedResourcesCmd implements UserCmd {
@Parameter(name = ApiConstants.SHOW_RESOURCE_ICON, type = CommandType.BOOLEAN, description = "Flag to display the resource image for the ISOs")
private Boolean showIcon;

@Parameter(name = ApiConstants.ARCH, type = CommandType.STRING,
description = "the CPU arch of the ISO. Valid options are: x86_64, aarch64, s390x",
since = "4.20")
@Parameter(name = ApiConstants.ARCH,
type = CommandType.STRING,
description = "the CPU arch of the ISO. Valid options are: x86_64, aarch64, s390x",
since = "4.20",
allowedValues = {
"x86_64",
"aarch64",
"s390x"
})
private String arch;

@Parameter(name = ApiConstants.OS_CATEGORY_ID, type = CommandType.UUID, entityType= GuestOSCategoryResponse.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ public class CreateIpForwardingRuleCmd extends BaseAsyncCreateCmd implements Sta
@Parameter(name = ApiConstants.END_PORT, type = CommandType.INTEGER, description = "The end port for the rule")
private Integer endPort;

@Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, required = true, description = "The protocol for the rule. Valid values are TCP or UDP.")
@Parameter(
name = ApiConstants.PROTOCOL,
type = CommandType.STRING,
required = true,
description = "The protocol for the rule. Valid values are TCP or UDP.",
allowedValues = {
"TCP",
"UDP"
})
private String protocol;

@Parameter(name = ApiConstants.OPEN_FIREWALL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,16 @@ public class CreateSnapshotPolicyCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////

@Parameter(name = ApiConstants.INTERVAL_TYPE, type = CommandType.STRING, required = true, description = "Valid values are HOURLY, DAILY, WEEKLY, and MONTHLY")
@Parameter(name = ApiConstants.INTERVAL_TYPE,
type = CommandType.STRING,
required = true,
description = "Valid values are HOURLY, DAILY, WEEKLY, and MONTHLY",
allowedValues = {
"HOURLY",
"DAILY",
"WEEKLY",
"MONTHLY"
})
private String intervalType;

@Parameter(name = ApiConstants.MAX_SNAPS, type = CommandType.INTEGER, required = true, description = "Maximum number of Snapshots to retain")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,27 @@ public class ListSnapshotsCmd extends BaseListTaggedResourcesCmd {
@Parameter(name=ApiConstants.IDS, type=CommandType.LIST, collectionType=CommandType.UUID, entityType=SnapshotResponse.class, description = "The IDs of the Snapshots, mutually exclusive with id", since = "4.9")
private List<Long> ids;

@Parameter(name = ApiConstants.INTERVAL_TYPE, type = CommandType.STRING, description = "Valid values are HOURLY, DAILY, WEEKLY, and MONTHLY.")
@Parameter(name = ApiConstants.INTERVAL_TYPE,
type = CommandType.STRING,
description = "Valid values are HOURLY, DAILY, WEEKLY, and MONTHLY.",
allowedValues = {
"HOURLY",
"DAILY",
"WEEKLY",
"MONTHLY"
})
private String intervalType;

@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "Lists Snapshot by Snapshot name")
private String snapshotName;

@Parameter(name = ApiConstants.SNAPSHOT_TYPE, type = CommandType.STRING, description = "Valid values are MANUAL or RECURRING.")
@Parameter(name = ApiConstants.SNAPSHOT_TYPE,
type = CommandType.STRING,
description = "Valid values are MANUAL or RECURRING.",
allowedValues = {
"MANUAL",
"RECURRING"
})
private String snapshotType;

@Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.UUID, entityType = VolumeResponse.class, description = "The ID of the disk volume")
Expand All @@ -64,8 +78,15 @@ public class ListSnapshotsCmd extends BaseListTaggedResourcesCmd {
@Parameter(name = ApiConstants.SHOW_UNIQUE, type = CommandType.BOOLEAN, description = "If set to false, list templates across zones and their storages", since = "4.19.0")
private Boolean showUnique;

@Parameter(name = ApiConstants.LOCATION_TYPE, type = CommandType.STRING, description = "list snapshots by location type. Used only when showunique=false. " +
"Valid location types: 'primary', 'secondary'. Default is empty", since = "4.19.0")
@Parameter(name = ApiConstants.LOCATION_TYPE,
type = CommandType.STRING,
description = "list snapshots by location type. Used only when showunique=false. "
+ "Valid location types: 'primary', 'secondary'. Default is empty",
since = "4.19.0",
allowedValues = {
"primary",
"secondary"
})
private String locationType;

/////////////////////////////////////////////////////
Expand Down
Loading
Loading