use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListPublicIpAddressesCmd method execute.
@Override
public void execute() {
List<? extends IpAddress> result = _mgr.searchForIPAddresses(this);
ListResponse<IPAddressResponse> response = new ListResponse<IPAddressResponse>();
List<IPAddressResponse> ipAddrResponses = new ArrayList<IPAddressResponse>();
for (IpAddress ipAddress : result) {
IPAddressResponse ipResponse = _responseGenerator.createIPAddressResponse(ipAddress);
ipResponse.setObjectName("publicipaddress");
ipAddrResponses.add(ipResponse);
}
response.setResponses(ipAddrResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListRoutersCmd method execute.
@Override
public void execute() {
List<? extends VirtualRouter> result = _mgr.searchForRouters(this);
ListResponse<DomainRouterResponse> response = new ListResponse<DomainRouterResponse>();
List<DomainRouterResponse> routerResponses = new ArrayList<DomainRouterResponse>();
for (VirtualRouter router : result) {
DomainRouterResponse routerResponse = _responseGenerator.createDomainRouterResponse(router);
routerResponse.setObjectName("router");
routerResponses.add(routerResponse);
}
response.setResponses(routerResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListSSHKeyPairsCmd method execute.
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
public void execute() {
List<? extends SSHKeyPair> resultList = _mgr.listSSHKeyPairs(this);
List<SSHKeyPairResponse> responses = new ArrayList<SSHKeyPairResponse>();
for (SSHKeyPair result : resultList) {
SSHKeyPairResponse r = new SSHKeyPairResponse(result.getName(), result.getFingerprint());
r.setObjectName("sshkeypair");
responses.add(r);
}
ListResponse<SSHKeyPairResponse> response = new ListResponse<SSHKeyPairResponse>();
response.setResponses(responses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
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);
}
Aggregations