Show / Hide Table of Contents

Class GlaaSJob


GlaaSJob objects represent jobs that have been submitted by C4.

Fundamental operations like job submissions, terminations, and monitoring are included in this class.

Note that most operations, from submitting a job to getting a job's Status, may take a long time or
throw an exception, because the C4 server is queried.

Constructors

GlaaSJob(Int32, String)


Creates a new GlaaSJob object, representing a job that has already been submitted to GlaaS.

Note: This operation may wait a long time or throw an exception if the connection to the web server is poor.

Parameters
System.Int32 Id

The ID of the GlaaSJob to create.

System.String FarmName

The name of the farm that the GlaaS job exists on.

Examples

Language: VB.NET

Dim MyJob As New GlaaSJob (11, "TestFarm")

Language: C#

GlaaSJob MyJob = new GlaaSJob (11, "TestFarm");
Exceptions
System.InvalidOperationException

Thrown when the function cannot be completed, including if the specified job or farm does not exist or connecting to GlaaS fails.

Properties

AXISVersion


The AXIS version of the dataset used.

Property Value
System.Int32

BatchId


The ID of the batch used in this run.

Property Value
System.Int32

BatchName


The name of the batch used in this run.

Property Value
System.String

Cores


The number of cores used.

Property Value
System.Int32

DatasetName


The name of the dataset used.

Property Value
System.String

DatasetPath


The physical path to the workfolder of the dataset used.

Property Value
System.String

DataSizeAsUploaded


The size of the data uploaded in bytes.

Property Value
System.Int64

DataStatus


The data status of a GlaaS job.

Property Value
DataStatus

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
' ...
App.LogMsg (App.LOG.INFO, "Data status", MyJob.DataStatus.ToString ())

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
// ...
App.LogMsg (App.LOG.INFO, "Data status", MyJob.DataStatus.ToString ());

FarmId


The ID of the farm used for the run.

Property Value
System.Int32

FarmName


The name of the farm used for the run.

Property Value
System.String

FarmStatus


The farm status of a GlaaS job.

Property Value
FarmStatus

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
' ...
App.LogMsg (App.LOG.INFO, "Farm status", MyJob.FarmStatus.ToString ())

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
// ...
App.LogMsg (App.LOG.INFO, "Farm status", MyJob.FarmStatus.ToString ());

Id


The job ID in GlaaS.

Property Value
System.Int32

IsBookFarm


True if and only if this GlaaSJob represents a booked farm.

Property Value
System.Boolean

IsFailure


True if and only if GlaaSJob has finished unsuccessfully.
"Finished unsuccessfully" means these job statuses: Terminated, Failed, Cancelled, Invalid.

Property Value
System.Boolean

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)

MyJob.WaitForFinish ()

If MyJob.IsFailure Then
    App.LogMsg (App.LOG.ERROR, "MyJob failed", MyJob.Status.ToString ());
End If

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);

MyJob.WaitForFinish ();

if (MyJob.IsFailure)
    App.LogMsg (App.LOG.ERROR, "MyJob failed", MyJob.Status.ToString ());

IsFinished


True if and only if GlaaSJob is finished.
"Finished" means these job statuses: Done, Terminated, Failed, Cancelled, Invalid.

Property Value
System.Boolean

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)

While Not MyJob.IsFinished
    Thread.Sleep (1000)
End While

If MyJob.IsSuccess Then
    App.LogMsg (App.LOG.INFO, "MyJob.Status", MyJob.Status.ToString ())
    MyJob.SyncDataset ()
End If

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);

while (!MyJob.IsFinished)
{
    App.LogMsg (App.LOG.INFO, "MyJob.Status", MyJob.Status.ToString ());
    Thread.Sleep (1000);
}

if (MyJob.IsSuccess)
    MyJob.SyncDataset ();

IsSuccess


True if and only if GlaaSJob.State == GlaaS.JobStatus.Done.

Property Value
System.Boolean

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)

MyJob.WaitForFinish ()

If MyJob.IsSuccess Then
    App.LogMsg (App.LOG.INFO, "MyJob.Status", MyJob.Status.ToString ())
    MyJob.SyncDataset ()
End If

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);

MyJob.WaitForFinish ();

while (!MyJob.IsFinished)
{
    App.LogMsg (App.LOG.INFO, "MyJob.Status", MyJob.Status.ToString ());
    Thread.Sleep (1000);
}

if (MyJob.IsSuccess)
    MyJob.SyncDataset ();

IsSyncingDataset


True if and only if this GlaaSJob is in the process of synchronizing its associated dataset.

Property Value
System.Boolean

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()

App.LogMsg (App.LOG.INFO, "IsSyncingDataset", MyJob.IsSyncingDataset.ToString ())  ' logs false
MyJob.SyncDataset ()
App.LogMsg (App.LOG.INFO, "IsSyncingDataset", MyJob.IsSyncingDataset.ToString ())  ' logs true
MyJob.WaitForSyncDatasetFinish ()
App.LogMsg (App.LOG.INFO, "IsSyncingDataset", MyJob.IsSyncingDataset.ToString ())  ' logs false

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();

App.LogMsg (App.LOG.INFO, "IsSyncingDataset", MyJob.IsSyncingDataset.ToString ());  // logs false
MyJob.SyncDataset ();
App.LogMsg (App.LOG.INFO, "IsSyncingDataset", MyJob.IsSyncingDataset.ToString ());  // logs true
MyJob.WaitForSyncDatasetFinish ();
App.LogMsg (App.LOG.INFO, "IsSyncingDataset", MyJob.IsSyncingDataset.ToString ());  // logs false

IsSyncingJobInfo


True if and only if this GlaaSJob is in the process of synchronizing its associated job information.

Property Value
System.Boolean

IsSyncingSqlOutput


True if and only if this GlaaSJob is in the process of synchronizing its SQL output data.

Property Value
System.Boolean

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()

App.LogMsg (App.LOG.INFO, "IsSyncingSqlOutput", MyJob.IsSyncingSqlOutput.ToString ())  ' logs false
MyJob.SyncSqlOutput ()
App.LogMsg (App.LOG.INFO, "IsSyncingSqlOutput", MyJob.IsSyncingSqlOutput.ToString ())  ' logs true
MyJob.WaitForSyncSqlOutputFinish ()
App.LogMsg (App.LOG.INFO, "IsSyncingSqlOutput", MyJob.IsSyncingSqlOutput.ToString ())  ' logs false

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();

App.LogMsg (App.LOG.INFO, "IsSyncingSqlOutput", MyJob.IsSyncingSqlOutput.ToString ());  // logs false
MyJob.SyncDataset ();
App.LogMsg (App.LOG.INFO, "IsSyncingSqlOutput", MyJob.IsSyncingSqlOutput.ToString ());  // logs true
MyJob.WaitForSyncDatasetFinish ();
App.LogMsg (App.LOG.INFO, "IsSyncingSqlOutput", MyJob.IsSyncingSqlOutput.ToString ());  // logs false

IsUploaded


True if and only if GlaaSJob's data has completed uploading.
These data statuses indicate that the upload has not completed yet: Pending or Uploading.

Property Value
System.Boolean

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

' Submit 2 jobs, but upload only one at a time.
MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)

While Not MyJob.IsUploaded
    App.LogMsg (App.LOG.INFO, "Job is still uploading", MyJob.DataStatus.ToString ())
    Thread.Sleep (1000)
End While

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch #2", "Test Farm", 2, 1)

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

// Submit 2 jobs, but upload only one at a time.
MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);

while (!MyJob.IsUploaded)
{
    App.LogMsg (App.LOG.INFO, "Job is still uploading", MyJob.DataStatus.ToString ());
    Thread.Sleep (1000);
}

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch #2", "Test Farm", 2, 1);

MemberDatasets


All member dataset names, for super dataset jobs.

Property Value
System.Collections.Generic.List<System.String>

ParentJobId


The parent job ID. 0 means there is no parent job.

Property Value
System.Int32

Queues


The number of queues used.

Property Value
System.Int32

RunDurationSeconds


The run time of the job. The value of this might not be valid before the job is finished.

Property Value
System.Int32

RunStatus


The run status of a GlaaS job.

Property Value
RunStatus

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)

App.LogMsg (App.LOG.INFO, "Run status", MyJob.RunStatus.ToString ())

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);

App.LogMsg (App.LOG.INFO, "Run status", MyJob.RunStatus.ToString ());

SqlDataStatus


The SQL data status of a GlaaS job.

Property Value
SqlDataStatus

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)

MyJob.WaitForFinish ()

If MyJob.SqlDataStatus <> GlaaSJob.SqlDataStatus.NotRequired Then
   MyJob.SyncSqlOutput ()
End If

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);

MyJob.WaitForFinish();

if (MyJob.SqlDataStatus != GlaaSJob.SqlDataStatus.NotRequired) MyJob.SyncSqlOutput ();

Status


The job status of a GlaaS job.

Property Value
JobStatus

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
' ...
App.LogMsg (App.LOG.INFO, "Job status", MyJob.Status.ToString ())

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
// ...
App.LogMsg (App.LOG.INFO, "Job status", MyJob.Status.ToString ());

Methods

BookFarm(String, Int32, Int32, Int32, Boolean, Boolean, Dictionary<String, String>, String, Int32, Int32, Boolean)


Books a farm, so that jobs with a matching AXIS version and cores can use it instead of provisioning their own.

Parameters
System.String FarmName

The name of the farm to book on.

System.Int32 Cores

The number of cores to book.

System.Int32 AxisVersion

The AXIS version to use for this booked farm.

System.Int32 BookTimeInMinutes

The period in minutes that the booked farm will exist. Must be at least 15.

System.Boolean IsSqlRequired

Whether SQL support will be required for jobs on this farm.

System.Boolean AllowGuestJobsQueueing

Whether the booked farm will queue applicable jobs or not. If not, then if the farm is in use then subsequent jobs will start provisioning instead.

System.Collections.Generic.Dictionary<System.String, System.String> Tags

A Dictionary of tag names and values to prioritize.
Optional. Default value = null

System.String Description

The description for this booked farm. Max length of 255 characters.
Optional. Default value = null

System.Int32 Priority

Priority of the booked farm (which competes with other jobs for cores). Higher values indicate higher priority.
Optional. Default value = 0

System.Int32 Queues

Number of job queues in a booked farm - use if you are planning to run Grid Job Set jobs or want the jobs to run in parallel, Note: max number of queues is limited to the number of machines
Optional. Default value = 1

System.Boolean RequireSfApiFile

If true, then after provisioning the farm, the uploaded deal file (SF_API.Zip) will be copied to the farm for jobs on the farm to use.
Optional. Default value = false

Returns
GlaaSJob

A GlaaSJob object representing the booked farm.

Examples

Language: VB.NET

Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim BatchId1 As Integer = 12
Dim BatchId2 As Integer = 33
Dim MyBookedFarm As GlaaSJob
Dim MyJob1 As GlaaSJob
Dim MyJob2 As GlaaSJob

MyBookedFarm = GlaaSJob.BookFarm ("Test Farm", 2, MyDataset.Version, 60, true, true)
MyBookedFarm.WaitForRunning ()

MyJob1 = GlaaSJob.SubmitBatchToGlaaSById (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), BatchId1, "Test Farm", 2, 1)
MyJob2 = GlaaSJob.SubmitBatchToGlaaSById (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), BatchId2, "Test Farm", 2, 1)

MyJob1.WaitForFinish ()
MyJob2.WaitForFinish ()
MyBookedFarm.SubmitTerminateRequest () ' all jobs done--kill farm

Language: C#

Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
int BatchId1 = 12;
int BatchId2 = 33;
GlaaSJob MyBookedFarm;
GlaaSJob MyJob1;
GlaaSJob MyJob2;

MyBookedFarm = GlaaSJob.BookFarm ("Test Farm", 2, MyDataset.Version, 60, true, true);
MyBookedFarm.WaitForRunning ();

MyJob1 = GlaaSJob.SubmitBatchToGlaaSById (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), BatchId1, "Test Farm", 2, 1);
MyJob2 = GlaaSJob.SubmitBatchToGlaaSById (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), BatchId2, "Test Farm", 2, 1);

MyJob1.WaitForFinish ();
MyJob2.WaitForFinish ();
MyBookedFarm.SubmitTerminateRequest ();  // all jobs done--kill farm
Exceptions
System.ArgumentException

Thrown when BookTimeInMinutes is less than 15.

System.InvalidOperationException

Thrown when the function cannot be completed.

System.TimeoutException

Thrown when the booked farm takes longer than GlaaSSettings.JobSubmissionTimeOutMs to submit.

DownloadBatchLog(String)


Download the batch log for this GlaaSJob.

