mirror of https://github.com/apache/cloudstack.git
api: Fix response object for various APIs (#5573)
This commit is contained in:
parent
6b757d502e
commit
e73445e5d5
|
|
@ -32,10 +32,9 @@ import org.apache.cloudstack.api.response.ListResponse;
|
|||
import org.apache.cloudstack.api.response.ProjectResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectRolePermissionResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectRoleResponse;
|
||||
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
|
||||
@APICommand(name = ListProjectRolePermissionsCmd.APINAME, description = "Lists a project's project role permissions", responseObject = SuccessResponse.class,
|
||||
@APICommand(name = ListProjectRolePermissionsCmd.APINAME, description = "Lists a project's project role permissions", responseObject = ProjectRolePermissionResponse.class,
|
||||
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, authorized = {
|
||||
RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User}, since = "4.15.0")
|
||||
public class ListProjectRolePermissionsCmd extends BaseCmd {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import org.apache.cloudstack.api.BaseCmd;
|
|||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.response.BackupOfferingResponse;
|
||||
import org.apache.cloudstack.api.response.BackupResponse;
|
||||
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||
import org.apache.cloudstack.backup.BackupManager;
|
||||
|
|
@ -43,7 +42,7 @@ import com.cloud.exception.ResourceUnavailableException;
|
|||
|
||||
@APICommand(name = AssignVirtualMachineToBackupOfferingCmd.APINAME,
|
||||
description = "Assigns a VM to a backup offering",
|
||||
responseObject = BackupResponse.class, since = "4.14.0",
|
||||
responseObject = SuccessResponse.class, since = "4.14.0",
|
||||
authorized = {RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User})
|
||||
public class AssignVirtualMachineToBackupOfferingCmd extends BaseAsyncCmd {
|
||||
public static final String APINAME = "assignVirtualMachineToBackupOffering";
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ import org.apache.cloudstack.api.ResponseObject.ResponseView;
|
|||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.command.user.UserCmd;
|
||||
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
|
||||
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||
|
||||
import com.cloud.event.EventTypes;
|
||||
|
|
@ -50,7 +49,7 @@ import com.cloud.uservm.UserVm;
|
|||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
|
||||
@APICommand(name = "scaleVirtualMachine", description = "Scales the virtual machine to a new service offering.", responseObject = SuccessResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
|
||||
@APICommand(name = "scaleVirtualMachine", description = "Scales the virtual machine to a new service offering.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
|
||||
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
|
||||
public class ScaleVMCmd extends BaseAsyncCmd implements UserCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ScaleVMCmd.class.getName());
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import com.cloud.exception.ResourceUnavailableException;
|
|||
import com.cloud.network.vpc.Vpc;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@APICommand(name = "restartVPC", description = "Restarts a VPC", responseObject = VpcResponse.class, entityType = {Vpc.class},
|
||||
@APICommand(name = "restartVPC", description = "Restarts a VPC", responseObject = SuccessResponse.class, entityType = {Vpc.class},
|
||||
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
|
||||
public class RestartVPCCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(RestartVPCCmd.class.getName());
|
||||
|
|
|
|||
|
|
@ -96,6 +96,8 @@ public class DeleteRemoteAccessVpnCmd extends BaseAsyncCmd {
|
|||
if (! _ravService.destroyRemoteAccessVpnForIp(publicIpId, CallContext.current().getCallingAccount(), false)) {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete remote access vpn");
|
||||
}
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import org.apache.cloudstack.api.BaseCmd;
|
|||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.response.AccountResponse;
|
||||
import org.apache.cloudstack.api.response.ApiLimitResponse;
|
||||
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
||||
|
|
@ -37,7 +36,7 @@ import org.apache.cloudstack.ratelimit.ApiRateLimitService;
|
|||
import com.cloud.configuration.Config;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@APICommand(name = "resetApiLimit", responseObject = ApiLimitResponse.class, description = "Reset api count",
|
||||
@APICommand(name = "resetApiLimit", responseObject = SuccessResponse.class, description = "Reset api count",
|
||||
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
|
||||
public class ResetApiLimitCmd extends BaseCmd {
|
||||
private static final Logger s_logger = Logger.getLogger(ResetApiLimitCmd.class.getName());
|
||||
|
|
|
|||
Loading…
Reference in New Issue