def connect(self): """Connect to the Ravello API server with the given credentials.""" try: self._client = RavelloClient() #self._client.login(self._username, self._password) self._client = RavelloClient(eph_token=self._password) c = self._client self._app = c.get_application_by_name(self._app_name, aspect=self._aspect) self._vm = self.get_vm(self._app, self._vm_name) return True except Exception as e: msg = "Exception while connecting to API server:" + str(e) logging.error(msg) print(msg) return False
def connect_ravello(trial_name): """Return a new Ravello connection.""" client = RavelloClient() client.connect() kwargs = cfgdict(app.config, '{0}_ravello'.format(trial_name), 'ravello') client.login(**kwargs) return client
def setUp(self): url = self.config.get('integration', 'url') or None username = self.config.get('integration', 'username') password = self.config.get('integration', 'password') self.client = RavelloClient() self.client.connect(url) self.client.login(username, password)
def ravello_login(args): try: client = RavelloClient() domain = None if args["domain_id"] == "None" else args["domain_id"] client.login(args["user"], args["password"], domain) return client except Exception as e: print("Error connecting to Ravello: {0}".format(e)) sys.exit(-1)
def create_client(args): """Connect to the Ravello API and return a connection.""" client = RavelloClient() if args['password'] is None: args['password'] = getpass('Enter password for {0}: '.format( args['username'])) client.connect() try: client.login(args['username'], args['password']) except RavelloError: raise RavelloError('could not login with provided credentials') return client
def __init__(self, user, password, application_name, vm_name): self.client = RavelloClient() self.client.login(user, password) self.application_name = application_name self.vm_name = vm_name
#!/usr/bin/python #will probably need these later #import os #import re #import sys #import json from ravello_sdk import RavelloClient client = RavelloClient() client.login('*****@*****.**', 'Redhat1234') for app in client.get_applications(): print('Found Application: {0}'.format(app['name']))