Class Job
(experimental) A Glue Job.
Inherited Members
Namespace: Amazon.CDK.AWS.Glue.Alpha
Assembly: Amazon.CDK.AWS.Glue.Alpha.dll
Syntax (csharp)
public class Job : Resource, IJob, IResource, IGrantable
Syntax (vb)
Public Class Job
Inherits Resource
Implements IJob, IResource, IGrantable
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
new Job(this, "EnableSparkUI", new JobProps {
JobName = "EtlJobWithSparkUIPrefix",
SparkUI = new SparkUIProps {
Enabled = true
},
Executable = JobExecutable.PythonEtl(new PythonSparkJobExecutableProps {
GlueVersion = GlueVersion.V3_0,
PythonVersion = PythonVersion.THREE,
Script = Code.FromAsset(Join(__dirname, "job-script", "hello_world.py"))
})
});
Synopsis
Constructors
Job(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Job(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Job(Construct, String, IJobProps) |
Properties
GrantPrincipal | (experimental) The principal this Glue Job is running as. |
JobArn | (experimental) The ARN of the job. |
JobName | (experimental) The name of the job. |
Role | (experimental) The IAM role Glue assumes to run this job. |
SparkUILoggingLocation | (experimental) The Spark UI logs location if Spark UI monitoring and debugging is enabled. |
Methods
FromJobAttributes(Construct, String, IJobAttributes) | (experimental) Creates a Glue Job. |
Metric(String, MetricType, IMetricOptions) | (experimental) Create a CloudWatch metric. |
MetricFailure(IMetricOptions) | (experimental) Return a CloudWatch Metric indicating job failure. |
MetricSuccess(IMetricOptions) | (experimental) Return a CloudWatch Metric indicating job success. |
MetricTimeout(IMetricOptions) | (experimental) Return a CloudWatch Metric indicating job timeout. |
OnEvent(String, IOnEventOptions) | (experimental) Create a CloudWatch Event Rule for this Glue Job when it's in a given state. |
OnFailure(String, IOnEventOptions) | (experimental) Return a CloudWatch Event Rule matching FAILED state. |
OnStateChange(String, JobState, IOnEventOptions) | (experimental) Create a CloudWatch Event Rule for the transition into the input jobState. |
OnSuccess(String, IOnEventOptions) | (experimental) Create a CloudWatch Event Rule matching JobState.SUCCEEDED. |
OnTimeout(String, IOnEventOptions) | (experimental) Return a CloudWatch Event Rule matching TIMEOUT state. |
Constructors
Job(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Job(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Job(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Job(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Job(Construct, String, IJobProps)
public Job(Construct scope, string id, IJobProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IJobProps
Remarks
Stability: Experimental
Properties
GrantPrincipal
(experimental) The principal this Glue Job is running as.
public virtual IPrincipal GrantPrincipal { get; }
Property Value
Remarks
Stability: Experimental
JobArn
(experimental) The ARN of the job.
public virtual string JobArn { get; }
Property Value
System.String
Remarks
Stability: Experimental
JobName
(experimental) The name of the job.
public virtual string JobName { get; }
Property Value
System.String
Remarks
Stability: Experimental
Role
(experimental) The IAM role Glue assumes to run this job.
public virtual IRole Role { get; }
Property Value
Remarks
Stability: Experimental
SparkUILoggingLocation
(experimental) The Spark UI logs location if Spark UI monitoring and debugging is enabled.
public virtual ISparkUILoggingLocation SparkUILoggingLocation { get; }
Property Value
Remarks
Stability: Experimental
See: https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
Methods
FromJobAttributes(Construct, String, IJobAttributes)
(experimental) Creates a Glue Job.
public static IJob FromJobAttributes(Construct scope, string id, IJobAttributes attrs)
Parameters
- scope Constructs.Construct
The scope creating construct (usually
this
).- id System.String
The construct's id.
- attrs IJobAttributes
Import attributes.
Returns
Remarks
Stability: Experimental
Metric(String, MetricType, IMetricOptions)
(experimental) Create a CloudWatch metric.
public virtual Metric Metric(string metricName, MetricType type, IMetricOptions props = null)
Parameters
- metricName System.String
name of the metric typically prefixed with
glue.driver.
,glue.<executorId>.
orglue.ALL.
.- type MetricType
the metric type.
- props IMetricOptions
metric options.
Returns
Remarks
Stability: Experimental
See: https://docs.aws.amazon.com/glue/latest/dg/monitoring-awsglue-with-cloudwatch-metrics.html
MetricFailure(IMetricOptions)
(experimental) Return a CloudWatch Metric indicating job failure.
public virtual Metric MetricFailure(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
This metric is based on the Rule returned by no-args onFailure() call.
Stability: Experimental
MetricSuccess(IMetricOptions)
(experimental) Return a CloudWatch Metric indicating job success.
public virtual Metric MetricSuccess(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
This metric is based on the Rule returned by no-args onSuccess() call.
Stability: Experimental
MetricTimeout(IMetricOptions)
(experimental) Return a CloudWatch Metric indicating job timeout.
public virtual Metric MetricTimeout(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
This metric is based on the Rule returned by no-args onTimeout() call.
Stability: Experimental
OnEvent(String, IOnEventOptions)
(experimental) Create a CloudWatch Event Rule for this Glue Job when it's in a given state.
public virtual Rule OnEvent(string id, IOnEventOptions options = null)
Parameters
- id System.String
construct id.
- options IOnEventOptions
event options.
Returns
Remarks
Stability: Experimental
See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html#glue-event-types
OnFailure(String, IOnEventOptions)
(experimental) Return a CloudWatch Event Rule matching FAILED state.
public virtual Rule OnFailure(string id, IOnEventOptions options = null)
Parameters
- id System.String
construct id.
- options IOnEventOptions
optional event options.
Returns
Remarks
Stability: Experimental
OnStateChange(String, JobState, IOnEventOptions)
(experimental) Create a CloudWatch Event Rule for the transition into the input jobState.
public virtual Rule OnStateChange(string id, JobState jobState, IOnEventOptions options = null)
Parameters
- id System.String
construct id.
- jobState JobState
the job state.
- options IOnEventOptions
optional event options.
Returns
Remarks
Stability: Experimental
OnSuccess(String, IOnEventOptions)
(experimental) Create a CloudWatch Event Rule matching JobState.SUCCEEDED.
public virtual Rule OnSuccess(string id, IOnEventOptions options = null)
Parameters
- id System.String
construct id.
- options IOnEventOptions
optional event options.
Returns
Remarks
Stability: Experimental
OnTimeout(String, IOnEventOptions)
(experimental) Return a CloudWatch Event Rule matching TIMEOUT state.
public virtual Rule OnTimeout(string id, IOnEventOptions options = null)
Parameters
- id System.String
construct id.
- options IOnEventOptions
optional event options.
Returns
Remarks
Stability: Experimental