IJsonpWsEndUserGetJobs 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]
[WebGetAttribute(ResponseFormat = WebMessageFormat.Json, UriTemplate = "GetJobs/{jsonp}/{userName}/{token}")]
Stream GetJobs(
string jsonp,
string userName,
string token
)<OperationContractAttribute>
<WebGetAttribute(ResponseFormat := WebMessageFormat.Json, UriTemplate := "GetJobs/{jsonp}/{userName}/{token}")>
Function GetJobs (
jsonp As String,
userName As String,
token As String
) As Stream[OperationContractAttribute]
[WebGetAttribute(ResponseFormat = WebMessageFormat::Json, UriTemplate = L"GetJobs/{jsonp}/{userName}/{token}")]
Stream^ GetJobs(
String^ jsonp,
String^ userName,
String^ token
)[<OperationContractAttribute>]
[<WebGetAttribute(ResponseFormat = WebMessageFormat.Json, UriTemplate = "GetJobs/{jsonp}/{userName}/{token}")>]
abstract GetJobs :
jsonp : string *
userName : string *
token : string -> Stream
function GetJobs(
jsonp : String,
userName : String,
token : String
) : Stream
Parameters
- jsonp
- Type: SystemString
- userName
- Type: SystemString
- token
- Type: SystemString
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