From fb50fe624c577c866beb18d72e31c404f26aa3f3 Mon Sep 17 00:00:00 2001 From: alena Date: Mon, 11 Oct 2010 09:16:29 -0700 Subject: [PATCH] * Added descriptions for Api command's request and response parameters. * Changed response type for DeleteDomain and DeletePreallocatedLun commands to SuccessResponse * Implemented small tool (ApiXmlDocReader) for comparing api commands of different product versions. --- .../com/cloud/api/commands/AddConfigCmd.java | 11 +- .../com/cloud/api/commands/AddHostCmd.java | 14 +- .../api/commands/AddHostOrStorageCmd.java | 90 ------ .../api/commands/AddSecondaryStorageCmd.java | 4 +- .../AssignPortForwardingServiceCmd.java | 8 +- .../commands/AssignToLoadBalancerRuleCmd.java | 6 +- .../com/cloud/api/commands/AttachIsoCmd.java | 4 +- .../cloud/api/commands/AttachVolumeCmd.java | 16 +- .../AuthorizeNetworkGroupIngressCmd.java | 11 +- .../api/commands/CancelMaintenanceCmd.java | 2 +- .../CancelPrimaryStorageMaintenanceCmd.java | 2 +- .../com/cloud/api/commands/CopyIsoCmd.java | 6 +- .../cloud/api/commands/CopyTemplateCmd.java | 6 +- .../api/commands/CreateDiskOfferingCmd.java | 10 +- .../commands/CreateLoadBalancerRuleCmd.java | 12 +- .../api/commands/CreateNetworkGroupCmd.java | 10 +- .../com/cloud/api/commands/CreatePodCmd.java | 12 +- .../CreatePortForwardingServiceRuleCmd.java | 8 +- .../commands/CreateServiceOfferingCmd.java | 18 +- .../cloud/api/commands/CreateSnapshotCmd.java | 6 +- .../api/commands/CreateSnapshotPolicyCmd.java | 19 +- .../api/commands/CreateStoragePoolCmd.java | 14 +- .../cloud/api/commands/CreateTemplateCmd.java | 18 +- .../cloud/api/commands/CreateVMGroupCmd.java | 6 +- .../api/commands/CreateVlanIpRangeCmd.java | 20 +- .../cloud/api/commands/CreateVolumeCmd.java | 14 +- .../com/cloud/api/commands/CreateZoneCmd.java | 17 +- .../api/commands/DeleteDiskOfferingCmd.java | 2 +- .../cloud/api/commands/DeleteDomainCmd.java | 17 +- .../com/cloud/api/commands/DeleteHostCmd.java | 2 +- .../com/cloud/api/commands/DeleteIsoCmd.java | 4 +- .../commands/DeleteLoadBalancerRuleCmd.java | 2 +- .../api/commands/DeleteNetworkGroupCmd.java | 6 +- .../com/cloud/api/commands/DeletePodCmd.java | 2 +- .../com/cloud/api/commands/DeletePoolCmd.java | 2 +- .../DeletePortForwardingServiceCmd.java | 2 +- .../commands/DeletePreallocatedLunCmd.java | 8 +- .../commands/DeleteServiceOfferingCmd.java | 2 +- .../cloud/api/commands/DeleteSnapshotCmd.java | 2 +- .../commands/DeleteSnapshotPoliciesCmd.java | 4 +- .../cloud/api/commands/DeleteTemplateCmd.java | 4 +- .../cloud/api/commands/DeleteVMGroupCmd.java | 2 +- .../api/commands/DeleteVlanIpRangeCmd.java | 2 +- .../cloud/api/commands/DeleteVolumeCmd.java | 2 +- .../com/cloud/api/commands/DeleteZoneCmd.java | 2 +- .../com/cloud/api/commands/DeployVMCmd.java | 22 +- .../api/commands/DestroyConsoleProxyCmd.java | 2 +- .../com/cloud/api/commands/DestroyVMCmd.java | 2 +- .../com/cloud/api/commands/DetachIsoCmd.java | 2 +- .../cloud/api/commands/DetachVolumeCmd.java | 6 +- .../com/cloud/api/commands/ExtractIsoCmd.java | 5 +- .../api/commands/ExtractTemplateCmd.java | 3 + .../cloud/api/commands/ExtractVolumeCmd.java | 3 + .../api/commands/GetCloudIdentifierCmd.java | 2 +- .../cloud/api/commands/ListAccountsCmd.java | 14 +- .../com/cloud/api/commands/ListAlertsCmd.java | 2 +- .../cloud/api/commands/ListAsyncJobsCmd.java | 6 +- .../cloud/api/commands/ListCapacityCmd.java | 8 +- .../com/cloud/api/commands/ListCfgsByCmd.java | 4 +- .../cloud/api/commands/ListClustersCmd.java | 8 +- .../api/commands/ListDiskOfferingsCmd.java | 6 +- .../com/cloud/api/commands/ListEventsCmd.java | 16 +- .../commands/ListGuestOsCategoriesCmd.java | 2 +- .../cloud/api/commands/ListGuestOsCmd.java | 4 +- .../com/cloud/api/commands/ListHostsCmd.java | 14 +- .../com/cloud/api/commands/ListIsosCmd.java | 22 +- .../ListLoadBalancerRuleInstancesCmd.java | 4 +- .../commands/ListLoadBalancerRulesCmd.java | 12 +- .../api/commands/ListNetworkGroupsCmd.java | 8 +- .../com/cloud/api/commands/ListPodsByCmd.java | 6 +- .../commands/ListPortForwardingRulesCmd.java | 2 +- .../ListPortForwardingServicesByVmCmd.java | 8 +- .../ListPortForwardingServicesCmd.java | 8 +- .../api/commands/ListPreallocatedLunsCmd.java | 2 + .../ListRecurringSnapshotScheduleCmd.java | 4 +- .../api/commands/ListResourceLimitsCmd.java | 16 +- .../cloud/api/commands/ListRoutersCmd.java | 14 +- .../api/commands/ListServiceOfferingsCmd.java | 6 +- .../api/commands/ListSnapshotPoliciesCmd.java | 6 +- .../cloud/api/commands/ListSnapshotsCmd.java | 14 +- .../commands/ListStoragePoolsAndHostsCmd.java | 276 ------------------ .../api/commands/ListStoragePoolsCmd.java | 12 +- .../cloud/api/commands/ListSystemVMsCmd.java | 14 +- .../ListTemplateOrIsoPermissionsCmd.java | 6 +- .../cloud/api/commands/ListTemplatesCmd.java | 16 +- .../cloud/api/commands/ListVMGroupsCmd.java | 8 +- .../com/cloud/api/commands/ListVMsCmd.java | 16 +- .../api/commands/ListVlanIpRangesCmd.java | 12 +- .../cloud/api/commands/ListVolumesCmd.java | 16 +- .../cloud/api/commands/ListZonesByCmd.java | 2 +- .../commands/PrepareForMaintenanceCmd.java | 2 +- ...reparePrimaryStorageForMaintenanceCmd.java | 2 +- .../api/commands/QueryAsyncJobResultCmd.java | 2 +- .../cloud/api/commands/RebootRouterCmd.java | 2 +- .../cloud/api/commands/RebootSystemVmCmd.java | 2 +- .../com/cloud/api/commands/RebootVMCmd.java | 2 +- .../cloud/api/commands/ReconnectHostCmd.java | 2 +- .../com/cloud/api/commands/RecoverVMCmd.java | 2 +- .../cloud/api/commands/RegisterIsoCmd.java | 16 +- .../commands/RegisterPreallocatedLunCmd.java | 8 +- .../api/commands/RegisterTemplateCmd.java | 22 +- .../RemoveFromLoadBalancerRuleCmd.java | 6 +- .../RemovePortForwardingServiceCmd.java | 6 +- .../api/commands/ResetVMPasswordCmd.java | 2 +- .../RevokeNetworkGroupIngressCmd.java | 10 + .../cloud/api/commands/StartRouterCmd.java | 2 +- .../cloud/api/commands/StartSystemVMCmd.java | 2 +- .../com/cloud/api/commands/StartVMCmd.java | 2 +- .../com/cloud/api/commands/StopRouterCmd.java | 2 +- .../cloud/api/commands/StopSystemVmCmd.java | 2 +- .../src/com/cloud/api/commands/StopVMCmd.java | 2 +- .../com/cloud/api/commands/UpdateCfgCmd.java | 4 +- .../api/commands/UpdateDiskOfferingCmd.java | 8 +- .../com/cloud/api/commands/UpdateHostCmd.java | 2 +- .../commands/UpdateLoadBalancerRuleCmd.java | 10 +- .../com/cloud/api/commands/UpdatePodCmd.java | 12 +- .../api/commands/UpdateResourceLimitCmd.java | 12 +- .../commands/UpdateServiceOfferingCmd.java | 16 +- .../api/commands/UpdateStoragePoolCmd.java | 4 +- .../api/commands/UpdateTemplateOrIsoCmd.java | 14 +- .../UpdateTemplateOrIsoPermissionsCmd.java | 10 +- .../com/cloud/api/commands/UpdateVMCmd.java | 8 +- .../cloud/api/commands/UpdateVMGroupCmd.java | 5 +- .../com/cloud/api/commands/UpdateZoneCmd.java | 16 +- .../com/cloud/api/commands/UpgradeVMCmd.java | 4 +- .../com/cloud/api/doc/ApiXmlDocReader.java | 183 ++++++++++-- .../com/cloud/api/doc/ApiXmlDocWriter.java | 19 +- server/src/com/cloud/api/doc/Argument.java | 6 +- server/src/com/cloud/api/doc/Command.java | 16 +- .../cloud/api/response/AccountResponse.java | 53 ++-- .../com/cloud/api/response/AlertResponse.java | 7 +- .../cloud/api/response/AsyncJobResponse.java | 27 +- .../api/response/CapabilitiesResponse.java | 5 +- .../cloud/api/response/CapacityResponse.java | 17 +- .../api/response/CloudIdentifierResponse.java | 7 +- .../cloud/api/response/ClusterResponse.java | 13 +- .../api/response/ConfigurationResponse.java | 9 +- .../api/response/DeleteDomainResponse.java | 33 --- .../DeletePreallocatedLunResponse.java | 16 - .../api/response/DiskOfferingResponse.java | 18 +- .../cloud/api/response/DomainResponse.java | 11 +- .../api/response/DomainRouterResponse.java | 61 ++-- .../com/cloud/api/response/EventResponse.java | 23 +- .../cloud/api/response/ExtractResponse.java | 23 +- .../api/response/FirewallRuleResponse.java | 13 +- .../api/response/GuestOSCategoryResponse.java | 7 +- .../cloud/api/response/GuestOSResponse.java | 7 +- .../com/cloud/api/response/HostResponse.java | 71 ++--- .../cloud/api/response/IPAddressResponse.java | 23 +- .../api/response/IngressRuleResponse.java | 17 +- .../api/response/InstanceGroupResponse.java | 13 +- .../api/response/LoadBalancerResponse.java | 21 +- .../api/response/NetworkGroupResponse.java | 15 +- .../com/cloud/api/response/PodResponse.java | 17 +- .../PortForwardingServiceRuleResponse.java | 15 +- .../api/response/PreallocatedLunResponse.java | 16 +- .../cloud/api/response/RegisterResponse.java | 5 +- .../api/response/ResourceLimitResponse.java | 11 +- .../api/response/SecurityGroupResponse.java | 14 +- .../api/response/ServiceOfferingResponse.java | 23 +- .../api/response/SnapshotPolicyResponse.java | 13 +- .../cloud/api/response/SnapshotResponse.java | 27 +- .../response/SnapshotScheduleResponse.java | 9 +- .../api/response/StoragePoolResponse.java | 33 ++- .../cloud/api/response/SystemVmResponse.java | 51 ++-- .../response/TemplatePermissionsResponse.java | 9 +- .../cloud/api/response/TemplateResponse.java | 49 ++-- .../cloud/api/response/UpgradeVmResponse.java | 48 +-- .../com/cloud/api/response/UserResponse.java | 29 +- .../cloud/api/response/UserVmResponse.java | 75 ++--- .../api/response/VlanIpRangeResponse.java | 29 +- .../cloud/api/response/VolumeResponse.java | 47 +-- .../com/cloud/api/response/ZoneResponse.java | 21 +- .../com/cloud/server/ManagementServer.java | 10 +- .../cloud/server/ManagementServerImpl.java | 37 +-- 175 files changed, 1228 insertions(+), 1389 deletions(-) delete mode 100644 server/src/com/cloud/api/commands/AddHostOrStorageCmd.java delete mode 100644 server/src/com/cloud/api/commands/ListStoragePoolsAndHostsCmd.java delete mode 100644 server/src/com/cloud/api/response/DeleteDomainResponse.java delete mode 100644 server/src/com/cloud/api/response/DeletePreallocatedLunResponse.java diff --git a/server/src/com/cloud/api/commands/AddConfigCmd.java b/server/src/com/cloud/api/commands/AddConfigCmd.java index 9d5a7a80e5a..10bbcd00bb5 100644 --- a/server/src/com/cloud/api/commands/AddConfigCmd.java +++ b/server/src/com/cloud/api/commands/AddConfigCmd.java @@ -36,22 +36,23 @@ public class AddConfigCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="category", type=CommandType.STRING, required=true) + @Parameter(name="category", type=CommandType.STRING, required=true, description="component's category") private String category; - @Parameter(name="component", type=CommandType.STRING, required=true) + @Parameter(name="component", type=CommandType.STRING, required=true, description="the component of the configuration") private String component; - @Parameter(name="description", type=CommandType.STRING) + @Parameter(name="description", type=CommandType.STRING, description="the description of the configuration") private String description; + //FIXME - add description @Parameter(name="instance", type=CommandType.STRING, required=true) private String instance; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the configuration") private String name; - @Parameter(name="value", type=CommandType.STRING) + @Parameter(name="value", type=CommandType.STRING, description="the value of the configuration") private String value; diff --git a/server/src/com/cloud/api/commands/AddHostCmd.java b/server/src/com/cloud/api/commands/AddHostCmd.java index 5c198fb0637..6076d3d489a 100644 --- a/server/src/com/cloud/api/commands/AddHostCmd.java +++ b/server/src/com/cloud/api/commands/AddHostCmd.java @@ -53,25 +53,25 @@ public class AddHostCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="clusterid", type=CommandType.LONG) + @Parameter(name="clusterid", type=CommandType.LONG, description="the cluster ID for the host") private Long clusterId; - @Parameter(name="clustername", type=CommandType.STRING) + @Parameter(name="clustername", type=CommandType.STRING, description="the cluster name for the host") private String clusterName; - @Parameter(name="password", type=CommandType.STRING, required=true) + @Parameter(name="password", type=CommandType.STRING, required=true, description="the password for the host") private String password; - @Parameter(name="podid", type=CommandType.LONG) + @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID for the host") private Long podId; - @Parameter(name="url", type=CommandType.STRING, required=true) + @Parameter(name="url", type=CommandType.STRING, required=true, description="the host URL") private String url; - @Parameter(name="username", type=CommandType.STRING, required=true) + @Parameter(name="username", type=CommandType.STRING, required=true, description="the username for the host") private String username; - @Parameter(name="zoneid", type=CommandType.LONG, required=true) + @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the Zone ID for the host") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/AddHostOrStorageCmd.java b/server/src/com/cloud/api/commands/AddHostOrStorageCmd.java deleted file mode 100644 index 5b5ba5a38b3..00000000000 --- a/server/src/com/cloud/api/commands/AddHostOrStorageCmd.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright (C) 2010 Cloud.com, Inc. All rights reserved. - * - * This software is licensed under the GNU General Public License v3 or later. - * - * It is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package com.cloud.api.commands; - -import org.apache.log4j.Logger; - -import com.cloud.api.BaseCmd; -import com.cloud.api.BaseCmd.Manager; -import com.cloud.api.Implementation; -import com.cloud.api.Parameter; - -@Implementation(method="discoverHosts", manager=Manager.AgentManager) -public abstract class AddHostOrStorageCmd extends BaseCmd { - public static final Logger s_logger = Logger.getLogger(AddHostOrStorageCmd.class.getName()); - - ///////////////////////////////////////////////////// - //////////////// API parameters ///////////////////// - ///////////////////////////////////////////////////// - - @Parameter(name="clusterid", type=CommandType.LONG) - private Long clusterId; - - @Parameter(name="clustername", type=CommandType.STRING) - private String clusterName; - - @Parameter(name="password", type=CommandType.STRING, required=true) - private String password; - - @Parameter(name="podid", type=CommandType.LONG) - private Long podId; - - @Parameter(name="url", type=CommandType.STRING, required=true) - private String url; - - @Parameter(name="username", type=CommandType.STRING, required=true) - private String username; - - @Parameter(name="zoneid", type=CommandType.LONG, required=true) - private Long zoneId; - - - ///////////////////////////////////////////////////// - /////////////////// Accessors /////////////////////// - ///////////////////////////////////////////////////// - - public Long getClusterId() { - return clusterId; - } - - public String getClusterName() { - return clusterName; - } - - public String getPassword() { - return password; - } - - public Long getPodId() { - return podId; - } - - public String getUrl() { - return url; - } - - public String getUsername() { - return username; - } - - public Long getZoneId() { - return zoneId; - } - -} diff --git a/server/src/com/cloud/api/commands/AddSecondaryStorageCmd.java b/server/src/com/cloud/api/commands/AddSecondaryStorageCmd.java index 3798252187c..bf6c7552ede 100644 --- a/server/src/com/cloud/api/commands/AddSecondaryStorageCmd.java +++ b/server/src/com/cloud/api/commands/AddSecondaryStorageCmd.java @@ -48,10 +48,10 @@ public class AddSecondaryStorageCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="url", type=CommandType.STRING, required=true) + @Parameter(name="url", type=CommandType.STRING, required=true, description="the URL for the secondary storage") private String url; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="the Zone ID for the secondary storage") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/AssignPortForwardingServiceCmd.java b/server/src/com/cloud/api/commands/AssignPortForwardingServiceCmd.java index e1f97f7784e..22fef170011 100644 --- a/server/src/com/cloud/api/commands/AssignPortForwardingServiceCmd.java +++ b/server/src/com/cloud/api/commands/AssignPortForwardingServiceCmd.java @@ -41,16 +41,16 @@ public class AssignPortForwardingServiceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="the ID of the port forwarding service to assign to the virtual machine/public IP") private Long id; - @Parameter(name="ids", type=CommandType.LIST, collectionType=CommandType.LONG) + @Parameter(name="ids", type=CommandType.LIST, collectionType=CommandType.LONG, description="a comma delimited list of port forwarding service IDs to assign to the virtual machine/public IP") private List ids; - @Parameter(name="publicip", type=CommandType.STRING, required=true) + @Parameter(name="publicip", type=CommandType.STRING, required=true, description="the public IP address to associate to the port forwarding service") private String publicIp; - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true) + @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true, description="the ID of the virtual machine to assign to the port forwarding service") private Long virtualMachineId; diff --git a/server/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java b/server/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java index de80b9b38d7..4bace7e6c09 100644 --- a/server/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java +++ b/server/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java @@ -41,13 +41,13 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the load balancer rule") private Long id; - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=false) + @Parameter(name="virtualmachineid", type=CommandType.LONG, required=false, description="the ID of the virtual machine that is being assigned to the load balancer rule") private Long virtualMachineId; - @Parameter(name="virtualmachineids", type=CommandType.LIST, collectionType=CommandType.LONG, required=false) + @Parameter(name="virtualmachineids", type=CommandType.LIST, collectionType=CommandType.LONG, required=false, description="the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)") private List virtualMachineIds; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/AttachIsoCmd.java b/server/src/com/cloud/api/commands/AttachIsoCmd.java index c57980ff620..2eb7799dab8 100644 --- a/server/src/com/cloud/api/commands/AttachIsoCmd.java +++ b/server/src/com/cloud/api/commands/AttachIsoCmd.java @@ -41,10 +41,10 @@ public class AttachIsoCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the ISO file") private Long id; - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true) + @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true, description="the ID of the virtual machine") private Long virtualMachineId; diff --git a/server/src/com/cloud/api/commands/AttachVolumeCmd.java b/server/src/com/cloud/api/commands/AttachVolumeCmd.java index 15170a77c49..a8dc872bf22 100644 --- a/server/src/com/cloud/api/commands/AttachVolumeCmd.java +++ b/server/src/com/cloud/api/commands/AttachVolumeCmd.java @@ -40,13 +40,23 @@ public class AttachVolumeCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="deviceid", type=CommandType.LONG) + @Parameter(name="deviceid", type=CommandType.LONG, description="the ID of the device to map the volume to within the guest OS. " + + "If no deviceId is passed in, the next available deviceId will be chosen. " + + "Possible values for a Linux OS are:" + + "* 1 - /dev/xvdb" + + "* 2 - /dev/xvdc" + + "* 4 - /dev/xvde" + + "* 5 - /dev/xvdf" + + "* 6 - /dev/xvdg" + + "* 7 - /dev/xvdh" + + "* 8 - /dev/xvdi" + + "* 9 - /dev/xvdj") private Long deviceId; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the disk volume") private Long id; - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true) + @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true, description=" the ID of the virtual machine") private Long virtualMachineId; diff --git a/server/src/com/cloud/api/commands/AuthorizeNetworkGroupIngressCmd.java b/server/src/com/cloud/api/commands/AuthorizeNetworkGroupIngressCmd.java index a1d30a7a673..35cb13d3243 100644 --- a/server/src/com/cloud/api/commands/AuthorizeNetworkGroupIngressCmd.java +++ b/server/src/com/cloud/api/commands/AuthorizeNetworkGroupIngressCmd.java @@ -50,33 +50,42 @@ public class AuthorizeNetworkGroupIngressCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="protocol", type=CommandType.STRING) + @Parameter(name="protocol", type=CommandType.STRING, description="TCP is default. UDP is the other supported protocol") private String protocol; + //FIXME - add description @Parameter(name="startport", type=CommandType.INTEGER) private Integer startPort; + //FIXME - add description @Parameter(name="endport", type=CommandType.INTEGER) private Integer endPort; + //FIXME - add description @Parameter(name="icmptype", type=CommandType.INTEGER) private Integer icmpType; + //FIXME - add description @Parameter(name="icmpcode", type=CommandType.INTEGER) private Integer icmpCode; + //FIXME - add description @Parameter(name="networkgroupname", type=CommandType.STRING, required=true) private String networkGroupName; + //FIXME - add description @Parameter(name="cidrlist", type=CommandType.LIST, collectionType=CommandType.STRING) private List cidrList; + //FIXME - add description @Parameter(name="usernetworkgrouplist", type=CommandType.MAP) private Map userNetworkGroupList; + //FIXME - add description @Parameter(name="account", type=CommandType.STRING) private String accountName; + //FIXME - add description @Parameter(name="domainid", type=CommandType.LONG) private Long domainId; diff --git a/server/src/com/cloud/api/commands/CancelMaintenanceCmd.java b/server/src/com/cloud/api/commands/CancelMaintenanceCmd.java index 57b7369215f..d355efdb738 100644 --- a/server/src/com/cloud/api/commands/CancelMaintenanceCmd.java +++ b/server/src/com/cloud/api/commands/CancelMaintenanceCmd.java @@ -54,7 +54,7 @@ public class CancelMaintenanceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the host ID") private Long id; diff --git a/server/src/com/cloud/api/commands/CancelPrimaryStorageMaintenanceCmd.java b/server/src/com/cloud/api/commands/CancelPrimaryStorageMaintenanceCmd.java index 29c5fc9ac12..ce4e944ec3e 100644 --- a/server/src/com/cloud/api/commands/CancelPrimaryStorageMaintenanceCmd.java +++ b/server/src/com/cloud/api/commands/CancelPrimaryStorageMaintenanceCmd.java @@ -43,7 +43,7 @@ public class CancelPrimaryStorageMaintenanceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the primary storage ID") private Long id; diff --git a/server/src/com/cloud/api/commands/CopyIsoCmd.java b/server/src/com/cloud/api/commands/CopyIsoCmd.java index afc04740fb2..e2fefb9cb2a 100644 --- a/server/src/com/cloud/api/commands/CopyIsoCmd.java +++ b/server/src/com/cloud/api/commands/CopyIsoCmd.java @@ -45,13 +45,13 @@ public class CopyIsoCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="destzoneid", type=CommandType.LONG, required=true) + @Parameter(name="destzoneid", type=CommandType.LONG, required=true, description="the ID of the destination zone to which the ISO file will be copied") private Long destZoneId; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the ISO file") private Long id; - @Parameter(name="sourcezoneid", type=CommandType.LONG, required=true) + @Parameter(name="sourcezoneid", type=CommandType.LONG, required=true, description="the ID of the source zone from which the ISO file will be copied") private Long sourceZoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CopyTemplateCmd.java b/server/src/com/cloud/api/commands/CopyTemplateCmd.java index 98cb9de2f93..c0ec81014a0 100644 --- a/server/src/com/cloud/api/commands/CopyTemplateCmd.java +++ b/server/src/com/cloud/api/commands/CopyTemplateCmd.java @@ -45,13 +45,13 @@ public class CopyTemplateCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="destzoneid", type=CommandType.LONG, required=true) + @Parameter(name="destzoneid", type=CommandType.LONG, required=true, description="ID of the zone the template is being copied to.") private Long destZoneId; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="Template ID.") private Long id; - @Parameter(name="sourcezoneid", type=CommandType.LONG, required=true) + @Parameter(name="sourcezoneid", type=CommandType.LONG, required=true, description="ID of the zone the template is currently hosted on.") private Long sourceZoneId; diff --git a/server/src/com/cloud/api/commands/CreateDiskOfferingCmd.java b/server/src/com/cloud/api/commands/CreateDiskOfferingCmd.java index 94b10dab2b4..6a7602d45ea 100755 --- a/server/src/com/cloud/api/commands/CreateDiskOfferingCmd.java +++ b/server/src/com/cloud/api/commands/CreateDiskOfferingCmd.java @@ -38,19 +38,19 @@ public class CreateDiskOfferingCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="disksize", type=CommandType.LONG, required=true) + @Parameter(name="disksize", type=CommandType.LONG, required=true, description="disk size of the disk offering in GB") private Long diskSize; - @Parameter(name="displaytext", type=CommandType.STRING, required=true) + @Parameter(name="displaytext", type=CommandType.STRING, required=true, description="alternate display text of the disk offering") private String displayText; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="domain ID where disk offering is going to be created") private Long domainId; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="name of the disk offering") private String offeringName; - @Parameter(name="tags", type=CommandType.STRING) + @Parameter(name="tags", type=CommandType.STRING, description="tags for the disk offering") private String tags; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java b/server/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java index f9569e008b4..737d482d69e 100644 --- a/server/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java +++ b/server/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java @@ -38,22 +38,22 @@ public class CreateLoadBalancerRuleCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="algorithm", type=CommandType.STRING, required=true) + @Parameter(name="algorithm", type=CommandType.STRING, required=true, description="load balancer algorithm (source, roundrobin, leastconn)") private String algorithm; - @Parameter(name="description", type=CommandType.STRING) + @Parameter(name="description", type=CommandType.STRING, description="the description of the load balancer rule") private String description; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="name of the load balancer rule") private String loadBalancerRuleName; - @Parameter(name="privateport", type=CommandType.STRING, required=true) + @Parameter(name="privateport", type=CommandType.STRING, required=true, description="the private port of the private ip address/virtual machine where the network traffic will be load balanced to") private String privatePort; - @Parameter(name="publicip", type=CommandType.STRING, required=true) + @Parameter(name="publicip", type=CommandType.STRING, required=true, description="public ip address from where the network traffic will be load balanced from") private String publicIp; - @Parameter(name="publicport", type=CommandType.STRING, required=true) + @Parameter(name="publicport", type=CommandType.STRING, required=true, description="the public port from where the network traffic will be load balanced from") private String publicPort; diff --git a/server/src/com/cloud/api/commands/CreateNetworkGroupCmd.java b/server/src/com/cloud/api/commands/CreateNetworkGroupCmd.java index 5a579f05fca..58698b3fea1 100644 --- a/server/src/com/cloud/api/commands/CreateNetworkGroupCmd.java +++ b/server/src/com/cloud/api/commands/CreateNetworkGroupCmd.java @@ -27,7 +27,7 @@ import com.cloud.api.Parameter; import com.cloud.api.response.NetworkGroupResponse; import com.cloud.network.security.NetworkGroupVO; -@Implementation(method="createLoadBalancerRule", manager=Manager.NetworkGroupManager) +@Implementation(method="createNetworkGroup", manager=Manager.NetworkGroupManager) public class CreateNetworkGroupCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(CreateNetworkGroupCmd.class.getName()); @@ -37,16 +37,16 @@ public class CreateNetworkGroupCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="an optional account for the network group. Must be used with domainId.") private String accountName; - @Parameter(name="description", type=CommandType.STRING) + @Parameter(name="description", type=CommandType.STRING, description="the description of the network group") private String description; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="an optional domainId for the network group. If the account parameter is used, domainId must also be used.") private Long domainId; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="name of the network group") private String networkGroupName; diff --git a/server/src/com/cloud/api/commands/CreatePodCmd.java b/server/src/com/cloud/api/commands/CreatePodCmd.java index 3317b82d1b9..5eaa1cf6e88 100644 --- a/server/src/com/cloud/api/commands/CreatePodCmd.java +++ b/server/src/com/cloud/api/commands/CreatePodCmd.java @@ -38,22 +38,22 @@ public class CreatePodCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="cidr", type=CommandType.STRING, required=true) + @Parameter(name="cidr", type=CommandType.STRING, required=true, description="the CIDR notation for the base IP address of the Pod") private String cidr; - @Parameter(name="endip", type=CommandType.STRING) + @Parameter(name="endip", type=CommandType.STRING, description="the ending IP address for the Pod") private String endIp; - @Parameter(name="gateway", type=CommandType.STRING, required=true) + @Parameter(name="gateway", type=CommandType.STRING, required=true, description="the gateway for the Pod") private String gateway; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the Pod") private String podName; - @Parameter(name="startip", type=CommandType.STRING, required=true) + @Parameter(name="startip", type=CommandType.STRING, required=true, description="the starting IP address for the Pod") private String startIp; - @Parameter(name="zoneid", type=CommandType.LONG, required=true) + @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the Zone ID in which the Pod will be created ") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/CreatePortForwardingServiceRuleCmd.java b/server/src/com/cloud/api/commands/CreatePortForwardingServiceRuleCmd.java index 88014bab082..c4786710ae0 100644 --- a/server/src/com/cloud/api/commands/CreatePortForwardingServiceRuleCmd.java +++ b/server/src/com/cloud/api/commands/CreatePortForwardingServiceRuleCmd.java @@ -40,16 +40,16 @@ public class CreatePortForwardingServiceRuleCmd extends BaseAsyncCreateCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="portforwardingserviceid", type=CommandType.LONG, required=true) + @Parameter(name="portforwardingserviceid", type=CommandType.LONG, required=true, description="the ID of the port forwarding service the rule is being created for") private Long portForwardingServiceId; - @Parameter(name="privateport", type=CommandType.STRING, required=true) + @Parameter(name="privateport", type=CommandType.STRING, required=true, description="the port of the private ip address/virtual machine to forward traffic to") private String privatePort; - @Parameter(name="protocol", type=CommandType.STRING) + @Parameter(name="protocol", type=CommandType.STRING, description="TCP is default. UDP is the other supported protocol") private String protocol; - @Parameter(name="publicport", type=CommandType.STRING, required=true) + @Parameter(name="publicport", type=CommandType.STRING, required=true, description="the port of the public ip address to forward traffic from") private String publicPort; diff --git a/server/src/com/cloud/api/commands/CreateServiceOfferingCmd.java b/server/src/com/cloud/api/commands/CreateServiceOfferingCmd.java index c176df8b63a..81f3e5329ef 100644 --- a/server/src/com/cloud/api/commands/CreateServiceOfferingCmd.java +++ b/server/src/com/cloud/api/commands/CreateServiceOfferingCmd.java @@ -36,31 +36,31 @@ public class CreateServiceOfferingCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="cpunumber", type=CommandType.LONG, required=true) + @Parameter(name="cpunumber", type=CommandType.LONG, required=true, description="the CPU number of the service offering") private Long cpuNumber; - @Parameter(name="cpuspeed", type=CommandType.LONG, required=true) + @Parameter(name="cpuspeed", type=CommandType.LONG, required=true, description="the CPU speed of the service offering in MHz.") private Long cpuSpeed; - @Parameter(name="displaytext", type=CommandType.STRING, required=true) + @Parameter(name="displaytext", type=CommandType.STRING, required=true, description="the display text of the service offering") private String displayText; - @Parameter(name="memory", type=CommandType.LONG, required=true) + @Parameter(name="memory", type=CommandType.LONG, required=true, description="the total memory of the service offering in MB") private Long memory; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the service offering") private String serviceOfferingName; - @Parameter(name="offerha", type=CommandType.BOOLEAN) + @Parameter(name="offerha", type=CommandType.BOOLEAN, description="the HA for the service offering") private Boolean offerHa; - @Parameter(name="storagetype", type=CommandType.STRING) + @Parameter(name="storagetype", type=CommandType.STRING, description="the storage type of the service offering. Values are local and shared.") private String storageType; - @Parameter(name="tags", type=CommandType.STRING) + @Parameter(name="tags", type=CommandType.STRING, description="the tags for this service offering.") private String tags; - @Parameter(name="usevirtualnetwork", type=CommandType.BOOLEAN) + @Parameter(name="usevirtualnetwork", type=CommandType.BOOLEAN, description="if true, the VM created will use default virtual networking. If false, the VM created will use a direct attached networking model. The default value is true.") private Boolean useVirtualNetwork; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateSnapshotCmd.java b/server/src/com/cloud/api/commands/CreateSnapshotCmd.java index 95a2f8c1ca1..256940e5463 100644 --- a/server/src/com/cloud/api/commands/CreateSnapshotCmd.java +++ b/server/src/com/cloud/api/commands/CreateSnapshotCmd.java @@ -41,13 +41,13 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="The account of the snapshot. The account parameter must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the disk volume.") private Long domainId; - @Parameter(name="volumeid", type=CommandType.LONG, required=true) + @Parameter(name="volumeid", type=CommandType.LONG, required=true, description="The ID of the disk volume") private Long volumeId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java b/server/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java index db37c5b2658..895d0bb03b4 100644 --- a/server/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java +++ b/server/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java @@ -37,25 +37,30 @@ public class CreateSnapshotPolicyCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="The account of the snapshot policy. The account parameter must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the snapshot policy.") private Long domainId; - @Parameter(name="intervaltype", type=CommandType.STRING, required=true) + @Parameter(name="intervaltype", type=CommandType.STRING, required=true, description="valid values are HOURLY, DAILY, WEEKLY, and MONTHLY") private String intervalType; - @Parameter(name="maxsnaps", type=CommandType.INTEGER, required=true) + @Parameter(name="maxsnaps", type=CommandType.INTEGER, required=true, description="maximum number of snapshots to retain") private Integer maxSnaps; - @Parameter(name="schedule", type=CommandType.STRING, required=true) + @Parameter(name="schedule", type=CommandType.STRING, required=true, description="time the snapshot is scheduled to be taken. " + + "Format is:" + + "* if HOURLY, MM" + + "* if DAILY, MM:HH" + + "* if WEEKLY, MM:HH:DD (1-7)" + + "* if MONTHLY, MM:HH:DD (1-28)") private String schedule; - @Parameter(name="timezone", type=CommandType.STRING, required=true) + @Parameter(name="timezone", type=CommandType.STRING, required=true, description="Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.") private String timezone; - @Parameter(name="volumeid", type=CommandType.LONG, required=true) + @Parameter(name="volumeid", type=CommandType.LONG, required=true, description="the ID of the disk volume") private Long volumeId; diff --git a/server/src/com/cloud/api/commands/CreateStoragePoolCmd.java b/server/src/com/cloud/api/commands/CreateStoragePoolCmd.java index a780e6b002b..53102f8546b 100644 --- a/server/src/com/cloud/api/commands/CreateStoragePoolCmd.java +++ b/server/src/com/cloud/api/commands/CreateStoragePoolCmd.java @@ -42,25 +42,25 @@ public class CreateStoragePoolCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="clusterid", type=CommandType.LONG) + @Parameter(name="clusterid", type=CommandType.LONG, description="the cluster ID for the storage pool") private Long clusterId; - @Parameter(name="details", type=CommandType.MAP) + @Parameter(name="details", type=CommandType.MAP, description="the details for the storage pool") private Map details; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="the name for the storage pool") private String storagePoolName; - @Parameter(name="podid", type=CommandType.LONG) + @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID for the storage pool") private Long podId; - @Parameter(name="tags", type=CommandType.STRING) + @Parameter(name="tags", type=CommandType.STRING, description="the tags for the storage pool") private String tags; - @Parameter(name="url", type=CommandType.STRING, required=true) + @Parameter(name="url", type=CommandType.STRING, required=true, description="the URL of the storage pool") private String url; - @Parameter(name="zoneid", type=CommandType.LONG, required=true) + @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the Zone ID for the storage pool") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateTemplateCmd.java b/server/src/com/cloud/api/commands/CreateTemplateCmd.java index faf4cf04a7c..c04459750d2 100644 --- a/server/src/com/cloud/api/commands/CreateTemplateCmd.java +++ b/server/src/com/cloud/api/commands/CreateTemplateCmd.java @@ -50,31 +50,31 @@ public class CreateTemplateCmd extends BaseAsyncCreateCmd { @Parameter(name="bits", type=CommandType.INTEGER) private Integer bits; - @Parameter(name="displaytext", type=CommandType.STRING, required=true) + @Parameter(name="displaytext", type=CommandType.STRING, required=true, description="the display text of the template. This is usually used for display purposes.") private String displayText; - @Parameter(name="isfeatured", type=CommandType.BOOLEAN) + @Parameter(name="isfeatured", type=CommandType.BOOLEAN, description="true if this template is a featured template, false otherwise") private Boolean featured; - @Parameter(name="ispublic", type=CommandType.BOOLEAN) + @Parameter(name="ispublic", type=CommandType.BOOLEAN, description="true if this template is a public template, false otherwise") private Boolean publicTemplate; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the template") private String templateName; - @Parameter(name="ostypeid", type=CommandType.LONG, required=true) + @Parameter(name="ostypeid", type=CommandType.LONG, required=true, description=" the ID of the OS Type that best represents the OS of this template.") private Long osTypeId; - @Parameter(name="passwordenabled", type=CommandType.BOOLEAN) + @Parameter(name="passwordenabled", type=CommandType.BOOLEAN, description="true if the template supports the password reset feature; default is false") private Boolean passwordEnabled; - @Parameter(name="requireshvm", type=CommandType.BOOLEAN) + @Parameter(name="requireshvm", type=CommandType.BOOLEAN, description="true if the template requres HVM, false otherwise") private Boolean requiresHvm; - @Parameter(name="snapshotid", type=CommandType.LONG) + @Parameter(name="snapshotid", type=CommandType.LONG, description="the ID of the snapshot the template is being created from") private Long snapshotId; - @Parameter(name="volumeid", type=CommandType.LONG) + @Parameter(name="volumeid", type=CommandType.LONG, description="the ID of the disk volume the template is being created from") private Long volumeId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateVMGroupCmd.java b/server/src/com/cloud/api/commands/CreateVMGroupCmd.java index d615872c7fa..16965475703 100644 --- a/server/src/com/cloud/api/commands/CreateVMGroupCmd.java +++ b/server/src/com/cloud/api/commands/CreateVMGroupCmd.java @@ -38,13 +38,13 @@ public class CreateVMGroupCmd extends BaseCmd{ //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the instance group") private String groupName; - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="the account of the instance group. The account parameter must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID of account owning the instance group") private Long domainId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateVlanIpRangeCmd.java b/server/src/com/cloud/api/commands/CreateVlanIpRangeCmd.java index e1f96e1c9c1..11e84dda13e 100644 --- a/server/src/com/cloud/api/commands/CreateVlanIpRangeCmd.java +++ b/server/src/com/cloud/api/commands/CreateVlanIpRangeCmd.java @@ -38,34 +38,34 @@ public class CreateVlanIpRangeCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="account who will own the VLAN. If VLAN is Zone wide, this parameter should be ommited") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="domain ID of the account owning a VLAN") private Long domainId; - @Parameter(name="endip", type=CommandType.STRING) + @Parameter(name="endip", type=CommandType.STRING, description="the ending IP address in the VLAN IP range") private String endIp; - @Parameter(name="forvirtualnetwork", type=CommandType.BOOLEAN) + @Parameter(name="forvirtualnetwork", type=CommandType.BOOLEAN, description="true if VLAN is of Virtual type, false if Direct") private Boolean forVirtualNetwork; - @Parameter(name="gateway", type=CommandType.STRING, required=true) + @Parameter(name="gateway", type=CommandType.STRING, required=true, description="the gateway of the VLAN IP range") private String gateway; - @Parameter(name="netmask", type=CommandType.STRING, required=true) + @Parameter(name="netmask", type=CommandType.STRING, required=true, description="the netmask of the VLAN IP range") private String netmask; - @Parameter(name="podid", type=CommandType.LONG) + @Parameter(name="podid", type=CommandType.LONG, description="optional parameter. Have to be specified for Direct Untagged vlan only.") private Long podId; - @Parameter(name="startip", type=CommandType.STRING, required=true) + @Parameter(name="startip", type=CommandType.STRING, required=true, description="the beginning IP address in the VLAN IP range") private String startIp; - @Parameter(name="vlan", type=CommandType.STRING) + @Parameter(name="vlan", type=CommandType.STRING, description="the ID or VID of the VLAN. Default is an \"untagged\" VLAN.") private String vlan; - @Parameter(name="zoneid", type=CommandType.LONG, required=true) + @Parameter(name="zoneid", type=CommandType.LONG, required=true, description=" the Zone ID of the VLAN IP range") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/CreateVolumeCmd.java b/server/src/com/cloud/api/commands/CreateVolumeCmd.java index 5f93550bbac..1f8d4c3bd79 100644 --- a/server/src/com/cloud/api/commands/CreateVolumeCmd.java +++ b/server/src/com/cloud/api/commands/CreateVolumeCmd.java @@ -42,25 +42,25 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="the account associated with the disk volume. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="diskofferingid", type=CommandType.LONG) + @Parameter(name="diskofferingid", type=CommandType.LONG, description="the ID of the disk offering. Either diskOfferingId or snapshotId must be passed in.") private Long diskOfferingId; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID associated with the disk offering. If used with the account parameter returns the disk volume associated with the account for the specified domain.") private Long domainId; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the disk volume") private String volumeName; - @Parameter(name="size", type=CommandType.LONG) + @Parameter(name="size", type=CommandType.LONG, description="Arbitrary volume size. Mutually exclusive with diskOfferingId") private Long size; - @Parameter(name="snapshotid", type=CommandType.LONG) + @Parameter(name="snapshotid", type=CommandType.LONG, description="the snapshot ID for the disk volume. Either diskOfferingId or snapshotId must be passed in.") private Long snapshotId; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="the ID of the availability zone") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/CreateZoneCmd.java b/server/src/com/cloud/api/commands/CreateZoneCmd.java index 64e559a53f3..37ce1dbecd5 100644 --- a/server/src/com/cloud/api/commands/CreateZoneCmd.java +++ b/server/src/com/cloud/api/commands/CreateZoneCmd.java @@ -37,25 +37,26 @@ public class CreateZoneCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="dns1", type=CommandType.STRING, required=true) + @Parameter(name="dns1", type=CommandType.STRING, required=true, description="the first DNS for the Zone") private String dns1; - @Parameter(name="dns2", type=CommandType.STRING) + @Parameter(name="dns2", type=CommandType.STRING, description="the second DNS for the Zone") private String dns2; - @Parameter(name="guestcidraddress", type=CommandType.STRING, required=true) + @Parameter(name="guestcidraddress", type=CommandType.STRING, required=true, description="the guest CIDR address for the Zone") private String guestCidrAddress; - @Parameter(name="internaldns1", type=CommandType.STRING, required=true) + @Parameter(name="internaldns1", type=CommandType.STRING, required=true, description="the first internal DNS for the Zone") private String internalDns1; - @Parameter(name="internaldns2", type=CommandType.STRING) + @Parameter(name="internaldns2", type=CommandType.STRING, description="the second internal DNS for the Zone") private String internalDns2; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the Zone") private String zoneName; - - @Parameter(name="vlan", type=CommandType.STRING) + + //FIXME - this parameter is called "vnet" in updateZone. Have to figure out which one is right + @Parameter(name="vlan", type=CommandType.STRING, description="the VNET for the Zone") private String vlan; diff --git a/server/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java b/server/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java index 3d6d14a484a..c7c5c8e7206 100644 --- a/server/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java +++ b/server/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java @@ -35,7 +35,7 @@ public class DeleteDiskOfferingCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="ID of the disk offering") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteDomainCmd.java b/server/src/com/cloud/api/commands/DeleteDomainCmd.java index 40bc5d3a3c4..fa39e2e4942 100644 --- a/server/src/com/cloud/api/commands/DeleteDomainCmd.java +++ b/server/src/com/cloud/api/commands/DeleteDomainCmd.java @@ -21,9 +21,11 @@ import org.apache.log4j.Logger; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; +import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; -import com.cloud.api.response.DeleteDomainResponse; +import com.cloud.api.ServerApiException; +import com.cloud.api.response.SuccessResponse; import com.cloud.domain.DomainVO; import com.cloud.event.EventTypes; import com.cloud.user.Account; @@ -86,11 +88,16 @@ public class DeleteDomainCmd extends BaseAsyncCmd { } @Override @SuppressWarnings("unchecked") - public DeleteDomainResponse getResponse() { - String deleteResult = (String)getResponseObject(); + public SuccessResponse getResponse() { + Boolean responseObject = (Boolean)getResponseObject(); - DeleteDomainResponse response = new DeleteDomainResponse(); - response.setResult(deleteResult); + SuccessResponse response = new SuccessResponse(); + + if (responseObject != null) { + response.setSuccess(responseObject); + } else { + throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete host"); + } response.setResponseName(getName()); return response; diff --git a/server/src/com/cloud/api/commands/DeleteHostCmd.java b/server/src/com/cloud/api/commands/DeleteHostCmd.java index 9cd6739d9ec..5f727bbb435 100644 --- a/server/src/com/cloud/api/commands/DeleteHostCmd.java +++ b/server/src/com/cloud/api/commands/DeleteHostCmd.java @@ -38,7 +38,7 @@ public class DeleteHostCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the host ID") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteIsoCmd.java b/server/src/com/cloud/api/commands/DeleteIsoCmd.java index b93662281cf..39efa1759b7 100644 --- a/server/src/com/cloud/api/commands/DeleteIsoCmd.java +++ b/server/src/com/cloud/api/commands/DeleteIsoCmd.java @@ -40,10 +40,10 @@ public class DeleteIsoCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the ISO file") private Long id; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="the ID of the zone of the ISO file. If not specified, the ISO will be deleted from all the zones") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java b/server/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java index 8ffd3033c1b..12430fca000 100644 --- a/server/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java +++ b/server/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java @@ -37,7 +37,7 @@ public class DeleteLoadBalancerRuleCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the load balancer rule") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteNetworkGroupCmd.java b/server/src/com/cloud/api/commands/DeleteNetworkGroupCmd.java index 4a2635b9a3d..a14e0fef420 100644 --- a/server/src/com/cloud/api/commands/DeleteNetworkGroupCmd.java +++ b/server/src/com/cloud/api/commands/DeleteNetworkGroupCmd.java @@ -17,13 +17,13 @@ public class DeleteNetworkGroupCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="the account of the network group. Must be specified with domain ID") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID of account owning the network group") private Long domainId; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="the network group name") private String networkGroupName; diff --git a/server/src/com/cloud/api/commands/DeletePodCmd.java b/server/src/com/cloud/api/commands/DeletePodCmd.java index e6ecc69cc57..ff854ca8242 100644 --- a/server/src/com/cloud/api/commands/DeletePodCmd.java +++ b/server/src/com/cloud/api/commands/DeletePodCmd.java @@ -37,7 +37,7 @@ public class DeletePodCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the Pod") private Long id; diff --git a/server/src/com/cloud/api/commands/DeletePoolCmd.java b/server/src/com/cloud/api/commands/DeletePoolCmd.java index d8ffb206752..5d26634565b 100644 --- a/server/src/com/cloud/api/commands/DeletePoolCmd.java +++ b/server/src/com/cloud/api/commands/DeletePoolCmd.java @@ -18,7 +18,7 @@ public class DeletePoolCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="Storage pool id") private Long id; diff --git a/server/src/com/cloud/api/commands/DeletePortForwardingServiceCmd.java b/server/src/com/cloud/api/commands/DeletePortForwardingServiceCmd.java index b2af8328d1f..c29127fb213 100644 --- a/server/src/com/cloud/api/commands/DeletePortForwardingServiceCmd.java +++ b/server/src/com/cloud/api/commands/DeletePortForwardingServiceCmd.java @@ -41,7 +41,7 @@ public class DeletePortForwardingServiceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="ID of the port forwarding service") private Long id; diff --git a/server/src/com/cloud/api/commands/DeletePreallocatedLunCmd.java b/server/src/com/cloud/api/commands/DeletePreallocatedLunCmd.java index e3416cabbcc..885eba60221 100644 --- a/server/src/com/cloud/api/commands/DeletePreallocatedLunCmd.java +++ b/server/src/com/cloud/api/commands/DeletePreallocatedLunCmd.java @@ -20,7 +20,7 @@ package com.cloud.api.commands; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; -import com.cloud.api.response.DeletePreallocatedLunResponse; +import com.cloud.api.response.SuccessResponse; @Implementation(method="unregisterPreallocatedLun") public class DeletePreallocatedLunCmd extends BaseCmd { @@ -30,7 +30,7 @@ public class DeletePreallocatedLunCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="preallocated LUN ID") private Long id; ///////////////////////////////////////////////////// @@ -51,10 +51,10 @@ public class DeletePreallocatedLunCmd extends BaseCmd { } @Override @SuppressWarnings("unchecked") - public DeletePreallocatedLunResponse getResponse() { + public SuccessResponse getResponse() { Boolean result = (Boolean)getResponseObject(); - DeletePreallocatedLunResponse response = new DeletePreallocatedLunResponse(); + SuccessResponse response = new SuccessResponse(); response.setSuccess(result); response.setResponseName(getName()); diff --git a/server/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java b/server/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java index 3316c727076..048f1f9dc11 100644 --- a/server/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java +++ b/server/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java @@ -35,7 +35,7 @@ public class DeleteServiceOfferingCmd extends BaseCmd{ //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the service offering") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteSnapshotCmd.java b/server/src/com/cloud/api/commands/DeleteSnapshotCmd.java index 511daa32970..71c9f3bd5cf 100644 --- a/server/src/com/cloud/api/commands/DeleteSnapshotCmd.java +++ b/server/src/com/cloud/api/commands/DeleteSnapshotCmd.java @@ -45,7 +45,7 @@ public class DeleteSnapshotCmd extends BaseAsyncCmd { @Parameter(name="domainid", type=CommandType.LONG) private Long domainId; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the snapshot") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteSnapshotPoliciesCmd.java b/server/src/com/cloud/api/commands/DeleteSnapshotPoliciesCmd.java index cb8a25abfea..7725adba353 100644 --- a/server/src/com/cloud/api/commands/DeleteSnapshotPoliciesCmd.java +++ b/server/src/com/cloud/api/commands/DeleteSnapshotPoliciesCmd.java @@ -44,10 +44,10 @@ public class DeleteSnapshotPoliciesCmd extends BaseCmd { @Parameter(name="domainid", type=CommandType.LONG) private Long domainId; - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="the Id of the snapshot") private Long id; - @Parameter(name="ids", type=CommandType.LIST, collectionType=CommandType.LONG) + @Parameter(name="ids", type=CommandType.LIST, collectionType=CommandType.LONG, description="list of snapshots IDs separated by comma") private List ids; diff --git a/server/src/com/cloud/api/commands/DeleteTemplateCmd.java b/server/src/com/cloud/api/commands/DeleteTemplateCmd.java index 5961190c671..56e89dc05ee 100644 --- a/server/src/com/cloud/api/commands/DeleteTemplateCmd.java +++ b/server/src/com/cloud/api/commands/DeleteTemplateCmd.java @@ -39,10 +39,10 @@ public class DeleteTemplateCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the template") private Long id; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="the ID of zone of the template") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/DeleteVMGroupCmd.java b/server/src/com/cloud/api/commands/DeleteVMGroupCmd.java index ff5bf91cb91..247bd8c4e99 100644 --- a/server/src/com/cloud/api/commands/DeleteVMGroupCmd.java +++ b/server/src/com/cloud/api/commands/DeleteVMGroupCmd.java @@ -34,7 +34,7 @@ public class DeleteVMGroupCmd extends BaseCmd{ //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the instance group") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DeleteVlanIpRangeCmd.java b/server/src/com/cloud/api/commands/DeleteVlanIpRangeCmd.java index da020dc7a1a..9c2bfa8340f 100644 --- a/server/src/com/cloud/api/commands/DeleteVlanIpRangeCmd.java +++ b/server/src/com/cloud/api/commands/DeleteVlanIpRangeCmd.java @@ -36,7 +36,7 @@ public class DeleteVlanIpRangeCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the id of the VLAN IP range") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DeleteVolumeCmd.java b/server/src/com/cloud/api/commands/DeleteVolumeCmd.java index 1c21f3e01c8..45a0b805480 100644 --- a/server/src/com/cloud/api/commands/DeleteVolumeCmd.java +++ b/server/src/com/cloud/api/commands/DeleteVolumeCmd.java @@ -35,7 +35,7 @@ public class DeleteVolumeCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the disk volume") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteZoneCmd.java b/server/src/com/cloud/api/commands/DeleteZoneCmd.java index 6fc3f3528ea..63ecc2ff667 100644 --- a/server/src/com/cloud/api/commands/DeleteZoneCmd.java +++ b/server/src/com/cloud/api/commands/DeleteZoneCmd.java @@ -36,7 +36,7 @@ public class DeleteZoneCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the Zone") private Long id; diff --git a/server/src/com/cloud/api/commands/DeployVMCmd.java b/server/src/com/cloud/api/commands/DeployVMCmd.java index 7389cae39ff..62edfb5fedb 100644 --- a/server/src/com/cloud/api/commands/DeployVMCmd.java +++ b/server/src/com/cloud/api/commands/DeployVMCmd.java @@ -47,37 +47,37 @@ public class DeployVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="an optional account for the virtual machine. Must be used with domainId.") private String accountName; - @Parameter(name="diskofferingid", type=CommandType.LONG) + @Parameter(name="diskofferingid", type=CommandType.LONG, description="the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to dinidcate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.") private Long diskOfferingId; - @Parameter(name="displayname", type=CommandType.STRING) + @Parameter(name="displayname", type=CommandType.STRING, description="an optional user generated name for the virtual machine") private String displayName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.") private Long domainId; - @Parameter(name="group", type=CommandType.STRING) + @Parameter(name="group", type=CommandType.STRING, description="an optional group for the virtual machine") private String group; - @Parameter(name="networkgrouplist", type=CommandType.LIST, collectionType=CommandType.STRING) + @Parameter(name="networkgrouplist", type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of network groups that going to be applied to the virtual machine. Should be passed only when vm is created from service offering with Direct Attach Network support") private List networkGroupList; - @Parameter(name="serviceofferingid", type=CommandType.LONG, required=true) + @Parameter(name="serviceofferingid", type=CommandType.LONG, required=true, description="the ID of the service offering for the virtual machine") private Long serviceOfferingId; - @Parameter(name="size", type=CommandType.LONG) + @Parameter(name="size", type=CommandType.LONG, description="the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId") private Long size; - @Parameter(name="templateid", type=CommandType.LONG, required=true) + @Parameter(name="templateid", type=CommandType.LONG, required=true, description="the ID of the template for the virtual machine") private Long templateId; - @Parameter(name="userdata", type=CommandType.STRING) + @Parameter(name="userdata", type=CommandType.STRING, description="an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Currently only HTTP GET is supported. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding.") private String userData; - @Parameter(name="zoneid", type=CommandType.LONG, required=true) + @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="availability zone for the virtual machine") private Long zoneId; // unexposed parameter needed for serializing/deserializing the command diff --git a/server/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java b/server/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java index c0893e4fd19..1f8039b755b 100644 --- a/server/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java +++ b/server/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java @@ -39,7 +39,7 @@ public class DestroyConsoleProxyCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="console proxy ID") private Long id; diff --git a/server/src/com/cloud/api/commands/DestroyVMCmd.java b/server/src/com/cloud/api/commands/DestroyVMCmd.java index 98496b83d77..d6304519b09 100644 --- a/server/src/com/cloud/api/commands/DestroyVMCmd.java +++ b/server/src/com/cloud/api/commands/DestroyVMCmd.java @@ -39,7 +39,7 @@ public class DestroyVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DetachIsoCmd.java b/server/src/com/cloud/api/commands/DetachIsoCmd.java index 115a5ebce71..26ef17830ff 100644 --- a/server/src/com/cloud/api/commands/DetachIsoCmd.java +++ b/server/src/com/cloud/api/commands/DetachIsoCmd.java @@ -39,7 +39,7 @@ public class DetachIsoCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true) + @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true, description=" The ID of the virtual machine") private Long virtualMachineId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DetachVolumeCmd.java b/server/src/com/cloud/api/commands/DetachVolumeCmd.java index 8da640716b3..28629966b81 100644 --- a/server/src/com/cloud/api/commands/DetachVolumeCmd.java +++ b/server/src/com/cloud/api/commands/DetachVolumeCmd.java @@ -39,13 +39,13 @@ public class DetachVolumeCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="the ID of the disk volume") private Long id; - @Parameter(name="deviceid", type=CommandType.LONG) + @Parameter(name="deviceid", type=CommandType.LONG, description="the device ID on the virtual machine where volume is detached from") private Long deviceId; - @Parameter(name="virtualmachineid", type=CommandType.LONG) + @Parameter(name="virtualmachineid", type=CommandType.LONG, description="the ID of the virtual machine where the volume is detached from") private Long virtualMachineId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ExtractIsoCmd.java b/server/src/com/cloud/api/commands/ExtractIsoCmd.java index e75558fcf42..791a1c45f3d 100755 --- a/server/src/com/cloud/api/commands/ExtractIsoCmd.java +++ b/server/src/com/cloud/api/commands/ExtractIsoCmd.java @@ -39,13 +39,14 @@ public class ExtractIsoCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the ISO file") private Long id; + //FIXME - add description @Parameter(name="url", type=CommandType.STRING, required=true) private String url; - @Parameter(name="zoneid", type=CommandType.LONG, required=true) + @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the ID of the zone where the ISO is originally located") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ExtractTemplateCmd.java b/server/src/com/cloud/api/commands/ExtractTemplateCmd.java index 245d9002f18..3bb7aca38ca 100755 --- a/server/src/com/cloud/api/commands/ExtractTemplateCmd.java +++ b/server/src/com/cloud/api/commands/ExtractTemplateCmd.java @@ -39,12 +39,15 @@ public class ExtractTemplateCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// + //FIXME - add description @Parameter(name="id", type=CommandType.LONG, required=true) private Long id; + //FIXME - add description @Parameter(name="url", type=CommandType.STRING, required=true) private String url; + //FIXME - add description @Parameter(name="zoneid", type=CommandType.LONG, required=true) private Long zoneId; diff --git a/server/src/com/cloud/api/commands/ExtractVolumeCmd.java b/server/src/com/cloud/api/commands/ExtractVolumeCmd.java index f61e5101d51..c9b6ee2b159 100755 --- a/server/src/com/cloud/api/commands/ExtractVolumeCmd.java +++ b/server/src/com/cloud/api/commands/ExtractVolumeCmd.java @@ -38,12 +38,15 @@ public class ExtractVolumeCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// + //FIXME - add description @Parameter(name="id", type=CommandType.LONG, required=true) private Long id; + //FIXME - add description @Parameter(name="url", type=CommandType.STRING, required=true) private String url; + //FIXME - add description @Parameter(name="zoneid", type=CommandType.LONG, required=true) private Long zoneId; diff --git a/server/src/com/cloud/api/commands/GetCloudIdentifierCmd.java b/server/src/com/cloud/api/commands/GetCloudIdentifierCmd.java index 07b8a58e7b5..28f7bea69ba 100644 --- a/server/src/com/cloud/api/commands/GetCloudIdentifierCmd.java +++ b/server/src/com/cloud/api/commands/GetCloudIdentifierCmd.java @@ -38,7 +38,7 @@ public class GetCloudIdentifierCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="userid", type=CommandType.LONG, required=true) + @Parameter(name="userid", type=CommandType.LONG, required=true, description="the user ID for the cloud identifier") private Long userid; diff --git a/server/src/com/cloud/api/commands/ListAccountsCmd.java b/server/src/com/cloud/api/commands/ListAccountsCmd.java index 16845177b91..58759007322 100644 --- a/server/src/com/cloud/api/commands/ListAccountsCmd.java +++ b/server/src/com/cloud/api/commands/ListAccountsCmd.java @@ -49,25 +49,25 @@ public class ListAccountsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="List account for a specified account. Must be used with the domainId parameter.") + @Parameter(name="account", type=CommandType.STRING, description="list account for a specified account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="accounttype", type=CommandType.LONG, description="List accounts by account type. Valid account types are 1 (admin), 2 (domain-admin), and 0 (user).") + @Parameter(name="accounttype", type=CommandType.LONG, description="list accounts by account type. Valid account types are 1 (admin), 2 (domain-admin), and 0 (user).") private Long accountType; - @Parameter(name="domainid", type=CommandType.LONG, description="List all accounts in specified domain. If used with the account parameter, retrieves account information for specified account in specified domain.") + @Parameter(name="domainid", type=CommandType.LONG, description="list all accounts in specified domain. If used with the account parameter, retrieves account information for specified account in specified domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, description="List account by account ID") + @Parameter(name="id", type=CommandType.LONG, description="list account by account ID") private Long id; - @Parameter(name="iscleanuprequired", type=CommandType.BOOLEAN) + @Parameter(name="iscleanuprequired", type=CommandType.BOOLEAN, description="list accounts by cleanuprequred attribute (values are true or false)") private Boolean cleanupRequired; - @Parameter(name="name", type=CommandType.STRING, description="List account by account name") + @Parameter(name="name", type=CommandType.STRING, description="list account by account name") private String searchName; - @Parameter(name="state", type=CommandType.STRING, description="List accounts by state. Valid states are enabled, disabled, and locked.") + @Parameter(name="state", type=CommandType.STRING, description="list accounts by state. Valid states are enabled, disabled, and locked.") private String state; diff --git a/server/src/com/cloud/api/commands/ListAlertsCmd.java b/server/src/com/cloud/api/commands/ListAlertsCmd.java index ab3f99c394a..c2a639b93b0 100644 --- a/server/src/com/cloud/api/commands/ListAlertsCmd.java +++ b/server/src/com/cloud/api/commands/ListAlertsCmd.java @@ -40,7 +40,7 @@ public class ListAlertsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="type", type=CommandType.STRING) + @Parameter(name="type", type=CommandType.STRING, description="list by alert type") private String type; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListAsyncJobsCmd.java b/server/src/com/cloud/api/commands/ListAsyncJobsCmd.java index 1d448ad1428..53ebd75a195 100644 --- a/server/src/com/cloud/api/commands/ListAsyncJobsCmd.java +++ b/server/src/com/cloud/api/commands/ListAsyncJobsCmd.java @@ -38,13 +38,13 @@ public class ListAsyncJobsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="the account associated with the async job. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID associated with the async job. If used with the account parameter, returns async jobs for the account in the specified domain.") private Long domainId; - @Parameter(name="startdate", type=CommandType.TZDATE) + @Parameter(name="startdate", type=CommandType.TZDATE, description="the start date of the async job") private Date startDate; diff --git a/server/src/com/cloud/api/commands/ListCapacityCmd.java b/server/src/com/cloud/api/commands/ListCapacityCmd.java index f248cb42429..e2826cbb113 100644 --- a/server/src/com/cloud/api/commands/ListCapacityCmd.java +++ b/server/src/com/cloud/api/commands/ListCapacityCmd.java @@ -52,16 +52,16 @@ public class ListCapacityCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="hostid", type=CommandType.LONG) + @Parameter(name="hostid", type=CommandType.LONG, description="lists capacity by the Host ID") private Long hostId; - @Parameter(name="podid", type=CommandType.LONG) + @Parameter(name="podid", type=CommandType.LONG, description="lists capacity by the Pod ID") private Long podId; - @Parameter(name="type", type=CommandType.STRING) + @Parameter(name="type", type=CommandType.STRING, description="lists capacity by type") private String type; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="lists capacity by the Zone ID") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/ListCfgsByCmd.java b/server/src/com/cloud/api/commands/ListCfgsByCmd.java index 7e263512138..472b32f99f3 100644 --- a/server/src/com/cloud/api/commands/ListCfgsByCmd.java +++ b/server/src/com/cloud/api/commands/ListCfgsByCmd.java @@ -40,10 +40,10 @@ public class ListCfgsByCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="category", type=CommandType.STRING) + @Parameter(name="category", type=CommandType.STRING, description="lists configurations by category") private String category; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="lists configuration by name") private String configName; diff --git a/server/src/com/cloud/api/commands/ListClustersCmd.java b/server/src/com/cloud/api/commands/ListClustersCmd.java index 06413b91643..eab8d4984b5 100644 --- a/server/src/com/cloud/api/commands/ListClustersCmd.java +++ b/server/src/com/cloud/api/commands/ListClustersCmd.java @@ -43,16 +43,16 @@ public class ListClustersCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="lists clusters by the cluster ID") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="lists clusters by the cluster name") private String clusterName; - @Parameter(name="podid", type=CommandType.LONG) + @Parameter(name="podid", type=CommandType.LONG, description="lists clusters by Pod ID") private Long podId; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="lists clusters by Zone ID") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/ListDiskOfferingsCmd.java b/server/src/com/cloud/api/commands/ListDiskOfferingsCmd.java index 069ca1c5ebb..98ac3e1381a 100644 --- a/server/src/com/cloud/api/commands/ListDiskOfferingsCmd.java +++ b/server/src/com/cloud/api/commands/ListDiskOfferingsCmd.java @@ -41,13 +41,13 @@ public class ListDiskOfferingsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the ID of the domain of the disk offering. This information is not currently applicable, and should not be used as a parameter.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="ID of the disk offering") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="name of the disk offering") private String diskOfferingName; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListEventsCmd.java b/server/src/com/cloud/api/commands/ListEventsCmd.java index 76bc22b58ed..6d8ee45ab80 100644 --- a/server/src/com/cloud/api/commands/ListEventsCmd.java +++ b/server/src/com/cloud/api/commands/ListEventsCmd.java @@ -42,28 +42,28 @@ public class ListEventsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="the account for the event. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID for the event. If used with the account parameter, returns all events for an account in the specified domain ID.") private Long domainId; - @Parameter(name="duration", type=CommandType.INTEGER) + @Parameter(name="duration", type=CommandType.INTEGER, description="the duration of the event") private Integer duration; - @Parameter(name="enddate", type=CommandType.DATE) + @Parameter(name="enddate", type=CommandType.DATE, description="the end date range of the list you want to retrieve (use format \"yyyy-MM-dd\")") private Date endDate; - @Parameter(name="entrytime", type=CommandType.INTEGER) + @Parameter(name="entrytime", type=CommandType.INTEGER, description="the time the event was entered") private Integer entryTime; - @Parameter(name="level", type=CommandType.STRING) + @Parameter(name="level", type=CommandType.STRING, description="the event level (INFO, WARN, ERROR)") private String level; - @Parameter(name="startdate", type=CommandType.DATE) + @Parameter(name="startdate", type=CommandType.DATE, description="the start date range of the list you want to retrieve (use format \"yyyy-MM-dd\")") private Date startDate; - @Parameter(name="type", type=CommandType.STRING) + @Parameter(name="type", type=CommandType.STRING, description="the event type (see event types)") private String type; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListGuestOsCategoriesCmd.java b/server/src/com/cloud/api/commands/ListGuestOsCategoriesCmd.java index 3ecee1ac19a..ef8e6b81aef 100644 --- a/server/src/com/cloud/api/commands/ListGuestOsCategoriesCmd.java +++ b/server/src/com/cloud/api/commands/ListGuestOsCategoriesCmd.java @@ -40,7 +40,7 @@ public class ListGuestOsCategoriesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="list Os category by id") private Long id; diff --git a/server/src/com/cloud/api/commands/ListGuestOsCmd.java b/server/src/com/cloud/api/commands/ListGuestOsCmd.java index 114bae5bcb6..4d375b33e1d 100644 --- a/server/src/com/cloud/api/commands/ListGuestOsCmd.java +++ b/server/src/com/cloud/api/commands/ListGuestOsCmd.java @@ -40,10 +40,10 @@ public class ListGuestOsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="list by Os type Id") private Long id; - @Parameter(name="oscategoryid", type=CommandType.LONG) + @Parameter(name="oscategoryid", type=CommandType.LONG, description="list by Os Category id") private Long osCategoryId; diff --git a/server/src/com/cloud/api/commands/ListHostsCmd.java b/server/src/com/cloud/api/commands/ListHostsCmd.java index a454f2c59c4..40afb7c8ac9 100644 --- a/server/src/com/cloud/api/commands/ListHostsCmd.java +++ b/server/src/com/cloud/api/commands/ListHostsCmd.java @@ -52,25 +52,25 @@ public class ListHostsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="clusterid", type=CommandType.LONG) + @Parameter(name="clusterid", type=CommandType.LONG, description="lists hosts existing in particular cluster") private Long clusterId; - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="the id of the host") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the name of the host") private String hostName; - @Parameter(name="podid", type=CommandType.LONG) + @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID for the host") private Long podId; - @Parameter(name="state", type=CommandType.STRING) + @Parameter(name="state", type=CommandType.STRING, description="the state of the host") private String state; - @Parameter(name="type", type=CommandType.STRING) + @Parameter(name="type", type=CommandType.STRING, description="the host type") private String type; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="the Zone ID for the host") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/ListIsosCmd.java b/server/src/com/cloud/api/commands/ListIsosCmd.java index fb4689b7fba..f2d3107c5bf 100644 --- a/server/src/com/cloud/api/commands/ListIsosCmd.java +++ b/server/src/com/cloud/api/commands/ListIsosCmd.java @@ -52,31 +52,35 @@ public class ListIsosCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="the account of the ISO file. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="bootable", type=CommandType.BOOLEAN) + @Parameter(name="bootable", type=CommandType.BOOLEAN, description="true if the ISO is bootable, false otherwise") private Boolean bootable; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="lists all available ISO files by ID of a domain. If used with the account parameter, lists all available ISO files for the account in the ID of a domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="list all isos by id") private Long id; - @Parameter(name="ispublic", type=CommandType.BOOLEAN) + @Parameter(name="ispublic", type=CommandType.BOOLEAN, description="true if the ISO is publicly available to all users, false otherwise.") private Boolean publicIso; - @Parameter(name="isready", type=CommandType.BOOLEAN) + @Parameter(name="isready", type=CommandType.BOOLEAN, description="true if this ISO is ready to be deployed") private Boolean ready; - @Parameter(name="isofilter", type=CommandType.STRING) + @Parameter(name="isofilter", type=CommandType.STRING, description="possible values are \"featured\", \"self\", \"self-executable\",\"executable\", and \"community\". " + + "* featured—ISOs that are featured and are publicself—ISOs that have been registered/created by the owner. " + + "* selfexecutable— ISOs that have been registered/created by the owner that can be used to deploy a new VM. " + + "* executable— all ISOs that can be used to deploy a new VM " + + "* community—ISOs that are public.") private String isoFilter = TemplateFilter.selfexecutable.toString(); - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="list all isos by name") private String isoName; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="the ID of the zone") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/ListLoadBalancerRuleInstancesCmd.java b/server/src/com/cloud/api/commands/ListLoadBalancerRuleInstancesCmd.java index 1a757b0bafb..19b00b1230b 100644 --- a/server/src/com/cloud/api/commands/ListLoadBalancerRuleInstancesCmd.java +++ b/server/src/com/cloud/api/commands/ListLoadBalancerRuleInstancesCmd.java @@ -41,10 +41,10 @@ public class ListLoadBalancerRuleInstancesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="applied", type=CommandType.BOOLEAN) + @Parameter(name="applied", type=CommandType.BOOLEAN, description="true if listing all virtual machines currently applied to the load balancer rule; default is true") private Boolean applied; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the load balancer rule") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListLoadBalancerRulesCmd.java b/server/src/com/cloud/api/commands/ListLoadBalancerRulesCmd.java index 9e8c9ecfb35..49bfc32110a 100644 --- a/server/src/com/cloud/api/commands/ListLoadBalancerRulesCmd.java +++ b/server/src/com/cloud/api/commands/ListLoadBalancerRulesCmd.java @@ -42,22 +42,22 @@ public class ListLoadBalancerRulesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="the account of the load balancer rule. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID of the load balancer rule. If used with the account parameter, lists load balancer rules for the account in the specified domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="the ID of the load balancer rule") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the name of the load balancer rule") private String loadBalancerRuleName; - @Parameter(name="publicip", type=CommandType.STRING) + @Parameter(name="publicip", type=CommandType.STRING, description="the public IP address of the load balancer rule ") private String publicIp; - @Parameter(name="virtualmachineid", type=CommandType.LONG) + @Parameter(name="virtualmachineid", type=CommandType.LONG, description="the ID of the virtual machine of the load balancer rule") private Long virtualMachineId; diff --git a/server/src/com/cloud/api/commands/ListNetworkGroupsCmd.java b/server/src/com/cloud/api/commands/ListNetworkGroupsCmd.java index 92798076c78..3e489e0e54f 100644 --- a/server/src/com/cloud/api/commands/ListNetworkGroupsCmd.java +++ b/server/src/com/cloud/api/commands/ListNetworkGroupsCmd.java @@ -44,16 +44,16 @@ public class ListNetworkGroupsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="lists all available port network groups for the account. Must be used with domainID parameter") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="lists all available network groups for the domain ID. If used with the account parameter, lists all available network groups for the account in the specified domain ID.") private Long domainId; - @Parameter(name="networkgroupname", type=CommandType.STRING) + @Parameter(name="networkgroupname", type=CommandType.STRING, description="lists network groups by name") private String networkGroupName; - @Parameter(name="virtualmachineid", type=CommandType.LONG) + @Parameter(name="virtualmachineid", type=CommandType.LONG, description="lists network groups by virtual machine id") private Long virtualMachineId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListPodsByCmd.java b/server/src/com/cloud/api/commands/ListPodsByCmd.java index b0d945a871f..e0f337c9f7a 100644 --- a/server/src/com/cloud/api/commands/ListPodsByCmd.java +++ b/server/src/com/cloud/api/commands/ListPodsByCmd.java @@ -41,13 +41,13 @@ public class ListPodsByCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="list Pods by ID") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="list Pods by name") private String podName; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="list Pods by Zone ID") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/ListPortForwardingRulesCmd.java b/server/src/com/cloud/api/commands/ListPortForwardingRulesCmd.java index 105955deb34..15d0cfafe81 100644 --- a/server/src/com/cloud/api/commands/ListPortForwardingRulesCmd.java +++ b/server/src/com/cloud/api/commands/ListPortForwardingRulesCmd.java @@ -46,7 +46,7 @@ public class ListPortForwardingRulesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="ipaddress", type=CommandType.STRING, required=true) + @Parameter(name="ipaddress", type=CommandType.STRING, required=true, description="the IP address of the port forwarding services") private String ipAddress; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListPortForwardingServicesByVmCmd.java b/server/src/com/cloud/api/commands/ListPortForwardingServicesByVmCmd.java index 52527bee8fb..12a39aa4cc5 100644 --- a/server/src/com/cloud/api/commands/ListPortForwardingServicesByVmCmd.java +++ b/server/src/com/cloud/api/commands/ListPortForwardingServicesByVmCmd.java @@ -43,16 +43,16 @@ public class ListPortForwardingServicesByVmCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="the account associated with the port forwarding services. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID associated with the port forwarding services. If used with the account parameter, returns a list of all port forwarding services for an account in the specified domain ID.") private Long domainId; - @Parameter(name="ipaddress", type=CommandType.STRING) + @Parameter(name="ipaddress", type=CommandType.STRING, description="public ip address") private String ipAddress; - @Parameter(name="virtualmachineid", type=CommandType.LONG) + @Parameter(name="virtualmachineid", type=CommandType.LONG, description="ID of the virtual machine") private Long virtualMachineId; diff --git a/server/src/com/cloud/api/commands/ListPortForwardingServicesCmd.java b/server/src/com/cloud/api/commands/ListPortForwardingServicesCmd.java index 6737ba08150..b18c2c31d59 100644 --- a/server/src/com/cloud/api/commands/ListPortForwardingServicesCmd.java +++ b/server/src/com/cloud/api/commands/ListPortForwardingServicesCmd.java @@ -42,16 +42,16 @@ public class ListPortForwardingServicesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="lists all available port forwarding services for the account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="lists all available port forwarding services for the domain ID. If used with the account parameter, lists all available port forwarding services for the account in the specified domain ID.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="the ID of the port forwarding service") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the name of the port forwarding service") private String portForwardingServiceName; diff --git a/server/src/com/cloud/api/commands/ListPreallocatedLunsCmd.java b/server/src/com/cloud/api/commands/ListPreallocatedLunsCmd.java index 0b88b3488e3..a1884a5e3a8 100644 --- a/server/src/com/cloud/api/commands/ListPreallocatedLunsCmd.java +++ b/server/src/com/cloud/api/commands/ListPreallocatedLunsCmd.java @@ -40,9 +40,11 @@ public class ListPreallocatedLunsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// + //FIXME - add description @Parameter(name="scope", type=CommandType.STRING) private String scope; + //FIXME - add description @Parameter(name="targetiqn", type=CommandType.STRING) private String targetIqn; diff --git a/server/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java b/server/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java index aec1f8bf9a7..3107012855c 100644 --- a/server/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java +++ b/server/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java @@ -37,10 +37,10 @@ public class ListRecurringSnapshotScheduleCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="snapshotpolicyid", type=CommandType.LONG) + @Parameter(name="snapshotpolicyid", type=CommandType.LONG, description="lists recurring snapshots by snapshot policy ID") private Long snapshotPolicyId; - @Parameter(name="volumeid", type=CommandType.LONG, required=true) + @Parameter(name="volumeid", type=CommandType.LONG, required=true, description="list recurring snapshots by volume ID") private Long volumeId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListResourceLimitsCmd.java b/server/src/com/cloud/api/commands/ListResourceLimitsCmd.java index a5f392b3d1d..a71cafd84c2 100644 --- a/server/src/com/cloud/api/commands/ListResourceLimitsCmd.java +++ b/server/src/com/cloud/api/commands/ListResourceLimitsCmd.java @@ -43,18 +43,22 @@ public class ListResourceLimitsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="Lists resource limits by account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="Lists resource limits by domain ID. If used with the account parameter, lists resource limits for a specified account in a specified domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="Lists resource limits by ID.") private Long id; - @Parameter(name="resourcetype", type=CommandType.INTEGER) - private Integer resourceType; - + @Parameter(name="resourcetype", type=CommandType.INTEGER, required=true, description="Type of resource to update. Values are 0, 1, 2, 3, and 4. 0 — Instance. Number of instances a user can create. " + + "1 — IP. Number of public IP addresses a user can own. " + + "2 — Volume. Number of disk volumes a user can create." + + "3 — Snapshot. Number of snapshots a user can create." + + "4 — Template. Number of templates that a user can register/create.") + private Integer resourceType; + ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListRoutersCmd.java b/server/src/com/cloud/api/commands/ListRoutersCmd.java index bf222491539..00b2ce8978c 100644 --- a/server/src/com/cloud/api/commands/ListRoutersCmd.java +++ b/server/src/com/cloud/api/commands/ListRoutersCmd.java @@ -43,25 +43,25 @@ public class ListRoutersCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="the name of the account associated with the router. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID associated with the router. If used with the account parameter, lists all routers associated with an account in the specified domain.") private Long domainId; - @Parameter(name="hostid", type=CommandType.LONG) + @Parameter(name="hostid", type=CommandType.LONG, description="the host ID of the router") private Long hostId; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the name of the router") private String routerName; - @Parameter(name="podid", type=CommandType.LONG) + @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID of the router") private Long podId; - @Parameter(name="state", type=CommandType.STRING) + @Parameter(name="state", type=CommandType.STRING, description="the state of the router") private String state; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="the Zone ID of the router") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListServiceOfferingsCmd.java b/server/src/com/cloud/api/commands/ListServiceOfferingsCmd.java index 3b6e98323f5..28f54d7db2f 100644 --- a/server/src/com/cloud/api/commands/ListServiceOfferingsCmd.java +++ b/server/src/com/cloud/api/commands/ListServiceOfferingsCmd.java @@ -40,13 +40,13 @@ public class ListServiceOfferingsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="ID of the service offering") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="name of the service offering") private String serviceOfferingName; - @Parameter(name="virtualmachineid", type=CommandType.LONG) + @Parameter(name="virtualmachineid", type=CommandType.LONG, description="the ID of the virtual machine. Pass this in if you want to see the available service offering that a virtual machine can be changed to.") private Long virtualMachineId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListSnapshotPoliciesCmd.java b/server/src/com/cloud/api/commands/ListSnapshotPoliciesCmd.java index 9e36be5565c..99a4a18ff87 100644 --- a/server/src/com/cloud/api/commands/ListSnapshotPoliciesCmd.java +++ b/server/src/com/cloud/api/commands/ListSnapshotPoliciesCmd.java @@ -41,13 +41,13 @@ public class ListSnapshotPoliciesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="lists snapshot policies for the specified account. Must be used with domainid parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID. If used with the account parameter, lists snapshot policies for the specified account in this domain.") private Long domainId; - @Parameter(name="volumeid", type=CommandType.LONG, required=true) + @Parameter(name="volumeid", type=CommandType.LONG, required=true, description="the ID of the disk volume") private Long volumeId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListSnapshotsCmd.java b/server/src/com/cloud/api/commands/ListSnapshotsCmd.java index b331b922f5a..487a0f7daf0 100644 --- a/server/src/com/cloud/api/commands/ListSnapshotsCmd.java +++ b/server/src/com/cloud/api/commands/ListSnapshotsCmd.java @@ -45,25 +45,25 @@ public class ListSnapshotsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="lists snapshot belongig to the specified account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID. If used with the account parameter, lists snapshots for the specified account in this domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="lists snapshot by snapshot ID") private Long id; - @Parameter(name="intervalType", type=CommandType.STRING) + @Parameter(name="intervalType", type=CommandType.STRING, description="valid values are HOURLY, DAILY, WEEKLY, and MONTHLY.") private String intervalType; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="lists snapshot by snapshot name") private String snapshotName; - @Parameter(name="snapshottype", type=CommandType.STRING) + @Parameter(name="snapshottype", type=CommandType.STRING, description="valid values are MANUAL or RECURRING.") private String snapshotType; - @Parameter(name="volumeid", type=CommandType.LONG) + @Parameter(name="volumeid", type=CommandType.LONG, description="the ID of the disk volume") private Long volumeId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListStoragePoolsAndHostsCmd.java b/server/src/com/cloud/api/commands/ListStoragePoolsAndHostsCmd.java deleted file mode 100644 index 998d393fac1..00000000000 --- a/server/src/com/cloud/api/commands/ListStoragePoolsAndHostsCmd.java +++ /dev/null @@ -1,276 +0,0 @@ -/** - * Copyright (C) 2010 Cloud.com, Inc. All rights reserved. - * - * This software is licensed under the GNU General Public License v3 or later. - * - * It is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package com.cloud.api.commands; - -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.apache.log4j.Logger; - -import com.cloud.api.ApiDBUtils; -import com.cloud.api.BaseListCmd; -import com.cloud.api.Implementation; -import com.cloud.api.Parameter; -import com.cloud.api.ResponseObject; -import com.cloud.api.response.ApiResponseSerializer; -import com.cloud.api.response.HostResponse; -import com.cloud.api.response.ListResponse; -import com.cloud.api.response.StoragePoolResponse; -import com.cloud.dc.ClusterVO; -import com.cloud.host.Host; -import com.cloud.host.HostStats; -import com.cloud.host.HostVO; -import com.cloud.host.Status.Event; -import com.cloud.offering.ServiceOffering; -import com.cloud.storage.GuestOSCategoryVO; -import com.cloud.storage.StoragePoolVO; -import com.cloud.storage.StorageStats; -import com.cloud.vm.UserVmVO; - -@Implementation(method="") -public class ListStoragePoolsAndHostsCmd extends BaseListCmd { - public static final Logger s_logger = Logger.getLogger(ListStoragePoolsAndHostsCmd.class.getName()); - - private static final String s_name = "liststoragepoolsandhostsresponse"; - - ///////////////////////////////////////////////////// - //////////////// API parameters ///////////////////// - ///////////////////////////////////////////////////// - - @Parameter(name="ipaddress", type=CommandType.STRING) - private String ipAddress; - - @Parameter(name="name", type=CommandType.STRING) - private String storagePoolName; - - @Parameter(name="path", type=CommandType.STRING) - private String path; - - @Parameter(name="podid", type=CommandType.LONG) - private Long podId; - - @Parameter(name="state", type=CommandType.STRING) - private String state; - - @Parameter(name="type", type=CommandType.STRING) - private String type; - - @Parameter(name="zoneid", type=CommandType.LONG) - private Long zoneId; - - ///////////////////////////////////////////////////// - /////////////////// Accessors /////////////////////// - ///////////////////////////////////////////////////// - - public String getIpAddress() { - return ipAddress; - } - - public String getStoragePoolName() { - return storagePoolName; - } - - public String getPath() { - return path; - } - - public Long getPodId() { - return podId; - } - - public String getState() { - return state; - } - - public String getType() { - return type; - } - - public Long getZoneId() { - return zoneId; - } - - ///////////////////////////////////////////////////// - /////////////// API Implementation/////////////////// - ///////////////////////////////////////////////////// - - @Override - public String getName() { - return s_name; - } - - @Override @SuppressWarnings("unchecked") - public ResponseObject getResponse() { - List poolsAndHosts = (List)getResponseObject(); - - ListResponse response = new ListResponse(); - List responses = new ArrayList(); - for (Object poolOrHost : poolsAndHosts) { - if (poolOrHost instanceof StoragePoolVO) { - StoragePoolVO pool = (StoragePoolVO)poolOrHost; - responses.add(constructStoragePoolResponse(pool)); - } else if (poolOrHost instanceof HostVO) { - HostVO host = (HostVO)poolOrHost; - responses.add(constructHostResponse(host)); - } - } - - response.setResponses(responses); - response.setResponseName(getName()); - return response; - } - - private StoragePoolResponse constructStoragePoolResponse(StoragePoolVO pool) { - StoragePoolResponse poolResponse = new StoragePoolResponse(); - poolResponse.setId(pool.getId()); - poolResponse.setName(pool.getName()); - poolResponse.setPath(pool.getPath()); - poolResponse.setIpAddress(pool.getHostAddress()); - poolResponse.setZoneId(pool.getDataCenterId()); - poolResponse.setZoneName(ApiDBUtils.findZoneById(pool.getDataCenterId()).getName()); - if (pool.getPoolType() != null) { - poolResponse.setType(pool.getPoolType().toString()); - } - if (pool.getPodId() != null) { - poolResponse.setPodId(pool.getPodId()); - poolResponse.setPodName(ApiDBUtils.findPodById(pool.getPodId()).getName()); - } - if (pool.getCreated() != null) { - poolResponse.setCreated(pool.getCreated()); - } - - StorageStats stats = ApiDBUtils.getStoragePoolStatistics(pool.getId()); - long capacity = pool.getCapacityBytes(); - long available = pool.getAvailableBytes() ; - long used = capacity - available; - - if (stats != null) { - used = stats.getByteUsed(); - available = capacity - used; - } - - poolResponse.setDiskSizeTotal(pool.getCapacityBytes()); - poolResponse.setDiskSizeAllocated(used); - - if (pool.getClusterId() != null) { - ClusterVO cluster = ApiDBUtils.findClusterById(pool.getClusterId()); - poolResponse.setClusterId(cluster.getId()); - poolResponse.setClusterName(cluster.getName()); - } - - poolResponse.setTags(ApiDBUtils.getStoragePoolTags(pool.getId())); - poolResponse.setResponseName("storagepools"); - - return poolResponse; - } - - private HostResponse constructHostResponse(HostVO host) { - HostResponse hostResponse = new HostResponse(); - hostResponse.setId(host.getId()); - hostResponse.setCapabilities(host.getCapabilities()); - hostResponse.setClusterId(host.getClusterId()); - hostResponse.setCpuNumber(host.getCpus()); - hostResponse.setZoneId(host.getDataCenterId()); - hostResponse.setDisconnectedOn(host.getDisconnectedOn()); - hostResponse.setHypervisor(host.getHypervisorType()); - hostResponse.setHostType(host.getType()); - hostResponse.setLastPinged(new Date(host.getLastPinged())); - hostResponse.setManagementServerId(host.getManagementServerId()); - hostResponse.setName(host.getName()); - hostResponse.setPodId(host.getPodId()); - hostResponse.setRemoved(host.getRemoved()); - hostResponse.setCpuSpeed(host.getSpeed()); - hostResponse.setState(host.getStatus()); - hostResponse.setIpAddress(host.getPrivateIpAddress()); - hostResponse.setVersion(host.getVersion()); - - // TODO: implement - GuestOSCategoryVO guestOSCategory = ApiDBUtils.getHostGuestOSCategory(host.getId()); - if (guestOSCategory != null) { - hostResponse.setOsCategoryId(guestOSCategory.getId()); - hostResponse.setOsCategoryName(guestOSCategory.getName()); - } - hostResponse.setZoneName(ApiDBUtils.findZoneById(host.getDataCenterId()).getName()); - hostResponse.setPodName(ApiDBUtils.findPodById(host.getPodId()).getName()); - - // calculate cpu allocated by vm - int cpu = 0; - String cpuAlloc = null; - DecimalFormat decimalFormat = new DecimalFormat("#.##"); - List instances = ApiDBUtils.listUserVMsByHostId(host.getId()); - for (UserVmVO vm : instances) { - ServiceOffering so = ApiDBUtils.findServiceOfferingById(vm.getServiceOfferingId()); - cpu += so.getCpu() * so.getSpeed(); - } - cpuAlloc = decimalFormat.format(((float) cpu / (float) (host.getCpus() * host.getSpeed())) * 100f) + "%"; - hostResponse.setCpuAllocated(cpuAlloc); - - // calculate cpu utilized - String cpuUsed = null; - HostStats hostStats = ApiDBUtils.getHostStatistics(host.getId()); - if (hostStats != null) { - float cpuUtil = (float) hostStats.getCpuUtilization(); - cpuUsed = decimalFormat.format(cpuUtil) + "%"; - hostResponse.setCpuUsed(cpuUsed); - hostResponse.setAverageLoad((long)hostStats.getAverageLoad()); - hostResponse.setNetworkKbsRead((long)hostStats.getNetworkReadKBs()); - hostResponse.setNetworkKbsWrite((long)hostStats.getNetworkWriteKBs()); - } - - if (host.getType() == Host.Type.Routing) { - hostResponse.setMemoryTotal(host.getTotalMemory()); - - // calculate memory allocated by systemVM and userVm - long mem = ApiDBUtils.getMemoryUsagebyHost(host.getId()); - hostResponse.setMemoryAllocated(mem); - hostResponse.setMemoryUsed(mem); - } else if (host.getType().toString().equals("Storage")) { - hostResponse.setDiskSizeTotal(host.getTotalSize()); - hostResponse.setDiskSizeAllocated(0L); - } - - if (host.getClusterId() != null) { - ClusterVO cluster = ApiDBUtils.findClusterById(host.getClusterId()); - hostResponse.setClusterName(cluster.getName()); - } - - hostResponse.setLocalStorageActive(ApiDBUtils.isLocalStorageActiveOnHost(host)); - - Set possibleEvents = host.getStatus().getPossibleEvents(); - if ((possibleEvents != null) && !possibleEvents.isEmpty()) { - String events = ""; - Iterator iter = possibleEvents.iterator(); - while (iter.hasNext()) { - Event event = iter.next(); - events += event.toString(); - if (iter.hasNext()) { - events += "; "; - } - } - hostResponse.setEvents(events); - } - - hostResponse.setResponseName("host"); - return hostResponse; - } -} diff --git a/server/src/com/cloud/api/commands/ListStoragePoolsCmd.java b/server/src/com/cloud/api/commands/ListStoragePoolsCmd.java index 9acd9f2a009..7543df73292 100644 --- a/server/src/com/cloud/api/commands/ListStoragePoolsCmd.java +++ b/server/src/com/cloud/api/commands/ListStoragePoolsCmd.java @@ -43,22 +43,22 @@ public class ListStoragePoolsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="clusterid", type=CommandType.LONG) + @Parameter(name="clusterid", type=CommandType.LONG, description="list storage pools belongig to the specific cluster") private Long clusterId; - @Parameter(name="ipaddress", type=CommandType.STRING) + @Parameter(name="ipaddress", type=CommandType.STRING, description="the IP address for the storage pool") private String ipAddress; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the name of the storage pool") private String storagePoolName; - @Parameter(name="path", type=CommandType.STRING) + @Parameter(name="path", type=CommandType.STRING, description="the storage pool path") private String path; - @Parameter(name="podid", type=CommandType.LONG) + @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID for the storage pool") private Long podId; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="the Zone ID for the storage pool") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListSystemVMsCmd.java b/server/src/com/cloud/api/commands/ListSystemVMsCmd.java index 2e17d3d4d87..77cca3802f2 100644 --- a/server/src/com/cloud/api/commands/ListSystemVMsCmd.java +++ b/server/src/com/cloud/api/commands/ListSystemVMsCmd.java @@ -44,25 +44,25 @@ public class ListSystemVMsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="hostid", type=CommandType.LONG) + @Parameter(name="hostid", type=CommandType.LONG, description="the host ID of the system VM") private Long hostId; - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="the ID of the system VM") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the name of the system VM") private String systemVmName; - @Parameter(name="podid", type=CommandType.LONG) + @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID of the system VM") private Long podId; - @Parameter(name="state", type=CommandType.STRING) + @Parameter(name="state", type=CommandType.STRING, description="the state of the system VM") private String state; - @Parameter(name="systemvmtype", type=CommandType.STRING) + @Parameter(name="systemvmtype", type=CommandType.STRING, description="the system VM type. Possible types are \"consoleproxy\" and \"secondarystoragevm\".") private String systemVmType; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="the Zone ID of the system VM") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java b/server/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java index f56015093f1..4d0621b2c82 100644 --- a/server/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java +++ b/server/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java @@ -39,13 +39,13 @@ public class ListTemplateOrIsoPermissionsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="List template visibility and permissions for the specified account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="List template visibility and permissions by domain. If used with the account parameter, specifies in which domain the specified account exists.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the template ID") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListTemplatesCmd.java b/server/src/com/cloud/api/commands/ListTemplatesCmd.java index 8c56a45eb24..f123810c434 100644 --- a/server/src/com/cloud/api/commands/ListTemplatesCmd.java +++ b/server/src/com/cloud/api/commands/ListTemplatesCmd.java @@ -51,22 +51,26 @@ public class ListTemplatesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="list template by account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="list all templates in specified domain. If used with the account parameter, lists all templates for an account in the specified domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="the template ID") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the template name") private String templateName; - @Parameter(name="templatefilter", type=CommandType.STRING, required=true) + @Parameter(name="templatefilter", type=CommandType.STRING, required=true, description="possible values are \"featured\", \"self\", \"self-executable\", \"executable\", and \"community\"." + + "* featured—templates that are featured and are public" + + "* self—templates that have been registered/created by the owner" + + "* selfexecutable— templates that have been registered/created by the owner that can be used to deploy a new VM" + + "* executable— all templates that can be used to deploy a new VM* community—templates that are public.") private String templateFilter; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="list templates by zoneId") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListVMGroupsCmd.java b/server/src/com/cloud/api/commands/ListVMGroupsCmd.java index f7e30926e25..90d59f90953 100644 --- a/server/src/com/cloud/api/commands/ListVMGroupsCmd.java +++ b/server/src/com/cloud/api/commands/ListVMGroupsCmd.java @@ -41,16 +41,16 @@ public class ListVMGroupsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="list instance groups by ID") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="list instance groups by name") private String groupName; - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="list instance group belonging to the specified account. Must be used with domainid parameter") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID. If used with the account parameter, lists virtual machines for the specified account in this domain.") private Long domainId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListVMsCmd.java b/server/src/com/cloud/api/commands/ListVMsCmd.java index 6831901dca0..948457f76c3 100644 --- a/server/src/com/cloud/api/commands/ListVMsCmd.java +++ b/server/src/com/cloud/api/commands/ListVMsCmd.java @@ -48,28 +48,28 @@ public class ListVMsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID. If used with the account parameter, lists virtual machines for the specified account in this domain.") private Long domainId; - @Parameter(name="hostid", type=CommandType.LONG) + @Parameter(name="hostid", type=CommandType.LONG, description="the host ID") private Long hostId; - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="the ID of the virtual machine") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="name of the virtual machine") private String instanceName; - @Parameter(name="podid", type=CommandType.LONG) + @Parameter(name="podid", type=CommandType.LONG, description="the pod ID") private Long podId; - @Parameter(name="state", type=CommandType.STRING) + @Parameter(name="state", type=CommandType.STRING, description="state of the virtual machine") private String state; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="the availability zone ID") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListVlanIpRangesCmd.java b/server/src/com/cloud/api/commands/ListVlanIpRangesCmd.java index f0971c74718..e0f51389c5e 100644 --- a/server/src/com/cloud/api/commands/ListVlanIpRangesCmd.java +++ b/server/src/com/cloud/api/commands/ListVlanIpRangesCmd.java @@ -43,22 +43,22 @@ public class ListVlanIpRangesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="the account with which the VLAN IP range is associated. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID with which the VLAN IP range is associated. If used with the account parameter, returns all VLAN IP ranges for that account in the specified domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the VLAN IP range") private Long id; - @Parameter(name="podid", type=CommandType.LONG) + @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID of the VLAN IP range") private Long podId; - @Parameter(name="vlan", type=CommandType.STRING) + @Parameter(name="vlan", type=CommandType.STRING, description="the ID or VID of the VLAN. Default is an \"untagged\" VLAN.") private String vlan; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="the Zone ID of the VLAN IP range") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListVolumesCmd.java b/server/src/com/cloud/api/commands/ListVolumesCmd.java index 289fb3372c1..ced9e076364 100755 --- a/server/src/com/cloud/api/commands/ListVolumesCmd.java +++ b/server/src/com/cloud/api/commands/ListVolumesCmd.java @@ -47,31 +47,31 @@ public class ListVolumesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="the account associated with the disk volume. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="Lists all disk volumes for the specified domain ID. If used with the account parameter, returns all disk volumes for an account in the specified domain ID.") private Long domainId; - @Parameter(name="hostid", type=CommandType.LONG) + @Parameter(name="hostid", type=CommandType.LONG, description="list volumes on specified host") private Long hostId; - @Parameter(name="id", type=CommandType.LONG) + @Parameter(name="id", type=CommandType.LONG, description="the ID of the disk volume") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the name of the disk volume") private String volumeName; @Parameter(name="podid", type=CommandType.LONG) private Long podId; - @Parameter(name="type", type=CommandType.STRING) + @Parameter(name="type", type=CommandType.STRING, description="the type of disk volume") private String type; - @Parameter(name="virtualmachineid", type=CommandType.LONG) + @Parameter(name="virtualmachineid", type=CommandType.LONG, description="the ID of the virtual machine") private Long virtualMachineId; - @Parameter(name="zoneid", type=CommandType.LONG) + @Parameter(name="zoneid", type=CommandType.LONG, description="the ID of the availability zone") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListZonesByCmd.java b/server/src/com/cloud/api/commands/ListZonesByCmd.java index f59c4bc0b36..fdbbb8cc7a1 100644 --- a/server/src/com/cloud/api/commands/ListZonesByCmd.java +++ b/server/src/com/cloud/api/commands/ListZonesByCmd.java @@ -41,7 +41,7 @@ public class ListZonesByCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="available", type=CommandType.BOOLEAN) + @Parameter(name="available", type=CommandType.BOOLEAN, description="true if you want to retrieve all available Zones. False if you only want to return the Zones from which you have at least one VM. Default is false.") private Boolean available; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java b/server/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java index c05be6a3974..316a3ac9dd2 100644 --- a/server/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java +++ b/server/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java @@ -38,7 +38,7 @@ public class PrepareForMaintenanceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the host ID") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/PreparePrimaryStorageForMaintenanceCmd.java b/server/src/com/cloud/api/commands/PreparePrimaryStorageForMaintenanceCmd.java index 907a2142b05..44d5d33bc22 100644 --- a/server/src/com/cloud/api/commands/PreparePrimaryStorageForMaintenanceCmd.java +++ b/server/src/com/cloud/api/commands/PreparePrimaryStorageForMaintenanceCmd.java @@ -37,7 +37,7 @@ public class PreparePrimaryStorageForMaintenanceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="Primary storage ID") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/QueryAsyncJobResultCmd.java b/server/src/com/cloud/api/commands/QueryAsyncJobResultCmd.java index 0091896273e..fb8a3d5026e 100644 --- a/server/src/com/cloud/api/commands/QueryAsyncJobResultCmd.java +++ b/server/src/com/cloud/api/commands/QueryAsyncJobResultCmd.java @@ -40,7 +40,7 @@ public class QueryAsyncJobResultCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="jobid", type=CommandType.LONG, required=true) + @Parameter(name="jobid", type=CommandType.LONG, required=true, description="the ID of the asychronous job") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RebootRouterCmd.java b/server/src/com/cloud/api/commands/RebootRouterCmd.java index 90df17b5a4d..b1a68483a90 100644 --- a/server/src/com/cloud/api/commands/RebootRouterCmd.java +++ b/server/src/com/cloud/api/commands/RebootRouterCmd.java @@ -41,7 +41,7 @@ public class RebootRouterCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the router") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RebootSystemVmCmd.java b/server/src/com/cloud/api/commands/RebootSystemVmCmd.java index 265b23c8da6..622727272a4 100644 --- a/server/src/com/cloud/api/commands/RebootSystemVmCmd.java +++ b/server/src/com/cloud/api/commands/RebootSystemVmCmd.java @@ -39,7 +39,7 @@ public class RebootSystemVmCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the system virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RebootVMCmd.java b/server/src/com/cloud/api/commands/RebootVMCmd.java index 9633c5eaf95..0d6bfc283a2 100644 --- a/server/src/com/cloud/api/commands/RebootVMCmd.java +++ b/server/src/com/cloud/api/commands/RebootVMCmd.java @@ -38,7 +38,7 @@ public class RebootVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ReconnectHostCmd.java b/server/src/com/cloud/api/commands/ReconnectHostCmd.java index 690e1ac7b3d..81d80da1abb 100644 --- a/server/src/com/cloud/api/commands/ReconnectHostCmd.java +++ b/server/src/com/cloud/api/commands/ReconnectHostCmd.java @@ -54,7 +54,7 @@ public class ReconnectHostCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the host ID") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RecoverVMCmd.java b/server/src/com/cloud/api/commands/RecoverVMCmd.java index 80e02066094..52e74a4cede 100644 --- a/server/src/com/cloud/api/commands/RecoverVMCmd.java +++ b/server/src/com/cloud/api/commands/RecoverVMCmd.java @@ -36,7 +36,7 @@ public class RecoverVMCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RegisterIsoCmd.java b/server/src/com/cloud/api/commands/RegisterIsoCmd.java index e3a78973d36..6ef12f63c77 100644 --- a/server/src/com/cloud/api/commands/RegisterIsoCmd.java +++ b/server/src/com/cloud/api/commands/RegisterIsoCmd.java @@ -45,28 +45,28 @@ public class RegisterIsoCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="bootable", type=CommandType.BOOLEAN) + @Parameter(name="bootable", type=CommandType.BOOLEAN, description="true if this ISO is bootable") private Boolean bootable; - @Parameter(name="displaytext", type=CommandType.STRING, required=true) + @Parameter(name="displaytext", type=CommandType.STRING, required=true, description="the display text of the ISO. This is usually used for display purposes.") private String displayText; - @Parameter(name="isfeatured", type=CommandType.BOOLEAN) + @Parameter(name="isfeatured", type=CommandType.BOOLEAN, description="true if you want this ISO to be featured") private Boolean featured; - @Parameter(name="ispublic", type=CommandType.BOOLEAN) + @Parameter(name="ispublic", type=CommandType.BOOLEAN, description="true if you want to register the ISO to be publicly available to all users, false otherwise.") private Boolean publicIso; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the ISO") private String isoName; - @Parameter(name="ostypeid", type=CommandType.LONG, required=true) + @Parameter(name="ostypeid", type=CommandType.LONG, required=true, description="the ID of the OS Type that best represents the OS of this ISO") private Long osTypeId; - @Parameter(name="url", type=CommandType.STRING, required=true) + @Parameter(name="url", type=CommandType.STRING, required=true, description="the URL to where the ISO is currently being hosted") private String url; - @Parameter(name="zoneid", type=CommandType.LONG, required=true) + @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the ID of the zone you wish to register the ISO to.") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RegisterPreallocatedLunCmd.java b/server/src/com/cloud/api/commands/RegisterPreallocatedLunCmd.java index 48e833c787f..c07e20bb746 100644 --- a/server/src/com/cloud/api/commands/RegisterPreallocatedLunCmd.java +++ b/server/src/com/cloud/api/commands/RegisterPreallocatedLunCmd.java @@ -31,22 +31,26 @@ public class RegisterPreallocatedLunCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// + //FIXME - add description @Parameter(name="disksize", type=CommandType.LONG, required=true) private Long diskSize; + //FIXME - add description @Parameter(name="lun", type=CommandType.INTEGER, required=true) private Integer lun; + //FIXME - add description @Parameter(name="portal", type=CommandType.STRING, required=true) private String portal; + //FIXME - add description @Parameter(name="tags", type=CommandType.STRING) private String tags; - @Parameter(name="targetiqn", type=CommandType.STRING, required=true) + @Parameter(name="targetiqn", type=CommandType.STRING, required=true, description="the target IQN on the storage host where LUN is created") private String targetIqn; - @Parameter(name="zoneid", type=CommandType.LONG, required=true) + @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="zone ID where LUN is going to be created") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RegisterTemplateCmd.java b/server/src/com/cloud/api/commands/RegisterTemplateCmd.java index 61487fdd593..98faa8e6c6d 100644 --- a/server/src/com/cloud/api/commands/RegisterTemplateCmd.java +++ b/server/src/com/cloud/api/commands/RegisterTemplateCmd.java @@ -46,37 +46,37 @@ public class RegisterTemplateCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="bits", type=CommandType.INTEGER) + @Parameter(name="bits", type=CommandType.INTEGER, description="32 or 64 bits support. 64 by default") private Integer bits; - @Parameter(name="displaytext", type=CommandType.STRING, required=true) + @Parameter(name="displaytext", type=CommandType.STRING, required=true, description="the display text of the template. This is usually used for display purposes.") private String displayText; - @Parameter(name="format", type=CommandType.STRING, required=true) + @Parameter(name="format", type=CommandType.STRING, required=true, description="the format for the template. Possible values include QCOW2, RAW, and VHD.") private String format; - @Parameter(name="isfeatured", type=CommandType.BOOLEAN) + @Parameter(name="isfeatured", type=CommandType.BOOLEAN, description="true if this template is a featured template, false otherwise") private Boolean featured; - @Parameter(name="ispublic", type=CommandType.BOOLEAN) + @Parameter(name="ispublic", type=CommandType.BOOLEAN, description="true if the template is available to all accounts; default is true") private Boolean publicTemplate; - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the template") private String templateName; - @Parameter(name="ostypeid", type=CommandType.LONG, required=true) + @Parameter(name="ostypeid", type=CommandType.LONG, required=true, description="the ID of the OS Type that best represents the OS of this template.") private Long osTypeId; - @Parameter(name="passwordenabled", type=CommandType.BOOLEAN) + @Parameter(name="passwordenabled", type=CommandType.BOOLEAN, description="true if the template supports the password reset feature; default is false") private Boolean passwordEnabled; - @Parameter(name="requireshvm", type=CommandType.BOOLEAN) + @Parameter(name="requireshvm", type=CommandType.BOOLEAN, description="true if this template requires HVM") private Boolean requiresHvm; - @Parameter(name="url", type=CommandType.STRING, required=true) + @Parameter(name="url", type=CommandType.STRING, required=true, description="the URL of where the template is hosted. Possible URL include http:// and https://") private String url; - @Parameter(name="zoneid", type=CommandType.LONG, required=true) + @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the ID of the zone the template is to be hosted on") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RemoveFromLoadBalancerRuleCmd.java b/server/src/com/cloud/api/commands/RemoveFromLoadBalancerRuleCmd.java index 848174416f7..81357209ab6 100644 --- a/server/src/com/cloud/api/commands/RemoveFromLoadBalancerRuleCmd.java +++ b/server/src/com/cloud/api/commands/RemoveFromLoadBalancerRuleCmd.java @@ -43,13 +43,13 @@ public class RemoveFromLoadBalancerRuleCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the load balancer rule") private Long id; - @Parameter(name="virtualmachineid", type=CommandType.LONG) + @Parameter(name="virtualmachineid", type=CommandType.LONG, description="the ID of the virtual machine that is being removed from the load balancer rule") private Long virtualMachineId; - @Parameter(name="virtualmachineids", type=CommandType.LIST, collectionType=CommandType.LONG) + @Parameter(name="virtualmachineids", type=CommandType.LIST, collectionType=CommandType.LONG, description="the list of IDs of the virtual machines that are being removed from the load balancer rule (i.e. virtualMachineIds=1,2,3)") private List virtualMachineIds; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RemovePortForwardingServiceCmd.java b/server/src/com/cloud/api/commands/RemovePortForwardingServiceCmd.java index 5fb91c44959..5c4105b26e6 100644 --- a/server/src/com/cloud/api/commands/RemovePortForwardingServiceCmd.java +++ b/server/src/com/cloud/api/commands/RemovePortForwardingServiceCmd.java @@ -39,13 +39,13 @@ public class RemovePortForwardingServiceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the port forwarding service to remove from the virtual machine/publicIp") private Long id; - @Parameter(name="publicip", type=CommandType.STRING, required=true) + @Parameter(name="publicip", type=CommandType.STRING, required=true, description="the public IP address associated with the port forwarding service") private String publicIp; - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true) + @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true, description="the virtual machine currently assigned to the port forwarding service") private Long virtualMachineId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ResetVMPasswordCmd.java b/server/src/com/cloud/api/commands/ResetVMPasswordCmd.java index 3886df07699..b81f0dbd989 100644 --- a/server/src/com/cloud/api/commands/ResetVMPasswordCmd.java +++ b/server/src/com/cloud/api/commands/ResetVMPasswordCmd.java @@ -47,7 +47,7 @@ public class ResetVMPasswordCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; // unexposed parameter needed for serializing/deserializing the command diff --git a/server/src/com/cloud/api/commands/RevokeNetworkGroupIngressCmd.java b/server/src/com/cloud/api/commands/RevokeNetworkGroupIngressCmd.java index 8dc7db51b91..ba5484e97d3 100644 --- a/server/src/com/cloud/api/commands/RevokeNetworkGroupIngressCmd.java +++ b/server/src/com/cloud/api/commands/RevokeNetworkGroupIngressCmd.java @@ -28,33 +28,43 @@ public class RevokeNetworkGroupIngressCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// + //FIXME - add description @Parameter(name="account", type=CommandType.STRING) private String accountName; + //FIXME - add description @Parameter(name="cidrlist", type=CommandType.STRING) private String cidrList; + //FIXME - add description @Parameter(name="domainid", type=CommandType.LONG) private Long domainId; + //FIXME - add description @Parameter(name="endport", type=CommandType.INTEGER) private Integer endPort; + //FIXME - add description @Parameter(name="icmpcode", type=CommandType.INTEGER) private Integer icmpCode; + //FIXME - add description @Parameter(name="icmptype", type=CommandType.INTEGER) private Integer icmpType; + //FIXME - add description @Parameter(name="networkgroupname", type=CommandType.STRING, required=true) private String networkGroupName; + //FIXME - add description @Parameter(name="protocol", type=CommandType.STRING) private String protocol; + //FIXME - add description @Parameter(name="startport", type=CommandType.INTEGER) private Integer startPort; + //FIXME - add description @Parameter(name="usernetworkgrouplist", type=CommandType.MAP) private Map userNetworkGroupList; diff --git a/server/src/com/cloud/api/commands/StartRouterCmd.java b/server/src/com/cloud/api/commands/StartRouterCmd.java index 6c2bf2aa3ab..e1dabd621df 100644 --- a/server/src/com/cloud/api/commands/StartRouterCmd.java +++ b/server/src/com/cloud/api/commands/StartRouterCmd.java @@ -42,7 +42,7 @@ public class StartRouterCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the router") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/StartSystemVMCmd.java b/server/src/com/cloud/api/commands/StartSystemVMCmd.java index 7eaeacbdff1..c076a23aa7f 100644 --- a/server/src/com/cloud/api/commands/StartSystemVMCmd.java +++ b/server/src/com/cloud/api/commands/StartSystemVMCmd.java @@ -43,7 +43,7 @@ public class StartSystemVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the system virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/StartVMCmd.java b/server/src/com/cloud/api/commands/StartVMCmd.java index fa98d9f6b8f..12f5f864bc1 100644 --- a/server/src/com/cloud/api/commands/StartVMCmd.java +++ b/server/src/com/cloud/api/commands/StartVMCmd.java @@ -44,7 +44,7 @@ public class StartVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true) + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/StopRouterCmd.java b/server/src/com/cloud/api/commands/StopRouterCmd.java index 16d859a4a4a..aa24ad9238e 100644 --- a/server/src/com/cloud/api/commands/StopRouterCmd.java +++ b/server/src/com/cloud/api/commands/StopRouterCmd.java @@ -41,7 +41,7 @@ public class StopRouterCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the router") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/StopSystemVmCmd.java b/server/src/com/cloud/api/commands/StopSystemVmCmd.java index fd34f24601f..f5aac72c130 100644 --- a/server/src/com/cloud/api/commands/StopSystemVmCmd.java +++ b/server/src/com/cloud/api/commands/StopSystemVmCmd.java @@ -43,7 +43,7 @@ public class StopSystemVmCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the system virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/StopVMCmd.java b/server/src/com/cloud/api/commands/StopVMCmd.java index 644b0fdefa9..b2d9617899f 100644 --- a/server/src/com/cloud/api/commands/StopVMCmd.java +++ b/server/src/com/cloud/api/commands/StopVMCmd.java @@ -39,7 +39,7 @@ public class StopVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateCfgCmd.java b/server/src/com/cloud/api/commands/UpdateCfgCmd.java index f244c457119..4ea9fa85c8f 100644 --- a/server/src/com/cloud/api/commands/UpdateCfgCmd.java +++ b/server/src/com/cloud/api/commands/UpdateCfgCmd.java @@ -36,10 +36,10 @@ public class UpdateCfgCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="name", type=CommandType.STRING, required=true) + @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the configuration") private String cfgName; - @Parameter(name="value", type=CommandType.STRING) + @Parameter(name="value", type=CommandType.STRING, description="the value of the configuration") private String value; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java b/server/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java index 306395e04cb..07145bedbc8 100644 --- a/server/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java +++ b/server/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java @@ -38,16 +38,16 @@ public class UpdateDiskOfferingCmd extends BaseCmd{ ///////////////////////////////////////////////////// - @Parameter(name="displaytext", type=CommandType.STRING) + @Parameter(name="displaytext", type=CommandType.STRING, description="updates alternate display text of the disk offering with this value") private String displayText; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="ID of the disk offering") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="updates name of the disk offering with this value") private String diskOfferingName; - @Parameter(name="tags", type=CommandType.STRING) + @Parameter(name="tags", type=CommandType.STRING, description="update tags of the disk offering with this value") private String tags; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateHostCmd.java b/server/src/com/cloud/api/commands/UpdateHostCmd.java index 31aea6efd94..a0ca873a87c 100644 --- a/server/src/com/cloud/api/commands/UpdateHostCmd.java +++ b/server/src/com/cloud/api/commands/UpdateHostCmd.java @@ -51,7 +51,7 @@ public class UpdateHostCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the host to update") private Long id; @Parameter(name="oscategoryid", type=CommandType.LONG) diff --git a/server/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java b/server/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java index 3b4e7a6f19d..bae5b7f1fae 100644 --- a/server/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java +++ b/server/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java @@ -38,19 +38,19 @@ public class UpdateLoadBalancerRuleCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="algorithm", type=CommandType.STRING) + @Parameter(name="algorithm", type=CommandType.STRING, description="load balancer algorithm (source, roundrobin, leastconn)") private String algorithm; - @Parameter(name="description", type=CommandType.STRING) + @Parameter(name="description", type=CommandType.STRING, description="the description of the load balancer rule") private String description; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the id of the load balancer rule to update") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the name of the load balancer rule") private String loadBalancerName; - @Parameter(name="privateport", type=CommandType.STRING) + @Parameter(name="privateport", type=CommandType.STRING, description="the private port of the private ip address/virtual machine where the network traffic will be load balanced to") private String privatePort; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdatePodCmd.java b/server/src/com/cloud/api/commands/UpdatePodCmd.java index fc46b07e675..72a4f2c8791 100644 --- a/server/src/com/cloud/api/commands/UpdatePodCmd.java +++ b/server/src/com/cloud/api/commands/UpdatePodCmd.java @@ -36,22 +36,22 @@ public class UpdatePodCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="cidr", type=CommandType.STRING) + @Parameter(name="cidr", type=CommandType.STRING, description="the CIDR notation for the base IP address of the Pod") private String cidr; - @Parameter(name="endip", type=CommandType.STRING) + @Parameter(name="endip", type=CommandType.STRING, description="the ending IP address for the Pod") private String endIp; - @Parameter(name="gateway", type=CommandType.STRING) + @Parameter(name="gateway", type=CommandType.STRING, description="the gateway for the Pod") private String gateway; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the Pod") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the name of the Pod") private String podName; - @Parameter(name="startip", type=CommandType.STRING) + @Parameter(name="startip", type=CommandType.STRING, description="the starting IP address for the Pod") private String startIp; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateResourceLimitCmd.java b/server/src/com/cloud/api/commands/UpdateResourceLimitCmd.java index b2b99271d63..28ed292bf76 100644 --- a/server/src/com/cloud/api/commands/UpdateResourceLimitCmd.java +++ b/server/src/com/cloud/api/commands/UpdateResourceLimitCmd.java @@ -40,16 +40,20 @@ public class UpdateResourceLimitCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name="account", type=CommandType.STRING, description="Update resource for a specified account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name="domainid", type=CommandType.LONG, description="Update resource limits for all accounts in specified domain. If used with the account parameter, updates resource limits for a specified account in specified domain.") private Long domainId; - @Parameter(name="max", type=CommandType.LONG) + @Parameter(name="max", type=CommandType.LONG, description=" Maximum resource limit.") private Long max; - @Parameter(name="resourcetype", type=CommandType.INTEGER, required=true) + @Parameter(name="resourcetype", type=CommandType.INTEGER, required=true, description="Type of resource to update. Values are 0, 1, 2, 3, and 4. 0 — Instance. Number of instances a user can create. " + + "1 — IP. Number of public IP addresses a user can own. " + + "2 — Volume. Number of disk volumes a user can create." + + "3 — Snapshot. Number of snapshots a user can create." + + "4 — Template. Number of templates that a user can register/create.") private Integer resourceType; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java b/server/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java index 8fd03d926b0..83d2454781a 100644 --- a/server/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java +++ b/server/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java @@ -36,22 +36,22 @@ public class UpdateServiceOfferingCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="displaytext", type=CommandType.STRING) + @Parameter(name="displaytext", type=CommandType.STRING, description="the display text of the service offering to be updated") private String displayText; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the service offering to be updated") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the name of the service offering to be updated") private String serviceOfferingName; - - @Parameter(name="offerha", type=CommandType.BOOLEAN) + + @Parameter(name="offerha", type=CommandType.BOOLEAN, description="the HA of the service offering to be updated") private Boolean offerHa; - - @Parameter(name="tags", type=CommandType.STRING) + + @Parameter(name="tags", type=CommandType.STRING, description="the tags for this service offering.") private String tags; - @Parameter(name="usevirtualnetwork", type=CommandType.BOOLEAN) + @Parameter(name="usevirtualnetwork", type=CommandType.BOOLEAN, description="if true, the VM created from the offering will use default virtual networking. If false, the VM created will use a direct attached networking model. The default value is true.") private Boolean useVirtualNetwork; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateStoragePoolCmd.java b/server/src/com/cloud/api/commands/UpdateStoragePoolCmd.java index 90f6ec0f3d0..8e9e898c95b 100644 --- a/server/src/com/cloud/api/commands/UpdateStoragePoolCmd.java +++ b/server/src/com/cloud/api/commands/UpdateStoragePoolCmd.java @@ -40,10 +40,10 @@ public class UpdateStoragePoolCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the Id of the storage pool") private Long id; - @Parameter(name="tags", type=CommandType.STRING) + @Parameter(name="tags", type=CommandType.STRING, description="the tags for the storage pool") private String tags; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java b/server/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java index d5321d06e72..322c412a900 100644 --- a/server/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java +++ b/server/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java @@ -33,25 +33,25 @@ public abstract class UpdateTemplateOrIsoCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="bootable", type=CommandType.BOOLEAN) + @Parameter(name="bootable", type=CommandType.BOOLEAN, description="true if image is bootable, false otherwise") private Boolean bootable; - @Parameter(name="displaytext", type=CommandType.STRING) + @Parameter(name="displaytext", type=CommandType.STRING, description="the display text of the image") private String displayText; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the image file") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the name of the image file") private String isoName; - @Parameter(name="ostypeid", type=CommandType.LONG) + @Parameter(name="ostypeid", type=CommandType.LONG, description="the ID of the OS type that best represents the OS of this image.") private Long osTypeId; - @Parameter(name="format", type=CommandType.STRING) + @Parameter(name="format", type=CommandType.STRING, description="the format for the image") private String format; - @Parameter(name="passwordenabled", type=CommandType.BOOLEAN) + @Parameter(name="passwordenabled", type=CommandType.BOOLEAN, description="true if the image supports the password reset feature; default is false") private Boolean passwordEnabled; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java b/server/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java index 58de94a25a8..9a35a674de0 100644 --- a/server/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java +++ b/server/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java @@ -21,19 +21,19 @@ public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="accounts", type=CommandType.LIST, collectionType=CommandType.STRING) + @Parameter(name="accounts", type=CommandType.LIST, collectionType=CommandType.STRING, description="a comma delimited list of accounts") private List accountNames; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the template ID") private Long id; - @Parameter(name="isfeatured", type=CommandType.BOOLEAN) + @Parameter(name="isfeatured", type=CommandType.BOOLEAN, description="true for featured templates/isos, false otherwise") private Boolean featured; - @Parameter(name="ispublic", type=CommandType.BOOLEAN) + @Parameter(name="ispublic", type=CommandType.BOOLEAN, description="true for public templates/isos, false for private templates/isos") private Boolean isPublic; - @Parameter(name="op", type=CommandType.STRING) + @Parameter(name="op", type=CommandType.STRING, description="permission operator (add, remove, reset)") private String operation; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateVMCmd.java b/server/src/com/cloud/api/commands/UpdateVMCmd.java index 527dbda5cb2..d33ce0ce929 100644 --- a/server/src/com/cloud/api/commands/UpdateVMCmd.java +++ b/server/src/com/cloud/api/commands/UpdateVMCmd.java @@ -34,16 +34,16 @@ public class UpdateVMCmd extends BaseCmd{ //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="displayname", type=CommandType.STRING) + @Parameter(name="displayname", type=CommandType.STRING, description="user generated name") private String displayName; - @Parameter(name="group", type=CommandType.STRING) + @Parameter(name="group", type=CommandType.STRING, description="group of the virtual machine") private String group; - @Parameter(name="haenable", type=CommandType.BOOLEAN) + @Parameter(name="haenable", type=CommandType.BOOLEAN, description="true if high-availability is enabled for the virtual machine, false otherwise") private Boolean haEnable; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateVMGroupCmd.java b/server/src/com/cloud/api/commands/UpdateVMGroupCmd.java index e27c54df9d1..01e8092221d 100644 --- a/server/src/com/cloud/api/commands/UpdateVMGroupCmd.java +++ b/server/src/com/cloud/api/commands/UpdateVMGroupCmd.java @@ -23,7 +23,6 @@ import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; -import com.cloud.api.ResponseObject; import com.cloud.api.response.InstanceGroupResponse; import com.cloud.user.Account; import com.cloud.vm.InstanceGroupVO; @@ -38,10 +37,10 @@ public class UpdateVMGroupCmd extends BaseCmd{ //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="Instance group ID") private Long id; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="new instance group name") private String groupName; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateZoneCmd.java b/server/src/com/cloud/api/commands/UpdateZoneCmd.java index ec3cdec46d9..c9e79e2c4b1 100644 --- a/server/src/com/cloud/api/commands/UpdateZoneCmd.java +++ b/server/src/com/cloud/api/commands/UpdateZoneCmd.java @@ -38,28 +38,28 @@ public class UpdateZoneCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="dns1", type=CommandType.STRING) + @Parameter(name="dns1", type=CommandType.STRING, description="the first DNS for the Zone") private String dns1; - @Parameter(name="dns2", type=CommandType.STRING) + @Parameter(name="dns2", type=CommandType.STRING, description="the second DNS for the Zone") private String dns2; - @Parameter(name="guestcidraddress", type=CommandType.STRING) + @Parameter(name="guestcidraddress", type=CommandType.STRING, description="the guest CIDR address for the Zone") private String guestCidrAddress; - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the Zone") private Long id; - @Parameter(name="internaldns1", type=CommandType.STRING) + @Parameter(name="internaldns1", type=CommandType.STRING, description="the first internal DNS for the Zone") private String internalDns1; - @Parameter(name="internaldns2", type=CommandType.STRING) + @Parameter(name="internaldns2", type=CommandType.STRING, description="the second internal DNS for the Zone") private String internalDns2; - @Parameter(name="name", type=CommandType.STRING) + @Parameter(name="name", type=CommandType.STRING, description="the name of the Zone") private String zoneName; - @Parameter(name="vnet", type=CommandType.STRING) + @Parameter(name="vnet", type=CommandType.STRING, description="the VNET for the Zone") private String vnet; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpgradeVMCmd.java b/server/src/com/cloud/api/commands/UpgradeVMCmd.java index 04658819ad4..ee11b9b4792 100644 --- a/server/src/com/cloud/api/commands/UpgradeVMCmd.java +++ b/server/src/com/cloud/api/commands/UpgradeVMCmd.java @@ -44,10 +44,10 @@ public class UpgradeVMCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; - @Parameter(name="serviceofferingid", type=CommandType.LONG, required=true) + @Parameter(name="serviceofferingid", type=CommandType.LONG, required=true, description="the service offering ID to apply to the virtual machine") private Long serviceOfferingId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/doc/ApiXmlDocReader.java b/server/src/com/cloud/api/doc/ApiXmlDocReader.java index 850ae79271b..b4f3f1f4680 100644 --- a/server/src/com/cloud/api/doc/ApiXmlDocReader.java +++ b/server/src/com/cloud/api/doc/ApiXmlDocReader.java @@ -18,8 +18,11 @@ package com.cloud.api.doc; +import java.io.BufferedWriter; import java.io.EOFException; import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; import java.io.ObjectInputStream; import java.util.ArrayList; import java.util.Arrays; @@ -32,13 +35,16 @@ import com.thoughtworks.xstream.io.xml.DomDriver; public class ApiXmlDocReader { public static void main (String[] args) { - String newFile = ""; - String oldFile = ""; - + String newFile = null; + String oldFile = null; + String dirName = ""; HashMap commands = new HashMap(); HashMap oldCommands = new HashMap(); - ArrayList newCommands = new ArrayList(); + ArrayList addedCommands = new ArrayList(); + ArrayList removedCommands = new ArrayList(); + HashMap stableCommands = new HashMap(); + XStream xs = new XStream(new DomDriver()); xs.alias("command", Command.class); xs.alias("arg", Argument.class); @@ -55,9 +61,12 @@ public class ApiXmlDocReader { if (arg.equals("-old")) { oldFile = iter.next(); } + if (arg.equals("-d")) { + dirName = iter.next(); + } } + try { - try{ ObjectInputStream inOld = xs.createObjectInputStream(new FileReader(oldFile)); while (true){ @@ -81,24 +90,160 @@ public class ApiXmlDocReader { ex.printStackTrace(); } - - Iterator i = commands.keySet().iterator(); - while (i.hasNext()) { - String key = (String)i.next(); - //Check if command existed in old version + //Check if any commands got added in new version + for (String key : commands.keySet()) { if (!oldCommands.containsKey(key)) { - newCommands.add(commands.get(key)); + addedCommands.add(commands.get(key)); + } else { + stableCommands.put(commands.get(key).getName(), commands.get(key)); } + } + + //Check if any commands were removed in new version + for (String key : oldCommands.keySet()) { + if (!commands.containsKey(key)) { + removedCommands.add(oldCommands.get(key)); + if (stableCommands.get(key) != null) { + stableCommands.remove(key); + } + } + } + + + try { + FileWriter fstream = new FileWriter(dirName + "/diff.txt"); + BufferedWriter out = new BufferedWriter(fstream); + + //Print added commands + out.write("Added commands:\n"); + for (Command c : addedCommands) { + out.write("\n " + c.getName() + " (" + c.getDescription() + "\n"); + } + + //Print removed commands + out.write("\nRemoved commands:\n"); + for (Command c : removedCommands) { + out.write("\n " + c.getName() + " (" + c.getDescription() + ")\n"); + } + + //Print differences between commands arguments + out.write("\nChanges in commands arguments:\n"); + for (String key : stableCommands.keySet()){ + ArrayList newReqArgs = new ArrayList(); + ArrayList removedReqArgs = new ArrayList(); + HashMap stableReqArgs = new HashMap(); + ArrayList newRespArgs = new ArrayList(); + ArrayList removedRespArgs = new ArrayList(); + HashMap stableRespArgs = new HashMap(); - //Verify request and response arguments - else { - commands.get(key).compareArguments(oldCommands.get(key)); + Command newCommand = commands.get(key); + Command oldCommand = oldCommands.get(key); + + //Check if any request arguments were added in new version + for (Argument arg : newCommand.getRequest()) { + if (oldCommand.getReqArgByName(arg.getName()) == null) { + newReqArgs.add(arg); + } else { + stableReqArgs.put(arg.getName(), arg); + } + } + + //Check if any request arguments were removed in new version + for (Argument arg : oldCommand.getRequest()) { + if (newCommand.getReqArgByName(arg.getName()) == null) { + removedReqArgs.add(arg); + if (stableReqArgs.get(arg.getName()) != null) { + stableReqArgs.remove(arg.getName()); + } + } + } + + //Compare stable request arguments of old and new version + for (Iterator i = stableReqArgs.keySet().iterator(); i.hasNext();) { + String argName = i.next(); + if (oldCommand.getReqArgByName(argName).isRequired() == newCommand.getReqArgByName(argName).isRequired()) { + i.remove(); + } + } + + //Check if any response arguments were added in new version + for (Argument arg : newCommand.getResponse()) { + if (oldCommand.getResArgByName(arg.getName()) == null) { + newRespArgs.add(arg); + } + } + + //Check if any response arguments were removed in new version + for (Argument arg : oldCommand.getResponse()) { + if (newCommand.getResArgByName(arg.getName()) == null) { + removedRespArgs.add(arg); + } + } + + if (newReqArgs.size() != 0 || newRespArgs.size() != 0 || removedReqArgs.size() != 0 || removedRespArgs.size() != 0 || stableReqArgs.size() != 0 || stableReqArgs.size() != 0) { + out.write("\n\t" + key); + //Request + if (newReqArgs.size() != 0 || removedReqArgs.size() != 0 || stableReqArgs.size() != 0) { + out.write("\n\t\tRequest"); + if (newReqArgs.size() != 0){ + out.write("\n\t\t\tNew parameters: "); + for (Argument newArg: newReqArgs) { + out.write(newArg.getName()); + } + out.write("\n"); + } + if (removedReqArgs.size() != 0){ + out.write("\n\t\t\tRemoved parameters: "); + for (Argument removedArg: removedReqArgs) { + out.write(removedArg.getName()); + } + } + out.write("\n"); + if (stableReqArgs.size() != 0){ + out.write("\n\t\t\tChanged parameters: "); + for (Argument stableArg: stableReqArgs.values()) { + String newRequired = "optional"; + String oldRequired = "optional"; + if (oldCommand.getReqArgByName(stableArg.getName()).isRequired() == true) + oldRequired = "required"; + if (newCommand.getReqArgByName(stableArg.getName()).isRequired() == true) + newRequired = "required"; + + out.write(stableArg.getName() + " (old version - " + oldRequired + ", new version - " + newRequired + ") "); + } + } + out.write("\n"); + } + + //Response + if (newRespArgs.size() != 0 || removedRespArgs.size() != 0 || stableRespArgs.size() != 0) { + out.write("\n\t\tResponse:"); + if (newRespArgs.size() != 0){ + out.write("\n\t\t\tNew parameters: "); + for (Argument newArg: newRespArgs) { + out.write(newArg.getName()); + } + out.write("\n"); + } + if (removedRespArgs.size() != 0){ + out.write("\n\t\t\tRemoved parameters: "); + for (Argument removedArg: removedRespArgs) { + out.write(removedArg.getName()); + } + } + out.write("\n"); + } + } } - } - //Print new commands - for (Command c : newCommands) { - System.out.println(c.getName()); - } + + + + out.close(); + + } catch (IOException e) { + e.printStackTrace(); + } + } } diff --git a/server/src/com/cloud/api/doc/ApiXmlDocWriter.java b/server/src/com/cloud/api/doc/ApiXmlDocWriter.java index 697354e8bf9..aed4f87669c 100644 --- a/server/src/com/cloud/api/doc/ApiXmlDocWriter.java +++ b/server/src/com/cloud/api/doc/ApiXmlDocWriter.java @@ -36,6 +36,8 @@ import java.util.Properties; import org.apache.log4j.Logger; +import com.cloud.api.BaseAsyncCmd; +import com.cloud.api.BaseAsyncCreateCmd; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -52,6 +54,7 @@ public class ApiXmlDocWriter { Properties preProcessedCommands = new Properties(); Enumeration command = null; String[] fileNames = null; + ArrayList commands = new ArrayList(); List argsList = Arrays.asList(args); Iterator iter = argsList.iterator(); @@ -99,8 +102,8 @@ public class ApiXmlDocWriter { xs.alias("command", Command.class); xs.alias("arg", Argument.class); - ObjectOutputStream out = xs.createObjectOutputStream(new FileWriter(dirName + "commands.xml"), "commands"); - + ObjectOutputStream out = xs.createObjectOutputStream(new FileWriter(dirName + "/commands.xml"), "commands"); + while (command.hasMoreElements()) { String key = (String) command.nextElement(); Class clas = Class.forName(api_commands.getProperty(key)); @@ -110,6 +113,7 @@ public class ApiXmlDocWriter { //Create a new command, set name and description Command apiCommand = new Command(); apiCommand.setName(key); + Implementation impl = (Implementation)clas.getAnnotation(Implementation.class); if (impl == null) impl = (Implementation)clas.getSuperclass().getAnnotation(Implementation.class); @@ -122,9 +126,11 @@ public class ApiXmlDocWriter { //Get request parameters Field[] fields = clas.getDeclaredFields(); - //Get fields from superclass +// //Get fields from superclass Class superClass = clas.getSuperclass(); - while (BaseCmd.class.isAssignableFrom(superClass) && !superClass.getName().equals(BaseCmd.class.getName())) { + String superName = superClass.getName(); +// while (BaseCmd.class.isAssignableFrom(superClass) && !superClass.getName().equals(BaseCmd.class.getName())) { + if (!superName.equals(BaseCmd.class.getName()) && !superName.equals(BaseAsyncCmd.class.getName()) && !superName.equals(BaseAsyncCreateCmd.class.getName())) { Field[] superClassFields = superClass.getDeclaredFields(); if (superClassFields != null) { Field[] tmpFields = new Field[fields.length + superClassFields.length]; @@ -134,6 +140,8 @@ public class ApiXmlDocWriter { } superClass = superClass.getSuperclass(); } + +// } for (Field f : fields) { Parameter parameterAnnotation = f.getAnnotation(Parameter.class); @@ -171,14 +179,13 @@ public class ApiXmlDocWriter { response.add(respArg); } - apiCommand.setRequest(request); apiCommand.setResponse(response); + commands.add(apiCommand); //Write command to xml file out.writeObject(apiCommand); } - out.close(); } catch (Exception ex) { ex.printStackTrace(); diff --git a/server/src/com/cloud/api/doc/Argument.java b/server/src/com/cloud/api/doc/Argument.java index 77fcbe4f877..c3927842c2b 100644 --- a/server/src/com/cloud/api/doc/Argument.java +++ b/server/src/com/cloud/api/doc/Argument.java @@ -18,7 +18,7 @@ package com.cloud.api.doc; -public class Argument implements Comparable{ +public class Argument{ private String name; private String description; private Boolean required; @@ -46,8 +46,4 @@ public class Argument implements Comparable{ this.required = required; } - public int compareTo(Argument arg) { - return required.compareTo(arg.isRequired()); - } - } diff --git a/server/src/com/cloud/api/doc/Command.java b/server/src/com/cloud/api/doc/Command.java index e76ad389672..6aa8ef92e07 100644 --- a/server/src/com/cloud/api/doc/Command.java +++ b/server/src/com/cloud/api/doc/Command.java @@ -66,8 +66,20 @@ public class Command { this.response = response; } - public void compareArguments(Command oldCommand){ - //TODO compare request and response arguments + public Argument getReqArgByName(String name){ + for (Argument a : this.getRequest()) { + if (a.getName().equals(name)) + return a; + } + return null; + } + + public Argument getResArgByName(String name){ + for (Argument a : this.getResponse()) { + if (a.getName().equals(name)) + return a; + } + return null; } } diff --git a/server/src/com/cloud/api/response/AccountResponse.java b/server/src/com/cloud/api/response/AccountResponse.java index f6746002369..5cf20e6fa4a 100644 --- a/server/src/com/cloud/api/response/AccountResponse.java +++ b/server/src/com/cloud/api/response/AccountResponse.java @@ -17,85 +17,86 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class AccountResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the id of the account") private Long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the account") private String name; - @SerializedName("accounttype") + @SerializedName("accounttype") @Param(description="account type (admin, domain-admin, user)") private Short accountType; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="id of the Domain the account belongs too") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="name of the Domain the account belongs too") private String domainName; - @SerializedName("receivedbytes") + @SerializedName("receivedbytes") @Param(description="the total number of network traffic bytes received") private Long bytesReceived; - @SerializedName("sentbytes") + @SerializedName("sentbytes") @Param(description="the total number of network traffic bytes sent") private Long bytesSent; - @SerializedName("vmlimit") + @SerializedName("vmlimit") @Param(description="the total number of virtual machines that can be deployed by this account") private String vmLimit; - @SerializedName("vmtotal") + @SerializedName("vmtotal") @Param(description="the total number of virtual machines deployed by this account") private Long vmTotal; - @SerializedName("vmavailable") + @SerializedName("vmavailable") @Param(description="the total number of virtual machines available for this account to acquire") private String vmAvailable; - @SerializedName("iplimit") + @SerializedName("iplimit") @Param(description="the total number of public ip addresses this account can acquire") private String ipLimit; - @SerializedName("iptotal") + @SerializedName("iptotal") @Param(description="the total number of public ip addresses allocated for this account") private Long ipTotal; - @SerializedName("ipavailable") + @SerializedName("ipavailable") @Param(description="the total number of public ip addresses available for this account to acquire") private String ipAvailable; - @SerializedName("volumelimit") + @SerializedName("volumelimit") @Param(description="the total volume which can be used by this account") private String volumeLimit; - @SerializedName("volumetotal") + @SerializedName("volumetotal") @Param(description="the total volume being used by this account") private Long volumeTotal; - @SerializedName("volumeavailable") + @SerializedName("volumeavailable") @Param(description="the total volume available for this account") private String volumeAvailable; - @SerializedName("snapshotlimit") + @SerializedName("snapshotlimit") @Param(description="the total number of snapshots which can be stored by this account") private String snapshotLimit; - @SerializedName("snapshottotal") + @SerializedName("snapshottotal") @Param(description="the total number of snapshots stored by this account") private Long snapshotTotal; - @SerializedName("snapshotavailable") + @SerializedName("snapshotavailable") @Param(description="the total number of snapshots available for this account") private String snapshotAvailable; - @SerializedName("templatelimit") + @SerializedName("templatelimit") @Param(description="the total number of templates which can be created by this account") private String templateLimit; - @SerializedName("templatetotal") + @SerializedName("templatetotal") @Param(description="the total number of templates which have been created by this account") private Long templateTotal; - @SerializedName("templateavailable") + @SerializedName("templateavailable") @Param(description="the total number of templates available to be created by this account") private String templateAvailable; - @SerializedName("vmstopped") + @SerializedName("vmstopped") @Param(description="the total number of virtual machines stopped for this account") private Integer vmStopped; - @SerializedName("vmrunning") + @SerializedName("vmrunning") @Param(description="the total number of virtual machines running for this account") private Integer vmRunning; - @SerializedName("state") + @SerializedName("state") @Param(description="the state of the account") private String state; - @SerializedName("iscleanuprequired") + @SerializedName("iscleanuprequired") @Param(description="true if the account requires cleanup") private Boolean cleanupRequired; public Long getId() { diff --git a/server/src/com/cloud/api/response/AlertResponse.java b/server/src/com/cloud/api/response/AlertResponse.java index 64515a9fcd5..73c890d69e6 100644 --- a/server/src/com/cloud/api/response/AlertResponse.java +++ b/server/src/com/cloud/api/response/AlertResponse.java @@ -19,16 +19,17 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class AlertResponse extends BaseResponse { - @SerializedName("type") + @SerializedName("type") @Param(description="the alert type") private Short alertType; - @SerializedName("description") + @SerializedName("description") @Param(description="description of the alert") private String description; - @SerializedName("sent") + @SerializedName("sent") @Param(description="the date and time the alert was sent") private Date lastSent; public Short getAlertType() { diff --git a/server/src/com/cloud/api/response/AsyncJobResponse.java b/server/src/com/cloud/api/response/AsyncJobResponse.java index 862b3f9d4f2..e9653f10465 100644 --- a/server/src/com/cloud/api/response/AsyncJobResponse.java +++ b/server/src/com/cloud/api/response/AsyncJobResponse.java @@ -20,43 +20,44 @@ package com.cloud.api.response; import java.util.Date; import com.cloud.api.ResponseObject; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class AsyncJobResponse extends BaseResponse { - @SerializedName("jobid") + @SerializedName("jobid") @Param(description="async job ID") private Long id; - @SerializedName("accountid") + @SerializedName("accountid") @Param(description="the account that executed the async command") private Long accountId; - @SerializedName("userid") + @SerializedName("userid") @Param(description="the user that executed the async command") private Long userId; - @SerializedName("cmd") + @SerializedName("cmd") @Param(description="the async command executed") private String cmd; - @SerializedName("jobstatus") + @SerializedName("jobstatus") @Param(description="the current job status—should be 0 for PENDING") private Integer jobStatus; - @SerializedName("jobprocstatus") + @SerializedName("jobprocstatus") @Param(description="the progress information of the PENDING job") private Integer jobProcStatus; - @SerializedName("jobresultcode") + @SerializedName("jobresultcode") @Param(description="the result code for the job") private Integer jobResultCode; - @SerializedName("jobresulttype") + @SerializedName("jobresulttype") @Param(description="the result type") private String jobResultType; - @SerializedName("jobresult") + @SerializedName("jobresult") @Param(description="the result reason") private ResponseObject jobResult; - - @SerializedName("jobinstancetype") + + @SerializedName("jobinstancetype") @Param(description="the instance/entity object related to the job") private String jobInstanceType; - @SerializedName("jobinstanceid") + @SerializedName("jobinstanceid") @Param(description="the unique ID of the instance/entity object related to the job") private Long jobInstanceId; - @SerializedName("created") + @SerializedName("created") @Param(description=" the created date of the job") private Date created; public Long getId() { diff --git a/server/src/com/cloud/api/response/CapabilitiesResponse.java b/server/src/com/cloud/api/response/CapabilitiesResponse.java index 6b4114c8f8c..8f6a08c809b 100644 --- a/server/src/com/cloud/api/response/CapabilitiesResponse.java +++ b/server/src/com/cloud/api/response/CapabilitiesResponse.java @@ -1,12 +1,13 @@ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class CapabilitiesResponse extends BaseResponse { - @SerializedName("networkgroupsenabled") + @SerializedName("networkgroupsenabled") @Param(description="true if network groups support is enabled, false otherwise") private String networkGroupsEnabled; - @SerializedName("cloudstackversion") + @SerializedName("cloudstackversion") @Param(description="version of the cloud stack") private String cloudStackVersion; public String getNetworkGroupsEnabled() { diff --git a/server/src/com/cloud/api/response/CapacityResponse.java b/server/src/com/cloud/api/response/CapacityResponse.java index 26ffee2cfbb..560fb88cda1 100644 --- a/server/src/com/cloud/api/response/CapacityResponse.java +++ b/server/src/com/cloud/api/response/CapacityResponse.java @@ -17,31 +17,32 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class CapacityResponse extends BaseResponse { - @SerializedName("type") + @SerializedName("type") @Param(description="the capacity type") private Short capacityType; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the Zone ID") private Long zoneId; - @SerializedName("zonename") + @SerializedName("zonename") @Param(description="the Zone name") private String zoneName; - @SerializedName("podid") + @SerializedName("podid") @Param(description="the Pod ID") private Long podId; - @SerializedName("podname") + @SerializedName("podname") @Param(description="the Pod name") private String podName; - @SerializedName("capacityused") + @SerializedName("capacityused") @Param(description="the capacity currently in use") private Long capacityUsed; - @SerializedName("capacityTotal") + @SerializedName("capacityTotal") @Param(description="the total capacity available") private Long capacityTotal; - @SerializedName("percentused") + @SerializedName("percentused") @Param(description="the percentage of capacity currently in use") private String percentUsed; public Short getCapacityType() { diff --git a/server/src/com/cloud/api/response/CloudIdentifierResponse.java b/server/src/com/cloud/api/response/CloudIdentifierResponse.java index 1e1ebf67228..12101497a7e 100644 --- a/server/src/com/cloud/api/response/CloudIdentifierResponse.java +++ b/server/src/com/cloud/api/response/CloudIdentifierResponse.java @@ -1,16 +1,17 @@ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class CloudIdentifierResponse extends BaseResponse { - @SerializedName("userid") + @SerializedName("userid") @Param(description="the user ID for the cloud identifier") private Long userId; - @SerializedName("cloudidentifier") + @SerializedName("cloudidentifier") @Param(description="the cloud identifier") private String cloudIdentifier; - @SerializedName("signature") + @SerializedName("signature") @Param(description="the signed response for the cloud identifier") private String signature; public Long getUserId() { diff --git a/server/src/com/cloud/api/response/ClusterResponse.java b/server/src/com/cloud/api/response/ClusterResponse.java index d4feb8917c6..61d2ba24cb6 100644 --- a/server/src/com/cloud/api/response/ClusterResponse.java +++ b/server/src/com/cloud/api/response/ClusterResponse.java @@ -17,25 +17,26 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class ClusterResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the cluster ID") private Long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the cluster name") private String name; - @SerializedName("podid") + @SerializedName("podid") @Param(description="the Pod ID of the cluster") private Long podId; - @SerializedName("podname") + @SerializedName("podname") @Param(description="the Pod name of the cluster") private String podName; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the Zone ID of the cluster") private Long zoneId; - @SerializedName("zonename") + @SerializedName("zonename") @Param(description="the Zone name of the cluster") private String zoneName; public Long getId() { diff --git a/server/src/com/cloud/api/response/ConfigurationResponse.java b/server/src/com/cloud/api/response/ConfigurationResponse.java index dc2a9a54ee0..8d310fab04f 100644 --- a/server/src/com/cloud/api/response/ConfigurationResponse.java +++ b/server/src/com/cloud/api/response/ConfigurationResponse.java @@ -17,19 +17,20 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class ConfigurationResponse extends BaseResponse { - @SerializedName("category") + @SerializedName("category") @Param(description="the category of the configuration") private String category; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the configuration") private String name; - @SerializedName("value") + @SerializedName("value") @Param(description="the value of the configuration") private String value; - @SerializedName("description") + @SerializedName("description") @Param(description="the description of the configuration") private String description; public String getCategory() { diff --git a/server/src/com/cloud/api/response/DeleteDomainResponse.java b/server/src/com/cloud/api/response/DeleteDomainResponse.java deleted file mode 100644 index 8375d1c4cee..00000000000 --- a/server/src/com/cloud/api/response/DeleteDomainResponse.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2010 Cloud.com, Inc. All rights reserved. - * - * This software is licensed under the GNU General Public License v3 or later. - * - * It is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -package com.cloud.api.response; - -import com.google.gson.annotations.SerializedName; - -public class DeleteDomainResponse extends BaseResponse { - @SerializedName("result") - private String result; - - public String getResult() { - return result; - } - - public void setResult(String result) { - this.result = result; - } -} diff --git a/server/src/com/cloud/api/response/DeletePreallocatedLunResponse.java b/server/src/com/cloud/api/response/DeletePreallocatedLunResponse.java deleted file mode 100644 index 06724aa60b8..00000000000 --- a/server/src/com/cloud/api/response/DeletePreallocatedLunResponse.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.cloud.api.response; - -import com.google.gson.annotations.SerializedName; - -public class DeletePreallocatedLunResponse extends BaseResponse { - @SerializedName("success") - private Boolean success; - - public Boolean getSuccess() { - return success; - } - - public void setSuccess(Boolean success) { - this.success = success; - } -} diff --git a/server/src/com/cloud/api/response/DiskOfferingResponse.java b/server/src/com/cloud/api/response/DiskOfferingResponse.java index de6e1bce0f7..1e69d09b80f 100644 --- a/server/src/com/cloud/api/response/DiskOfferingResponse.java +++ b/server/src/com/cloud/api/response/DiskOfferingResponse.java @@ -19,34 +19,36 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class DiskOfferingResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="unique ID of the disk offering") private Long id; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the domain ID this disk offering belongs to. Ignore this information as it is not currently applicable.") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the domain name this disk offering belongs to. Ignore this information as it is not currently applicable.") private String domain; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the disk offering") private String name; - @SerializedName("displaytext") + @SerializedName("displaytext") @Param(description="an alternate display text of the disk offering.") private String displayText; - @SerializedName("disksize") + @SerializedName("disksize") @Param(description="the size of the disk offering in GB") private Long diskSize; - @SerializedName("created") + @SerializedName("created") @Param(description="the date this disk offering was created") private Date created; @SerializedName("ismirrored") private Boolean mirrored; - @SerializedName("tags") + @SerializedName("tags") @Param(description="the tags for the disk offering") + private String tags; public Long getId() { diff --git a/server/src/com/cloud/api/response/DomainResponse.java b/server/src/com/cloud/api/response/DomainResponse.java index 43df57980bc..4236d806c4b 100644 --- a/server/src/com/cloud/api/response/DomainResponse.java +++ b/server/src/com/cloud/api/response/DomainResponse.java @@ -17,22 +17,23 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class DomainResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the domain") private Long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the domain") private String domainName; - @SerializedName("level") + @SerializedName("level") @Param(description="the level of the domain") private Integer level; - @SerializedName("parentdomainid") + @SerializedName("parentdomainid") @Param(description="the domain ID of the parent domain") private Long parentDomainId; - @SerializedName("parentdomainname") + @SerializedName("parentdomainname") @Param(description="the domain name of the parent domain") private String parentDomainName; public Long getId() { diff --git a/server/src/com/cloud/api/response/DomainRouterResponse.java b/server/src/com/cloud/api/response/DomainRouterResponse.java index 867195b0f55..f2aeedd461a 100644 --- a/server/src/com/cloud/api/response/DomainRouterResponse.java +++ b/server/src/com/cloud/api/response/DomainRouterResponse.java @@ -19,92 +19,93 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.cloud.vm.State; import com.google.gson.annotations.SerializedName; public class DomainRouterResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the id of the router") private Long id; - - @SerializedName("jobid") + + @SerializedName("jobid") @Param(description="the job ID associated with the router. This is only displayed if the router listed is part of a currently running asynchronous job.") private Long jobId; - @SerializedName("jobstatus") + @SerializedName("jobstatus") @Param(description="the job status associated with the router. This is only displayed if the router listed is part of a currently running asynchronous job.") private Integer jobStatus; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the Zone ID for the router") private Long zoneId; - @SerializedName("zonename") - private String zoneName; + @SerializedName("zonename") @Param(description="the Zone name for the router") + private String zoneName; - @SerializedName("dns1") + @SerializedName("dns1") @Param(description="the first DNS for the router") private String dns1; - @SerializedName("dns2") + @SerializedName("dns2") @Param(description="the second DNS for the router") private String dns2; - @SerializedName("networkdomain") + @SerializedName("networkdomain") @Param(description="the network domain for the router") private String networkDomain; - @SerializedName("gateway") + @SerializedName("gateway") @Param(description="the gateway for the router") private String gateway; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the router") private String name; - @SerializedName("podid") + @SerializedName("podid") @Param(description="the Pod ID for the router") private Long podId; - @SerializedName("hostid") + @SerializedName("hostid") @Param(description="the host ID for the router") private Long hostId; - @SerializedName("hostname") + @SerializedName("hostname") @Param(description="the hostname for the router") private String hostName; - @SerializedName("privateip") + @SerializedName("privateip") @Param(description="the private IP address for the router") private String privateIp; - @SerializedName("privatemacaddress") + @SerializedName("privatemacaddress") @Param(description="the private MAC address for the router") private String privateMacAddress; - @SerializedName("privatenetmask") + @SerializedName("privatenetmask") @Param(description="the private netmask for the router") private String privateNetmask; - @SerializedName("publicip") + @SerializedName("publicip") @Param(description="the public IP address for the router") private String publicIp; - @SerializedName("publicmacaddress") + @SerializedName("publicmacaddress") @Param(description="the public MAC address for the router") private String publicMacAddress; - @SerializedName("publicnetmask") + @SerializedName("publicnetmask") @Param(description="the public netmask for the router") private String publicNetmask; - @SerializedName("guestipaddress") + @SerializedName("guestipaddress") @Param(description="the guest IP address for the router") private String guestIpAddress; - @SerializedName("guestmacaddress") + @SerializedName("guestmacaddress") @Param(description="the guest MAC address for the router") private String guestMacAddress; - @SerializedName("guestnetmask") + @SerializedName("guestnetmask") @Param(description="the guest netmask for the router") private String guestNetmask; - @SerializedName("templateid") + @SerializedName("templateid") @Param(description="the template ID for the router") private Long templateId; - @SerializedName("created") + @SerializedName("created") @Param(description="the date and time the router was created") private Date created; - @SerializedName("state") + @SerializedName("state") @Param(description="the state of the router") private State state; - @SerializedName("account") + @SerializedName("account") @Param(description="the account associated with the router") private String accountName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the domain ID associated with the router") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the domain associated with the router") private String domainName; public Long getId() { diff --git a/server/src/com/cloud/api/response/EventResponse.java b/server/src/com/cloud/api/response/EventResponse.java index 7b80483f31e..f1b77d76765 100644 --- a/server/src/com/cloud/api/response/EventResponse.java +++ b/server/src/com/cloud/api/response/EventResponse.java @@ -20,40 +20,41 @@ package com.cloud.api.response; import java.util.Date; import com.cloud.event.EventState; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class EventResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the event") private Long id; - @SerializedName("username") + @SerializedName("username") @Param(description="the name of the user who performed the action (can be different from the account if an admin is performing an action for a user, e.g. starting/stopping a user's virtual machine)") private String username; - @SerializedName("type") + @SerializedName("type") @Param(description="the type of the event (see event types)") private String eventType; - @SerializedName("level") + @SerializedName("level") @Param(description="the event level (INFO, WARN, ERROR)") private String level; - @SerializedName("description") + @SerializedName("description") @Param(description="a brief description of the event") private String description; - @SerializedName("account") + @SerializedName("account") @Param(description="the account name for the account that owns the object being acted on in the event (e.g. the owner of the virtual machine, ip address, or security group)") private String accountName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the id of the account's domain") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the name of the account's domain") private String domainName; - @SerializedName("created") + @SerializedName("created") @Param(description="the date the event was created") private Date created; - @SerializedName("state") + @SerializedName("state") @Param(description="the state of the event") private EventState state; - @SerializedName("parentid") + @SerializedName("parentid") @Param(description="whether the event is parented") private Long parentId; public Long getId() { diff --git a/server/src/com/cloud/api/response/ExtractResponse.java b/server/src/com/cloud/api/response/ExtractResponse.java index b3249dc7eae..602ac495025 100644 --- a/server/src/com/cloud/api/response/ExtractResponse.java +++ b/server/src/com/cloud/api/response/ExtractResponse.java @@ -19,43 +19,48 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class ExtractResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the id of extracted object") private long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the extracted object") private String name; + //FIXME - add description @SerializedName("uploadpercentage") private int uploadPercent; + //FIXME - add description @SerializedName("uploadstatus") private String uploadStatus; - @SerializedName("accountid") + @SerializedName("accountid") @Param(description="the account id to which the extracted object belongs") private long accountId; - @SerializedName("resultstring") + @SerializedName("resultstring") @Param(description="") private String resultString; - @SerializedName("created") + @SerializedName("created") @Param(description="the time and date the object was created") private Date createdDate; - @SerializedName("state") + @SerializedName("state") @Param(description="the state of the extracted object") private String state; + //FIXME - add description @SerializedName("storagetype") private String storageType; - + + //FIXME - add description @SerializedName("storage") private String storage; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="zone ID the object was extracted from") private Long zoneId; - @SerializedName("zonename") + @SerializedName("zonename") @Param(description="zone name the object was extracted from") private String zoneName; public long getId() { diff --git a/server/src/com/cloud/api/response/FirewallRuleResponse.java b/server/src/com/cloud/api/response/FirewallRuleResponse.java index 82e32074da0..45a112fd2c8 100644 --- a/server/src/com/cloud/api/response/FirewallRuleResponse.java +++ b/server/src/com/cloud/api/response/FirewallRuleResponse.java @@ -17,25 +17,26 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class FirewallRuleResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the port forwarding rule") private Long id; - @SerializedName("privateport") + @SerializedName("privateport") @Param(description="the private port for the port forwarding rule") private String privatePort; - @SerializedName("protocol") + @SerializedName("protocol") @Param(description="the protocol of the port forwarding rule") private String protocol; - @SerializedName("publicport") + @SerializedName("publicport") @Param(description="the public port for the port forwarding rule") private String publicPort; - @SerializedName("virtualmachineid") + @SerializedName("virtualmachineid") @Param(description="the VM ID for the port forwarding rule") private Long virtualMachineId; - @SerializedName("virtualmachinename") + @SerializedName("virtualmachinename") @Param(description="the VM name for the port forwarding rule") private String virtualMachineName; public Long getId() { diff --git a/server/src/com/cloud/api/response/GuestOSCategoryResponse.java b/server/src/com/cloud/api/response/GuestOSCategoryResponse.java index 837e5c54c17..337d642fe93 100644 --- a/server/src/com/cloud/api/response/GuestOSCategoryResponse.java +++ b/server/src/com/cloud/api/response/GuestOSCategoryResponse.java @@ -17,14 +17,15 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class GuestOSCategoryResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the OS category") private Long id; - @SerializedName("name") - private String name; + @SerializedName("name") @Param(description="the name of the OS category") + private String name; public Long getId() { return id; diff --git a/server/src/com/cloud/api/response/GuestOSResponse.java b/server/src/com/cloud/api/response/GuestOSResponse.java index 182593d36f0..fcaa8e6bf04 100644 --- a/server/src/com/cloud/api/response/GuestOSResponse.java +++ b/server/src/com/cloud/api/response/GuestOSResponse.java @@ -17,16 +17,17 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class GuestOSResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the OS type") private Long id; - @SerializedName("oscategoryid") + @SerializedName("oscategoryid") @Param(description="the ID of the OS category") private Long osCategoryId; - @SerializedName("description") + @SerializedName("description") @Param(description="the name/description of the OS type") private String description; public Long getId() { diff --git a/server/src/com/cloud/api/response/HostResponse.java b/server/src/com/cloud/api/response/HostResponse.java index 8448f164a21..3144ff8ca72 100644 --- a/server/src/com/cloud/api/response/HostResponse.java +++ b/server/src/com/cloud/api/response/HostResponse.java @@ -22,112 +22,113 @@ import java.util.Date; import com.cloud.host.Host; import com.cloud.host.Status; import com.cloud.hypervisor.Hypervisor; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class HostResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the host") private Long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the host") private String name; - @SerializedName("state") + @SerializedName("state") @Param(description="the state of the host") private Status state; - @SerializedName("disconnected") + @SerializedName("disconnected") @Param(description="true if the host is disconnected. False otherwise.") private Date disconnectedOn; - @SerializedName("type") + @SerializedName("type") @Param(description="the host type") private Host.Type hostType; - @SerializedName("oscategoryid") + @SerializedName("oscategoryid") @Param(description="the OS category ID of the host") private Long osCategoryId; - @SerializedName("oscategoryname") + @SerializedName("oscategoryname") @Param(description="the OS category name of the host") private String osCategoryName; - @SerializedName("ipaddress") + @SerializedName("ipaddress") @Param(description="the IP address of the host") private String ipAddress; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the Zone ID of the host") private Long zoneId; - @SerializedName("zonename") + @SerializedName("zonename") @Param(description="the Zone name of the host") private String zoneName; - @SerializedName("podid") + @SerializedName("podid") @Param(description="the Pod ID of the host") private Long podId; - @SerializedName("podname") + @SerializedName("podname") @Param(description="the Pod name of the host") private String podName; - @SerializedName("version") + @SerializedName("version") @Param(description="the host version") private String version; - @SerializedName("hypervisor") + @SerializedName("hypervisor") @Param(description="the host hypervisor") private Hypervisor.Type hypervisor; - @SerializedName("cpunumber") + @SerializedName("cpunumber") @Param(description="the CPU number of the host") private Integer cpuNumber; - @SerializedName("cpuspeed") + @SerializedName("cpuspeed") @Param(description="the CPU speed of the host") private Long cpuSpeed; - @SerializedName("cpuallocated") + @SerializedName("cpuallocated") @Param(description="the amount of the host's CPU currently allocated") private String cpuAllocated; - @SerializedName("cpuused") + @SerializedName("cpuused") @Param(description="the amount of the host's CPU currently used") private String cpuUsed; - @SerializedName("averageload") + @SerializedName("averageload") @Param(description="the cpu average load on the host") private Long averageLoad; - @SerializedName("networkkbsread") + @SerializedName("networkkbsread") @Param(description="the incoming network traffic on the host") private Long networkKbsRead; - @SerializedName("networkkbswrite") + @SerializedName("networkkbswrite") @Param(description="the outgoing network traffic on the host") private Long networkKbsWrite; - @SerializedName("memorytotal") + @SerializedName("memorytotal") @Param(description="the memory total of the host") private Long memoryTotal; - @SerializedName("memoryallocated") + @SerializedName("memoryallocated") @Param(description="the amount of the host's memory currently allocated") private Long memoryAllocated; - @SerializedName("memoryused") + @SerializedName("memoryused") @Param(description="the amount of the host's memory currently used") private Long memoryUsed; - @SerializedName("disksizetotal") + @SerializedName("disksizetotal") @Param(description="the total disk size of the host") private Long diskSizeTotal; - @SerializedName("disksizeallocated") + @SerializedName("disksizeallocated") @Param(description="the host's currently allocated disk size") private Long diskSizeAllocated; - @SerializedName("capabilities") + @SerializedName("capabilities") @Param(description="capabilities of the host") private String capabilities; - @SerializedName("lastpinged") + @SerializedName("lastpinged") @Param(description="the date and time the host was last pinged") private Date lastPinged; - @SerializedName("managementserverid") + @SerializedName("managementserverid") @Param(description="the management server ID of the host") private Long managementServerId; - @SerializedName("custerid") + @SerializedName("custerid") @Param(description="the cluster ID of the host") private Long clusterId; - @SerializedName("clustername") + @SerializedName("clustername") @Param(description="the cluster name of the host") private String clusterName; - @SerializedName("islocalstorageactive") + @SerializedName("islocalstorageactive") @Param(description="true if local storage is active, false otherwise") private Boolean localStorageActive; - @SerializedName("created") + @SerializedName("created") @Param(description="the date and time the host was created") private Date created; - @SerializedName("removed") + @SerializedName("removed") @Param(description="the date and time the host was removed") private Date removed; - @SerializedName("events") + @SerializedName("events") @Param(description="events available for the host") private String events; public Long getId() { diff --git a/server/src/com/cloud/api/response/IPAddressResponse.java b/server/src/com/cloud/api/response/IPAddressResponse.java index fd19d8277a6..dc780f89559 100644 --- a/server/src/com/cloud/api/response/IPAddressResponse.java +++ b/server/src/com/cloud/api/response/IPAddressResponse.java @@ -19,40 +19,41 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class IPAddressResponse extends BaseResponse { - @SerializedName("ipaddress") + @SerializedName("ipaddress") @Param(description="public IP address") private String ipAddress; - @SerializedName("allocated") + @SerializedName("allocated") @Param(description="date the public IP address was acquired") private Date allocated; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the ID of the zone the public IP address belongs to") private Long zoneId; - @SerializedName("zonename") + @SerializedName("zonename") @Param(description="the name of the zone the public IP address belongs to") private String zoneName; - @SerializedName("issourcenat") + @SerializedName("issourcenat") @Param(description="true if the IP address is a source nat address, false otherwise") private Boolean sourceNat; - @SerializedName("account") + @SerializedName("account") @Param(description="the account the public IP address is associated with") private String accountName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the domain ID the public IP address is associated with") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the domain the public IP address is associated with") private String domainName; - @SerializedName("forvirtualnetwork") + @SerializedName("forvirtualnetwork") @Param(description="the virtual network for the IP address") private Boolean forVirtualNetwork; - @SerializedName("vlanid") + @SerializedName("vlanid") @Param(description="the ID of the VLAN associated with the IP address") private Long vlanId; - @SerializedName("vlanname") + @SerializedName("vlanname") @Param(description="the VLAN associated with the IP address") private String vlanName; public String getIpAddress() { diff --git a/server/src/com/cloud/api/response/IngressRuleResponse.java b/server/src/com/cloud/api/response/IngressRuleResponse.java index c7aa5d5e37f..169024e589e 100644 --- a/server/src/com/cloud/api/response/IngressRuleResponse.java +++ b/server/src/com/cloud/api/response/IngressRuleResponse.java @@ -17,34 +17,37 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class IngressRuleResponse extends BaseResponse { - @SerializedName("ruleid") + @SerializedName("ruleid") @Param(description="the id of the ingress rule") private Long ruleId; - @SerializedName("protocol") + @SerializedName("protocol") @Param(description="the protocol of the ingress rule") private String protocol; + //FIXME - add description @SerializedName("icmptype") private Integer icmpType; + //FIXME - add description @SerializedName("icmpcode") private Integer icmpCode; - @SerializedName("startport") + @SerializedName("startport") @Param(description="the starting IP of the ingress rule") private Integer startPort; - @SerializedName("endport") + @SerializedName("endport") @Param(description="the ending IP of the ingress rule ") private Integer endPort; - @SerializedName("networkgroupname") + @SerializedName("networkgroupname") @Param(description="network group name") private String networkGroupName; - @SerializedName("account") + @SerializedName("account") @Param(description="account owning the ingress rule") private String accountName; - @SerializedName("cidr") + @SerializedName("cidr") @Param(description="the CIDR notation for the base IP address of the ingress rule") private String cidr; public Long getRuleId() { diff --git a/server/src/com/cloud/api/response/InstanceGroupResponse.java b/server/src/com/cloud/api/response/InstanceGroupResponse.java index 25222777b31..cd344320329 100644 --- a/server/src/com/cloud/api/response/InstanceGroupResponse.java +++ b/server/src/com/cloud/api/response/InstanceGroupResponse.java @@ -2,25 +2,26 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class InstanceGroupResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the id of the instance group") private Long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the instance group") private String name; - @SerializedName("created") + @SerializedName("created") @Param(description="time and date the instance group was created") private Date created; - @SerializedName("account") + @SerializedName("account") @Param(description="the account owning the instance group") private String accountName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the domain ID of the instance group") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the domain name of the instance group") private String domainName; public Long getId() { diff --git a/server/src/com/cloud/api/response/LoadBalancerResponse.java b/server/src/com/cloud/api/response/LoadBalancerResponse.java index 76a51d478b2..b30fb49a255 100644 --- a/server/src/com/cloud/api/response/LoadBalancerResponse.java +++ b/server/src/com/cloud/api/response/LoadBalancerResponse.java @@ -17,37 +17,38 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class LoadBalancerResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the load balancer rule ID") private Long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the load balancer") private String name; - @SerializedName("description") + @SerializedName("description") @Param(description="the description of the load balancer") private String description; - @SerializedName("publicip") + @SerializedName("publicip") @Param(description="the public ip address") private String publicIp; - @SerializedName("publicport") + @SerializedName("publicport") @Param(description="the public port") private String publicPort; - @SerializedName("privateport") + @SerializedName("privateport") @Param(description="the private port") private String privatePort; - @SerializedName("algorithm") + @SerializedName("algorithm") @Param(description="the load balancer algorithm (source, roundrobin, leastconn)") private String algorithm; - @SerializedName("account") + @SerializedName("account") @Param(description="the account of the load balancer rule") private String accountName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the domain ID of the load balancer rule") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the domain of the load balancer rule") private String domainName; public Long getId() { diff --git a/server/src/com/cloud/api/response/NetworkGroupResponse.java b/server/src/com/cloud/api/response/NetworkGroupResponse.java index df7b1854bab..7fc8632b719 100644 --- a/server/src/com/cloud/api/response/NetworkGroupResponse.java +++ b/server/src/com/cloud/api/response/NetworkGroupResponse.java @@ -19,28 +19,29 @@ package com.cloud.api.response; import java.util.List; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class NetworkGroupResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the network group") private Long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the network group") private String name; - @SerializedName("description") + @SerializedName("description") @Param(description="the description of the network group") private String description; - @SerializedName("account") + @SerializedName("account") @Param(description="the account owning the network group") private String accountName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the domain ID of the network group") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the domain name of the network group") private String domainName; - @SerializedName("ingressrule") + @SerializedName("ingressrule") @Param(description="the list of ingress rules associated with the network group") private List ingressRules; public Long getId() { diff --git a/server/src/com/cloud/api/response/PodResponse.java b/server/src/com/cloud/api/response/PodResponse.java index f8ff7670e31..5fbd8a615a8 100644 --- a/server/src/com/cloud/api/response/PodResponse.java +++ b/server/src/com/cloud/api/response/PodResponse.java @@ -17,31 +17,32 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class PodResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the Pod") private Long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the Pod") private String name; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the Zone ID of the Pod") private Long zoneId; - @SerializedName("zonename") + @SerializedName("zonename") @Param(description="the Zone name of the Pod") private String zoneName; - @SerializedName("gateway") + @SerializedName("gateway") @Param(description="the gateway of the Pod") private String gateway; - @SerializedName("cidr") + @SerializedName("cidr") @Param(description="the CIDR notation for the base IP address of the Pod") private String cidr; - @SerializedName("startip") + @SerializedName("startip") @Param(description="the starting IP for the Pod") private String startIp; - @SerializedName("endIp") + @SerializedName("endIp") @Param(description="the ending IP for the Pod") private String endIp; public Long getId() { diff --git a/server/src/com/cloud/api/response/PortForwardingServiceRuleResponse.java b/server/src/com/cloud/api/response/PortForwardingServiceRuleResponse.java index 770cbb7db8c..8b9f009efd0 100644 --- a/server/src/com/cloud/api/response/PortForwardingServiceRuleResponse.java +++ b/server/src/com/cloud/api/response/PortForwardingServiceRuleResponse.java @@ -17,28 +17,29 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class PortForwardingServiceRuleResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the port forwarding service rule") private long ruleId; - @SerializedName("publicport") + @SerializedName("publicport") @Param(description="the public port of the port forwarding service rule") private String publicPort; - @SerializedName("privateport") + @SerializedName("privateport") @Param(description="the private port of the port forwarding service rule") private String privatePort; - @SerializedName("protocol") + @SerializedName("protocol") @Param(description="the protocol (TCP/UDP) of the port forwarding service rule") private String protocol; - @SerializedName("portforwardingserviceid") + @SerializedName("portforwardingserviceid") @Param(description="the id of port forwarding service where the rule belongs to") private Long portForwardingServiceId; - @SerializedName("jobid") + @SerializedName("jobid") @Param(description="the job ID associated with the port forwarding rule. This is only displayed if the rule listed is part of a currently running asynchronous job.") private Long jobId; - @SerializedName("jobstatus") + @SerializedName("jobstatus") @Param(description="the job status associated with the port forwarding rule. This is only displayed if the rule listed is part of a currently running asynchronous job.") private Integer jobStatus; public Long getPortForwardingServiceId() { diff --git a/server/src/com/cloud/api/response/PreallocatedLunResponse.java b/server/src/com/cloud/api/response/PreallocatedLunResponse.java index 61c85e6867b..061da2cc65f 100644 --- a/server/src/com/cloud/api/response/PreallocatedLunResponse.java +++ b/server/src/com/cloud/api/response/PreallocatedLunResponse.java @@ -19,31 +19,33 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class PreallocatedLunResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the preallocated LUN") private Long id; - @SerializedName("volumeid") + @SerializedName("volumeid") @Param(description="the ID of the preallocated LUN") private Long volumeId; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the zone ID of the preallocated LUN") private Long zoneId; - @SerializedName("lun") + @SerializedName("lun") @Param(description="the name of the preallocated LUN") private Integer lun; + //FIXME - add description @SerializedName("portal") private String portal; - @SerializedName("size") + @SerializedName("size") @Param(description="the size of the preallocated LUN") private Long size; - @SerializedName("taken") + @SerializedName("taken") @Param(description="true if the preallocated LUN is used by the volume, false otherwise") private Date taken; - @SerializedName("targetiqn") + @SerializedName("targetiqn") @Param(description="the target IQN of the preallocated LUN") private String targetIqn; public Long getId() { diff --git a/server/src/com/cloud/api/response/RegisterResponse.java b/server/src/com/cloud/api/response/RegisterResponse.java index 4a83636df43..6a5fd94cad6 100644 --- a/server/src/com/cloud/api/response/RegisterResponse.java +++ b/server/src/com/cloud/api/response/RegisterResponse.java @@ -1,12 +1,13 @@ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class RegisterResponse extends BaseResponse { - @SerializedName("apikey") + @SerializedName("apikey") @Param(description="the api key of the registered user") private String apiKey; - @SerializedName("secretkey") + @SerializedName("secretkey") @Param(description="the secret key of the registered user") private String secretKey; public String getApiKey() { diff --git a/server/src/com/cloud/api/response/ResourceLimitResponse.java b/server/src/com/cloud/api/response/ResourceLimitResponse.java index 611f1a70cb0..5b4ba74a4df 100644 --- a/server/src/com/cloud/api/response/ResourceLimitResponse.java +++ b/server/src/com/cloud/api/response/ResourceLimitResponse.java @@ -17,22 +17,23 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class ResourceLimitResponse extends BaseResponse { - @SerializedName("account") + @SerializedName("account") @Param(description="the account of the resource limit") private String accountName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the domain ID of the resource limit") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the domain name of the resource limit") private String domainName; - @SerializedName("resourcetype") + @SerializedName("resourcetype") @Param(description="resource type. Values include 0, 1, 2, 3, 4. See the resourceType parameter for more information on these values.") private Integer resourceType; - @SerializedName("max") + @SerializedName("max") @Param(description="the maximum number of the resource. A -1 means the resource currently has no limit.") private Long max; public String getAccountName() { diff --git a/server/src/com/cloud/api/response/SecurityGroupResponse.java b/server/src/com/cloud/api/response/SecurityGroupResponse.java index 23233b5944b..1e081166505 100644 --- a/server/src/com/cloud/api/response/SecurityGroupResponse.java +++ b/server/src/com/cloud/api/response/SecurityGroupResponse.java @@ -17,27 +17,29 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class SecurityGroupResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the security group") private Long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the security group") private String name; - @SerializedName("description") + @SerializedName("description") @Param(description="the description of the security group") private String description; - @SerializedName("account") + @SerializedName("account") @Param(description="the account owning the securtiy group") private String accountName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the domain ID of the security group") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the domain name of the secruity group") private String domainName; + //FIXME - add description @SerializedName("ipaddress") private String ipAddress; diff --git a/server/src/com/cloud/api/response/ServiceOfferingResponse.java b/server/src/com/cloud/api/response/ServiceOfferingResponse.java index 86b28532029..16cd432f1a9 100644 --- a/server/src/com/cloud/api/response/ServiceOfferingResponse.java +++ b/server/src/com/cloud/api/response/ServiceOfferingResponse.java @@ -19,40 +19,41 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class ServiceOfferingResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the id of the service offering") private Long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the service offering") private String name; - @SerializedName("displaytext") + @SerializedName("displaytext") @Param(description="an alternate display text of the service offering.") private String displayText; - @SerializedName("cpunumber") + @SerializedName("cpunumber") @Param(description="the number of CPU") private int cpuNumber; - @SerializedName("cpuspeed") + @SerializedName("cpuspeed") @Param(description="the clock rate CPU speed in Mhz") private int cpuSpeed; - @SerializedName("memory") + @SerializedName("memory") @Param(description="the memory in MB") private int memory; - @SerializedName("created") + @SerializedName("created") @Param(description="the date this service offering was created") private Date created; - @SerializedName("storagetype") + @SerializedName("storagetype") @Param(description="the storage type for this service offering") private String storageType; - @SerializedName("offerha") + @SerializedName("offerha") @Param(description="the ha support in the service offering") private Boolean offerHa; - @SerializedName("usevirtualnetwork") + @SerializedName("usevirtualnetwork") @Param(description="the virtual network for the service offering") private Boolean useVirtualNetwork; - @SerializedName("tags") + @SerializedName("tags") @Param(description="the tags for the service offering") private String tags; public Long getId() { diff --git a/server/src/com/cloud/api/response/SnapshotPolicyResponse.java b/server/src/com/cloud/api/response/SnapshotPolicyResponse.java index 6b30bbb702e..e015f1bfda5 100644 --- a/server/src/com/cloud/api/response/SnapshotPolicyResponse.java +++ b/server/src/com/cloud/api/response/SnapshotPolicyResponse.java @@ -17,25 +17,26 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class SnapshotPolicyResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the snapshot policy") private Long id; - @SerializedName("volumeid") + @SerializedName("volumeid") @Param(description="the ID of the disk volume") private Long volumeId; - @SerializedName("schedule") + @SerializedName("schedule") @Param(description="time the snapshot is scheduled to be taken.") private String schedule; - @SerializedName("intervaltype") + @SerializedName("intervaltype") @Param(description="the interval type of the snapshot policy") private short intervalType; - @SerializedName("maxsnaps") + @SerializedName("maxsnaps") @Param(description="maximum number of snapshots retained") private int maxSnaps; - @SerializedName("timezone") + @SerializedName("timezone") @Param(description="the time zone of the snapshot policy") private String timezone; public Long getId() { diff --git a/server/src/com/cloud/api/response/SnapshotResponse.java b/server/src/com/cloud/api/response/SnapshotResponse.java index 03fecf3654f..db8e733e3c1 100644 --- a/server/src/com/cloud/api/response/SnapshotResponse.java +++ b/server/src/com/cloud/api/response/SnapshotResponse.java @@ -19,46 +19,47 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class SnapshotResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="ID of the snapshot") private Long id; - @SerializedName("account") + @SerializedName("account") @Param(description="the account associated with the snapshot") private String accountName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the domain ID of the snapshot's account") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the domain name of the snapshot's account") private String domainName; - @SerializedName("snapshottype") + @SerializedName("snapshottype") @Param(description="the type of the snapshot") private String snapshotType; - @SerializedName("volumeid") + @SerializedName("volumeid") @Param(description="ID of the disk volume") private Long volumeId; - @SerializedName("volumename") + @SerializedName("volumename") @Param(description="name of the disk volume") private String volumeName; - @SerializedName("volumetype") + @SerializedName("volumetype") @Param(description="type of the disk volume") private String volumeType; - @SerializedName("created") + @SerializedName("created") @Param(description=" the date the snapshot was created") private Date created; - @SerializedName("name") + @SerializedName("name") @Param(description="name of the snapshot") private String name; - @SerializedName("jobid") + @SerializedName("jobid") @Param(description="the job ID associated with the snapshot. This is only displayed if the snapshot listed is part of a currently running asynchronous job.") private Long jobId; - @SerializedName("jobstatus") + @SerializedName("jobstatus") @Param(description="the job status associated with the snapshot. This is only displayed if the snapshot listed is part of a currently running asynchronous job.") private Integer jobStatus; - @SerializedName("intervaltype") + @SerializedName("intervaltype") @Param(description="valid types are hourly, daily, weekly, monthy, template, and none.") private String intervalType; public Long getId() { diff --git a/server/src/com/cloud/api/response/SnapshotScheduleResponse.java b/server/src/com/cloud/api/response/SnapshotScheduleResponse.java index d64f1c75937..d8434f6c79c 100644 --- a/server/src/com/cloud/api/response/SnapshotScheduleResponse.java +++ b/server/src/com/cloud/api/response/SnapshotScheduleResponse.java @@ -19,19 +19,20 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class SnapshotScheduleResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the snapshot schedule") private Long id; - @SerializedName("volumeid") + @SerializedName("volumeid") @Param(description="the volume ID the snapshot schedule applied for") private Long volumeId; - @SerializedName("snapshotpolicyid") + @SerializedName("snapshotpolicyid") @Param(description="the snapshot policy ID used by the snapshot schedule") private Long snapshotPolicyId; - @SerializedName("scheduled") + @SerializedName("scheduled") @Param(description="time the snapshot is scheduled to be taken") private Date scheduled; public Long getId() { diff --git a/server/src/com/cloud/api/response/StoragePoolResponse.java b/server/src/com/cloud/api/response/StoragePoolResponse.java index 5f5bc33db0a..ddc6c0137e4 100644 --- a/server/src/com/cloud/api/response/StoragePoolResponse.java +++ b/server/src/com/cloud/api/response/StoragePoolResponse.java @@ -19,55 +19,56 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class StoragePoolResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the storage pool") private Long id; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the Zone ID of the storage pool") private Long zoneId; - @SerializedName("zonename") + @SerializedName("zonename") @Param(description="the Zone name of the storage pool") private String zoneName; - @SerializedName("podid") + @SerializedName("podid") @Param(description="the Pod ID of the storage pool") private Long podId; - @SerializedName("podname") + @SerializedName("podname") @Param(description="the Pod name of the storage pool") private String podName; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the storage pool") private String name; - @SerializedName("ipaddress") + @SerializedName("ipaddress") @Param(description="the IP address of the storage pool") private String ipAddress; - @SerializedName("path") + @SerializedName("path") @Param(description="the storage pool path") private String path; - @SerializedName("created") + @SerializedName("created") @Param(description="the date and time the storage pool was created") private Date created; - @SerializedName("type") + @SerializedName("type") @Param(description="the storage pool type") private String type; - @SerializedName("clusterid") + @SerializedName("clusterid") @Param(description="the ID of the cluster for the storage pool") private Long clusterId; - @SerializedName("clustername") + @SerializedName("clustername") @Param(description="the name of the cluster for the storage pool") private String clusterName; - @SerializedName("disksizetotal") + @SerializedName("disksizetotal") @Param(description="the total disk size of the storage pool") private Long diskSizeTotal; - @SerializedName("disksizeallocated") + @SerializedName("disksizeallocated") @Param(description="the host's currently allocated disk size") private Long diskSizeAllocated; - @SerializedName("tags") + @SerializedName("tags") @Param(description="the tags for the storage pool") private String tags; - @SerializedName("state") + @SerializedName("state") @Param(description="the state of the storage pool") private String state; public Long getId() { diff --git a/server/src/com/cloud/api/response/SystemVmResponse.java b/server/src/com/cloud/api/response/SystemVmResponse.java index df2079cec34..bc5e0020fb1 100644 --- a/server/src/com/cloud/api/response/SystemVmResponse.java +++ b/server/src/com/cloud/api/response/SystemVmResponse.java @@ -19,79 +19,80 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class SystemVmResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the system VM") private Long id; - @SerializedName("systemvmtype") + @SerializedName("systemvmtype") @Param(description="the system VM type") private String systemVmType; - @SerializedName("jobid") + @SerializedName("jobid") @Param(description="the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.") private Long jobId; - @SerializedName("jobstatus") + @SerializedName("jobstatus") @Param(description="the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.") private Integer jobStatus; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the Zone ID for the system VM") private Long zoneId; - @SerializedName("zonename") + @SerializedName("zonename") @Param(description="the Zone name for the system VM") private String zoneName; - @SerializedName("dns1") + @SerializedName("dns1") @Param(description="the first DNS for the system VM") private String dns1; - @SerializedName("dns2") + @SerializedName("dns2") @Param(description="the second DNS for the system VM") private String dns2; - @SerializedName("networkdomain") + @SerializedName("networkdomain") @Param(description="the network domain for the system VM") private String networkDomain; - @SerializedName("gateway") + @SerializedName("gateway") @Param(description="the gateway for the system VM") private String gateway; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the system VM") private String name; - @SerializedName("podid") + @SerializedName("podid") @Param(description="the Pod ID for the system VM") private Long podId; - @SerializedName("hostid") + @SerializedName("hostid") @Param(description="the host ID for the system VM") private Long hostId; - @SerializedName("hostname") + @SerializedName("hostname") @Param(description="the hostname for the system VM") private String hostName; - @SerializedName("privateip") + @SerializedName("privateip") @Param(description="the private IP address for the system VM") private String privateIp; - @SerializedName("privatemacaddress") + @SerializedName("privatemacaddress") @Param(description="the private MAC address for the system VM") private String privateMacAddress; - @SerializedName("privatenetmask") + @SerializedName("privatenetmask") @Param(description="the private netmask for the system VM") private String privateNetmask; - @SerializedName("publicip") + @SerializedName("publicip") @Param(description="the public IP address for the system VM") private String publicIp; - @SerializedName("publicmacaddress") + @SerializedName("publicmacaddress") @Param(description="the public MAC address for the system VM") private String publicMacAddress; - @SerializedName("publicnetmask") + @SerializedName("publicnetmask") @Param(description="the public netmask for the system VM") private String publicNetmask; - @SerializedName("templateid") + @SerializedName("templateid") @Param(description="the template ID for the system VM") private Long templateId; - @SerializedName("created") + @SerializedName("created") @Param(description="the date and time the system VM was created") private Date created; - @SerializedName("state") + @SerializedName("state") @Param(description="the state of the system VM") private String state; - - @SerializedName("activeviewersessions") + + @SerializedName("activeviewersessions") @Param(description="the number of active console sessions for the console proxy system vm") private Integer activeViewerSessions; public Long getId() { diff --git a/server/src/com/cloud/api/response/TemplatePermissionsResponse.java b/server/src/com/cloud/api/response/TemplatePermissionsResponse.java index 38eb9c16c96..9c69a4c3415 100644 --- a/server/src/com/cloud/api/response/TemplatePermissionsResponse.java +++ b/server/src/com/cloud/api/response/TemplatePermissionsResponse.java @@ -19,19 +19,20 @@ package com.cloud.api.response; import java.util.List; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class TemplatePermissionsResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the template ID") private Long id; - @SerializedName("ispublic") + @SerializedName("ispublic") @Param(description="true if this template is a public template, false otherwise") private Boolean publicTemplate; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the ID of the domain to which the template belongs") private Long domainId; - @SerializedName("account") + @SerializedName("account") @Param(description="the list of accounts the template is available for") private List accountNames; public Long getId() { diff --git a/server/src/com/cloud/api/response/TemplateResponse.java b/server/src/com/cloud/api/response/TemplateResponse.java index 8b5a21997b1..4021e9fb457 100644 --- a/server/src/com/cloud/api/response/TemplateResponse.java +++ b/server/src/com/cloud/api/response/TemplateResponse.java @@ -19,80 +19,83 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.cloud.storage.Storage.ImageFormat; import com.google.gson.annotations.SerializedName; public class TemplateResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the template ID") private long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the template name") private String name; - @SerializedName("displaytext") + @SerializedName("displaytext") @Param(description="the template display text") private String displayText; @SerializedName("ispublic") // propName="public" (FIXME: this used to be part of Param annotation, do we need it?) + @Param(description="true if this template is a public template, false otherwise") private boolean isPublic; - @SerializedName("created") + @SerializedName("created") @Param(description="the date this template was created") private Date created; - @SerializedName("removed") + @SerializedName("removed") @Param(description="the date this template was removed") private Date removed; @SerializedName("isready") // propName="ready" (FIXME: this used to be part of Param annotation, do we need it?) + @Param(description="true if the template is ready to be deployed from, false otherwise.") private boolean isReady; - @SerializedName("passwordenabled") + @SerializedName("passwordenabled") @Param(description="true if the reset password feature is enabled, false otherwise") private boolean passwordEnabled; - @SerializedName("format") + @SerializedName("format") @Param(description="the format of the template.") private ImageFormat format; - @SerializedName("bootable") + @SerializedName("bootable") @Param(description="true if the ISO is bootable, false otherwise") private boolean bootable; - @SerializedName("isfeatured") + @SerializedName("isfeatured") @Param(description="true if this template is a featured template, false otherwise") private boolean featured; - @SerializedName("crossZones") + @SerializedName("crossZones") @Param(description="true if the template is managed across all Zones, false otherwise") private boolean crossZones; - @SerializedName("ostypeid") + @SerializedName("ostypeid") @Param(description="the ID of the OS type for this template.") private Long osTypeId; - @SerializedName("ostypename") + @SerializedName("ostypename") @Param(description="the name of the OS type for this template.") private String osTypeName; - @SerializedName("accountid") + @SerializedName("accountid") @Param(description="the account id to which the template belongs") private Long accountId; - @SerializedName("account") + @SerializedName("account") @Param(description="the account name to which the template belongs") private String account; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the ID of the zone for this template") private Long zoneId; - @SerializedName("zonename") + @SerializedName("zonename") @Param(description="the name of the zone for this template") private String zoneName; - - @SerializedName("status") + + @SerializedName("status") @Param(description="the status of the template") private String status; - @SerializedName("size") + @SerializedName("size") @Param(description="the size of the template") private Long size; - @SerializedName("jobid") + @SerializedName("jobid") @Param(description="shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the template") private Long jobId; - @SerializedName("jobstatus") + @SerializedName("jobstatus") @Param(description="shows the current pending asynchronous job status") private Integer jobStatus; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the name of the domain to which the template belongs") private String domainName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the ID of the domain to which the template belongs") private long domainId; public Long getZoneId() { diff --git a/server/src/com/cloud/api/response/UpgradeVmResponse.java b/server/src/com/cloud/api/response/UpgradeVmResponse.java index e2679ab5787..fd0f7f82705 100644 --- a/server/src/com/cloud/api/response/UpgradeVmResponse.java +++ b/server/src/com/cloud/api/response/UpgradeVmResponse.java @@ -222,75 +222,75 @@ public class UpgradeVmResponse extends BaseResponse { return id; } - @SerializedName("name") + @SerializedName("name") @Param(description="the ID of the virtual machine") private String name; - @SerializedName("created") + @SerializedName("created") @Param(description="the date when this virtual machine was created") private Date created; - @SerializedName("ipaddress") + @SerializedName("ipaddress") @Param(description="the ip address of the virtual machine") private String ipAddress; - @SerializedName("state") + @SerializedName("state") @Param(description="the state of the virtual machine") private String state; - @SerializedName("account") + @SerializedName("account") @Param(description="the account associated with the virtual machine") private String account; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the ID of the domain in which the virtual machine exists") private long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the name of the domain in which the virtual machine exists") private String domain; - @SerializedName("haenable") + @SerializedName("haenable") @Param(description="true if high-availability is enabled, false otherwise") private boolean haEnable; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the ID of the availablility zone for the virtual machine") private long zoneId; - @SerializedName("displayname") + @SerializedName("displayname") @Param(description="user generated name. The name of the virtual machine is returned if no displayname exists.") private String displayName; - @SerializedName("zonename") + @SerializedName("zonename") @Param(description="the name of the availability zone for the virtual machine") private String zoneName; - @SerializedName("hostid") + @SerializedName("hostid") @Param(description="the ID of the host for the virtual machine") private long hostId; - @SerializedName("hostname") + @SerializedName("hostname") @Param(description="the name of the host for the virtual machine") private String hostName; - @SerializedName("templateid") + @SerializedName("templateid") @Param(description="the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.") private long templateId; - @SerializedName("templatename") + @SerializedName("templatename") @Param(description="the name of the template for the virtual machine") private String templateName; - @SerializedName("templatedisplaytext") + @SerializedName("templatedisplaytext") @Param(description=" an alternate display text of the template for the virtual machine") private String templateDisplayText; - @SerializedName("passwordenabled") + @SerializedName("passwordenabled") @Param(description="true if the password rest feature is enabled, false otherwise") private boolean passwordEnabled; - @SerializedName("serviceofferingid") + @SerializedName("serviceofferingid") @Param(description="the ID of the service offering of the virtual machine") private long serviceOfferingId; - @SerializedName("serviceofferingname") + @SerializedName("serviceofferingname") @Param(description="the name of the service offering of the virtual machine") private String serviceOfferingName; - @SerializedName("cpunumber") + @SerializedName("cpunumber") @Param(description="the number of cpu this virtual machine is running with") private long cpuSpeed; - @SerializedName("memory") + @SerializedName("memory") @Param(description="the memory allocated for the virtual machine") private long memory; - @SerializedName("cpuused") + @SerializedName("cpuused") @Param(description="the amount of the vm's CPU currently used") private long cpuUsed; - @SerializedName("networkkbsread") + @SerializedName("networkkbsread") @Param(description="the incoming network traffic on the vm") private long networkKbsRead; - @SerializedName("networkkbswrite") + @SerializedName("networkkbswrite") @Param(description="the outgoing network traffic on the host") private long networkKbsWrite; } diff --git a/server/src/com/cloud/api/response/UserResponse.java b/server/src/com/cloud/api/response/UserResponse.java index c1070757923..4df9802d3d5 100644 --- a/server/src/com/cloud/api/response/UserResponse.java +++ b/server/src/com/cloud/api/response/UserResponse.java @@ -19,49 +19,50 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class UserResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the user ID") private Long id; - @SerializedName("username") + @SerializedName("username") @Param(description="the user name") private String username; - @SerializedName("firstname") + @SerializedName("firstname") @Param(description="the user firstname") private String firstname; - @SerializedName("lastname") + @SerializedName("lastname") @Param(description="the user lastname") private String lastname; - @SerializedName("email") + @SerializedName("email") @Param(description="the user email address") private String email; - @SerializedName("created") + @SerializedName("created") @Param(description="the date and time the user account was created") private Date created; - @SerializedName("state") + @SerializedName("state") @Param(description="the user state") private String state; - @SerializedName("account") + @SerializedName("account") @Param(description="the account name of the user") private String accountName; - @SerializedName("accounttype") + @SerializedName("accounttype") @Param(description="the account type of the user") private Short accountType; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the domain ID of the user") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the domain name of the user") private String domainName; - @SerializedName("timezone") + @SerializedName("timezone") @Param(description="the timezone user was created in") private String timezone; - @SerializedName("apikey") + @SerializedName("apikey") @Param(description="the api key of the user") private String apiKey; - @SerializedName("secretkey") + @SerializedName("secretkey") @Param(description="the secret key of the user") private String secretKey; public Long getId() { diff --git a/server/src/com/cloud/api/response/UserVmResponse.java b/server/src/com/cloud/api/response/UserVmResponse.java index 0ef447fb499..c9bb7aa50b2 100644 --- a/server/src/com/cloud/api/response/UserVmResponse.java +++ b/server/src/com/cloud/api/response/UserVmResponse.java @@ -19,115 +19,116 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class UserVmResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the virtual machine") private Long id; - @SerializedName("name") + @SerializedName("name") @Param(description="the name of the virtual machine") private String name; - @SerializedName("displayname") + @SerializedName("displayname") @Param(description="user generated name. The name of the virtual machine is returned if no displayname exists.") private String displayName; - @SerializedName("ipaddress") + @SerializedName("ipaddress") @Param(description="the ip address of the virtual machine") private String ipAddress; - @SerializedName("account") + @SerializedName("account") @Param(description="the account associated with the virtual machine") private String accountName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the ID of the domain in which the virtual machine exists") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the name of the domain in which the virtual machine exists") private String domainName; - @SerializedName("created") + @SerializedName("created") @Param(description="the date when this virtual machine was created") private Date created; - @SerializedName("state") + @SerializedName("state") @Param(description="the state of the virtual machine") private String state; - @SerializedName("haenable") + @SerializedName("haenable") @Param(description="true if high-availability is enabled, false otherwise") private Boolean haEnable; - @SerializedName("groupid") + @SerializedName("groupid") @Param(description="the group ID of the virtual machine") private Long groupId; - @SerializedName("group") + @SerializedName("group") @Param(description="the group name of the virtual machine") private String group; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the ID of the availablility zone for the virtual machine") private Long zoneId; - @SerializedName("zonename") + @SerializedName("zonename") @Param(description="the name of the availability zone for the virtual machine") private String zoneName; - @SerializedName("hostid") + @SerializedName("hostid") @Param(description="the ID of the host for the virtual machine") private Long hostId; - @SerializedName("hostname") + @SerializedName("hostname") @Param(description="the name of the host for the virtual machine") private String hostName; - @SerializedName("templateid") + @SerializedName("templateid") @Param(description="the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.") private Long templateId; - @SerializedName("templatename") + @SerializedName("templatename") @Param(description="the name of the template for the virtual machine") private String templateName; - @SerializedName("templatedisplaytext") + @SerializedName("templatedisplaytext") @Param(description=" an alternate display text of the template for the virtual machine") private String templateDisplayText; - @SerializedName("passwordenabled") + @SerializedName("passwordenabled") @Param(description="true if the password rest feature is enabled, false otherwise") private Boolean passwordEnabled; - @SerializedName("isoid") + @SerializedName("isoid") @Param(description="the ID of the ISO attached to the virtual machine") private Long isoId; - @SerializedName("isoname") + @SerializedName("isoname") @Param(description="the name of the ISO attached to the virtual machine") private String isoName; - @SerializedName("isodisplaytext") + @SerializedName("isodisplaytext") @Param(description="an alternate display text of the ISO attached to the virtual machine") private String isoDisplayText; - @SerializedName("serviceofferingid") + @SerializedName("serviceofferingid") @Param(description="the ID of the service offering of the virtual machine") private Long serviceOfferingId; - @SerializedName("serviceofferingname") + @SerializedName("serviceofferingname") @Param(description="the name of the service offering of the virtual machine") private String serviceOfferingName; - @SerializedName("cpunumber") + @SerializedName("cpunumber") @Param(description="the number of cpu this virtual machine is running with") private Integer cpuNumber; - @SerializedName("cpuspeed") + @SerializedName("cpuspeed") @Param(description="the speed of each cpu") private Integer cpuSpeed; - @SerializedName("memory") + @SerializedName("memory") @Param(description="the memory allocated for the virtual machine") private Integer memory; - @SerializedName("cpuused") + @SerializedName("cpuused") @Param(description="the amount of the vm's CPU currently used") private String cpuUsed; - - @SerializedName("networkkbsread") + + @SerializedName("networkkbsread") @Param(description="the incoming network traffic on the vm") private Long networkKbsRead; - @SerializedName("networkkbswrite") + @SerializedName("networkkbswrite") @Param(description="the outgoing network traffic on the host") private Long networkKbsWrite; - @SerializedName("ostypeid") + @SerializedName("ostypeid") @Param(description="Os type ID of the virtual machine") private Long osTypeId; - @SerializedName("networkgrouplist") + @SerializedName("networkgrouplist") @Param(description="list of network groups associated with the virtual machine") private String networkGroupList; - @SerializedName("password") + @SerializedName("password") @Param(description="the password (if exists) of the virtual machine") private String password; - @SerializedName("jobid") + @SerializedName("jobid") @Param(description="shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the virtual machine") private Long jobId; - @SerializedName("jobstatus") + @SerializedName("jobstatus") @Param(description="shows the current pending asynchronous job status") private Integer jobStatus; public Long getId() { diff --git a/server/src/com/cloud/api/response/VlanIpRangeResponse.java b/server/src/com/cloud/api/response/VlanIpRangeResponse.java index 287190f0e81..6fe2d236119 100644 --- a/server/src/com/cloud/api/response/VlanIpRangeResponse.java +++ b/server/src/com/cloud/api/response/VlanIpRangeResponse.java @@ -17,49 +17,50 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class VlanIpRangeResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="the ID of the VLAN IP range") private Long id; - @SerializedName("forvirtualnetwork") + @SerializedName("forvirtualnetwork") @Param(description="the virtual network for the VLAN IP range") private Boolean forVirtualNetwork; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="the Zone ID of the VLAN IP range") private Long zoneId; - @SerializedName("vlan") + @SerializedName("vlan") @Param(description="the ID or VID of the VLAN.") private String vlan; - @SerializedName("account") + @SerializedName("account") @Param(description="the account of the VLAN IP range") private String accountName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the domain ID of the VLAN IP range") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the domain name of the VLAN IP range") private String domainName; - @SerializedName("podid") + @SerializedName("podid") @Param(description="the Pod ID for the VLAN IP range") private Long podId; - @SerializedName("podname") + @SerializedName("podname") @Param(description="the Pod name for the VLAN IP range") private String podName; - @SerializedName("gateway") + @SerializedName("gateway") @Param(description="the gateway of the VLAN IP range") private String gateway; - @SerializedName("netmask") + @SerializedName("netmask") @Param(description="the netmask of the VLAN IP range") private String netmask; - @SerializedName("description") + @SerializedName("description") @Param(description="the description of the VLAN IP range") private String description; - @SerializedName("startip") + @SerializedName("startip") @Param(description="the start ip of the VLAN IP range") private String startIp; - @SerializedName("endip") + @SerializedName("endip") @Param(description="the end ip of the VLAN IP range") private String endIp; public Long getId() { diff --git a/server/src/com/cloud/api/response/VolumeResponse.java b/server/src/com/cloud/api/response/VolumeResponse.java index 052f0fdf5dc..d3a5a955e1a 100644 --- a/server/src/com/cloud/api/response/VolumeResponse.java +++ b/server/src/com/cloud/api/response/VolumeResponse.java @@ -19,76 +19,77 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class VolumeResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="ID of the disk volume") private Long id; - @SerializedName("jobid") + @SerializedName("jobid") @Param(description="shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the volume") private Long jobId; - @SerializedName("jobstatus") + @SerializedName("jobstatus") @Param(description="shows the current pending asynchronous job status") private Integer jobStatus; - @SerializedName("name") + @SerializedName("name") @Param(description="name of the disk volume") private String name; - @SerializedName("zoneid") + @SerializedName("zoneid") @Param(description="ID of the availability zone") private Long zoneId; - @SerializedName("zonename") + @SerializedName("zonename") @Param(description="name of the availability zone") private String zoneName; - @SerializedName("type") + @SerializedName("type") @Param(description="type of the disk volume (ROOT or DATADISK)") private String volumeType; - @SerializedName("deviceid") + @SerializedName("deviceid") @Param(description="the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.") private Long deviceId; - @SerializedName("virtualmachineid") + @SerializedName("virtualmachineid") @Param(description="id of the virtual machine") private Long virtualMachineId; - @SerializedName("virtualmachinename") + @SerializedName("virtualmachinename") @Param(description="name of the virtual machine") private String virtualMachineName; - @SerializedName("virtualmachinedisplayname") + @SerializedName("virtualmachinedisplayname") @Param(description="display name of the virtual machine") private String virtualMachineDisplayName; - @SerializedName("virtualmachinestate") + @SerializedName("virtualmachinestate") @Param(description="state of the virtual machine") private String virtualMachineState; - @SerializedName("size") + @SerializedName("size") @Param(description="size of the disk volume") private Long size; - @SerializedName("created") + @SerializedName("created") @Param(description="the date the disk volume was created") private Date created; - @SerializedName("state") + @SerializedName("state") @Param(description="the state of the disk volume") private String state; - @SerializedName("account") + @SerializedName("account") @Param(description="the account associated with the disk volume") private String accountName; - @SerializedName("domainid") + @SerializedName("domainid") @Param(description="the ID of the domain associated with the disk volume") private Long domainId; - @SerializedName("domain") + @SerializedName("domain") @Param(description="the domain associated with the disk volume") private String domainName; - @SerializedName("storagetype") + @SerializedName("storagetype") @Param(description="shared or local storage") private String storageType; - @SerializedName("diskofferingid") + @SerializedName("diskofferingid") @Param(description="ID of the disk offering") private Long diskOfferingId; - @SerializedName("diskofferingname") + @SerializedName("diskofferingname") @Param(description="name of the disk offering") private String diskOfferingName; - @SerializedName("diskofferingdisplaytext") + @SerializedName("diskofferingdisplaytext") @Param(description="the display text of the disk offering") private String diskOfferingDisplayText; - @SerializedName("storage") + @SerializedName("storage") @Param(description="name of the primary storage hosting the disk volume") private String storagePoolName; public Long getId() { diff --git a/server/src/com/cloud/api/response/ZoneResponse.java b/server/src/com/cloud/api/response/ZoneResponse.java index 8c15b13914b..bb641b54768 100644 --- a/server/src/com/cloud/api/response/ZoneResponse.java +++ b/server/src/com/cloud/api/response/ZoneResponse.java @@ -17,36 +17,39 @@ */ package com.cloud.api.response; +import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class ZoneResponse extends BaseResponse { - @SerializedName("id") + @SerializedName("id") @Param(description="Zone id") private Long id; - @SerializedName("name") + @SerializedName("name") @Param(description="Zone name") private String name; - @SerializedName("description") + @SerializedName("description") @Param(description="Zone description") private String description; - @SerializedName("dns1") + @SerializedName("dns1") @Param(description="the first DNS for the Zone") private String dns1; - @SerializedName("dns2") + @SerializedName("dns2") @Param(description="the second DNS for the Zone") private String dns2; - @SerializedName("internaldns1") + @SerializedName("internaldns1") @Param(description="the first internal DNS for the Zone") private String internalDns1; - @SerializedName("internaldns2") + @SerializedName("internaldns2") @Param(description="the second internal DNS for the Zone") private String internalDns2; + //FIXME - add description. This parameter is called "vnet" in updateZone, and vlan in createZone - figure out which one is right. @SerializedName("vlan") private String vlan; - @SerializedName("guestcidraddress") + @SerializedName("guestcidraddress") @Param(description="the guest CIDR address for the Zone") private String guestCidrAddress; - + + //FIXME - do we need 2 parameters below at all? @SerializedName("status") private String status; diff --git a/server/src/com/cloud/server/ManagementServer.java b/server/src/com/cloud/server/ManagementServer.java index 2586943ef4c..9382043343a 100644 --- a/server/src/com/cloud/server/ManagementServer.java +++ b/server/src/com/cloud/server/ManagementServer.java @@ -66,7 +66,6 @@ import com.cloud.api.commands.ListPublicIpAddressesCmd; import com.cloud.api.commands.ListRoutersCmd; import com.cloud.api.commands.ListServiceOfferingsCmd; import com.cloud.api.commands.ListSnapshotsCmd; -import com.cloud.api.commands.ListStoragePoolsAndHostsCmd; import com.cloud.api.commands.ListStoragePoolsCmd; import com.cloud.api.commands.ListSystemVMsCmd; import com.cloud.api.commands.ListTemplateOrIsoPermissionsCmd; @@ -836,7 +835,7 @@ public interface ManagementServer { * - ownerId * - cleanup: whether or not to delete all accounts/VMs/sub-domains when deleting the domain */ - String deleteDomain(DeleteDomainCmd cmd) throws InvalidParameterValueException, PermissionDeniedException; + boolean deleteDomain(DeleteDomainCmd cmd) throws InvalidParameterValueException, PermissionDeniedException; /** * update an existing domain @@ -1138,13 +1137,6 @@ public interface ManagementServer { */ List searchForStoragePools(ListStoragePoolsCmd cmd); - /** - * List storage pools and storage hosts that match the given criteria - * @param cmd the command that wraps the search criteria (zone, pod, name, IP address, path, state) - * @return a list of storage pools and hosts that match the given criteria - */ - List searchForStoragePoolsAndHosts(ListStoragePoolsAndHostsCmd cmd); - SnapshotPolicyVO findSnapshotPolicyById(Long policyId); /** diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 748497780af..19a1c93199c 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -103,7 +103,6 @@ import com.cloud.api.commands.ListPublicIpAddressesCmd; import com.cloud.api.commands.ListRoutersCmd; import com.cloud.api.commands.ListServiceOfferingsCmd; import com.cloud.api.commands.ListSnapshotsCmd; -import com.cloud.api.commands.ListStoragePoolsAndHostsCmd; import com.cloud.api.commands.ListStoragePoolsCmd; import com.cloud.api.commands.ListSystemVMsCmd; import com.cloud.api.commands.ListTemplateOrIsoPermissionsCmd; @@ -4840,7 +4839,7 @@ public class ManagementServerImpl implements ManagementServer { } @Override - public String deleteDomain(DeleteDomainCmd cmd) throws InvalidParameterValueException, PermissionDeniedException { + public boolean deleteDomain(DeleteDomainCmd cmd) throws InvalidParameterValueException, PermissionDeniedException { Account account = (Account)UserContext.current().getAccountObject(); Long domainId = cmd.getId(); Boolean cleanup = cmd.getCleanup(); @@ -4857,12 +4856,14 @@ public class ManagementServerImpl implements ManagementServer { boolean success = cleanupDomain(domainId, ownerId); if (!success) { EventUtils.saveEvent(new Long(1), ownerId, EventVO.LEVEL_ERROR, EventTypes.EVENT_DOMAIN_DELETE, "Failed to clean up domain resources and sub domains, domain with id " + domainId + " was not deleted."); - return "Failed to clean up domain resources and sub domains, delete failed on domain " + domain.getName() + " (id: " + domainId + ")."; + s_logger.error("Failed to clean up domain resources and sub domains, delete failed on domain " + domain.getName() + " (id: " + domainId + ")."); + return false; } } else { if (!_domainDao.remove(domainId)) { EventUtils.saveEvent(new Long(1), ownerId, EventVO.LEVEL_ERROR, EventTypes.EVENT_DOMAIN_DELETE, "Domain with id " + domainId + " was not deleted"); - return "Delete failed on domain " + domain.getName() + " (id: " + domainId + "); please make sure all users and sub domains have been removed from the domain before deleting"; + s_logger.error("Delete failed on domain " + domain.getName() + " (id: " + domainId + "); please make sure all users and sub domains have been removed from the domain before deleting"); + return false; } else { EventUtils.saveEvent(new Long(1), ownerId, EventVO.LEVEL_INFO, EventTypes.EVENT_DOMAIN_DELETE, "Domain with id " + domainId + " was deleted"); } @@ -4870,12 +4871,12 @@ public class ManagementServerImpl implements ManagementServer { } else { throw new InvalidParameterValueException("Failed to delete domain nable " + domainId + ", domain not found"); } - return "success"; + return true; } catch (InvalidParameterValueException ex) { throw ex; } catch (Exception ex) { s_logger.error("Exception deleting domain with id " + domainId, ex); - return "Delete failed on domain with id " + domainId + " due to an internal server error."; + return false; } } @@ -6113,31 +6114,7 @@ public class ManagementServerImpl implements ManagementServer { return _poolDao.search(sc, searchFilter); } - @Override - public List searchForStoragePoolsAndHosts(ListStoragePoolsAndHostsCmd cmd) { - Criteria c = new Criteria("id", Boolean.TRUE, cmd.getStartIndex(), cmd.getPageSizeVal()); - c.addCriteria(Criteria.NAME, cmd.getStoragePoolName()); - c.addCriteria(Criteria.ADDRESS, cmd.getIpAddress()); - c.addCriteria(Criteria.KEYWORD, cmd.getKeyword()); - c.addCriteria(Criteria.PATH, cmd.getPath()); - c.addCriteria(Criteria.PODID, cmd.getPodId()); - c.addCriteria(Criteria.DATACENTERID, cmd.getZoneId()); - List poolsAndHosts = new ArrayList(); - List pools = searchForStoragePools(c); - if ((pools != null) && !pools.isEmpty()) { - poolsAndHosts.addAll(pools); - } - - if ((cmd.getPath() == null) && (cmd.getIpAddress() == null)) { - List hosts = searchForServers(cmd.getStartIndex(), cmd.getPageSizeVal(), cmd.getStoragePoolName(), Host.Type.Storage.toString(), cmd.getState(), cmd.getZoneId(), cmd.getPodId(), null, null, cmd.getKeyword()); - if ((hosts != null) && !hosts.isEmpty()) { - poolsAndHosts.addAll(hosts); - } - } - - return poolsAndHosts; - } @Override public List searchForStoragePoolDetails(long poolId, String value)