use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListServiceOfferingsCmd method execute.
@Override
public void execute() {
List<? extends ServiceOffering> offerings = _mgr.searchForServiceOfferings(this);
ListResponse<ServiceOfferingResponse> response = new ListResponse<ServiceOfferingResponse>();
List<ServiceOfferingResponse> offeringResponses = new ArrayList<ServiceOfferingResponse>();
for (ServiceOffering offering : offerings) {
ServiceOfferingResponse offeringResponse = _responseGenerator.createServiceOfferingResponse(offering);
offeringResponse.setObjectName("serviceoffering");
offeringResponses.add(offeringResponse);
}
response.setResponses(offeringResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListSnapshotPoliciesCmd method execute.
@Override
public void execute() {
List<? extends SnapshotPolicy> result = _snapshotService.listPoliciesforVolume(this);
ListResponse<SnapshotPolicyResponse> response = new ListResponse<SnapshotPolicyResponse>();
List<SnapshotPolicyResponse> policyResponses = new ArrayList<SnapshotPolicyResponse>();
for (SnapshotPolicy policy : result) {
SnapshotPolicyResponse policyResponse = _responseGenerator.createSnapshotPolicyResponse(policy);
policyResponse.setObjectName("snapshotpolicy");
policyResponses.add(policyResponse);
}
response.setResponses(policyResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListSnapshotsCmd method execute.
@Override
public void execute() {
List<? extends Snapshot> result = _snapshotService.listSnapshots(this);
ListResponse<SnapshotResponse> response = new ListResponse<SnapshotResponse>();
List<SnapshotResponse> snapshotResponses = new ArrayList<SnapshotResponse>();
for (Snapshot snapshot : result) {
SnapshotResponse snapshotResponse = _responseGenerator.createSnapshotResponse(snapshot);
snapshotResponse.setObjectName("snapshot");
snapshotResponses.add(snapshotResponse);
}
response.setResponses(snapshotResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListLBStickinessPoliciesCmd method execute.
@Override
public void execute() {
List<LBStickinessResponse> spResponses = new ArrayList<LBStickinessResponse>();
LoadBalancer lb = _lbService.findById(getLbRuleId());
ListResponse<LBStickinessResponse> response = new ListResponse<LBStickinessResponse>();
if (lb != null) {
//check permissions
Account caller = UserContext.current().getCaller();
_accountService.checkAccess(caller, null, true, lb);
List<? extends StickinessPolicy> stickinessPolicies = _lbService.searchForLBStickinessPolicies(this);
LBStickinessResponse spResponse = _responseGenerator.createLBStickinessPolicyResponse(stickinessPolicies, lb);
spResponses.add(spResponse);
response.setResponses(spResponses);
}
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListNetworkOfferingsCmd method execute.
@Override
public void execute() {
List<? extends NetworkOffering> offerings = _configService.searchForNetworkOfferings(this);
ListResponse<NetworkOfferingResponse> response = new ListResponse<NetworkOfferingResponse>();
List<NetworkOfferingResponse> offeringResponses = new ArrayList<NetworkOfferingResponse>();
for (NetworkOffering offering : offerings) {
NetworkOfferingResponse offeringResponse = _responseGenerator.createNetworkOfferingResponse(offering);
offeringResponses.add(offeringResponse);
}
response.setResponses(offeringResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
Aggregations