AWS Batch monitor R6
class
IAM policies
In order for the AWS Batch crew
monitor class to function
properly, your IAM policy needs permission to perform the SubmitJob
,
TerminateJob
, ListJobs
, and DescribeJobs
AWS Batch API calls.
In addition, to download CloudWatch logs with the log()
method,
your IAM policy also needs permission to perform the GetLogEvents
CloudWatch logs API call.
For more information on AWS policies and permissions, please visit
https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html.
See also
Other monitor:
crew_monitor_aws_batch()
Methods
Method new()
AWS Batch job definition constructor.
Usage
crew_class_monitor_aws_batch$new(
job_queue = NULL,
job_definition = NULL,
log_group = NULL,
config = NULL,
credentials = NULL,
endpoint = NULL,
region = NULL
)
Method terminate()
Terminate one or more AWS Batch jobs.
Usage
crew_class_monitor_aws_batch$terminate(
ids,
reason = "terminated by crew.aws.batch monitor",
verbose = TRUE
)
Method log()
Get the CloudWatch log of a job.
Arguments
id
Character of length 1, job ID. This is different from the user-supplied job name.
start_from_head
Logical of length 1, whether to print earlier log events before later ones.
Details
This method assumes the job has log driver "awslogs"
(specifying AWS CloudWatch) and that the log group is the one
prespecified in the log_group
argument of
crew_monitor_aws_batch()
. This method cannot use
other log drivers such as Splunk, and it will fail if the log
group is wrong or missing.
Method jobs()
List all the jobs in the given job queue with the given job definition.
Usage
crew_class_monitor_aws_batch$jobs(
status = c("submitted", "pending", "runnable", "starting", "running", "succeeded",
"failed")
)
Details
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
Method active()
List active jobs: submitted, pending, runnable, starting, or running (not succeeded or failed).
Details
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
Method inactive()
List inactive jobs: ones whose status is succeeded or failed (not submitted, pending, runnable, starting, or running).
Details
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
Method submitted()
List jobs whose status is "submitted"
.
Details
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
Method pending()
List jobs whose status is "pending"
.
Details
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
Method runnable()
List jobs whose status is "runnable"
.
Details
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
Method starting()
List jobs whose status is "starting"
.
Details
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
Method running()
List jobs whose status is "running"
.
Details
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
Method succeeded()
List jobs whose status is "succeeded"
.
Details
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
Method failed()
List jobs whose status is "failed"
.
Details
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.