Search in sources :

Example 6 with VpcOffering

use of com.cloud.network.vpc.VpcOffering in project cloudstack by apache.

the class ListVPCOfferingsCmd method execute.

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
public void execute() {
    Pair<List<? extends VpcOffering>, Integer> offerings = _vpcProvSvc.listVpcOfferings(getId(), getVpcOffName(), getDisplayText(), getSupportedServices(), isDefault, this.getKeyword(), getState(), this.getStartIndex(), this.getPageSizeVal());
    ListResponse<VpcOfferingResponse> response = new ListResponse<VpcOfferingResponse>();
    List<VpcOfferingResponse> offeringResponses = new ArrayList<VpcOfferingResponse>();
    for (VpcOffering offering : offerings.first()) {
        VpcOfferingResponse offeringResponse = _responseGenerator.createVpcOfferingResponse(offering);
        offeringResponses.add(offeringResponse);
    }
    response.setResponses(offeringResponses, offerings.second());
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
}
Also used : VpcOfferingResponse(org.apache.cloudstack.api.response.VpcOfferingResponse) ListResponse(org.apache.cloudstack.api.response.ListResponse) VpcOffering(com.cloud.network.vpc.VpcOffering) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList)

Aggregations

VpcOffering (com.cloud.network.vpc.VpcOffering)6 ArrayList (java.util.ArrayList)3 ServerApiException (org.apache.cloudstack.api.ServerApiException)3 VpcOfferingResponse (org.apache.cloudstack.api.response.VpcOfferingResponse)3 HashMap (java.util.HashMap)2 List (java.util.List)2 DataCenter (com.cloud.dc.DataCenter)1 Network (com.cloud.network.Network)1 Provider (com.cloud.network.Network.Provider)1 Service (com.cloud.network.Network.Service)1 OvsProvider (com.cloud.network.OvsProvider)1 PhysicalNetwork (com.cloud.network.PhysicalNetwork)1 PhysicalNetworkServiceProvider (com.cloud.network.PhysicalNetworkServiceProvider)1 VirtualRouterProvider (com.cloud.network.VirtualRouterProvider)1 VpcOfferingVO (com.cloud.network.vpc.VpcOfferingVO)1 ResourceTag (com.cloud.server.ResourceTag)1 ImmutableList (com.google.common.collect.ImmutableList)1 EnumSet (java.util.EnumSet)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1