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

#include <AWSProvider.hpp>

+ Inheritance diagram for openstudio::AWSProvider:

Public Member Functions

Constructor
 AWSProvider ()
 default constructor More...
 
Destructors
virtual ~AWSProvider ()
 virtual destructor More...
 
- Public Member Functions inherited from openstudio::CloudProvider
virtual ~CloudProvider ()
 virtual destructor More...
 
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...
 
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...
 
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...
 
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::AWSProvider_Impl ImplType
 
- Protected Types inherited from openstudio::CloudProvider
typedef detail::CloudProvider_Impl ImplType
 

Protected Member Functions

 AWSProvider (const std::shared_ptr< detail::AWSProvider_Impl > &impl)
 
- Protected Member Functions inherited from openstudio::CloudProvider
 CloudProvider (const std::shared_ptr< detail::CloudProvider_Impl > &impl)
 

Class members

bool requestEstimatedCharges ()
 
bool requestTotalInstances ()
 
double estimatedCharges (int msec=30000)
 
unsigned totalInstances (int msec=30000)
 
double lastEstimatedCharges () const
 
unsigned lastTotalInstances () const
 
static std::vector< std::string > availableRegions ()
 
static std::string defaultRegion ()
 
static std::vector< std::string > serverInstanceTypes ()
 
static std::string defaultServerInstanceType ()
 
static std::vector< std::string > workerInstanceTypes ()
 
static std::string defaultWorkerInstanceType ()
 
static std::vector< unsigned > serverProcessorCounts ()
 
static std::vector< unsigned > workerProcessorCounts ()
 
static std::vector< std::string > serverPrettyNames ()
 
static std::vector< std::string > workerPrettyNames ()
 
static std::string getServerPrettyName (const std::string &instanceType)
 
static std::string getWorkerPrettyName (const std::string &instanceType)
 
static unsigned getServerProcessorCount (const std::string &instanceType)
 
static unsigned getWorkerProcessorCount (const std::string &instanceType)
 
static std::vector
< AWSComputerInformation
serverInformation ()
 
static std::vector
< AWSComputerInformation
workerInformation ()
 

Detailed Description

AWSProvider is a CloudProvider that provides access to Amazon EC2 and CloudWatch services.

Member Typedef Documentation

typedef detail::AWSProvider_Impl openstudio::AWSProvider::ImplType
protected

Constructor & Destructor Documentation

openstudio::AWSProvider::AWSProvider ( )

default constructor

virtual openstudio::AWSProvider::~AWSProvider ( )
inlinevirtual

virtual destructor

openstudio::AWSProvider::AWSProvider ( const std::shared_ptr< detail::AWSProvider_Impl > &  impl)
protected

Member Function Documentation

static std::vector<std::string> openstudio::AWSProvider::availableRegions ( )
static
static std::string openstudio::AWSProvider::defaultRegion ( )
static
static std::string openstudio::AWSProvider::defaultServerInstanceType ( )
static
static std::string openstudio::AWSProvider::defaultWorkerInstanceType ( )
static
double openstudio::AWSProvider::estimatedCharges ( int  msec = 30000)
static std::string openstudio::AWSProvider::getServerPrettyName ( const std::string &  instanceType)
static
static unsigned openstudio::AWSProvider::getServerProcessorCount ( const std::string &  instanceType)
static
static std::string openstudio::AWSProvider::getWorkerPrettyName ( const std::string &  instanceType)
static
static unsigned openstudio::AWSProvider::getWorkerProcessorCount ( const std::string &  instanceType)
static
double openstudio::AWSProvider::lastEstimatedCharges ( ) const
unsigned openstudio::AWSProvider::lastTotalInstances ( ) const
bool openstudio::AWSProvider::requestEstimatedCharges ( )
bool openstudio::AWSProvider::requestTotalInstances ( )
static std::vector<AWSComputerInformation> openstudio::AWSProvider::serverInformation ( )
static
static std::vector<std::string> openstudio::AWSProvider::serverInstanceTypes ( )
static
static std::vector<std::string> openstudio::AWSProvider::serverPrettyNames ( )
static
static std::vector<unsigned> openstudio::AWSProvider::serverProcessorCounts ( )
static
unsigned openstudio::AWSProvider::totalInstances ( int  msec = 30000)
static std::vector<AWSComputerInformation> openstudio::AWSProvider::workerInformation ( )
static
static std::vector<std::string> openstudio::AWSProvider::workerInstanceTypes ( )
static
static std::vector<std::string> openstudio::AWSProvider::workerPrettyNames ( )
static
static std::vector<unsigned> openstudio::AWSProvider::workerProcessorCounts ( )
static