Parameters
System.String DownloadDir

The directory under which the batch log will be downloaded. If null/empty, then the batch log will be downloaded under the dataset directory. This must be an absolute path.
Optional. Default value = null.

Returns
System.String

The full path to the downloaded batch log file.

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim TargetDatasetName = "SAMPLE_with_Test_Batch_run"
Dim BatchLogLocation As String

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()

BatchLogLocation = MyJob.DownloadBatchLog ()
App.LogMsg (App.LOG.INFO, "batch log located at", BatchLogLocation)

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
string TargetDatasetName = "SAMPLE_with_Test_Batch_run";

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();

string BatchLogLocation = MyJob.DownloadBatchLog ();
App.LogMsg (App.LOG.INFO, "batch log located at", BatchLogLocation);
Exceptions
System.ArgumentException

Thrown when DownloadDir does not exist.

System.InvalidOperationException

Thrown when the job is not done.

System.TimeoutException

Thrown when the download times out after 240 seconds.

DownloadFullDataset(String)


Downloads the dataset associated with the job in GlaaS to the same folder
as the submitted dataset, but under a different name.

For a super dataset job, the datasets are instead downloaded a specified folder.

Note: This function throws an exception if this GlaaSJob has Status != GlaaS.JobStatus.Done.
Note: Upon completion of this method, the dataset will still be downloading in the background,
and its status can be checked through the IsDownloadingFullDataset method. Call WaitForDownloadFullDatasetFinish to wait if needed.

Parameters
System.String Target

The name to use for the downloaded dataset.
For a super dataset job, instead enter the full path to the folder to download to.

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()

If MyJob.IsSuccess Then
   MyJob.DownloadFullDataset ("SAMPLE_with_Test_Batch_run")
End If

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();

if (MyJob.IsSuccess)
{
   MyJob.DownloadFullDataset ("SAMPLE_with_Test_Batch_run");
}
Exceptions
System.InvalidOperationException

Thrown when the job is not done, or a file/directory exists at the target location, or the job is already downloading with the specified target.

GenerateJobReport(String)


Generates a job report file containing the GlaaS job info, job history log, and GridLink job info.
The file will be generated inside the specified directory, with the name 123_JobReport.txt, where 123 is the job ID.

Note: If the job report file already exists, it will be overwritten.

Parameters
System.String OutputDir

The directory under which the job report will be generated.

Returns
System.String

The full path of the generated job report file (e.g. C:\SPARE[JobId]_JobReport.txt)

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim JobReportLogLocation As String

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()

JobReportLogLocation = MyJob.GenerateJobReport ("C:\\SPARE")
App.LogMsg (App.LOG.INFO, "Job report located at", JobReportLogLocation)

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
string TargetDatasetName = "SAMPLE_with_Test_Batch_run";

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();

string JobReportLogLocation = MyJob.GenerateJobReport ("C:\\SPARE");
App.LogMsg (App.LOG.INFO, "batch log located at", JobReportLogLocation);
Exceptions
System.ArgumentException

Thrown when OutputDir does not exist.

System.InvalidOperationException

Thrown when the function cannot be completed.

GetActiveJobs(String)


Obtain a list of all active jobs in GlaaS (jobs whose statuses are not Done, Failed, Terminated, Cancelled, or Invalid).

Parameters
System.String FarmName

The name of the farm to get active jobs from.

Returns
System.Collections.Generic.List<GlaaSJob>

A List containing all jobs in GlaaS that are active.

Examples

Language: VB.NET

Dim MyJobs As List (Of GlaaSJob) = GlaaSJob.GetActiveJobs ("Test Farm")
For Each J As GlaaSJob In MyJobs
   App.LogMsg (App.LOG.INFO, string.Format ("Job ID {0}", J.Id), string.Format ("Cores: {0}", J.Cores))
Next J

Language: C#

List<GlaaSJob> MyJobs = GlaaSJob.GetActiveJobs ("Test Farm");
foreach (GlaaSJob J in MyJobs)
{
   App.LogMsg (App.LOG.INFO, string.Format ("Job ID {0}", J.Id), string.Format ("Cores: {0}", J.Cores));
}
Exceptions
System.InvalidOperationException

Thrown when the specified farm does not exist, or if no information on the farm or jobs can be obtained.

IsDownloadingFullDataset(String)


True if and only if the specified target is being downloaded via DownloadFullDataset.

Parameters
System.String Target

Returns
System.Boolean

True if and only if the specified target is being downloaded via DownloadFullDataset.

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim TargetDatasetName = "SAMPLE_with_Test_Batch_run"

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()

App.LogMsg (App.LOG.INFO, "Is downloading", MyJob.IsDownloadingFullDataset (TargetDatasetName).ToString ())  ' logs false
MyJob.DownloadFullDataset (TargetDatasetName)
App.LogMsg (App.LOG.INFO, "Is downloading", MyJob.IsDownloadingFullDataset (TargetDatasetName).ToString ())  ' logs true
MyJob.WaitForDownloadFullDatasetFinish (TargetDatasetName)
App.LogMsg (App.LOG.INFO, "Is downloading", MyJob.IsDownloadingFullDataset (TargetDatasetName).ToString ())  ' logs false

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
string TargetDatasetName = "SAMPLE_with_Test_Batch_run";

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();

App.LogMsg (App.LOG.INFO, "Is downloading", MyJob.IsDownloadingFullDataset (TargetDatasetName).ToString ());  // logs false
MyJob.DownloadFullDataset (TargetDatasetName);
App.LogMsg (App.LOG.INFO, "Is downloading", MyJob.IsDownloadingFullDataset (TargetDatasetName).ToString ());  // logs true
MyJob.WaitForDownloadFullDatasetFinish (TargetDatasetName);
App.LogMsg (App.LOG.INFO, "Is downloading", MyJob.IsDownloadingFullDataset (TargetDatasetName).ToString ());  // logs false

RequestToDeleteData()


Submits a request to delete data associated with job in the cloud storage account (dataset and SQL Server output)

Note: This function throws an exception if this GlaaSJob is in progress or data is being syncronized.

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()

If MyJob.IsSuccess Then
   MyJob.SyncDataset ()
   MyJob.WaitForSyncDatasetFinish ()
   MyJob.RequestToDeleteData ()
End If

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();

if (MyJob.IsSuccess)
{
   MyJob.SyncDataset ();
   MyJob.WaitForSyncDatasetFinish ();
   MyJob.RequestToDeleteData ();
}
Exceptions
System.InvalidOperationException

