crew_class_monitor_aws_batch | R Documentation |
AWS Batch monitor R6
class
See crew_monitor_aws_batch()
.
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
See crew_monitor_aws_batch()
.
job_definition
See crew_monitor_aws_batch()
.
log_group
See crew_monitor_aws_batch()
.
config
See crew_monitor_aws_batch()
.
credentials
See crew_monitor_aws_batch()
.
endpoint
See crew_monitor_aws_batch()
.
region
See crew_monitor_aws_batch()
.
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
See crew_monitor_aws_batch()
.
job_definition
See crew_monitor_aws_batch()
.
log_group
See crew_monitor_aws_batch()
.
config
See crew_monitor_aws_batch()
.
credentials
See crew_monitor_aws_batch()
.
endpoint
See crew_monitor_aws_batch()
.
region
See crew_monitor_aws_batch()
.
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 = NULL, all = FALSE, reason = "cancelled/terminated by crew.aws.batch monitor", verbose = TRUE )
ids
Character vector with the IDs of the AWS Batch jobs
to terminate. Leave as NULL
if all
is TRUE
.
all
TRUE
to terminate all jobs belonging to
the previously specified job definition. FALSE
to terminate
only the job IDs given in the ids
argument.
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, path = stdout(), start_from_head = FALSE)
id
Character of length 1, job ID. This is different from the user-supplied job name.
path
Character string or stream (e.g. stdout()
),
file path or connection passed to the con
argument of
writeLines()
to print the log messages.
Set to nullfile()
to suppress output
(and use the invisibly returned tibble
object instead).
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.
log()
invisibly returns a tibble
with log information
and writes the messages to the stream or path given by the
path
argument.
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.