Click or drag to resize

IWsEndUserGetVirtualDatacenter Method

Return detail informations of virtual datacenter. VirtualDatacenter class contain information account's datacenter. VirtualDatacenter has this elements:
Lists exposed
object list of IPAddress class
object list of VLan class
ServerDetail list

Namespace:  Aruba.Cloud.WsEndUser
Assembly:  Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<VirtualDatacenter> GetVirtualDatacenter()

Return Value

Type: WsResultVirtualDatacenter
WsResultOfVirtualDatacenter contain data center information of authenticated user. For more information consult WsResult class and VirtualDatacenterCost class.
Examples
        //IWsEndUser.GetVirtualDatacenter Method (c# .NET)
public static String GetVirtualDataCenterDetails(WsEndUserClient client)
{
    StringBuilder sb = new StringBuilder();

    try
    {
        //calls the GetVirtualDatacentermethod,
        //getting a WsResultOfVirtualDatacenter object 
        WsResultOfVirtualDatacenter result = client.GetVirtualDatacenter();

        if (result.Success)
        {
            //get running server list
            IEnumerable serverAttivi = result.Value.Servers
                .Where(p => p.ServerStatus == ServerStatus.Running);

            foreach (ServerDetails serverDtl in serverAttivi)
            {

                sb.AppendLine(String.Format("{0}: {1} GB RAM - {2} CPU",
                    serverDtl.Name,
                    serverDtl.RAMQuantity.Quantity,
                    serverDtl.CPUQuantity.Quantity));
            }
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //relaunches the generic error 
        throw new ApplicationException(ex.Message);
    }

    return sb.ToString();
}
The method can be called using the following notation:
https://api.dc1.computing.cloud.it/wsenduser/v1.3/jsonp/GetVirtualDatacenter/ArubaCloud.Response.Virtualdatacenter.call/ARU-0000/af519033-2d8e-4aa2-9aef-3a1d1d13f24a

The following is an example of the response body.

ArubaCloud.Response.virtualdatacenter.call({
  "ExceptionInfo": null,
  "ResultCode": 0,
  "ResultMessage": null,
  "Success": true,
  "Value": {
    "DatacenterId": 1,
    "IpAddresses": [
      {
        "CompanyId": 1,
        "ProductId": 20,
        "ResourceId": 4532,
        "ResourceType": 6,
        "UserId": 267,
        "Gateway": "95.110.152.1",
        "ServerId": null,
        "SubNetMask": "255.255.255.0",
        "Value": "95.110.152.86"
      },
      {
        "CompanyId": 1,
        "ProductId": 20,
        "ResourceId": 4538,
        "ResourceType": 6,
        "UserId": 267,
        "Gateway": "95.110.152.1",
        "ServerId": null,
        "SubNetMask": "255.255.255.0",
        "Value": "95.110.152.73"
      },
      {
        "CompanyId": 1,
        "ProductId": 20,
        "ResourceId": 4565,
        "ResourceType": 6,
        "UserId": 267,
        "Gateway": "95.110.152.1",
        "ServerId": null,
        "SubNetMask": "255.255.255.0",
        "Value": "95.110.152.106"
      },
      {
        "CompanyId": 1,
        "ProductId": 20,
        "ResourceId": 4745,
        "ResourceType": 6,
        "UserId": 267,
        "Gateway": "95.110.152.1",
        "ServerId": null,
        "SubNetMask": "255.255.255.0",
        "Value": "95.110.152.112"
      },
      {
        "CompanyId": 1,
        "ProductId": 20,
        "ResourceId": 4760,
        "ResourceType": 6,
        "UserId": 267,
        "Gateway": "95.110.152.1",
        "ServerId": null,
        "SubNetMask": "255.255.255.0",
        "Value": "95.110.152.116"
      },
      {
        "CompanyId": 1,
        "ProductId": 20,
        "ResourceId": 4761,
        "ResourceType": 6,
        "UserId": 267,
        "Gateway": "95.110.152.1",
        "ServerId": null,
        "SubNetMask": "255.255.255.0",
        "Value": "95.110.152.118"
      }
    ],
    "Servers": [
      {
        "ActiveJobs": [

        ],
        "CPUQuantity": {
          "CompanyId": 1,
          "ProductId": 1,
          "ResourceId": 3659,
          "ResourceType": 2,
          "UserId": 267,
          "Quantity": 0
        },
        "CompanyId": 1,
        "CreationDate": "\/Date(1321980777707+0100)\/",
        "DatacenterId": 1,
        "HypervisorServerType": 1,
        "HypervisorType": 1,
        "Name": "asdfa",
        "NetworkAdapters": [
          {
            "IPAddresses": [

            ],
            "Id": 2361,
            "MacAddress": "00:15:5D:03:02:93",
            "NetworkAdapterType": 0,
            "ServerId": 787,
            "VLan": null
          },
          {
            "IPAddresses": [

            ],
            "Id": 2362,
            "MacAddress": "00:15:5D:03:02:94",
            "NetworkAdapterType": 1,
            "ServerId": 787,
            "VLan": null
          },
          {
            "IPAddresses": [

            ],
            "Id": 2363,
            "MacAddress": "00:15:5D:03:02:95",
            "NetworkAdapterType": 2,
            "ServerId": 787,
            "VLan": null
          }
        ],
        "Note": "notee",
        "OSTemplate": {
          "CompanyId": 1,
          "ProductId": 12,
          "ResourceId": 3662,
          "ResourceType": 4,
          "UserId": 267,
          "Description": "Custom Template HyperV",
          "Id": 23,
          "Name": "Custom_Template"
        },
        "Parameters": [
          {
            "Key": 0,
            "Value": "10.111.3.2"
          },
          {
            "Key": 2,
            "Value": "b991932c-8247-446d-9589-a61e03043e1f"
          }
        ],
        "RAMQuantity": {
          "CompanyId": 1,
          "ProductId": 2,
          "ResourceId": 3660,
          "ResourceType": 1,
          "UserId": 267,
          "Quantity": 0
        },
        "ServerId": 787,
        "ServerStatus": 4,
        "Snapshots": [

        ],
        "ToolsAvailable": true,
        "UserId": 267,
        "VirtualDVDs": [

        ],
        "VirtualDisks": [
          {
            "CompanyId": 1,
            "ProductId": 3,
            "ResourceId": 3661,
            "ResourceType": 3,
            "UserId": 267,
            "CreationDate": "\/Date(1321980777707+0100)\/",
            "Size": 10
          },
          {
            "CompanyId": 1,
            "ProductId": 13,
            "ResourceId": 3857,
            "ResourceType": 7,
            "UserId": 267,
            "CreationDate": "\/Date(1321980777707+0100)\/",
            "Size": 10
          },
          {
            "CompanyId": 1,
            "ProductId": 14,
            "ResourceId": 3858,
            "ResourceType": 8,
            "UserId": 267,
            "CreationDate": "\/Date(1321980777707+0100)\/",
            "Size": 10
          },
          {
            "CompanyId": 1,
            "ProductId": 15,
            "ResourceId": 3859,
            "ResourceType": 9,
            "UserId": 267,
            "CreationDate": "\/Date(1321980777707+0100)\/",
            "Size": 10
          }
        ]
      },
      {
        "ActiveJobs": [

        ],
        "CPUQuantity": {
          "CompanyId": 1,
          "ProductId": 4,
          "ResourceId": 3949,
          "ResourceType": 2,
          "UserId": 267,
          "Quantity": 0
        },
        "CompanyId": 1,
        "CreationDate": "\/Date(1322759976467+0100)\/",
        "DatacenterId": 1,
        "HypervisorServerType": 2,
        "HypervisorType": 2,
        "Name": "Aruba",
        "NetworkAdapters": [
          {
            "IPAddresses": [

            ],
            "Id": 2475,
            "MacAddress": "00:5f:d6:b6:2c:38",
            "NetworkAdapterType": 0,
            "ServerId": 825,
            "VLan": null
          },
          {
            "IPAddresses": [

            ],
            "Id": 2476,
            "MacAddress": "00:f0:c6:b6:2c:39",
            "NetworkAdapterType": 1,
            "ServerId": 825,
            "VLan": null
          },
          {
            "IPAddresses": [

            ],
            "Id": 2477,
            "MacAddress": "00:50:56:b6:2c:3a",
            "NetworkAdapterType": 2,
            "ServerId": 825,
            "VLan": null
          }
        ],
        "Note": null,
        "OSTemplate": {
          "CompanyId": 1,
          "ProductId": 7,
          "ResourceId": 3952,
          "ResourceType": 4,
          "UserId": 267,
          "Description": "Windows Server 2008 R2",
          "Id": 4,
          "Name": "W2K8R2_x64_1_2"
        },
        "Parameters": [
          {
            "Key": 0,
            "Value": "10.101.5.21"
          },
          {
            "Key": 1,
            "Value": "10.101.2.33"
          },
          {
            "Key": 2,
            "Value": "503646e6-f899-22f2-03ef-c4acc581b289"
          },
          {
            "Key": 3,
            "Value": "vm-693"
          }
        ],
        "RAMQuantity": {
          "CompanyId": 1,
          "ProductId": 5,
          "ResourceId": 3950,
          "ResourceType": 1,
          "UserId": 267,
          "Quantity": 0
        },
        "ServerId": 825,
        "ServerStatus": 4,
        "Snapshots": [

        ],
        "ToolsAvailable": true,
        "UserId": 267,
        "VirtualDVDs": [

        ],
        "VirtualDisks": [
          {
            "CompanyId": 1,
            "ProductId": 6,
            "ResourceId": 3951,
            "ResourceType": 3,
            "UserId": 267,
            "CreationDate": "\/Date(1322759976467+0100)\/",
            "Size": 30
          }
        ]
      },
      {
        "ActiveJobs": [

        ],
        "CPUQuantity": {
          "CompanyId": 1,
          "ProductId": 4,
          "ResourceId": 4278,
          "ResourceType": 2,
          "UserId": 267,
          "Quantity": 1
        },
        "CompanyId": 1,
        "CreationDate": "\/Date(1324484829247+0100)\/",
        "DatacenterId": 1,
        "HypervisorServerType": 2,
        "HypervisorType": 2,
        "Name": "TestLinux",
        "NetworkAdapters": [
          {
            "IPAddresses": [

            ],
            "Id": 2577,
            "MacAddress": "00:5c:5f:16:12:79",
            "NetworkAdapterType": 0,
            "ServerId": 859,
            "VLan": null
          },
          {
            "IPAddresses": [

            ],
            "Id": 2578,
            "MacAddress": "00:50:56:b6:12:7a",
            "NetworkAdapterType": 1,
            "ServerId": 859,
            "VLan": null
          },
          {
            "IPAddresses": [

            ],
            "Id": 2579,
            "MacAddress": "00:44:6c:b6:12:7b",
            "NetworkAdapterType": 2,
            "ServerId": 859,
            "VLan": null
          }
        ],
        "Note": null,
        "OSTemplate": {
          "CompanyId": 1,
          "ProductId": 21,
          "ResourceId": 4281,
          "ResourceType": 4,
          "UserId": 267,
          "Description": "Linux Centos 5.7 32bit",
          "Id": 6,
          "Name": "Centos57_x32_2_0"
        },
        "Parameters": [
          {
            "Key": 0,
            "Value": "10.111.5.1"
          },
          {
            "Key": 1,
            "Value": "10.111.2.3"
          },
          {
            "Key": 2,
            "Value": "50362b7d-9218-0eab-441a-90652d220bad"
          },
          {
            "Key": 3,
            "Value": "vm-762"
          }
        ],
        "RAMQuantity": {
          "CompanyId": 1,
          "ProductId": 5,
          "ResourceId": 4279,
          "ResourceType": 1,
          "UserId": 267,
          "Quantity": 1
        },
        "ServerId": 859,
        "ServerStatus": 3,
        "Snapshots": [
          {
            "CreationDate": "\/Date(1326460764117+0100)\/",
            "ExpirationDate": null,
            "Status": 2
          }
        ],
        "ToolsAvailable": true,
        "UserId": 267,
        "VirtualDVDs": [
          {
            "MountDate": "\/Date(1327446000000+0100)\/",
            "Name": "pippo.iso"
          }
        ],
        "VirtualDisks": [
          {
            "CompanyId": 1,
            "ProductId": 6,
            "ResourceId": 4280,
            "ResourceType": 3,
            "UserId": 267,
            "CreationDate": "\/Date(1324484829247+0100)\/",
            "Size": 10
          }
        ]
      }
    ],
    "VLans": [
      {
        "CompanyId": 1,
        "ProductId": 19,
        "ResourceId": 2647,
        "ResourceType": 5,
        "UserId": 267,
        "Name": "Switch01",
        "ServerIds": [],
        "VlanCode": "3002"
      },
      {
        "CompanyId": 1,
        "ProductId": 19,
        "ResourceId": 3181,
        "ResourceType": 5,
        "UserId": 267,
        "Name": "internalVLan",
        "ServerIds": [],
        "VlanCode": "3003"
      },
      {
        "CompanyId": 1,
        "ProductId": 19,
        "ResourceId": 3398,
        "ResourceType": 5,
        "UserId": 267,
        "Name": "VLAn01",
        "ServerIds": [],
        "VlanCode": "3006"
      }
    ]
  }
})
See Also