Thrown when the function cannot be completed.

SubmitBaseUpload(String, String, String, String, String, Int32)


Submits a service job batch to upload the dataset to GlaaS.
This job can be then used to submit multiple dependent jobs to run in parallel or in sequence.

Parameters
System.String DatasetName

The name of the dataset to submit.

System.String PhysicalDatasetPath

The physical path to the workfolder containing the dataset.

System.String FarmName

The name of the farm to run on.

System.String UploadName

The name of the upload, e.g. if UploadName = "Base upload" then "Base upload" will appear under batch name in jobs list.

System.String Description

The description for this base upload. Max length of 255 characters.
Optional. Default value = null

System.Int32 Priority

Priority of the job. Higher values indicate higher priority.
Optional. Default value = 0

Returns
GlaaSJob

A GlaaSJob object representing this submission.

Examples

Language: VB.NET

Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim MyJob As GlaaSJob

MyJob = GlaaSJob.SubmitBaseUpload (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Farm", "Base upload")

Language: C#

Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
GlaaSJob MyJob;

MyJob = GlaaSJob.SubmitBaseUpload (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Farm", "Base upload");
Exceptions
System.InvalidOperationException

Thrown when the function cannot be completed.

SubmitBatchToGlaaS(String, String, String, GlaaSBatchInfo)


Submits a batch job to GlaaS.

Parameters
System.String DatasetName

The name of the dataset to submit.

System.String PhysicalDatasetPath

The physical path to the workfolder containing the dataset.

System.String FarmName

The name of the farm to run on.

GlaaSBatchInfo BatchInfo

A GlaaSBatchInfo containing at least the batch name or ID, cores, and queues.

Returns
GlaaSJob

A GlaaSJob object representing this submission.

Examples

Language: VB.NET

Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim BatchInfos As New List (Of GlaaSBatchInfo)
Dim Jobs As New List (Of GlaaSJob)

BatchInfos.Add (New GlaaSBatchInfo (40, 64, 1))  ' run batch 40 with 64 cores and 1 queue
BatchInfos.Add (New GlaaSBatchInfo ("Run all cells", 256, 1))  ' run batch "Run all cells" with 256 cores and 1 queue

For Each BatchInfo As GlaaSBatchInfo In BatchInfos
   Jobs.Add (GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Farm", BatchInfo))
Next BatchInfo

Language: C#

Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
List<GlaaSBatchInfo> BatchInfos = new List<GlaaSBatchInfo> ();
List<GlaaSJob> Jobs = new List<GlaaSJob> ();

BatchInfos.Add (new GlaaSBatchInfo (40, 64, 1));  // run batch 40 with 64 cores and 1 queue
BatchInfos.Add (new GlaaSBatchInfo ("Run all cells", 256, 1));  // run batch "Run all cells" with 256 cores and 1 queue

foreach (GlaaSBatchInfo BatchInfo in BatchInfos)
{
   Jobs.Add (GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Farm", BatchInfo));
}
Exceptions
System.ArgumentException

Thrown when the specified batch is not found, or if MaxRunTimeInMinutes in BatchInfo is negative.

System.InvalidOperationException

Thrown when the function cannot be completed.

System.TimeoutException

Thrown when the GlaaS Job takes longer than GlaaSSettings.JobSubmissionTimeOutMs to submit.

SubmitBatchToGlaaS(String, String, String, String, Int32, Int32, Int32, Boolean, String, Int32)


Submits a batch job to GlaaS.

Parameters
System.String DatasetName

The name of the dataset to submit.

System.String PhysicalDatasetPath

The physical path to the workfolder containing the dataset.

System.String BatchName

The name of the batch to run.

System.String FarmName

The name of the farm to run on.

System.Int32 Cores

The number of cores to use.

System.Int32 Queues

The number of queues to use.

System.Int32 MaxRunTimeInMinutes

The maximum time the job can run in C4, in minutes. Using 0 means there is no max run time. Note that ELink will not throw an exception from this time being exceeded.
Optional. Default value = 0
Note: ELink does not check if this time is exceeded, but C4 will cancel the job.

System.Boolean StartProvisioningAfterUpload

If true, then wait until uploading is complete before provisioning a farm. Otherwise, immediately provision a farm.
Optional. Default value = false

System.String Description

A run description to use for this job. Max length of 255 characters.
Optional. Default value = null

System.Int32 Priority

Priority of the job. Higher values indicate higher priority.
Optional. Default value = 0

Returns
GlaaSJob

A GlaaSJob object representing this submission.

Examples

Language: VB.NET

Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim Batch As String = "Run all cells"
Dim MyJob As GlaaSJob

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), Batch, "Test Farm", 2, 1)

Language: C#

Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
string Batch = "Run all cells";
GlaaSJob MyJob;

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), Batch, "Test Farm", 2, 1);
Exceptions
System.ArgumentException

Thrown when the specified batch is not found or if MaxRunTimeInMinutes is negative.

System.InvalidOperationException

Thrown when the function cannot be completed.

System.TimeoutException

Thrown when the GlaaS Job takes longer than GlaaSSettings.JobSubmissionTimeOutMs to submit.

SubmitBatchToGlaaSById(String, String, Int32, String, Int32, Int32, Int32, Boolean, String, Int32)


Submits a batch job to GlaaS.

Parameters
System.String DatasetName

The name of the dataset to submit.

System.String PhysicalDatasetPath

The physical path to the workfolder containing the dataset.

System.Int32 BatchId

The ID of the batch to run.

System.String FarmName

The name of the farm to run on.

System.Int32 Cores

The number of cores to use.

System.Int32 Queues

The number of queues to use.

System.Int32 MaxRunTimeInMinutes

The maximum time the job can run in C4, in minutes. Using 0 means there is no max run time. Note that ELink will not throw an exception from this time being exceeded.
Optional. Default value = 0.
Note: ELink does not check if this time is exceeded, but C4 will cancel the job.

System.Boolean StartProvisioningAfterUpload

If true, then wait until uploading is complete before provisioning a farm. Otherwise, immediately provision a farm.
Optional. Default value = false

System.String Description

A run description to use for this job. Max length of 255 characters.
Optional. Default value = null

System.Int32 Priority

Priority of the job. Higher values indicate higher priority.
Optional. Default value = 0

Returns
GlaaSJob

A GlaaSJob object representing this submission.

Examples

