IJsonPostWsEndUserGetHypervisors Method |
Namespace: Aruba.Cloud.WsEndUser
[OperationContractAttribute] [WebInvokeAttribute(Method = "POST", ResponseFormat = WebMessageFormat.Json)] Stream GetHypervisors( JsonRequest request )
Then you remove the list of available templates for each object class hypervisor. This list of templates being cycled so as to extract, for each template, the name (Name property) and type (property TemplateType).
// Returns a string that displays the available hypervisor and templates installed for each hypervisor private String GetAvailableHypervisor() { StringBuilder sb = new StringBuilder(); try { WsResultOfArrayOfHypervisor result = client.GetHypervisors(); if (result.Success) { foreach (Hypervisor hv in result.Value) { sb.AppendLine(String.Format("Hypervisor type: {0}, server type: ", hv.HypervisorType, hv.HypervisorServerType)); foreach (TemplateDetails tmpl in hv.Templates) { //vengono memorizzate le informazioni relative al template sb.AppendLine(String.Format("Template name: {0}, type: {1}", tmpl.Name, tmpl.TemplateType)); } } } else { throw new ApplicationException( String.Format("An error has occurred while invoking GetHypervisors(). This is the inner exception: {0}", result.ResultMessage)); } } catch (Exception ex) { throw new ApplicationException(String.Format( "An error has occurred while getting the list of available hypervisors {0}", ex.Message)); } return sb.ToString(); }