IJsonPostWsEndUserGetJobs Method
|
Get a list of Job and income associated with the account indicated. By the method GetJobs () of Aruba WsEndUser,
you can get a list of objects of class Job representing the operations currently in the Running state
and Waiting and going to work on the different resources in the datacenter.
Namespace:
Aruba.Cloud.WsEndUser
Assembly:
Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax[OperationContractAttribute]
[WebInvokeAttribute(Method = "POST", ResponseFormat = WebMessageFormat.Json)]
Stream GetJobs(
JsonRequest request
)
<OperationContractAttribute>
<WebInvokeAttribute(Method := "POST", ResponseFormat := WebMessageFormat.Json)>
Function GetJobs (
request As JsonRequest
) As Stream
[OperationContractAttribute]
[WebInvokeAttribute(Method = L"POST", ResponseFormat = WebMessageFormat::Json)]
Stream^ GetJobs(
JsonRequest^ request
)
[<OperationContractAttribute>]
[<WebInvokeAttribute(Method = "POST", ResponseFormat = WebMessageFormat.Json)>]
abstract GetJobs :
request : JsonRequest -> Stream
function GetJobs(
request : JsonRequest
) : Stream
Parameters
- request
- Type: Aruba.Cloud.WsEndUser.JsonJsonRequest
Return Value
Type:
Stream
The method returns an object WsResult<Job[]> containing information on the Job in the Running state or Wainting.
For further details on the information returned by the method see the class definition
Examplesprivate String TestGetJobs(WsEndUserClient client)
{
String lastJob = String.Empty;
try
{
WsResultOfArrayOfJob result = client.GetJobs();
if (result.Success)
{
Job job = result.Value.Where(p => p.ServerId == 1001).OrderByDescending(p=>p.CreationDate).FirstOrDefault();
StringBuilder sb = new StringBuilder();
sb.AppendLine("Creation date" + job.CreationDate.ToString ());
sb.AppendLine ("Id: " + job.JobId.ToString ());
sb.AppendLine ("Progress: " + job.Progress.ToString ());
lastJob = sb.ToString();
}
}
catch (Exception ex)
{
throw new ApplicationException(
String.Format("An error has occurred while active or running Jobs. {0}", ex.Message));
}
return lastJob;
}
See Also