OpenStudioCore:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Protected Types | Protected Member Functions | List of all members
openstudio::CloudProvider Class Reference

#include <CloudProvider.hpp>

+ Inheritance diagram for openstudio::CloudProvider:

Public Member Functions

Destructors
virtual ~CloudProvider ()
 virtual destructor More...
 
Accessor class members
std::string type () const
 returns the name of this type of cloud provider, e.g. 'AWSProvider' More...
 
unsigned numWorkers () const
 returns the number of workers to be requested More...
 
CloudSettings settings () const
 returns the current settings More...
 
bool setSettings (const CloudSettings &settings)
 returns true if can assign settings clears errors and warnings More...
 
CloudSession session () const
 returns the current session More...
 
bool setSession (const CloudSession &session)
 attempts to restore a previously started session returns false if the session does not have serverUrl or workerUrls specified this call does not check that the session is still valid or that the server can be reached clears errors and warnings More...
 
bool lastInternetAvailable () const
 returns the last state of the internet available check More...
 
bool lastServiceAvailable () const
 returns the last state of the service available check More...
 
bool lastValidateCredentials () const
 returns the last state of the validate credentials check More...
 
bool lastResourcesAvailableToStart () const
 returns the last state of the resources available to start check More...
 
bool serverStarted () const
 returns true if requestStartServer has been called relies on local state variable, not network requests this will return true before serverRunning() returns true More...
 
bool workersStarted () const
 returns true if requestStartWorkers has been called relies on local state variable, not network requests this will return true before serverRunning() returns true More...
 
bool lastServerRunning () const
 returns the last state of requestServerRunning More...
 
bool lastWorkersRunning () const
 returns the last state of requestWorkersRunning More...
 
bool lastRunning () const
 returns true if lastServerRunning and lastWorkersRunning More...
 
bool terminateStarted () const
 returns true if requestTerminate has been called relies on local state variable, not network requests this will return true before serverRunning() returns true More...
 
bool lastTerminateCompleted () const
 returns the last state of requestTerminateCompleted More...
 
std::vector< std::string > errors () const
 returns errors generated by the last operation More...
 
std::vector< std::string > warnings () const
 returns warnings generated by the last operation More...
 
Blocking class members
bool internetAvailable (int msec=30000)
 returns true if this computer is connected to the internet clears errors and warnings More...
 