Language: VB.NET

Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim BatchId As Integer = 12
Dim MyJob As GlaaSJob

MyJob = GlaaSJob.SubmitBatchToGlaaSById (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), BatchId, "Test Farm", 2, 1)

Language: C#

Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
int BatchId = 12;
GlaaSJob MyJob;

MyJob = GlaaSJob.SubmitBatchToGlaaSById (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), BatchId, "Test Farm", 2, 1);
Exceptions
System.ArgumentException

Thrown when the specified batch is not found or if MaxRunTimeInMinutes is negative.

System.InvalidOperationException

Thrown when the function cannot be completed.

System.TimeoutException

Thrown when the GlaaS Job takes longer than GlaaSSettings.JobSubmissionTimeOutMs to submit.

SubmitBatchToGlaaSWithTags(String, String, String, String, Int32, Int32, Dictionary<String, String>, Int32, Boolean, String, Int32)


Submits a batch job to GlaaS with tags.

Parameters
System.String DatasetName

The name of the dataset to submit.

System.String PhysicalDatasetPath

The physical path to the workfolder containing the dataset.

System.String BatchName

The name of the batch to run.

System.String FarmName

The name of the farm to run on.

System.Int32 Cores

The number of cores to use.

System.Int32 Queues

The number of queues to use.

System.Collections.Generic.Dictionary<System.String, System.String> Tags

A Dictionary of tag names and values.

System.Int32 MaxRunTimeInMinutes

The maximum time the job can run in C4, in minutes. Using 0 means there is no max run time. Note that ELink will not throw an exception from this time being exceeded.
Optional. Default value = 0
Note: ELink does not check if this time is exceeded, but C4 will cancel the job.

System.Boolean StartProvisioningAfterUpload

If true, then wait until uploading is complete before provisioning a farm. Otherwise, immediately provision a farm.
Optional. Default value = false

System.String Description

A run description to use for this job. Max length of 255 characters.
Optional. Default value = null

System.Int32 Priority

Priority of the job. Higher values indicate higher priority.
Optional. Default value = 0

Returns
GlaaSJob

A GlaaSJob object representing this submission.

Examples

Language: VB.NET

Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim Batch As String = "Run all cells"
Dim MyJob As GlaaSJob
Dim Tags As New Dictionary (Of String, String)
Tags.Add ("HostJobId", BookedFarm.Id.ToString())

MyJob = GlaaSJob.SubmitBatchToGlaaSWithTags (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), Batch, "Test Farm", 2, 1)

Language: C#

Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
string Batch = "Run all cells";
GlaaSJob MyJob;
Dictionary<string, string> Tags = new Dictionary<string, string> ()
{
   {"HostJobId",  BookedFarm.Id.ToString()},
   {"DirectPath",  DirectCloudPath + @"datasets\" + DatasetName}
};

MyJob = GlaaSJob.SubmitBatchToGlaaSWithTags (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), Batch, "Test Farm", 2, 1, 0, false, "test run", 0, Tags);
Exceptions
System.ArgumentException

Thrown when the specified batch is not found or if MaxRunTimeInMinutes is negative.

System.InvalidOperationException

Thrown when the function cannot be completed.

System.TimeoutException

Thrown when the GlaaS Job takes longer than GlaaSSettings.JobSubmissionTimeOutMs to submit.

SubmitDependentBatch(GlaaSBatchInfo)


Submits a batch job to GlaaS that is dependent on this GlaaSJob.

Note: If this GlaaSJob is Terminated, Failed, Cancelled, or Invalid, then no job will be submitted and null will be returned.

Parameters
GlaaSBatchInfo BatchInfo

A GlaaSBatchInfo containing at least the batch name or ID, cores, and queues.

Returns
GlaaSJob

A GlaaSJob object representing this submission.

Examples

Language: VB.NET

Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim BatchInfos As New List (Of GlaaSBatchInfo)
Dim Jobs As New List (Of GlaaSJob)

Jobs.Add (GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Run all cells", "Test Farm", 256, 1))

BatchInfos.Add (New GlaaSBatchInfo (40, 64, 1))  ' run dependent batch 40 with 64 cores and 1 queue
BatchInfos.Add (New GlaaSBatchInfo ("Export data", 16, 1))  ' run dependent batch "Export data" with 16 cores and 1 queue

For Each BatchInfo As GlaaSBatchInfo In BatchInfos
   Jobs.Add (Jobs(0).SubmitDependentBatch (BatchInfo))
Next BatchInfo

Language: C#

Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
List<GlaaSBatchInfo> BatchInfos = new List<GlaaSBatchInfo> ();
List<GlaaSJob> Jobs = new List<GlaaSJob> ();

Jobs.Add (GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Run all cells", "Test Farm", 256, 1));

BatchInfos.Add (new GlaaSBatchInfo (40, 64, 1));  // run batch 40 with 64 cores and 1 queue
BatchInfos.Add (New GlaaSBatchInfo ("Export data", 16, 1));  // run dependent batch "Export data" with 16 cores and 1 queue

foreach (GlaaSBatchInfo BatchInfo in BatchInfos)
{
   Jobs.Add (Jobs[0].SubmitDependentBatch (BatchInfo));
}
Exceptions
System.ArgumentException

Thrown when the specified batch is not found, or if MaxRunTimeInMinutes in BatchInfo is negative.

System.InvalidOperationException

Thrown when the function cannot be completed.

System.TimeoutException

Thrown when the GlaaS Job takes longer than GlaaSSettings.JobSubmissionTimeOutMs to submit.

SubmitDependentBatch(String, Int32, Int32, Int32, String, Int32)


Submits a batch job to GlaaS that is dependent on this GlaaSJob.

Note: If this GlaaSJob is Terminated, Failed, Cancelled, or Invalid, then no job will be submitted and null will be returned.

Parameters
System.String BatchName

The name of the batch to run.

System.Int32 Cores

The number of cores to use.

System.Int32 Queues

The number of queues to use.

System.Int32 MaxRunTimeInMinutes

The maximum time the job can run in C4, in minutes. Using 0 means there is no max run time. Note that ELink will not throw an exception from this time being exceeded.
Optional. Default value = 0
Note: ELink does not check if this time is exceeded, but C4 will cancel the job.

System.String Description

A run description to use for this job. Max length of 255 characters.
Optional. Default value = null

System.Int32 Priority

The priority to use for all jobs submitted under the macro batch. Higher values indicate higher priority.
Optional. Default value = 0

Returns
GlaaSJob

A GlaaSJob object representing this submission.

Examples

Language: VB.NET

Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim BatchId As Integer = 12
Dim DependentBatch As String = "My Batch"
Dim MyJob As GlaaSJob
Dim MyDependentJob As GlaaSJob

MyJob = GlaaSJob.SubmitBatchToGlaaSById (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), BatchId, "Test Farm", 2, 1)
MyDependentJob = MyJob.SubmitDependentBatch (DependentBatch, 32, 1)

Language: C#

Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
int BatchId = 12;
string DependentBatch = "My Batch";
GlaaSJob MyJob;
GlaaSJob MyDependentJob;

MyJob = GlaaSJob.SubmitBatchToGlaaSById (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), BatchId, "Test Farm", 2, 1);
MyDependentJob = MyJob.SubmitDependentBatch (DependentBatch, 32, 1);
Exceptions
System.ArgumentException

