RStudio Launcher Plugin SDK  1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
rstudio::launcher_plugins::api::PlacementConstraint Struct Reference

Struct which represents a custom placement constraint for the job. More...

#include <Job.hpp>

Public Member Functions

 PlacementConstraint ()=default
 Default constructor.
 
 PlacementConstraint (std::string in_name)
 Constructor. More...
 
 PlacementConstraint (std::string in_name, std::string in_value)
 Constructor. More...
 
json::Object toJson () const
 Converts this PlacementConstraint to a JSON object which represents it. More...
 

Static Public Member Functions

static Error fromJson (const json::Object &in_json, PlacementConstraint &out_placementConstraint)
 Constructs a PlacementConstraint from a JSON object which represents the placement constraint. More...
 

Public Attributes

std::string Name
 
std::string Value
 

Detailed Description

Struct which represents a custom placement constraint for the job.

This may be used to allow users to request other resource limits than those supported by ResourceLimit, or it may be used for any other constraint that can affect where a job is run.

There should be a PlacementConstraint for every value of a given constraint type. For example, if the constraint is the AWS region and the allowed AWS regions are us-east-1, us-west-1, and us-west-2, there should be the following PlacementConstraints in the ClusterInfo response: { "name": "region", "value": "us-east-1" } { "name": "region", "value": "us-west-1" } { "name": "region", "value": "us-west-2" }

For more details, see ClusterInfoResponse or PlacementConstraint in the RStudio Job Launcher Documentation: https://docs.rstudio.com/job-launcher/latest/creating-plugins.html#plugin-messages.

Constructor & Destructor Documentation

◆ PlacementConstraint() [1/2]

rstudio::launcher_plugins::api::PlacementConstraint::PlacementConstraint ( std::string  in_name)
explicit

Constructor.

Creates a free-form placement constraint, which allows the user to enter any text value.

Parameters
in_nameThe name of the placement constraint.

◆ PlacementConstraint() [2/2]

rstudio::launcher_plugins::api::PlacementConstraint::PlacementConstraint ( std::string  in_name,
std::string  in_value 
)

Constructor.

Creates an enumeration placement constraint, which allows to

Parameters
in_nameThe name of the placement constraint.
in_valueOne of the possible values for the placement constraint with the specified name.

Member Function Documentation

◆ fromJson()

static Error rstudio::launcher_plugins::api::PlacementConstraint::fromJson ( const json::Object in_json,
PlacementConstraint out_placementConstraint 
)
static

Constructs a PlacementConstraint from a JSON object which represents the placement constraint.

Parameters
in_jsonThe JSON object which represents the placement constraint.
out_placementConstraintThe populated placement constraint value. Not valid if an error is returned.
Returns
Success if in_json could be parsed as a PlacementConstraint; Error otherwise.

◆ toJson()

json::Object rstudio::launcher_plugins::api::PlacementConstraint::toJson ( ) const

Converts this PlacementConstraint to a JSON object which represents it.

Returns
The JSON object which represents this PlacementConstraint.

Member Data Documentation

◆ Name

std::string rstudio::launcher_plugins::api::PlacementConstraint::Name

The name of this placement constraint.

◆ Value

std::string rstudio::launcher_plugins::api::PlacementConstraint::Value

The value of this placement constraint.


The documentation for this struct was generated from the following file: