Click or drag to resize

IJsonpWsEndUserGetCustomVirtualDisks Method

Get a list of VirtualDisk imported. By the method GetCustomVirtualDisks() of Aruba WsEndUser, it is possible to obtain a CustomVirtualDisk list of class objects that represent virtual disks imported in the ftp to the user specified in the authentication phase. And 'possible to filter the hypervisor for virtual disks, using a member of the HyperVisorType, or obtain a list is not filtered, using HyperVisorType.All

Namespace:  Aruba.Cloud.WsEndUser
Assembly:  Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
[WebGetAttribute(ResponseFormat = WebMessageFormat.Json, UriTemplate = "GetCustomVirtualDisks/{jsonp}/{userName}/{token}/{hypervisorType}")]
Stream GetCustomVirtualDisks(
	string jsonp,
	string userName,
	string token,
	string hypervisorType
)

Parameters

jsonp
Type: SystemString
userName
Type: SystemString
token
Type: SystemString
hypervisorType
Type: SystemString

Return Value

Type: Stream
The method returns an object WsResult<CustomVirtualDisk[]> containing the information on the virtual disk imported.
Examples
The following example describes a method, called TestGetCustomVirtualDisks(), which means a call to GetCustomVirtualDisks() to Aruba WsEndUser, get a list of imported virtual disks to be connected to the virtual servers.
private List<String> TestGetCustomVirtualDisk(WsEndUserClient client)
{
  List<String> recentCustomVirtualDisk = new List<String>() ;

  try
  {
    WsResultOfArrayOfCustomVirtualDisk  result = client.GetCustomVirtualDisks(HypervisorTypes.All)  ;

    if (result.Success)
    {
      IEnumerable<CustomVirtualDisk> listOfRecentCustomVirtualDisk = result.Value.Where(p => p.CreationDate > new DateTime(2012, 01, 13));

      foreach (CustomVirtualDisk cvd in listOfRecentCustomVirtualDisk)
      {
      //aggiunge alla lista il path del disco virtuale
      recentCustomVirtualDisk.Add(cvd.RelativePathFile);
      }
    }
  }
  catch (Exception ex)
  {
    throw new ApplicationException(String.Format(
      "An error has occurred while obtaining custom virtual disks information. {0}", ex.Message));
  }

  return recentCustomVirtualDisk;
}
See Also