Thrown when the specified batch is not found or if MaxRunTimeInMinutes is negative.

System.InvalidOperationException

Thrown when the function cannot be completed.

System.TimeoutException

Thrown when the GlaaS Job takes longer than GlaaSSettings.JobSubmissionTimeOutMs to submit.

SubmitDependentBatchById(Int32, Int32, Int32, Int32, String, Int32)


Submits a batch job to GlaaS by ID that is dependent on this GlaaSJob.

Note: If this GlaaSJob is Terminated, Failed, Cancelled, or Invalid, then no job will be submitted and null will be returned.

Parameters
System.Int32 BatchId

The ID of the batch to run.

System.Int32 Cores

The number of cores to use.

System.Int32 Queues

The number of queues to use.

System.Int32 MaxRunTimeInMinutes

The maximum time the job can run in C4, in minutes. Using 0 means there is no max run time. Note that ELink will not throw an exception from this time being exceeded.
Optional. Default value = 0
Note: ELink does not check if this time is exceeded, but C4 will cancel the job.

System.String Description

A run description to use for this job. Max length of 255 characters.
Optional. Default value = null

System.Int32 Priority

The priority to use for all jobs submitted under the macro batch. Higher values indicate higher priority.
Optional. Default value = 0

Returns
GlaaSJob

A GlaaSJob object representing this submission.

Examples

Language: VB.NET

Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim BatchId As Integer = 12
Dim DependentBatchId As Integer = 37
Dim MyJob As GlaaSJob
Dim MyDependentJob As GlaaSJob

MyJob = GlaaSJob.SubmitBatchToGlaaSById (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), BatchId, "Test Farm", 2, 1)
MyDependentJob = MyJob.SubmitDependentBatchById (DependentBatchId, 32, 1)

Language: C#

Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
int BatchId = 12;
int DependentBatchId = 37;
GlaaSJob MyJob;
GlaaSJob MyDependentJob;

MyJob = GlaaSJob.SubmitBatchToGlaaSById (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), BatchId, "Test Farm", 2, 1);
MyDependentJob = MyJob.SubmitDependentBatchById (DependentBatchId, 32, 1);
Exceptions
System.ArgumentException

Thrown when the specified batch is not found or if MaxRunTimeInMinutes is negative.

System.InvalidOperationException

Thrown when the function cannot be completed.

System.TimeoutException

Thrown when the GlaaS Job takes longer than GlaaSSettings.JobSubmissionTimeOutMs to submit.

SubmitDependentBatchWithTags(String, Int32, Int32, Dictionary<String, String>, Int32, String, Int32)


Submits a dependent batch job to GlaaS with tags.

Parameters
System.String BatchName

The name of the batch to run.

System.Int32 Cores

The number of cores to use.

System.Int32 Queues

The number of queues to use.

System.Collections.Generic.Dictionary<System.String, System.String> Tags

A Dictionary of tag names and values to prioritize.
Optional. Default value = null

System.Int32 MaxRunTimeInMinutes

The maximum time the job can run in C4, in minutes. Using 0 means there is no max run time. Note that ELink will not throw an exception from this time being exceeded.
Optional. Default value = 0
Note: ELink does not check if this time is exceeded, but C4 will cancel the job.

System.String Description

A run description to use for this job. Max length of 255 characters.
Optional. Default value = null

System.Int32 Priority

Priority of the job. Higher values indicate higher priority.
Optional. Default value = 0

Returns
GlaaSJob

A GlaaSJob object representing this submission.

Examples

Language: VB.NET

Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim Tags As New Dictionary (Of String, String)
Tags.Add ("HostJobId", BookedFarm.Id.ToString())

Dim ParentJob As GlaaSJob = GlaaSJob.SubmitBatchToGlaaSWithTags (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Prepare dataset", "Test Farm", 2, 1, Tags)
Dim ChildJob As GlaaSJob = ParentJob.SubmitDependentBatchWithTags ("Run all", 2, 1, Tags)

Language: C#

Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
Dictionary<string, string> Tags = new Dictionary<string, string> ()
{
   {"HostJobId",  BookedFarm.Id.ToString()},
};

GlaaSJob ParentJob = GlaaSJob.SubmitBatchToGlaaSWithTags (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Prepare dataset", "Test Farm", 2, 1, Tags);
GlaaSJob ChildJob = ParentJob.SubmitDependentBatchWithTags ("Run all", 2, 1, Tags);
Exceptions
System.ArgumentException

Thrown when the specified batch is not found or if MaxRunTimeInMinutes is negative.

System.InvalidOperationException

Thrown when the function cannot be completed.

System.TimeoutException

Thrown when the GlaaS Job takes longer than GlaaSSettings.JobSubmissionTimeOutMs to submit.

SubmitMacroBatchToGlaaS(String, String, String, String, Boolean, String, Int32)


Submits a Dataset Macro-type batch to GlaaS, with a separate GlaaS job created for each batch run in the macro.

Parameters
System.String DatasetName

The name of the dataset to submit.

System.String PhysicalDatasetPath

The physical path to the workfolder containing the dataset.

System.String MacroBatchName

The name of the Dataset Macro batch to run.

System.String FarmName

The name of the farm to run on.

System.Boolean StartProvisioningAfterUpload

If true, then wait until uploading is complete before provisioning a farm. Otherwise, immediately provision a farm.
Optional. Default value = false

System.String Description

A run description to use for all jobs submitted under the macro batch. Max length of 255 characters.
Optional. Default value = null

System.Int32 Priority

The priority to use for all jobs submitted under the macro batch. Higher values indicate higher priority.
Optional. Default value = 0

Returns
System.Collections.Generic.List<GlaaSJob>

A list of GlaaSJob instances representing the jobs in the macro.

Examples

Language: VB.NET

Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim Batch As String = "Run ALL"  ' A dataset macro with 3 enabled batches under it.
Dim MyJobs As List (Of GlaaSJob)

MyJobs = GlaaSJob.SubmitMacroBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), Batch, "Test Farm")

