IWsEndUserGetAvailablePersonalTemplates Method |
Namespace: Aruba.Cloud.WsEndUser
[OperationContractAttribute] WsResult<List<PersonalTemplate>> GetAvailablePersonalTemplates()
private static string GetAvailablePersonalTemplates(WsEndUserClient client) { StringBuilder sb = new StringBuilder(); try { //calling GetAvailablePersonalTemplates, getting a WsResultOfArrayOfPersonalTemplate object as result WsResultOfArrayOfPersonalTemplate result = client.GetAvailablePersonalTemplates(); //if the call failed, throwing an exception if (result.Success) { //enumerating the result foreach (var template in result.Value) { sb.AppendLine(String.Format("TemplateID: {0}", template.TemplateID)); sb.AppendLine(String.Format("TemplateName: {0}", template.TemplateName)); sb.AppendLine(String.Format("TemplateDescription: {0}", template.TemplateDescription)); sb.AppendLine(String.Format("OSVersion: {0}", template.OSVersion)); sb.AppendLine(String.Format("TemplateStatus: {0}", template.TemplateStatus)); } } else { throw new ApplicationException(result.ResultMessage); } } catch (Exception ex) { Console.WriteLine(ex.Message); } return sb.ToString(); }
GetAvailablePersonalTemplatesResponse: { GetAvailablePersonalTemplatesResult: { ExceptionInfo: [System.String], ResultCode: 0, ResultMessage: [System.String], Success: true, Value: { PersonalTemplate: { ApplianceTypeID: [System.String], ArchitectureTypeID: 2, CompanyID: 1, DateEnd: [System.String], DateStart: 2015-06-15T16:28:09.83, Exportable: true, HypervisorType: HyperV, Icon: /*binaryImage*/, InsertDate: 2015-06-15T16:28:09.83, OSFamilyID: 5, OSVersion: w34, Revision: 1, Size: 10.00, TemplateBounds: { TemplateBound: { DefaultValue: 1, MaxValue: 8, MinValue: 1, ResourceType: Cpu, TemplateBoundID: 1230, }, TemplateBound: { DefaultValue: 1, MaxValue: 32, MinValue: 1, ResourceType: Ram, TemplateBoundID: 1231, }, TemplateBound: { DefaultValue: 10, MaxValue: 120, MinValue: 10, ResourceType: HardDisk0, TemplateBoundID: 1232, }, TemplateBound: { DefaultValue: 10, MaxValue: 500, MinValue: 10, ResourceType: HardDisk1, TemplateBoundID: 1233, }, TemplateBound: { DefaultValue: 10, MaxValue: 500, MinValue: 10, ResourceType: HardDisk2, TemplateBoundID: 1234, }, TemplateBound: { DefaultValue: 10, MaxValue: 500, MinValue: 10, ResourceType: HardDisk3, TemplateBoundID: 1235, }, }, TemplateDescription: testsa, TemplateExtendedDescription: testsa, TemplateFeatures: [System.String], TemplateID: 1197, TemplateLicenses: { TemplateLicense: { DefaultValue: 1, Description: Windows Server 2008, IsPersistent: false, LicenseMode: PerCPU, MinValue: 0, ProductID: 1, TemplateLicenseID: 16, Unit: 1, }, TemplateLicense: { DefaultValue: 4, Description: MSSQL Server 2008 Standard, IsPersistent: false, LicenseMode: PerCPU, MinValue: 0, ProductID: 2, TemplateLicenseID: 32, Unit: 2, }, }, TemplateName: Custom_Template, TemplatePassword: password, TemplateSellingStatus: NotOnSale, TemplateStatus: Active, TemplateType: Linux, TemplateUsername: userName, UserID: 1, }, }, }, }