RStudio Launcher Plugin SDK
1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
|
Structure which represents a job. More...
#include <Job.hpp>
Public Types | |
enum | State { State::CANCELED, State::FAILED, State::FINISHED, State::KILLED, State::PENDING, State::RUNNING, State::SUSPENDED, State::UNKNOWN } |
Public Member Functions | |
Job () | |
Constructor. | |
Job (const Job &in_other) | |
Copy constructor. More... | |
Job (Job &&in_other) noexcept | |
Move constructor. More... | |
Job & | operator= (const Job &in_other) |
Assignment operator. More... | |
Job & | operator= (Job &&in_other) noexcept |
Move operator. More... | |
Optional< std::string > | getJobConfigValue (const std::string &in_name) const |
Gets a job configuration value, if it exists. More... | |
bool | isCompleted () const |
Checks whether the job has completed (i.e. the job's state is a completed state). More... | |
bool | matchesTags (const std::set< std::string > &in_tags) const |
Checks whether the job has all of the supplied tags. More... | |
json::Object | toJson () const |
Converts this Job to a JSON object which represents it. More... | |
Static Public Member Functions | |
static Error | fromJson (const json::Object &in_json, Job &out_job) |
Constructs a Job from a JSON object which represents the job. More... | |
static Error | stateFromString (const std::string &in_statusString, State &out_status) |
Converts a status string into its equivalent Job::State enum value. More... | |
static std::string | stateToString (State in_status) |
Converts a Job::State enum value into its string representation. More... | |
Public Attributes | |
std::vector< std::string > | Arguments |
std::string | Cluster |
std::string | Command |
The shell command to run. More... | |
JobConfigList | Config |
Optional< Container > | ContainerDetails |
EnvironmentList | Environment |
std::string | Exe |
The executable to run. More... | |
Optional< int > | ExitCode |
ExposedPortList | ExposedPorts |
std::string | Host |
std::string | Id |
Optional< system::DateTime > | LastUpdateTime |
MountList | Mounts |
std::string | Name |
Optional< pid_t > | Pid |
PlacementConstraintList | PlacementConstraints |
std::set< std::string > | Queues |
ResourceLimitList | ResourceLimits |
std::string | StandardIn |
std::string | StandardErrFile |
std::string | StandardOutFile |
State | Status |
std::string | StatusMessage |
system::DateTime | SubmissionTime |
std::set< std::string > | Tags |
system::User | User |
std::string | WorkingDirectory |
Friends | |
class | JobLock |
Structure which represents a job.
|
strong |
rstudio::launcher_plugins::api::Job::Job | ( | const Job & | in_other | ) |
Copy constructor.
in_other | The job to copy. |
|
noexcept |
Move constructor.
in_other | The job to move into this job. |
|
static |
Optional<std::string> rstudio::launcher_plugins::api::Job::getJobConfigValue | ( | const std::string & | in_name | ) | const |
Gets a job configuration value, if it exists.
in_name | The name of the configuration option to retrieve. |
bool rstudio::launcher_plugins::api::Job::isCompleted | ( | ) | const |
Checks whether the job has completed (i.e. the job's state is a completed state).
bool rstudio::launcher_plugins::api::Job::matchesTags | ( | const std::set< std::string > & | in_tags | ) | const |
Checks whether the job has all of the supplied tags.
in_tags | The desired set of tags to filter jobs by. |
|
static |
Converts a status string into its equivalent Job::State enum value.
in_statusString | The string to convert. |
out_status | The converted status, if no error occurred. |
|
static |
Converts a Job::State enum value into its string representation.
in_status | The Job::State value to be converted to string. |
json::Object rstudio::launcher_plugins::api::Job::toJson | ( | ) | const |
std::vector<std::string> rstudio::launcher_plugins::api::Job::Arguments |
The arguments to supply to the Command or Exe.
std::string rstudio::launcher_plugins::api::Job::Cluster |
The name of the cluster which should run this job.
std::string rstudio::launcher_plugins::api::Job::Command |
The shell command to run.
This should be run using a shell such as /bin/sh, as opposed to Exe, which should be invoked directly.
Only one of Command and Exe may be set per job. Jobs which have both set should have been rejected by the Launcher.
JobConfigList rstudio::launcher_plugins::api::Job::Config |
The custom job scheduling specific configuration options that were set by the user for this job.
The container to run the job in. Only used for containerized jobs.
EnvironmentList rstudio::launcher_plugins::api::Job::Environment |
Environment variables to set on the job's run environment.
std::string rstudio::launcher_plugins::api::Job::Exe |
The executable to run.
This should be invoked directly. It is the user's responsibility to ensure that the provided executable is either fully qualified or on the PATH within the job environment.
Only one of Command and Exe may be set per job. Jobs which have both set should have been rejected by the Launcher.
Optional<int> rstudio::launcher_plugins::api::Job::ExitCode |
The exit code of the job, if applicable.
ExposedPortList rstudio::launcher_plugins::api::Job::ExposedPorts |
The ports which were exposed for this job. Only used with containerized jobs.
std::string rstudio::launcher_plugins::api::Job::Host |
The host on which the job was or is being run.
std::string rstudio::launcher_plugins::api::Job::Id |
The unique ID of the job in the scheduling system.
Optional<system::DateTime> rstudio::launcher_plugins::api::Job::LastUpdateTime |
The last time the job was updated.
MountList rstudio::launcher_plugins::api::Job::Mounts |
The file system mounts to set when launching this job.
std::string rstudio::launcher_plugins::api::Job::Name |
The name of the job.
Optional<pid_t> rstudio::launcher_plugins::api::Job::Pid |
The PID of the job, if applicable.
PlacementConstraintList rstudio::launcher_plugins::api::Job::PlacementConstraints |
Custom placement constraints for the job scheduling system that were set by the user for this job.
std::set<std::string> rstudio::launcher_plugins::api::Job::Queues |
The set of queues on which this job may be run, or the queue which ran the job.
ResourceLimitList rstudio::launcher_plugins::api::Job::ResourceLimits |
The resource limits that were set by the user for this job.
std::string rstudio::launcher_plugins::api::Job::StandardErrFile |
The file to which the job's standard error output was written.
std::string rstudio::launcher_plugins::api::Job::StandardIn |
Data which should be supplied to the job via standard in.
std::string rstudio::launcher_plugins::api::Job::StandardOutFile |
The file to which the job's standard output was written.
State rstudio::launcher_plugins::api::Job::Status |
The status of the job.
std::string rstudio::launcher_plugins::api::Job::StatusMessage |
The reason for the status, if any.
system::DateTime rstudio::launcher_plugins::api::Job::SubmissionTime |
The time at which the job was submitted to the job scheduling system.
std::set<std::string> rstudio::launcher_plugins::api::Job::Tags |
The tags which were set on the job by the user. Can be used for filtering jobs based on tags.
system::User rstudio::launcher_plugins::api::Job::User |
The user who ran the job.
std::string rstudio::launcher_plugins::api::Job::WorkingDirectory |
The working directory from which to run the job.