App.LogMsg (App.LOG.INFO, "# of submitted jobs", MyJobs.Count.ToString ())

Language: C#

Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
string Batch = "Run ALL";  // A dataset macro with 3 enabled batches under it.
List<GlaaSJob> MyJobs;

MyJobs = GlaaSJob.SubmitMacroBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), Batch, "Test Farm");

App.LogMsg (App.LOG.INFO, "# of submitted jobs", MyJobs.Count.ToString ());
Exceptions
System.ArgumentException

Thrown when the specified batch is not found.

System.InvalidOperationException

Thrown when the function cannot be completed.

System.TimeoutException

Thrown when the GlaaS Job takes longer than GlaaSSettings.JobSubmissionTimeOutMs to submit.

SubmitTerminateRequest()


Submits a request to terminate this GlaaS job.

Note: Termination might not go through if the job has not reached the provisioning status.

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
' Some time later, the program decides to terminate the job...
MyJob.SubmitTerminateRequest ()

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
// Some time later, the program decides to terminate the job...
MyJob.SubmitTerminateRequest ();
Exceptions
System.InvalidOperationException

Thrown when the function cannot be completed.

SyncAllJobsInfo(Int32)


Synchronizes job info into SQL server database table in C4 settings.

Note: This function throws an exception if this GlaaSJob has Status != GlaaS.JobStatus.Done.
Note: This function does not indicate whether the synchronization itself is successful after it has started.

Parameters
System.Int32 DaysBack

Only synchronizes the information of jobs submitted in the last number of days (DaysBack). If DaysBack = 0 then the function will synchronize all jobs.
Optional. Default value = 0

Examples

Language: VB.NET

GlaaSJob.SyncAllJobsInfo ()
GlaaSJob.WaitForSyncJobInfoToFinish ()

Language: C#

GlaaSJob.SyncAllJobsInfo();
GlaaSJob.WaitForSyncJobInfoToFinish();
Exceptions
System.InvalidOperationException

Thrown when the function cannot be completed.

System.ArgumentException

Thrown when the number of days is less than 0.

SyncDataset()


Replaces the dataset used to submit this GlaaSJob with the dataset associated with the job in GlaaS.

Note: This function throws an exception if this GlaaSJob has Status != GlaaS.JobStatus.Done.
Note: This function does not indicate whether the synchronization itself is successful after it has started.
Note: Upon completion of this method, the dataset will still be synchronizing in the background,
and its status can be checked through the IsSyncingDataset property. Call WaitForSyncDatasetFinish to wait if needed.

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()

If MyJob.IsSuccess Then
   MyJob.SyncDataset ()
End If

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();

if (MyJob.IsSuccess)
{
   MyJob.SyncDataset ();
}
Exceptions
System.InvalidOperationException

Thrown when the function cannot be completed.

SyncSqlOutput(SQLSyncTableOverwriteMode)


Synchronizes the SQL output data for this GlaaSJob.

Note: This function throws an exception if this GlaaSJob has Status != GlaaS.JobStatus.Done.
Note: This function does not indicate whether the synchronization itself is successful after it has started.
Note: Upon completion of this method, the SQL output data will still be synchronizing in the background,
and the status of synchronization can be checked through the IsSyncingSqlOutput property. Call WaitForSyncSqlOutputFinish to wait if needed.

Parameters
SQLSyncTableOverwriteMode OverwriteTablesMode

Used to specify whether to Append or Overwrite to tables where the Append/Overwrite setting cannot be determined.
This occurs if the table name contains Global Parameters or placeholders like $VALDATE.
By default, the Append mode is set for such tables. For other tables the setting in the batch is respected.
Set this parameter to SQLSyncTableOverwriteMode.Default to use the setting in the batch when possible, but Append when it cannot be read.
SQLSyncTableOverwriteMode.OverwriteAll will force Overwrite all tables during sync.
SQLSyncTableOverwriteMode.OverwriteIfPlaceholdersInTableName will force overwrite only for tables that have placeholders in their names.
Optional. Default value = SQLSyncTableOverwriteMode.Default.

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()

If MyJob.IsSuccess Then
   MyJob.SyncSqlOutput ()
End If

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();

if (MyJob.IsSuccess)
{
   MyJob.SyncSqlOutput ();
}
Exceptions
System.InvalidOperationException

Thrown when the function cannot be completed.

ToString()


Gets useful information about the specified job in formatted string:
ID, farm, dataset name, dataset path, AXIS version, batch ID, batch name, cores, queues, parent job ID.

Returns
System.String

Formatted string containing the job information.

Overrides
System.Object.ToString()
Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)

Dim JobInfo As String = MyJob.ToString ()

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);

string JobInfo = MyJob.ToString ();

WaitForDownloadFullDatasetFinish(String, Int32)


Waits for the specified target dataset to be fully downloaded after calling DownloadFullDataset.
Specifically, when it is found that IsDownloadingFullDataset == false, execution continues.

Note: This function is not stopped by the "Request Stop" button.

Parameters
System.String Target

The download to wait on. Use the same target as was used for DownloadFullDataset to wait for it.

System.Int32 TimeOutMs

The maximum amount of time to wait for a job to finish synchronizing (in milliseconds). If TimeOutMs = 0 then the function will wait indefinitely.
Optional. Default value = 0.

Returns
System.Boolean

Returns true upon success or false upon failure.

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim TargetDatasetName As String = "SAMPLE_with_Test_Batch_run"

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()

If MyJob.IsSuccess Then
   MyJob.DownloadFullDataset (TargetDatasetName)
   MyJob.WaitForDownloadFullDatasetFinish (TargetDatasetName)
End If

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
string TargetDatasetName = "SAMPLE_with_Test_Batch_run";

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();

if (MyJob.IsSuccess)
{
   MyJob.DownloadFullDataset (TargetDatasetName);
   MyJob.WaitForDownloadFullDatasetFinish (TargetDatasetName);
}
Exceptions
System.ArgumentException

Thrown when the function arguments are incorrect.

