Search in sources :

Example 1 with IsolationMethodResponse

use of org.apache.cloudstack.api.response.IsolationMethodResponse in project cloudstack by apache.

the class ListNetworkIsolationMethodsCmd method execute.

@Override
public void execute() {
    Networks.IsolationType[] methods = _ntwkModel.listNetworkIsolationMethods();
    ListResponse<IsolationMethodResponse> response = new ListResponse<IsolationMethodResponse>();
    List<IsolationMethodResponse> isolationResponses = new ArrayList<IsolationMethodResponse>();
    if (methods != null) {
        for (Networks.IsolationType method : methods) {
            IsolationMethodResponse isolationMethod = _responseGenerator.createIsolationMethodResponse(method);
            isolationResponses.add(isolationMethod);
        }
    }
    response.setResponses(isolationResponses, isolationResponses.size());
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
}
Also used : IsolationMethodResponse(org.apache.cloudstack.api.response.IsolationMethodResponse) Networks(com.cloud.network.Networks) ListResponse(org.apache.cloudstack.api.response.ListResponse) ArrayList(java.util.ArrayList)

Example 2 with IsolationMethodResponse

use of org.apache.cloudstack.api.response.IsolationMethodResponse in project cloudstack by apache.

the class ApiResponseHelper method createIsolationMethodResponse.

@Override
public IsolationMethodResponse createIsolationMethodResponse(IsolationType method) {
    IsolationMethodResponse response = new IsolationMethodResponse();
    response.setIsolationMethodName(method.toString());
    response.setObjectName("isolationmethod");
    return response;
}
Also used : IsolationMethodResponse(org.apache.cloudstack.api.response.IsolationMethodResponse)

Aggregations

IsolationMethodResponse (org.apache.cloudstack.api.response.IsolationMethodResponse)2 Networks (com.cloud.network.Networks)1 ArrayList (java.util.ArrayList)1 ListResponse (org.apache.cloudstack.api.response.ListResponse)1