bool serviceAvailable (int msec=30000)
 returns true if the cloud service can be reached (e.g. More...
 
bool validateCredentials (int msec=30000)
 returns true if the cloud service validates user credentials blocking call, clears errors and warnings More...
 
bool resourcesAvailableToStart (int msec=30000)
 returns true if the cloud service has sufficient resources to start the requested instances blocking call, clears errors and warnings More...
 
bool waitForServer (int msec=300000)
 waits up to msec milliseconds and returns true if server url becomes available in that time call requestStartServer before calling this function More...
 
bool waitForWorkers (int msec=300000)
 waits up to msec milliseconds and returns true if worker urls become available in that time call requestStartWorkers before calling this function More...
 
bool serverRunning (int msec=30000)
 returns true if the cloud service shows the server is running blocking call, clears errors and warnings More...
 
bool workersRunning (int msec=30000)
 returns true if the cloud service shows the workers are running blocking call, clears errors and warnings More...
 
bool waitForTerminated (int msec=300000)
 waits up to msec milliseconds and returns true if server and workers are fully terminated in that time call requestTerminate before calling this function More...
 
bool terminateCompleted (int msec=30000)
 returns true if the cloud service shows the server and workers are terminated blocking call, clears errors and warnings More...
 
Non-blocking class members
bool requestInternetAvailable ()
 starts a request to check for internet connectivity clears errors and warnings More...
 
bool requestServiceAvailable ()
 starts a request to check if the cloud service can be reached clears errors and warnings More...
 
bool requestValidateCredentials ()
 starts a request to check if the cloud service validates user credentials clears errors and warnings More...
 
bool requestResourcesAvailableToStart ()
 starts a request to check if the cloud service has sufficient resources to start the requested instances clears errors and warnings More...
 
bool requestStartServer ()
 returns true if the cloud server successfully begins to start the server node returns false if terminated, clears errors and warnings More...
 
bool requestStartWorkers ()
 returns true if the cloud server successfully begins to start all worker nodes returns false if terminated, clears errors and warnings More...
 
bool requestServerRunning ()
 returns true if the cloud server successfully requests the running state of the server More...
 
bool requestWorkersRunning ()
 returns true if the cloud server successfully requests the running state of the workers More...
 
bool requestTerminate ()
 returns true if the cloud server successfully begins to stop all nodes returns false if not running, clears errors and warnings More...
 
bool requestTerminateCompleted ()
 returns true if the cloud server successfully requests the terminated state of the server and workers More...
 
Type Casting
template<typename T >
cast () const
 cast to type T, can throw std::bad_cast More...
 
template<typename T >
boost::optional< T > optionalCast () const
 cast to optional of type T More...
 

Protected Types

typedef detail::CloudProvider_Impl ImplType
 

Protected Member Functions

 CloudProvider (const std::shared_ptr< detail::CloudProvider_Impl > &impl)
 

Detailed Description

CloudProvider is an abstract base class for classes that provide cloud resources.

CloudProvider is designed to be used for one time access. Once the CloudProvider is terminated it cannot be used again.

Member Typedef Documentation

typedef detail::CloudProvider_Impl openstudio::CloudProvider::ImplType
protected

Constructor & Destructor Documentation

virtual openstudio::CloudProvider::~CloudProvider ( )
virtual

virtual destructor

openstudio::CloudProvider::CloudProvider ( const std::shared_ptr< detail::CloudProvider_Impl > &  impl)
protected

Member Function Documentation

template<typename T >
T openstudio::CloudProvider::cast ( ) const
inline

cast to type T, can throw std::bad_cast

std::vector<std::string> openstudio::CloudProvider::errors ( ) const

returns errors generated by the last operation

bool openstudio::CloudProvider::internetAvailable ( int  msec = 30000)

returns true if this computer is connected to the internet clears errors and warnings

bool openstudio::CloudProvider::lastInternetAvailable ( ) const

returns the last state of the internet available check

bool openstudio::CloudProvider::lastResourcesAvailableToStart ( ) const

returns the last state of the resources available to start check

bool openstudio::CloudProvider::lastRunning ( ) const

returns true if lastServerRunning and lastWorkersRunning

bool openstudio::CloudProvider::lastServerRunning ( ) const

returns the last state of requestServerRunning

bool openstudio::CloudProvider::lastServiceAvailable ( ) const

returns the last state of the service available check

bool openstudio::CloudProvider::lastTerminateCompleted ( ) const

returns the last state of requestTerminateCompleted

bool openstudio::CloudProvider::lastValidateCredentials ( ) const

returns the last state of the validate credentials check

bool openstudio::CloudProvider::lastWorkersRunning ( ) const

returns the last state of requestWorkersRunning

unsigned openstudio::CloudProvider::numWorkers ( ) const

returns the number of workers to be requested

template<typename T >
boost::optional<T> openstudio::CloudProvider::optionalCast ( ) const
inline

cast to optional of type T

bool openstudio::CloudProvider::requestInternetAvailable ( )

starts a request to check for internet connectivity clears errors and warnings

bool openstudio::CloudProvider::requestResourcesAvailableToStart ( )

starts a request to check if the cloud service has sufficient resources to start the requested instances clears errors and warnings

bool openstudio::CloudProvider::requestServerRunning ( )

returns true if the cloud server successfully requests the running state of the server

bool openstudio::CloudProvider::requestServiceAvailable ( )

starts a request to check if the cloud service can be reached clears errors and warnings

bool openstudio::CloudProvider::requestStartServer ( )

returns true if the cloud server successfully begins to start the server node returns false if terminated, clears errors and warnings

bool openstudio::CloudProvider::requestStartWorkers ( )

returns true if the cloud server successfully begins to start all worker nodes returns false if terminated, clears errors and warnings

bool openstudio::CloudProvider::requestTerminate ( )

returns true if the cloud server successfully begins to stop all nodes returns false if not running, clears errors and warnings

bool openstudio::CloudProvider::requestTerminateCompleted ( )

returns true if the cloud server successfully requests the terminated state of the server and workers

bool openstudio::CloudProvider::requestValidateCredentials ( )

starts a request to check if the cloud service validates user credentials clears errors and warnings

bool openstudio::CloudProvider::requestWorkersRunning ( )

returns true if the cloud server successfully requests the running state of the workers

bool openstudio::CloudProvider::resourcesAvailableToStart ( int  msec = 30000)

returns true if the cloud service has sufficient resources to start the requested instances blocking call, clears errors and warnings

bool openstudio::CloudProvider::serverRunning ( int  msec = 30000)

returns true if the cloud service shows the server is running blocking call, clears errors and warnings

bool openstudio::CloudProvider::serverStarted ( ) const

returns true if requestStartServer has been called relies on local state variable, not network requests this will return true before serverRunning() returns true

bool openstudio::CloudProvider::serviceAvailable ( int  msec = 30000)

returns true if the cloud service can be reached (e.g.

ping) clears errors and warnings

CloudSession openstudio::CloudProvider::session ( ) const

returns the current session

bool openstudio::CloudProvider::setSession ( const CloudSession session)

attempts to restore a previously started session returns false if the session does not have serverUrl or workerUrls specified this call does not check that the session is still valid or that the server can be reached clears errors and warnings

bool openstudio::CloudProvider::setSettings ( const CloudSettings settings)

returns true if can assign settings clears errors and warnings

CloudSettings openstudio::CloudProvider::settings ( ) const

returns the current settings

bool openstudio::CloudProvider::terminateCompleted ( int  msec = 30000)

returns true if the cloud service shows the server and workers are terminated blocking call, clears errors and warnings

bool openstudio::CloudProvider::terminateStarted ( ) const

returns true if requestTerminate has been called relies on local state variable, not network requests this will return true before serverRunning() returns true

std::string openstudio::CloudProvider::type ( ) const

returns the name of this type of cloud provider, e.g. 'AWSProvider'

bool openstudio::CloudProvider::validateCredentials ( int  msec = 30000)

returns true if the cloud service validates user credentials blocking call, clears errors and warnings

bool openstudio::CloudProvider::waitForServer ( int  msec = 300000)

waits up to msec milliseconds and returns true if server url becomes available in that time call requestStartServer before calling this function

bool openstudio::CloudProvider::waitForTerminated ( int  msec = 300000)

waits up to msec milliseconds and returns true if server and workers are fully terminated in that time call requestTerminate before calling this function

bool openstudio::CloudProvider::waitForWorkers ( int  msec = 300000)

waits up to msec milliseconds and returns true if worker urls become available in that time call requestStartWorkers before calling this function

std::vector<std::string> openstudio::CloudProvider::warnings ( ) const

returns warnings generated by the last operation

bool openstudio::CloudProvider::workersRunning ( int  msec = 30000)

returns true if the cloud service shows the workers are running blocking call, clears errors and warnings

bool openstudio::CloudProvider::workersStarted ( ) const

returns true if requestStartWorkers has been called relies on local state variable, not network requests this will return true before serverRunning() returns true