crew_class_monitor_aws_batch {crew.aws.batch} | R Documentation |
AWS Batch monitor R6
class
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.
job_queue
job_definition
log_group
config
credentials
endpoint
region
new()
AWS Batch job definition constructor.
crew_class_monitor_aws_batch$new( job_queue = NULL, job_definition = NULL, log_group = NULL, config = NULL, credentials = NULL, endpoint = NULL, region = NULL )
job_queue
job_definition
log_group
config
credentials
endpoint
region
AWS Batch job definition object.
validate()
Validate the object.
crew_class_monitor_aws_batch$validate()
NULL
(invisibly). Throws an error if a field is invalid.
terminate()
Terminate one or more AWS Batch jobs.
crew_class_monitor_aws_batch$terminate( ids, reason = "terminated by crew.aws.batch monitor", verbose = TRUE )
ids
Character vector with the IDs of the AWS Batch jobs to terminate.
reason
Character of length 1, natural language explaining the reason the job was terminated.
verbose
Logical of length 1, whether to show a progress bar
if the R process is interactive and length(ids)
is greater than 1.
NULL
(invisibly).
status()
Get the status of a single job
crew_class_monitor_aws_batch$status(id)
id
Character of length 1, job ID. This is different from the user-supplied job name.
A one-row tibble
with information about the job.
log()
Get the CloudWatch log of a job.
crew_class_monitor_aws_batch$log(id, start_from_head = FALSE)
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.
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.
A tibble
with log information.
jobs()
List all the jobs in the given job queue with the given job definition.
crew_class_monitor_aws_batch$jobs( status = c("submitted", "pending", "runnable", "starting", "running", "succeeded", "failed") )
status
Character vector of job states. Results are limited to these job states.
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
A tibble
with one row per job and columns
with job information.
active()
List active jobs: submitted, pending, runnable, starting, or running (not succeeded or failed).
crew_class_monitor_aws_batch$active()
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
A tibble
with one row per job and columns
with job information.
inactive()
List inactive jobs: ones whose status is succeeded or failed (not submitted, pending, runnable, starting, or running).
crew_class_monitor_aws_batch$inactive()
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
A tibble
with one row per job and columns
with job information.
submitted()
List jobs whose status is "submitted"
.
crew_class_monitor_aws_batch$submitted()
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
A tibble
with one row per job and columns
with job information.
pending()
List jobs whose status is "pending"
.
crew_class_monitor_aws_batch$pending()
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
A tibble
with one row per job and columns
with job information.
runnable()
List jobs whose status is "runnable"
.
crew_class_monitor_aws_batch$runnable()
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
A tibble
with one row per job and columns
with job information.
starting()
List jobs whose status is "starting"
.
crew_class_monitor_aws_batch$starting()
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
A tibble
with one row per job and columns
with job information.
running()
List jobs whose status is "running"
.
crew_class_monitor_aws_batch$running()
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
A tibble
with one row per job and columns
with job information.
succeeded()
List jobs whose status is "succeeded"
.
crew_class_monitor_aws_batch$succeeded()
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
A tibble
with one row per job and columns
with job information.
failed()
List jobs whose status is "failed"
.
crew_class_monitor_aws_batch$failed()
The output only includes jobs under the
job queue and job definition
that were supplied through crew_monitor_aws_batch()
.
A tibble
with one row per job and columns
with job information.
Other monitor:
crew_monitor_aws_batch()