System.TimeoutException

Thrown when the download takes longer than TimeOutMs to finish.

WaitForFinish(Int32)


Waits for a job to finish before continuing execution.

Note: This function is not stopped by the "Request Stop" button.

Parameters
System.Int32 TimeOutMs

The maximum amount of time to wait for a job to finish running (in milliseconds). If TimeOutMs = 0 then the function will wait indefinitely.
Optional. Default value = 0.

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()
' Do something else now that the job has completed.

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();
// Do something else now that the job has completed.
Exceptions
System.ArgumentException

Thrown when the function arguments are incorrect.

System.TimeoutException

Thrown when the GlaaS Job takes longer than TimeOutMs to finish.

WaitForRunning(Int32)


Waits for a job to reach the Running status before continuing execution.
In addition, execution will continue if the job finishes without reaching the Running status, such as in the case of termination.

Note: This function is not stopped by the "Request Stop" button.

Parameters
System.Int32 TimeOutMs

The maximum amount of time to wait for a job to get to the Running status (in milliseconds). If TimeOutMs = 0 then the function will wait indefinitely.
Optional. Default value = 0.

Examples

Language: VB.NET

Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")
Dim BatchId As Integer = 12
Dim MyBookedFarm As GlaaSJob
Dim MyJob As GlaaSJob

MyBookedFarm = GlaaSJob.BookFarm ("Test Farm", 2, MyDataset.Version, 60, true, true)
MyBookedFarm.WaitForRunning ()
MyJob = GlaaSJob.SubmitBatchToGlaaSById (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), BatchId, "Test Farm", 2, 1)

Language: C#

Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");
int BatchId = 12;
GlaaSJob MyBookedFarm;
GlaaSJob MyJob;

MyBookedFarm = GlaaSJob.BookFarm ("Test Farm", 2, MyDataset.Version, 60, true, true);
MyBookedFarm.WaitForRunning ();
MyJob = GlaaSJob.SubmitBatchToGlaaSById (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), BatchId1, "Test Farm", 2, 1);
Exceptions
System.ArgumentException

Thrown when the function arguments are incorrect.

System.TimeoutException

Thrown when the GlaaS Job takes longer than TimeOutMs to get to the Running status, from the beginning of the WaitForRunning call.

WaitForSyncDatasetFinish(Int32)


Waits for a job to finish synchronizing (from calling SyncDataset) before continuing execution.
Specifically, when it is found that IsSyncingDataset == false, execution continues.

Note: This function is not stopped by the "Request Stop" button.

Parameters
System.Int32 TimeOutMs

The maximum amount of time to wait for a job to finish synchronizing (in milliseconds). If TimeOutMs = 0 then the function will wait indefinitely.
Optional. Default value = 0.

Returns
System.Boolean

Returns true upon success or false upon failure.

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()

If MyJob.IsSuccess Then
   MyJob.SyncDataset ()
   MyJob.WaitForSyncDatasetFinish ()
End If

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();

if (MyJob.IsSuccess)
{
  MyJob.SyncDataset ();
  MyJob.WaitForSyncDatasetFinish ();
}
Exceptions
System.ArgumentException

Thrown when the function arguments are incorrect.

System.TimeoutException

Thrown when the GlaaS synchronization takes longer than TimeOutMs to finish.

WaitForSyncJobInfoToFinish(Int32)


Waits for a synchronization of job info to finish.

Note: This function is not stopped by the "Request Stop" button.

Parameters
System.Int32 TimeOutMs

The maximum amount of time to wait (in milliseconds). If TimeOutMs = 0 then the function will wait indefinitely.
Optional. Default value = 0.

WaitForSyncSqlOutputFinish(Int32)


Waits for a job to finish synchronizing (from calling SyncSqlOutput) before continuing execution.
Specifically, when it is found that IsSyncingSqlOutput == false, execution continues.

Note: This function is not stopped by the "Request Stop" button.

Parameters
System.Int32 TimeOutMs

The maximum amount of time to wait for a job to finish synchronizing (in milliseconds). If TimeOutMs = 0 then the function will wait indefinitely.
Optional. Default value = 0.

Returns
System.Boolean

Returns true upon success or false upon failure.

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForFinish ()

If MyJob.IsSuccess Then
   MyJob.SyncSqlOutput ()
   MyJob.WaitForSyncSqlOutputFinish ()
End If

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForFinish ();

if (MyJob.IsSuccess)
{
  MyJob.SyncSqlOutput ();
  MyJob.WaitForSyncSqlOutputFinish ();
}
Exceptions
System.ArgumentException

Thrown when the function arguments are incorrect.

System.TimeoutException

Thrown when the GlaaS synchronization takes longer than TimeOutMs to finish.

WaitForUploadFinish(Int32)


Waits for a job to finish uploading before continuing execution.
Specifically, wait until GlaaSJob.DataStatus is neither GlaaS.DataStatus.Pending nor GlaaS.DataStatus.Uploading.
In addition, execution will continue if the job finishes without completing its upload, such as in the case of termination.

Note: This function is not stopped by the "Request Stop" button.
Note: This function does not throw an exception if the upload fails.

Parameters
System.Int32 TimeOutMs

The maximum amount of time to wait for a job to finish uploading (in milliseconds). If TimeOutMs = 0 then the function will wait indefinitely.
Optional. Default value = 0.

Examples

Language: VB.NET

Dim MyJob As GlaaSJob
Dim MyDataset As New Dataset ("$WORKAREA\Test", "SAMPLE")

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1)
MyJob.WaitForUploadFinish ()
App.LogMsg (App.LOG.INFO, "Upload Size", MyJob.DataSizeAsUploaded.ToString ())
' Do something else now that the job upload has completed.

Language: C#

GlaaSJob MyJob;
Dataset MyDataset = new Dataset ("$WORKAREA\\Test", "SAMPLE");

MyJob = GlaaSJob.SubmitBatchToGlaaS (MyDataset.Name, App.PathLogicalToPhysical (MyDataset.Path), "Test Batch", "Test Farm", 2, 1);
MyJob.WaitForUploadFinish ();
App.LogMsg (App.LOG.INFO, "Upload Size", MyJob.DataSizeAsUploaded.ToString ());
// Do something else now that the job upload has completed.
Exceptions
System.ArgumentException

Thrown when the function arguments are incorrect.

System.TimeoutException

Thrown when the GlaaS Job takes longer than TimeOutMs to upload.

Back to top