Public Member Functions | List of all members
dx::DXApp Class Reference

Public Member Functions

 DXApp (const std::string &nameOrID, const std::string &alias="default")
 
void setID (const std::string &nameOrID, const std::string &alias="default")
 
dx::JSON describe () const
 
void update (const dx::JSON &to_update) const
 
void addCategories (const dx::JSON &categories) const
 
void removeCategories (const dx::JSON &categories) const
 
void addTags (const dx::JSON &tags) const
 
void removeTags (const dx::JSON &tags) const
 
void install () const
 
void uninstall () const
 
dx::JSON get () const
 
void publish (bool makeDefault=false) const
 
void remove () const
 
DXJob run (const dx::JSON &app_input, const std::string &output_folder="/", const std::vector< std::string > &depends_on=std::vector< std::string >(), const dx::JSON &instance_type=dx::JSON(dx::JSON_NULL), const std::string &project_context=config::CURRENT_PROJECT()) const
 

Constructor & Destructor Documentation

dx::DXApp::DXApp ( const std::string &  nameOrID,
const std::string &  alias = "default" 
)
inline

Creates a handler for the remote app version. Providing only an app name (such as "micromap") selects the version of the app that is tagged "default". You can select an arbitrary version by providing a unique identifier (e.g. "app-j47b1k3z8Jqqv001213v312j1") or a combination of a name and version (e.g. "micromap" "1.0.1").

Parameters
nameOrIDEither the name of the app, (e.g. "micromap"), or the object ID of the app version (e.g. "app-j47b1k3z8Jqqv001213v312j1")
aliasThe version or tag of the app to be used (if nameOrID is an app name)

Member Function Documentation

void dx::DXApp::addCategories ( const dx::JSON &  categories) const

Adds the specified categories to the app. (Setting categories affects all versions of this app.)

See the /app-xxxx[/yyyy]/addCategories API method for more info.

Parameters
categoriesA JSON array of strings, each of which will be added as a category to the app.
void dx::DXApp::addTags ( const dx::JSON &  tags) const

Adds the specified tags to the app.

See the /app-xxxx[/yyyy]/addTags API method for more info.

Parameters
tagsA JSON array of strings, each of which will be added as a tag to the app.
JSON dx::DXApp::describe ( ) const

Returns a description of the app, as specified by the /app-xxxx[/yyyy]/describe API method.

Returns
JSON hash containing the describe output
JSON dx::DXApp::get ( ) const

Returns the full specification of the app as a JSON object, as described in the /app-xxxx[/yyyy]/get API method.

Returns
JSON has containing the full specification of the app
void dx::DXApp::install ( ) const

Installs the app into the requesting user's account.

See the /app-xxxx[/yyyy]/install API method for more info.

void dx::DXApp::publish ( bool  makeDefault = false) const

Makes this version of app discoverable by other users on the DNAnexus platform.

See the /app-xxxx[/yyyy]/publish API method for more info.

Parameters
makeDefaultIf true, then also makes this version of the app the "default".
void dx::DXApp::remove ( ) const

Deletes the app so that it can no longer be run, modified, or published. This state is reflected in output of DXApp::describe.

See the /app-xxxx[/yyyy]/delete API method for more info.

void dx::DXApp::removeCategories ( const dx::JSON &  categories) const

Removes the specified categories from the app. (Setting categories affects all versions of this app.)

See the /app-xxxx[/yyyy]/removeCategories API method for more info.

Parameters
categoriesA JSON array of strings, each of which will be removed as a category from the app.
void dx::DXApp::removeTags ( const dx::JSON &  tags) const

Removes the specified tags from the app.

See the /app-xxxx[/yyyy]/removeTags API method for more info.

Parameters
tagsA JSON array of strings, each of which will be removed as a tag from the app.
DXJob dx::DXApp::run ( const dx::JSON &  app_input,
const std::string &  output_folder = "/",
const std::vector< std::string > &  depends_on = std::vector<std::string>(),
const dx::JSON &  instance_type = dx::JSON(dx::JSON_NULL),
const std::string &  project_context = config::CURRENT_PROJECT() 
) const

Runs this app with the specified input and returns a handler for the resulting job.

See the /app-xxxx[/yyyy]/run API method for more info.

Parameters
app_inputA hash of name/value pairs specifying the input that the app is to be launched with.
output_folderThe folder (within the project_context) in which the app's output objects will be placed.
depends_onA list of job IDs and/or data object IDs (string), representing jobs that must finish and/or data objects that must close before this job should start running.
instance_typeA string, or a JSON_HASH (values must be string), representing instance type on which the job with the entry point "main" will be run, or a mapping of function names to instance types. (Note: you can pass a std::map<string, string> as well)
project_contextThe project context in which the app is to be run (used only if called outside of a running job, i.e., DX_JOB_ID is not set)
Returns
Handler for the job that was launched.
void dx::DXApp::setID ( const std::string &  nameOrID,
const std::string &  alias = "default" 
)
inline

Sets the app ID to that of a different remote app version. Providing only an app name (such as "micromap") selects the version of the app that is tagged "default". You can select an arbitrary version by providing a unique identifier (e.g. "app-j47b1k3z8Jqqv001213v312j1") or a combination of a name and version (e.g. "micromap" "1.0.1").

Parameters
nameOrIDEither the name of the app, (e.g. "micromap"), or the object ID of the app version (e.g. "app-j47b1k3z8Jqqv001213v312j1")
aliasThe version or tag of the app to be used (if nameOrID is an app name)
void dx::DXApp::uninstall ( ) const

Uninstalls the app from the requesting user's account, if it was previously installed. No error is thrown if the app wasn't originally installed.

See the /app-xxxx[/yyyy]/uninstall API method for more info.

void dx::DXApp::update ( const dx::JSON &  to_update) const

Updates the remote app's properties with given input hash, as specified by the /app-xxxx[/yyyy]/update API method.


The documentation for this class was generated from the following files: