diff --git a/CHANGELOG.md b/CHANGELOG.md index c7721305..c241c9f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## (2019-12-06) + + +#### Features + +* **client:** multiple security groups for single vms ([52990be6](52990be6)) + ## (2019-11-19) diff --git a/Makefile b/Makefile index 490fc2ed..99db83c2 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,13 @@ thrift_py: ## Builds python code from thrift file cp -a gen-py/VirtualMachineService/. VirtualMachineService rm -rf gen-py @echo Remember to fix the imports: for pip relative imports are needed, for others absolute imports + +dev: ## Build and Start the docker-compose.dev.yml + docker-compose -f docker-compose.dev.yml up --build + +production: ## Build Release from .env + docker-compose -f docker-compose.yml up --build -d -.PHONY: help lint docs thrift_py \ No newline at end of file +.PHONY: help lint docs thrift_py diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index dcbc4375..f5671e9e 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -13,7 +13,7 @@ from ttypes import otherException from ttypes import flavorNotFoundException from ttypes import ressourceException - from ttypes import Flavor, Image, VM, PlaybookResult + from ttypes import Flavor, Image, VM, PlaybookResult, Backend from constants import VERSION from ancon.Playbook import Playbook @@ -26,7 +26,7 @@ from .ttypes import otherException from .ttypes import flavorNotFoundException from .ttypes import ressourceException - from .ttypes import Flavor, Image, VM, PlaybookResult + from .ttypes import Flavor, Image, VM, PlaybookResult, Backend from .constants import VERSION from .ancon.Playbook import Playbook @@ -48,6 +48,8 @@ from keystoneclient.v3 import client from openstack import connection from oslo_utils import encodeutils +import requests as req +from requests.exceptions import Timeout active_playbooks = dict() @@ -61,7 +63,8 @@ class VirtualMachineHandler(Iface): PREPARE_PLAYBOOK_BUILD = "PREPARE_PLAYBOOK_BUILD" BUILD_PLAYBOOK = "BUILD_PLAYBOOK" PLAYBOOK_FAILED = "PLAYBOOK_FAILED" - DEFAULT_SECURITY_GROUPS = ['defaultSimpleVM'] + DEFAULT_SECURITY_GROUP = 'defaultSimpleVM' + DEFAULT_SECURITY_GROUPS = [DEFAULT_SECURITY_GROUP] def keyboard_interrupt_handler_playbooks(self): global active_playbooks @@ -144,7 +147,12 @@ def __init__(self, config): "floating_ip_network" ] self.AVAIALABILITY_ZONE = cfg["openstack_connection"]["availability_zone"] - self.DEFAULT_SECURITY_GROUP = cfg['openstack_connection']['default_security_group'] + + if cfg["urls"]["forc_url"]: + self.RE_BACKEND_URL = cfg["urls"]["forc_url"] + self.logger.info(msg="BACKEND URL LOADED {0}".format(self.RE_BACKEND_URL)) + else: + self.RE_BACKEND_URL = None if self.USE_GATEWAY: self.GATEWAY_IP = cfg["openstack_connection"]["gateway_ip"] self.SSH_FORMULAR = cfg["openstack_connection"]["ssh_port_calc_formular"] @@ -562,6 +570,7 @@ def create_volume(self, volume_name, diskspace, metadata): raise ressourceException(Reason=str(e)) + def start_server( self, flavor, @@ -571,6 +580,8 @@ def start_server( metadata, diskspace, volumename, + https, + http ): """ Start a new Server. @@ -582,10 +593,13 @@ def start_server( :param elixir_id: Elixir_id of the user who started a new server :param diskspace: Diskspace in GB for volume which should be created :param volumename: Name of the volume + :param http: bool for http rule in security group + :param https: bool for https rule in security group :return: {'openstackid': serverId, 'volumeId': volumeId} """ volume_id = '' self.logger.info("Start Server {0}".format(servername)) + custom_security_groups = [] try: image = self.get_image(image=image) flavor = self.get_flavor(flavor=flavor) @@ -594,6 +608,15 @@ def start_server( public_key = urllib.parse.unquote(public_key) key_pair = self.import_keypair(key_name, public_key) + custom_security_groups.append( + self.create_security_group(name=servername + "_ssh", description="Only SSH").name) + + if http or https: + custom_security_groups.append(self.create_security_group( + name=servername + '_https', + http=http, https=https, + description="Http/Https").name) + if diskspace > "0": volume_id = self.create_volume_by_start(volume_storage=diskspace, volume_name=volumename, @@ -609,7 +632,7 @@ def start_server( meta=metadata, userdata=init_script, availability_zone=self.AVAIALABILITY_ZONE, - security_groups=self.DEFAULT_SECURITY_GROUPS + security_groups=self.DEFAULT_SECURITY_GROUPS + custom_security_groups ) else: @@ -621,18 +644,20 @@ def start_server( key_name=key_pair.name, meta=metadata, availability_zone=self.AVAIALABILITY_ZONE, - security_groups=self.DEFAULT_SECURITY_GROUPS + security_groups=self.DEFAULT_SECURITY_GROUPS + custom_security_groups ) openstack_id = server['id'] return {"openstackid": openstack_id, "volumeId": volume_id} except Exception as e: + for security_group in custom_security_groups: + self.conn.network.delete_security_group(security_group) self.logger.exception("Start Server {1} error:{0}".format(e, servername)) return {} def start_server_with_custom_key(self, flavor, image, servername, metadata, diskspace, - volumename): + volumename, http, https): """ Start a new Server. @@ -648,11 +673,23 @@ def start_server_with_custom_key(self, flavor, image, servername, metadata, disk """ self.logger.info("Start Server {} with custom key".format(servername)) volume_id = '' + custom_security_groups = [] + try: image = self.get_image(image=image) flavor = self.get_flavor(flavor=flavor) network = self.get_network() key_creation = self.conn.create_keypair(name=servername) + + custom_security_groups.append( + self.create_security_group(name=servername + "_ssh", description="Only SSH").name) + + if http or https: + custom_security_groups.append(self.create_security_group( + name=servername + '_https', + http=http, https=https, + description="Http/Https").name) + try: private_key = key_creation["private_key"] except Exception: @@ -664,6 +701,7 @@ def start_server_with_custom_key(self, flavor, image, servername, metadata, disk server_name=servername, metadata=metadata) init_script = self.create_mount_init_script(volume_id=volume_id) + server = self.conn.create_server( name=servername, image=image.id, @@ -673,8 +711,7 @@ def start_server_with_custom_key(self, flavor, image, servername, metadata, disk meta=metadata, userdata=init_script, availability_zone=self.AVAIALABILITY_ZONE, - security_groups=self.DEFAULT_SECURITY_GROUPS - + security_groups=self.DEFAULT_SECURITY_GROUPS + custom_security_groups ) else: server = self.conn.create_server( @@ -684,9 +721,9 @@ def start_server_with_custom_key(self, flavor, image, servername, metadata, disk network=[network.id], key_name=servername, meta=metadata, - availability_zone=self.AVAIALABILITY_ZONE, - security_groups=self.DEFAULT_SECURITY_GROUPS + availability_zone=self.AVAIALABILITY_ZONE, + security_groups=self.DEFAULT_SECURITY_GROUPS + custom_security_groups ) openstack_id = server['id'] @@ -696,6 +733,8 @@ def start_server_with_custom_key(self, flavor, image, servername, metadata, disk return {"openstackid": openstack_id, "volumeId": volume_id, 'private_key': private_key} except Exception as e: self.delete_keypair(key_name=servername) + for security_group in custom_security_groups: + self.conn.network.delete_security_group(security_group) self.logger.exception("Start Server {1} error:{0}".format(e, servername)) return {} @@ -717,12 +756,168 @@ def create_and_deploy_playbook(self, public_key, playbooks_information, openstac active_playbooks[openstack_id] = playbook return 0 + def has_forc(self): + return self.RE_BACKEND_URL is not None + + def create_backend(self, elixir_id, user_key_url, template, template_version, upstream_url): + try: + post_url = "{0}backends/".format(self.RE_BACKEND_URL) + backend_info = { + "owner": elixir_id, + "user_key_url": user_key_url, + "template": template, + "template_version": template_version, + "upstream_url": upstream_url + } + except Exception as e: + self.logger.exception(e) + return {} + try: + response = req.post(post_url, json=backend_info, timeout=(30, 30), headers={"X-API-KEY": "fn438hf37ffbn8"}) + try: + data = response.json() + except Exception as e: + self.logger.exception(e) + return {} + return Backend(id=data["id"], + owner=data["owner"], + location_url=data["location_url"], + template=data["template"], + template_version=data["template_version"]) + except Timeout as e: + self.logger.info(msg="create_backend timed out. {0}".format(e)) + return {} + except Exception as e: + self.logger.exception(e) + return {} + + def get_backends(self): + get_url = "{0}/backends/".format(self.RE_BACKEND_URL) + try: + response = req.get(get_url, timeout=(30, 30), headers={"X-API-KEY": "fn438hf37ffbn8"}) + if response.status_code == 401: + return [response.json()] + else: + backends = [] + for data in response.json(): + backends.append(Backend(id=data["id"], + owner=data["owner"], + location_url=data["location_url"], + template=data["template"], + template_version=data["template_version"])) + return backends + except Timeout as e: + self.logger.info(msg="create_backend timed out. {0}".format(e)) + + def get_backends_by_owner(self, elixir_id): + get_url = "{0}/backends/byOwner/{1}".format(self.RE_BACKEND_URL, elixir_id) + try: + response = req.get(get_url, timeout=(30, 30), headers={"X-API-KEY": "fn438hf37ffbn8"}) + if response.status_code == 401: + return [response.json()] + else: + backends = [] + for data in response.json(): + backends.append(Backend(id=data["id"], + owner=data["owner"], + location_url=data["location_url"], + template=data["template"], + template_version=data["template_version"])) + return backends + except Timeout as e: + self.logger.info(msg="create_backend timed out. {0}".format(e)) + + def get_backends_by_template(self, template): + get_url = "{0}/backends/byTemplate/{1}".format(self.RE_BACKEND_URL, template) + try: + response = req.get(get_url, timeout=(30, 30), headers={"X-API-KEY": "fn438hf37ffbn8"}) + if response.status_code == 401: + return [response.json()] + else: + backends = [] + for data in response.json(): + backends.append(Backend(id=data["id"], + owner=data["owner"], + location_url=data["location_url"], + template=data["template"], + template_version=data["template_version"])) + return backends + except Timeout as e: + self.logger.info(msg="create_backend timed out. {0}".format(e)) + + def get_backend_by_id(self, id): + get_url = "{0}/backends/{1}".format(self.RE_BACKEND_URL, id) + try: + response = req.get(get_url, timeout=(30, 30), headers={"X-API-KEY": "fn438hf37ffbn8"}) + try: + data = response.json() + except Exception as e: + self.logger.exception(e) + return {} + return Backend(id=data["id"], + owner=data["owner"], + location_url=data["location_url"], + template=data["template"], + template_version=data["template_version"]) + except Timeout as e: + self.logger.info(msg="create_backend timed out. {0}".format(e)) + + def delete_backend(self, id): + delete_url = "{0}/backends/{1}".format(self.RE_BACKEND_URL, id) + try: + response = req.delete(delete_url, timeout=(30, 30), headers={"X-API-KEY": "fn438hf37ffbn8"}) + if response.status_code != 200: + return str(response.json()) + elif response.status_code == 200: + return str(True) + except Timeout as e: + self.logger.info(msg="create_backend timed out. {0}".format(e)) + return str(-1) + except Exception as e: + self.logger.exception(e) + return str(-1) + def exist_server(self, name): if self.conn.compute.find_server(name) is not None: return True else: return False + def get_templates(self): + get_url = "{0}templates/".format(self.RE_BACKEND_URL) + self.logger.info(get_url) + try: + response = req.get(get_url, timeout=(30, 30), headers={"X-API-KEY": "fn438hf37ffbn8"}) + self.logger.info(response.json()) + if response.status_code == 401: + return [response.json()] + else: + return response.json() + except Timeout as e: + self.logger.info(msg="create_backend timed out. {0}".format(e)) + + def get_templates_by_template(self, template_name): + get_url = "{0}/templates/{1}".format(self.RE_BACKEND_URL, template_name) + try: + response = req.get(get_url, timeout=(30, 30), headers={"X-API-KEY": "fn438hf37ffbn8"}) + if response.status_code == 401: + return [response.json()] + else: + return response.json() + except Timeout as e: + self.logger.info(msg="create_backend timed out. {0}".format(e)) + + def check_template(self, template_name, template_version): + get_url = "{0}/templates/{1}/{2}".format(self.RE_BACKEND_URL, template_name, template_version) + try: + response = req.get(get_url, timeout=(30, 30), headers={"X-API-KEY": "fn438hf37ffbn8"}) + if response.status_code == 401: + return [response.json()] + else: + return response.json() + except Timeout as e: + self.logger.info(msg="create_backend timed out. {0}".format(e)) + def get_playbook_logs(self, openstack_id): global active_playbooks if self.redis.exists(openstack_id) == 1 and openstack_id in active_playbooks: @@ -948,11 +1143,10 @@ def add_security_group_to_server(self, http, https, udp, server_id): :return: """ self.logger.info("Setting up security groups for {0}".format(server_id)) - if self.conn.network.find_security_group(server_id) is not None: - self.logger.info( - "Security group with name {0} already exists. Returning from function.".format( - server_id)) - return True + server = self.conn.get_server(name_or_id=server_id) + if server is None: + self.logger.exception("Instance {0} not found".format(server_id)) + raise serverNotFoundException ip_base = \ list(self.conn.compute.server_ips(server=server_id))[0].to_dict()['address'].split(".")[ @@ -960,22 +1154,16 @@ def add_security_group_to_server(self, http, https, udp, server_id): x = int(ip_base) udp_port_start = eval(self.UDP_PORT_CALCULATION) - security_group = self.conn.network.find_security_group(name_or_id=server_id) - if security_group: - self.conn.compute.remove_security_group_from_server(server=server_id, - security_group=security_group) - self.conn.network.delete_security_group(security_group) - security_group = self.create_security_group( - name=server_id, + name=server.name + "_udp", udp_port_start=udp_port_start, udp=udp, - ssh=True, + ssh=False, https=https, - http=http, + http=http, description="UDP" ) - self.conn.compute.add_security_group_to_server( - server=server_id, security_group=security_group + self.conn.add_server_security_groups( + server=server, security_groups=[security_group] ) return True @@ -1166,19 +1354,17 @@ def delete_server(self, openstack_id): """ self.logger.info("Delete Server {0}".format(openstack_id)) try: - server = self.conn.compute.get_server(openstack_id) + server = self.conn.get_server(openstack_id) if server is None: self.logger.exception("Instance {0} not found".format(openstack_id)) raise serverNotFoundException - self.logger.info(server) - self.logger.info(server.name) - try: - security_groups = self.conn.network.security_groups(name=openstack_id) - except Exception as e: - self.logger.exception(e) + security_groups = self.conn.list_server_security_groups(server=server) + self.logger.info(security_groups) + security_groups = [sec for sec in security_groups if + sec.name != self.DEFAULT_SECURITY_GROUP] if security_groups is not None: for sg in security_groups: - self.logger.info("Delete security group {0}".format(openstack_id)) + self.logger.info("Delete security group {0}".format(sg.name)) self.conn.compute.remove_security_group_from_server(server=server, security_group=sg) self.conn.network.delete_security_group(sg) @@ -1321,10 +1507,11 @@ def resume_server(self, openstack_id): return False def create_security_group( - self, name, udp_port_start=None, ssh=True, http=False, https=False, udp=False + self, name, udp_port_start=None, ssh=True, http=False, https=False, udp=False, + description=None ): self.logger.info("Create new security group {}".format(name)) - new_security_group = self.conn.network.create_security_group(name=name) + new_security_group = self.conn.create_security_group(name=name, description=description) if http: self.logger.info("Add http rule to security group {}".format(name)) self.conn.network.create_security_group_rule( diff --git a/VirtualMachineService/VirtualMachineService-remote b/VirtualMachineService/VirtualMachineService-remote index 9a388eb2..32cf1c94 100755 --- a/VirtualMachineService/VirtualMachineService-remote +++ b/VirtualMachineService/VirtualMachineService-remote @@ -36,11 +36,21 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print(' delete_metadata_from_server(string servername, keys)') print(' string add_floating_ip_to_server(string openstack_id, string network)') print(' bool create_connection(string username, string password, string auth_url, string user_domain_name, string project_domain_name)') - print(' start_server(string flavor, string image, string public_key, string servername, metadata, string diskspace, string volumename)') - print(' start_server_with_custom_key(string flavor, string image, string servername, metadata, string diskspace, string volumename)') + print(' start_server(string flavor, string image, string public_key, string servername, metadata, string diskspace, string volumename, bool https, bool http)') + print(' start_server_with_custom_key(string flavor, string image, string servername, metadata, string diskspace, string volumename, bool http, bool https)') print(' bool exist_server(string name)') print(' int create_and_deploy_playbook(string public_key, playbooks_information, string openstack_id)') print(' PlaybookResult get_playbook_logs(string openstack_id)') + print(' bool has_forc()') + print(' Backend create_backend(string elixir_id, string user_key_url, string template, string template_version, string upstream_url)') + print(' get_backends()') + print(' get_backends_by_owner(string elixir_id)') + print(' get_backends_by_template(string template)') + print(' Backend get_backend_by_id(i64 id)') + print(' string delete_backend(i64 id)') + print(' get_templates()') + print(' get_templates_by_template(string template_name)') + print(' check_template(string template_name, string template_version)') print(' bool add_security_group_to_server(bool http, bool https, bool udp, string server_id)') print(' get_servers()') print(' get_servers_by_ids( server_ids)') @@ -209,16 +219,16 @@ elif cmd == 'create_connection': pp.pprint(client.create_connection(args[0], args[1], args[2], args[3], args[4],)) elif cmd == 'start_server': - if len(args) != 7: - print('start_server requires 7 args') + if len(args) != 9: + print('start_server requires 9 args') sys.exit(1) - pp.pprint(client.start_server(args[0], args[1], args[2], args[3], eval(args[4]), args[5], args[6],)) + pp.pprint(client.start_server(args[0], args[1], args[2], args[3], eval(args[4]), args[5], args[6], eval(args[7]), eval(args[8]),)) elif cmd == 'start_server_with_custom_key': - if len(args) != 6: - print('start_server_with_custom_key requires 6 args') + if len(args) != 8: + print('start_server_with_custom_key requires 8 args') sys.exit(1) - pp.pprint(client.start_server_with_custom_key(args[0], args[1], args[2], eval(args[3]), args[4], args[5],)) + pp.pprint(client.start_server_with_custom_key(args[0], args[1], args[2], eval(args[3]), args[4], args[5], eval(args[6]), eval(args[7]),)) elif cmd == 'exist_server': if len(args) != 1: @@ -238,6 +248,66 @@ elif cmd == 'get_playbook_logs': sys.exit(1) pp.pprint(client.get_playbook_logs(args[0],)) +elif cmd == 'has_forc': + if len(args) != 0: + print('has_forc requires 0 args') + sys.exit(1) + pp.pprint(client.has_forc()) + +elif cmd == 'create_backend': + if len(args) != 5: + print('create_backend requires 5 args') + sys.exit(1) + pp.pprint(client.create_backend(args[0], args[1], args[2], args[3], args[4],)) + +elif cmd == 'get_backends': + if len(args) != 0: + print('get_backends requires 0 args') + sys.exit(1) + pp.pprint(client.get_backends()) + +elif cmd == 'get_backends_by_owner': + if len(args) != 1: + print('get_backends_by_owner requires 1 args') + sys.exit(1) + pp.pprint(client.get_backends_by_owner(args[0],)) + +elif cmd == 'get_backends_by_template': + if len(args) != 1: + print('get_backends_by_template requires 1 args') + sys.exit(1) + pp.pprint(client.get_backends_by_template(args[0],)) + +elif cmd == 'get_backend_by_id': + if len(args) != 1: + print('get_backend_by_id requires 1 args') + sys.exit(1) + pp.pprint(client.get_backend_by_id(eval(args[0]),)) + +elif cmd == 'delete_backend': + if len(args) != 1: + print('delete_backend requires 1 args') + sys.exit(1) + pp.pprint(client.delete_backend(eval(args[0]),)) + +elif cmd == 'get_templates': + if len(args) != 0: + print('get_templates requires 0 args') + sys.exit(1) + pp.pprint(client.get_templates()) + +elif cmd == 'get_templates_by_template': + if len(args) != 1: + print('get_templates_by_template requires 1 args') + sys.exit(1) + pp.pprint(client.get_templates_by_template(args[0],)) + +elif cmd == 'check_template': + if len(args) != 2: + print('check_template requires 2 args') + sys.exit(1) + pp.pprint(client.check_template(args[0], args[1],)) + elif cmd == 'add_security_group_to_server': if len(args) != 4: print('add_security_group_to_server requires 4 args') diff --git a/VirtualMachineService/VirtualMachineService.py b/VirtualMachineService/VirtualMachineService.py index 96b454d3..766bff00 100644 --- a/VirtualMachineService/VirtualMachineService.py +++ b/VirtualMachineService/VirtualMachineService.py @@ -148,7 +148,7 @@ def create_connection(self, username, password, auth_url, user_domain_name, proj """ pass - def start_server(self, flavor, image, public_key, servername, metadata, diskspace, volumename): + def start_server(self, flavor, image, public_key, servername, metadata, diskspace, volumename, https, http): """ Start a new server. @@ -160,11 +160,13 @@ def start_server(self, flavor, image, public_key, servername, metadata, diskspac - metadata: Metadata for the new instance - diskspace: Diskspace in GB for additional volume. - volumename: Name of additional Volume + - https + - http """ pass - def start_server_with_custom_key(self, flavor, image, servername, metadata, diskspace, volumename): + def start_server_with_custom_key(self, flavor, image, servername, metadata, diskspace, volumename, http, https): """ Start a new server with custom key for ansible. @@ -175,6 +177,8 @@ def start_server_with_custom_key(self, flavor, image, servername, metadata, disk - metadata: Metadata for the new instance - diskspace: Diskspace in GB for additional volume. - volumename: Name of additional Volume + - http: Boolean for http security rule + - https: Boolean for https security rule """ pass @@ -211,6 +215,94 @@ def get_playbook_logs(self, openstack_id): """ pass + def has_forc(self): + """ + Get boolean if client has backend url configured + + """ + pass + + def create_backend(self, elixir_id, user_key_url, template, template_version, upstream_url): + """ + Create a backend + + Parameters: + - elixir_id + - user_key_url + - template + - template_version + - upstream_url + + """ + pass + + def get_backends(self): + """ + Get all backends + + """ + pass + + def get_backends_by_owner(self, elixir_id): + """ + Get all backends by owner + + Parameters: + - elixir_id + + """ + pass + + def get_backends_by_template(self, template): + """ + Get all backends by template + + Parameters: + - template + + """ + pass + + def get_backend_by_id(self, id): + """ + Get a backend by id + + Parameters: + - id + + """ + pass + + def delete_backend(self, id): + """ + Delete a backend + + Parameters: + - id + + """ + pass + + def get_templates(self): + pass + + def get_templates_by_template(self, template_name): + """ + Parameters: + - template_name + + """ + pass + + def check_template(self, template_name, template_version): + """ + Parameters: + - template_name + - template_version + + """ + pass + def add_security_group_to_server(self, http, https, udp, server_id): """ Adds a security group to a server @@ -840,7 +932,7 @@ def recv_create_connection(self): raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "create_connection failed: unknown result") - def start_server(self, flavor, image, public_key, servername, metadata, diskspace, volumename): + def start_server(self, flavor, image, public_key, servername, metadata, diskspace, volumename, https, http): """ Start a new server. @@ -852,12 +944,14 @@ def start_server(self, flavor, image, public_key, servername, metadata, diskspac - metadata: Metadata for the new instance - diskspace: Diskspace in GB for additional volume. - volumename: Name of additional Volume + - https + - http """ - self.send_start_server(flavor, image, public_key, servername, metadata, diskspace, volumename) + self.send_start_server(flavor, image, public_key, servername, metadata, diskspace, volumename, https, http) return self.recv_start_server() - def send_start_server(self, flavor, image, public_key, servername, metadata, diskspace, volumename): + def send_start_server(self, flavor, image, public_key, servername, metadata, diskspace, volumename, https, http): self._oprot.writeMessageBegin('start_server', TMessageType.CALL, self._seqid) args = start_server_args() args.flavor = flavor @@ -867,6 +961,8 @@ def send_start_server(self, flavor, image, public_key, servername, metadata, dis args.metadata = metadata args.diskspace = diskspace args.volumename = volumename + args.https = https + args.http = http args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() @@ -900,7 +996,7 @@ def recv_start_server(self): raise result.o raise TApplicationException(TApplicationException.MISSING_RESULT, "start_server failed: unknown result") - def start_server_with_custom_key(self, flavor, image, servername, metadata, diskspace, volumename): + def start_server_with_custom_key(self, flavor, image, servername, metadata, diskspace, volumename, http, https): """ Start a new server with custom key for ansible. @@ -911,12 +1007,14 @@ def start_server_with_custom_key(self, flavor, image, servername, metadata, disk - metadata: Metadata for the new instance - diskspace: Diskspace in GB for additional volume. - volumename: Name of additional Volume + - http: Boolean for http security rule + - https: Boolean for https security rule """ - self.send_start_server_with_custom_key(flavor, image, servername, metadata, diskspace, volumename) + self.send_start_server_with_custom_key(flavor, image, servername, metadata, diskspace, volumename, http, https) return self.recv_start_server_with_custom_key() - def send_start_server_with_custom_key(self, flavor, image, servername, metadata, diskspace, volumename): + def send_start_server_with_custom_key(self, flavor, image, servername, metadata, diskspace, volumename, http, https): self._oprot.writeMessageBegin('start_server_with_custom_key', TMessageType.CALL, self._seqid) args = start_server_with_custom_key_args() args.flavor = flavor @@ -925,6 +1023,8 @@ def send_start_server_with_custom_key(self, flavor, image, servername, metadata, args.metadata = metadata args.diskspace = diskspace args.volumename = volumename + args.http = http + args.https = https args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() @@ -1064,32 +1164,22 @@ def recv_get_playbook_logs(self): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "get_playbook_logs failed: unknown result") - def add_security_group_to_server(self, http, https, udp, server_id): + def has_forc(self): """ - Adds a security group to a server - - Parameters: - - http: If http ports are open - - https: If https ports are open - - udp: If udp ports are open - - server_id: OpenStack id of the server + Get boolean if client has backend url configured """ - self.send_add_security_group_to_server(http, https, udp, server_id) - return self.recv_add_security_group_to_server() + self.send_has_forc() + return self.recv_has_forc() - def send_add_security_group_to_server(self, http, https, udp, server_id): - self._oprot.writeMessageBegin('add_security_group_to_server', TMessageType.CALL, self._seqid) - args = add_security_group_to_server_args() - args.http = http - args.https = https - args.udp = udp - args.server_id = server_id + def send_has_forc(self): + self._oprot.writeMessageBegin('has_forc', TMessageType.CALL, self._seqid) + args = has_forc_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_add_security_group_to_server(self): + def recv_has_forc(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1097,34 +1187,41 @@ def recv_add_security_group_to_server(self): x.read(iprot) iprot.readMessageEnd() raise x - result = add_security_group_to_server_result() + result = has_forc_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success - if result.r is not None: - raise result.r - if result.s is not None: - raise result.s - raise TApplicationException(TApplicationException.MISSING_RESULT, "add_security_group_to_server failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "has_forc failed: unknown result") - def get_servers(self): + def create_backend(self, elixir_id, user_key_url, template, template_version, upstream_url): """ - Get all servers. - Returns: List of server instances. + Create a backend + + Parameters: + - elixir_id + - user_key_url + - template + - template_version + - upstream_url """ - self.send_get_servers() - return self.recv_get_servers() + self.send_create_backend(elixir_id, user_key_url, template, template_version, upstream_url) + return self.recv_create_backend() - def send_get_servers(self): - self._oprot.writeMessageBegin('get_servers', TMessageType.CALL, self._seqid) - args = get_servers_args() + def send_create_backend(self, elixir_id, user_key_url, template, template_version, upstream_url): + self._oprot.writeMessageBegin('create_backend', TMessageType.CALL, self._seqid) + args = create_backend_args() + args.elixir_id = elixir_id + args.user_key_url = user_key_url + args.template = template + args.template_version = template_version + args.upstream_url = upstream_url args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_get_servers(self): + def recv_create_backend(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1132,34 +1229,29 @@ def recv_get_servers(self): x.read(iprot) iprot.readMessageEnd() raise x - result = get_servers_result() + result = create_backend_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "get_servers failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "create_backend failed: unknown result") - def get_servers_by_ids(self, server_ids): + def get_backends(self): """ - * Get list of servers by ids - * - - Parameters: - - server_ids + Get all backends """ - self.send_get_servers_by_ids(server_ids) - return self.recv_get_servers_by_ids() + self.send_get_backends() + return self.recv_get_backends() - def send_get_servers_by_ids(self, server_ids): - self._oprot.writeMessageBegin('get_servers_by_ids', TMessageType.CALL, self._seqid) - args = get_servers_by_ids_args() - args.server_ids = server_ids + def send_get_backends(self): + self._oprot.writeMessageBegin('get_backends', TMessageType.CALL, self._seqid) + args = get_backends_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_get_servers_by_ids(self): + def recv_get_backends(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1167,34 +1259,33 @@ def recv_get_servers_by_ids(self): x.read(iprot) iprot.readMessageEnd() raise x - result = get_servers_by_ids_result() + result = get_backends_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "get_servers_by_ids failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_backends failed: unknown result") - def get_server(self, openstack_id): + def get_backends_by_owner(self, elixir_id): """ - Get a Server. - Returns: A server instance. + Get all backends by owner Parameters: - - openstack_id: Id of the server. + - elixir_id """ - self.send_get_server(openstack_id) - return self.recv_get_server() + self.send_get_backends_by_owner(elixir_id) + return self.recv_get_backends_by_owner() - def send_get_server(self, openstack_id): - self._oprot.writeMessageBegin('get_server', TMessageType.CALL, self._seqid) - args = get_server_args() - args.openstack_id = openstack_id + def send_get_backends_by_owner(self, elixir_id): + self._oprot.writeMessageBegin('get_backends_by_owner', TMessageType.CALL, self._seqid) + args = get_backends_by_owner_args() + args.elixir_id = elixir_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_get_server(self): + def recv_get_backends_by_owner(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1202,36 +1293,33 @@ def recv_get_server(self): x.read(iprot) iprot.readMessageEnd() raise x - result = get_server_result() + result = get_backends_by_owner_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success - if result.e is not None: - raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "get_server failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_backends_by_owner failed: unknown result") - def stop_server(self, openstack_id): + def get_backends_by_template(self, template): """ - Stop a Server. - Returns: True if stopped, False if not. + Get all backends by template Parameters: - - openstack_id: Id of the server. + - template """ - self.send_stop_server(openstack_id) - return self.recv_stop_server() + self.send_get_backends_by_template(template) + return self.recv_get_backends_by_template() - def send_stop_server(self, openstack_id): - self._oprot.writeMessageBegin('stop_server', TMessageType.CALL, self._seqid) - args = stop_server_args() - args.openstack_id = openstack_id + def send_get_backends_by_template(self, template): + self._oprot.writeMessageBegin('get_backends_by_template', TMessageType.CALL, self._seqid) + args = get_backends_by_template_args() + args.template = template args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_stop_server(self): + def recv_get_backends_by_template(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1239,45 +1327,33 @@ def recv_stop_server(self): x.read(iprot) iprot.readMessageEnd() raise x - result = stop_server_result() + result = get_backends_by_template_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success - if result.e is not None: - raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "stop_server failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_backends_by_template failed: unknown result") - def create_snapshot(self, openstack_id, name, elixir_id, base_tag, description): + def get_backend_by_id(self, id): """ - Create Snapshot. - Returns: Id of new Snapshot - + Get a backend by id Parameters: - - openstack_id: Id of the server - - name: Name of new Snapshot - - elixir_id: Elixir-Id of the user who requested creation of Snapshot - - base_tag: Tag with which the servers image is also tagged ( for connection information at the webapp) - - description: Description of the new snapshot + - id """ - self.send_create_snapshot(openstack_id, name, elixir_id, base_tag, description) - return self.recv_create_snapshot() + self.send_get_backend_by_id(id) + return self.recv_get_backend_by_id() - def send_create_snapshot(self, openstack_id, name, elixir_id, base_tag, description): - self._oprot.writeMessageBegin('create_snapshot', TMessageType.CALL, self._seqid) - args = create_snapshot_args() - args.openstack_id = openstack_id - args.name = name - args.elixir_id = elixir_id - args.base_tag = base_tag - args.description = description + def send_get_backend_by_id(self, id): + self._oprot.writeMessageBegin('get_backend_by_id', TMessageType.CALL, self._seqid) + args = get_backend_by_id_args() + args.id = id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_create_snapshot(self): + def recv_get_backend_by_id(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1285,34 +1361,33 @@ def recv_create_snapshot(self): x.read(iprot) iprot.readMessageEnd() raise x - result = create_snapshot_result() + result = get_backend_by_id_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success - if result.e is not None: - raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "create_snapshot failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_backend_by_id failed: unknown result") - def get_limits(self): + def delete_backend(self, id): """ - Get Limits of OpenStack Projekt from client. - Returns: {'maxTotalVolumes': maxTotalVolumes, 'maxTotalVolumeGigabytes': maxTotalVolumeGigabytes, - 'maxTotalInstances': maxTotalInstances, 'totalRamUsed': totalRamUsed, - 'totalInstancesUsed': totalInstancesUsed} + Delete a backend + + Parameters: + - id """ - self.send_get_limits() - return self.recv_get_limits() + self.send_delete_backend(id) + return self.recv_delete_backend() - def send_get_limits(self): - self._oprot.writeMessageBegin('get_limits', TMessageType.CALL, self._seqid) - args = get_limits_args() + def send_delete_backend(self, id): + self._oprot.writeMessageBegin('delete_backend', TMessageType.CALL, self._seqid) + args = delete_backend_args() + args.id = id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_get_limits(self): + def recv_delete_backend(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1320,34 +1395,25 @@ def recv_get_limits(self): x.read(iprot) iprot.readMessageEnd() raise x - result = get_limits_result() + result = delete_backend_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "get_limits failed: unknown result") - - def delete_image(self, image_id): - """ - Delete Image. - Return: True if deleted, False if not - - Parameters: - - image_id: Id of image + raise TApplicationException(TApplicationException.MISSING_RESULT, "delete_backend failed: unknown result") - """ - self.send_delete_image(image_id) - return self.recv_delete_image() + def get_templates(self): + self.send_get_templates() + return self.recv_get_templates() - def send_delete_image(self, image_id): - self._oprot.writeMessageBegin('delete_image', TMessageType.CALL, self._seqid) - args = delete_image_args() - args.image_id = image_id + def send_get_templates(self): + self._oprot.writeMessageBegin('get_templates', TMessageType.CALL, self._seqid) + args = get_templates_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_delete_image(self): + def recv_get_templates(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1355,38 +1421,31 @@ def recv_delete_image(self): x.read(iprot) iprot.readMessageEnd() raise x - result = delete_image_result() + result = get_templates_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success - if result.e is not None: - raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "delete_image failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_templates failed: unknown result") - def delete_volume_attachment(self, volume_id, server_id): + def get_templates_by_template(self, template_name): """ - Delete volume attachment - Return: True if deleted, False if not - Parameters: - - volume_id: Id of the attached volume - - server_id: Id of the server where the volume is attached + - template_name """ - self.send_delete_volume_attachment(volume_id, server_id) - return self.recv_delete_volume_attachment() + self.send_get_templates_by_template(template_name) + return self.recv_get_templates_by_template() - def send_delete_volume_attachment(self, volume_id, server_id): - self._oprot.writeMessageBegin('delete_volume_attachment', TMessageType.CALL, self._seqid) - args = delete_volume_attachment_args() - args.volume_id = volume_id - args.server_id = server_id + def send_get_templates_by_template(self, template_name): + self._oprot.writeMessageBegin('get_templates_by_template', TMessageType.CALL, self._seqid) + args = get_templates_by_template_args() + args.template_name = template_name args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_delete_volume_attachment(self): + def recv_get_templates_by_template(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1394,36 +1453,33 @@ def recv_delete_volume_attachment(self): x.read(iprot) iprot.readMessageEnd() raise x - result = delete_volume_attachment_result() + result = get_templates_by_template_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success - if result.e is not None: - raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "delete_volume_attachment failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_templates_by_template failed: unknown result") - def delete_volume(self, volume_id): + def check_template(self, template_name, template_version): """ - Delete volume. - Returns: True if deleted, False if not - Parameters: - - volume_id + - template_name + - template_version """ - self.send_delete_volume(volume_id) - return self.recv_delete_volume() + self.send_check_template(template_name, template_version) + return self.recv_check_template() - def send_delete_volume(self, volume_id): - self._oprot.writeMessageBegin('delete_volume', TMessageType.CALL, self._seqid) - args = delete_volume_args() - args.volume_id = volume_id + def send_check_template(self, template_name, template_version): + self._oprot.writeMessageBegin('check_template', TMessageType.CALL, self._seqid) + args = check_template_args() + args.template_name = template_name + args.template_version = template_version args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_delete_volume(self): + def recv_check_template(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1431,36 +1487,39 @@ def recv_delete_volume(self): x.read(iprot) iprot.readMessageEnd() raise x - result = delete_volume_result() + result = check_template_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "delete_volume failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "check_template failed: unknown result") - def attach_volume_to_server(self, openstack_id, volume_id): + def add_security_group_to_server(self, http, https, udp, server_id): """ - Attach volume to server. - Returns: True if attached, False if not + Adds a security group to a server Parameters: - - openstack_id: Id of server - - volume_id: Id of volume + - http: If http ports are open + - https: If https ports are open + - udp: If udp ports are open + - server_id: OpenStack id of the server """ - self.send_attach_volume_to_server(openstack_id, volume_id) - return self.recv_attach_volume_to_server() + self.send_add_security_group_to_server(http, https, udp, server_id) + return self.recv_add_security_group_to_server() - def send_attach_volume_to_server(self, openstack_id, volume_id): - self._oprot.writeMessageBegin('attach_volume_to_server', TMessageType.CALL, self._seqid) - args = attach_volume_to_server_args() - args.openstack_id = openstack_id - args.volume_id = volume_id + def send_add_security_group_to_server(self, http, https, udp, server_id): + self._oprot.writeMessageBegin('add_security_group_to_server', TMessageType.CALL, self._seqid) + args = add_security_group_to_server_args() + args.http = http + args.https = https + args.udp = udp + args.server_id = server_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_attach_volume_to_server(self): + def recv_add_security_group_to_server(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1468,40 +1527,104 @@ def recv_attach_volume_to_server(self): x.read(iprot) iprot.readMessageEnd() raise x - result = attach_volume_to_server_result() + result = add_security_group_to_server_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success - if result.e is not None: - raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "attach_volume_to_server failed: unknown result") + if result.r is not None: + raise result.r + if result.s is not None: + raise result.s + raise TApplicationException(TApplicationException.MISSING_RESULT, "add_security_group_to_server failed: unknown result") - def check_server_status(self, openstack_id, diskspace, volume_id): + def get_servers(self): """ - Check status of server. - Returns: server instance + Get all servers. + Returns: List of server instances. + + """ + self.send_get_servers() + return self.recv_get_servers() + + def send_get_servers(self): + self._oprot.writeMessageBegin('get_servers', TMessageType.CALL, self._seqid) + args = get_servers_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get_servers(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = get_servers_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_servers failed: unknown result") + + def get_servers_by_ids(self, server_ids): + """ + * Get list of servers by ids + * Parameters: - - openstack_id: Id of the server - - diskspace: diskspace of server(volume will be attached if server is active and diskpace >0) - - volume_id: Id of the volume + - server_ids """ - self.send_check_server_status(openstack_id, diskspace, volume_id) - return self.recv_check_server_status() + self.send_get_servers_by_ids(server_ids) + return self.recv_get_servers_by_ids() - def send_check_server_status(self, openstack_id, diskspace, volume_id): - self._oprot.writeMessageBegin('check_server_status', TMessageType.CALL, self._seqid) - args = check_server_status_args() + def send_get_servers_by_ids(self, server_ids): + self._oprot.writeMessageBegin('get_servers_by_ids', TMessageType.CALL, self._seqid) + args = get_servers_by_ids_args() + args.server_ids = server_ids + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get_servers_by_ids(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = get_servers_by_ids_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_servers_by_ids failed: unknown result") + + def get_server(self, openstack_id): + """ + Get a Server. + Returns: A server instance. + + Parameters: + - openstack_id: Id of the server. + + """ + self.send_get_server(openstack_id) + return self.recv_get_server() + + def send_get_server(self, openstack_id): + self._oprot.writeMessageBegin('get_server', TMessageType.CALL, self._seqid) + args = get_server_args() args.openstack_id = openstack_id - args.diskspace = diskspace - args.volume_id = volume_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_check_server_status(self): + def recv_get_server(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1509,40 +1632,36 @@ def recv_check_server_status(self): x.read(iprot) iprot.readMessageEnd() raise x - result = check_server_status_result() + result = get_server_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e - if result.r is not None: - raise result.r - raise TApplicationException(TApplicationException.MISSING_RESULT, "check_server_status failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_server failed: unknown result") - def setUserPassword(self, user, password): + def stop_server(self, openstack_id): """ - Set Password of a User - Returns: the new password + Stop a Server. + Returns: True if stopped, False if not. Parameters: - - user: Elixir-Id of the user which wants to set a password - - password: New password + - openstack_id: Id of the server. """ - self.send_setUserPassword(user, password) - return self.recv_setUserPassword() + self.send_stop_server(openstack_id) + return self.recv_stop_server() - def send_setUserPassword(self, user, password): - self._oprot.writeMessageBegin('setUserPassword', TMessageType.CALL, self._seqid) - args = setUserPassword_args() - args.user = user - args.password = password + def send_stop_server(self, openstack_id): + self._oprot.writeMessageBegin('stop_server', TMessageType.CALL, self._seqid) + args = stop_server_args() + args.openstack_id = openstack_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_setUserPassword(self): + def recv_stop_server(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1550,36 +1669,45 @@ def recv_setUserPassword(self): x.read(iprot) iprot.readMessageEnd() raise x - result = setUserPassword_result() + result = stop_server_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "setUserPassword failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "stop_server failed: unknown result") - def resume_server(self, openstack_id): + def create_snapshot(self, openstack_id, name, elixir_id, base_tag, description): """ - Resume Server. - Returns: True if resumed False if not + Create Snapshot. + Returns: Id of new Snapshot + Parameters: - openstack_id: Id of the server + - name: Name of new Snapshot + - elixir_id: Elixir-Id of the user who requested creation of Snapshot + - base_tag: Tag with which the servers image is also tagged ( for connection information at the webapp) + - description: Description of the new snapshot """ - self.send_resume_server(openstack_id) - return self.recv_resume_server() + self.send_create_snapshot(openstack_id, name, elixir_id, base_tag, description) + return self.recv_create_snapshot() - def send_resume_server(self, openstack_id): - self._oprot.writeMessageBegin('resume_server', TMessageType.CALL, self._seqid) - args = resume_server_args() + def send_create_snapshot(self, openstack_id, name, elixir_id, base_tag, description): + self._oprot.writeMessageBegin('create_snapshot', TMessageType.CALL, self._seqid) + args = create_snapshot_args() args.openstack_id = openstack_id + args.name = name + args.elixir_id = elixir_id + args.base_tag = base_tag + args.description = description args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_resume_server(self): + def recv_create_snapshot(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1587,40 +1715,34 @@ def recv_resume_server(self): x.read(iprot) iprot.readMessageEnd() raise x - result = resume_server_result() + result = create_snapshot_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "resume_server failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "create_snapshot failed: unknown result") - def create_volume(self, volume_name, diskspace, metadata): + def get_limits(self): """ - Create volume. - Returns: Id of new volume - - Parameters: - - volume_name: Name of volume - - diskspace: Diskspace in GB for new volume - - metadata: Metadata for the new volume + Get Limits of OpenStack Projekt from client. + Returns: {'maxTotalVolumes': maxTotalVolumes, 'maxTotalVolumeGigabytes': maxTotalVolumeGigabytes, + 'maxTotalInstances': maxTotalInstances, 'totalRamUsed': totalRamUsed, + 'totalInstancesUsed': totalInstancesUsed} """ - self.send_create_volume(volume_name, diskspace, metadata) - return self.recv_create_volume() + self.send_get_limits() + return self.recv_get_limits() - def send_create_volume(self, volume_name, diskspace, metadata): - self._oprot.writeMessageBegin('create_volume', TMessageType.CALL, self._seqid) - args = create_volume_args() - args.volume_name = volume_name - args.diskspace = diskspace - args.metadata = metadata + def send_get_limits(self): + self._oprot.writeMessageBegin('get_limits', TMessageType.CALL, self._seqid) + args = get_limits_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_create_volume(self): + def recv_get_limits(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1628,38 +1750,34 @@ def recv_create_volume(self): x.read(iprot) iprot.readMessageEnd() raise x - result = create_volume_result() + result = get_limits_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success - if result.r is not None: - raise result.r - raise TApplicationException(TApplicationException.MISSING_RESULT, "create_volume failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_limits failed: unknown result") - def reboot_server(self, server_id, reboot_type): + def delete_image(self, image_id): """ - Reboot server. - Returns: True if rebooted False if not + Delete Image. + Return: True if deleted, False if not Parameters: - - server_id: Id of the server - - reboot_type: HARD or SOFT + - image_id: Id of image """ - self.send_reboot_server(server_id, reboot_type) - return self.recv_reboot_server() + self.send_delete_image(image_id) + return self.recv_delete_image() - def send_reboot_server(self, server_id, reboot_type): - self._oprot.writeMessageBegin('reboot_server', TMessageType.CALL, self._seqid) - args = reboot_server_args() - args.server_id = server_id - args.reboot_type = reboot_type + def send_delete_image(self, image_id): + self._oprot.writeMessageBegin('delete_image', TMessageType.CALL, self._seqid) + args = delete_image_args() + args.image_id = image_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_reboot_server(self): + def recv_delete_image(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1667,943 +1785,2810 @@ def recv_reboot_server(self): x.read(iprot) iprot.readMessageEnd() raise x - result = reboot_server_result() + result = delete_image_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "reboot_server failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "delete_image failed: unknown result") + def delete_volume_attachment(self, volume_id, server_id): + """ + Delete volume attachment + Return: True if deleted, False if not -class Processor(Iface, TProcessor): - def __init__(self, handler): - self._handler = handler - self._processMap = {} - self._processMap["check_Version"] = Processor.process_check_Version - self._processMap["get_client_version"] = Processor.process_get_client_version - self._processMap["import_keypair"] = Processor.process_import_keypair - self._processMap["get_ip_ports"] = Processor.process_get_ip_ports - self._processMap["get_Flavors"] = Processor.process_get_Flavors - self._processMap["get_Images"] = Processor.process_get_Images - self._processMap["get_Image_with_Tag"] = Processor.process_get_Image_with_Tag - self._processMap["delete_server"] = Processor.process_delete_server - self._processMap["add_metadata_to_server"] = Processor.process_add_metadata_to_server - self._processMap["delete_metadata_from_server"] = Processor.process_delete_metadata_from_server - self._processMap["add_floating_ip_to_server"] = Processor.process_add_floating_ip_to_server - self._processMap["create_connection"] = Processor.process_create_connection - self._processMap["start_server"] = Processor.process_start_server - self._processMap["start_server_with_custom_key"] = Processor.process_start_server_with_custom_key - self._processMap["exist_server"] = Processor.process_exist_server - self._processMap["create_and_deploy_playbook"] = Processor.process_create_and_deploy_playbook - self._processMap["get_playbook_logs"] = Processor.process_get_playbook_logs - self._processMap["add_security_group_to_server"] = Processor.process_add_security_group_to_server - self._processMap["get_servers"] = Processor.process_get_servers - self._processMap["get_servers_by_ids"] = Processor.process_get_servers_by_ids - self._processMap["get_server"] = Processor.process_get_server - self._processMap["stop_server"] = Processor.process_stop_server - self._processMap["create_snapshot"] = Processor.process_create_snapshot - self._processMap["get_limits"] = Processor.process_get_limits - self._processMap["delete_image"] = Processor.process_delete_image - self._processMap["delete_volume_attachment"] = Processor.process_delete_volume_attachment - self._processMap["delete_volume"] = Processor.process_delete_volume - self._processMap["attach_volume_to_server"] = Processor.process_attach_volume_to_server - self._processMap["check_server_status"] = Processor.process_check_server_status - self._processMap["setUserPassword"] = Processor.process_setUserPassword - self._processMap["resume_server"] = Processor.process_resume_server - self._processMap["create_volume"] = Processor.process_create_volume - self._processMap["reboot_server"] = Processor.process_reboot_server + Parameters: + - volume_id: Id of the attached volume + - server_id: Id of the server where the volume is attached - def process(self, iprot, oprot): - (name, type, seqid) = iprot.readMessageBegin() - if name not in self._processMap: - iprot.skip(TType.STRUCT) - iprot.readMessageEnd() - x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) - oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) - x.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - return - else: - self._processMap[name](self, seqid, iprot, oprot) - return True + """ + self.send_delete_volume_attachment(volume_id, server_id) + return self.recv_delete_volume_attachment() - def process_check_Version(self, seqid, iprot, oprot): - args = check_Version_args() - args.read(iprot) - iprot.readMessageEnd() - result = check_Version_result() - try: - result.success = self._handler.check_Version(args.version) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("check_Version", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def send_delete_volume_attachment(self, volume_id, server_id): + self._oprot.writeMessageBegin('delete_volume_attachment', TMessageType.CALL, self._seqid) + args = delete_volume_attachment_args() + args.volume_id = volume_id + args.server_id = server_id + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() - def process_get_client_version(self, seqid, iprot, oprot): - args = get_client_version_args() - args.read(iprot) + def recv_delete_volume_attachment(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = delete_volume_attachment_result() + result.read(iprot) iprot.readMessageEnd() - result = get_client_version_result() - try: - result.success = self._handler.get_client_version() - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("get_client_version", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + if result.success is not None: + return result.success + if result.e is not None: + raise result.e + raise TApplicationException(TApplicationException.MISSING_RESULT, "delete_volume_attachment failed: unknown result") - def process_import_keypair(self, seqid, iprot, oprot): - args = import_keypair_args() - args.read(iprot) - iprot.readMessageEnd() - result = import_keypair_result() - try: - result.success = self._handler.import_keypair(args.keyname, args.public_key) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("import_keypair", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def delete_volume(self, volume_id): + """ + Delete volume. + Returns: True if deleted, False if not - def process_get_ip_ports(self, seqid, iprot, oprot): - args = get_ip_ports_args() - args.read(iprot) - iprot.readMessageEnd() - result = get_ip_ports_result() - try: - result.success = self._handler.get_ip_ports(args.openstack_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("get_ip_ports", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + Parameters: + - volume_id - def process_get_Flavors(self, seqid, iprot, oprot): - args = get_Flavors_args() - args.read(iprot) - iprot.readMessageEnd() - result = get_Flavors_result() - try: - result.success = self._handler.get_Flavors() - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("get_Flavors", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + """ + self.send_delete_volume(volume_id) + return self.recv_delete_volume() - def process_get_Images(self, seqid, iprot, oprot): - args = get_Images_args() - args.read(iprot) - iprot.readMessageEnd() - result = get_Images_result() - try: - result.success = self._handler.get_Images() - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("get_Images", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def send_delete_volume(self, volume_id): + self._oprot.writeMessageBegin('delete_volume', TMessageType.CALL, self._seqid) + args = delete_volume_args() + args.volume_id = volume_id + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() - def process_get_Image_with_Tag(self, seqid, iprot, oprot): - args = get_Image_with_Tag_args() - args.read(iprot) + def recv_delete_volume(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = delete_volume_result() + result.read(iprot) iprot.readMessageEnd() - result = get_Image_with_Tag_result() - try: - result.success = self._handler.get_Image_with_Tag(args.openstack_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("get_Image_with_Tag", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "delete_volume failed: unknown result") - def process_delete_server(self, seqid, iprot, oprot): - args = delete_server_args() - args.read(iprot) - iprot.readMessageEnd() - result = delete_server_result() - try: - result.success = self._handler.delete_server(args.openstack_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except serverNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("delete_server", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def attach_volume_to_server(self, openstack_id, volume_id): + """ + Attach volume to server. + Returns: True if attached, False if not - def process_add_metadata_to_server(self, seqid, iprot, oprot): - args = add_metadata_to_server_args() - args.read(iprot) - iprot.readMessageEnd() - result = add_metadata_to_server_result() - try: - result.success = self._handler.add_metadata_to_server(args.servername, args.metadata) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except serverNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("add_metadata_to_server", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + Parameters: + - openstack_id: Id of server + - volume_id: Id of volume - def process_delete_metadata_from_server(self, seqid, iprot, oprot): - args = delete_metadata_from_server_args() - args.read(iprot) - iprot.readMessageEnd() - result = delete_metadata_from_server_result() - try: - result.success = self._handler.delete_metadata_from_server(args.servername, args.keys) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except serverNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("delete_metadata_from_server", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + """ + self.send_attach_volume_to_server(openstack_id, volume_id) + return self.recv_attach_volume_to_server() - def process_add_floating_ip_to_server(self, seqid, iprot, oprot): - args = add_floating_ip_to_server_args() - args.read(iprot) - iprot.readMessageEnd() - result = add_floating_ip_to_server_result() - try: - result.success = self._handler.add_floating_ip_to_server(args.openstack_id, args.network) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except serverNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except networkNotFoundException as f: - msg_type = TMessageType.REPLY - result.f = f - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("add_floating_ip_to_server", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def send_attach_volume_to_server(self, openstack_id, volume_id): + self._oprot.writeMessageBegin('attach_volume_to_server', TMessageType.CALL, self._seqid) + args = attach_volume_to_server_args() + args.openstack_id = openstack_id + args.volume_id = volume_id + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() - def process_create_connection(self, seqid, iprot, oprot): - args = create_connection_args() - args.read(iprot) + def recv_attach_volume_to_server(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = attach_volume_to_server_result() + result.read(iprot) iprot.readMessageEnd() - result = create_connection_result() - try: - result.success = self._handler.create_connection(args.username, args.password, args.auth_url, args.user_domain_name, args.project_domain_name) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except authenticationException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("create_connection", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + if result.success is not None: + return result.success + if result.e is not None: + raise result.e + raise TApplicationException(TApplicationException.MISSING_RESULT, "attach_volume_to_server failed: unknown result") - def process_start_server(self, seqid, iprot, oprot): - args = start_server_args() - args.read(iprot) - iprot.readMessageEnd() - result = start_server_result() - try: - result.success = self._handler.start_server(args.flavor, args.image, args.public_key, args.servername, args.metadata, args.diskspace, args.volumename) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except nameException as e: - msg_type = TMessageType.REPLY - result.e = e - except ressourceException as r: - msg_type = TMessageType.REPLY - result.r = r - except serverNotFoundException as s: - msg_type = TMessageType.REPLY - result.s = s - except networkNotFoundException as n: - msg_type = TMessageType.REPLY - result.n = n - except imageNotFoundException as i: - msg_type = TMessageType.REPLY - result.i = i - except flavorNotFoundException as f: - msg_type = TMessageType.REPLY - result.f = f - except otherException as o: - msg_type = TMessageType.REPLY - result.o = o - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("start_server", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def check_server_status(self, openstack_id, diskspace, volume_id): + """ + Check status of server. + Returns: server instance - def process_start_server_with_custom_key(self, seqid, iprot, oprot): - args = start_server_with_custom_key_args() - args.read(iprot) - iprot.readMessageEnd() - result = start_server_with_custom_key_result() - try: - result.success = self._handler.start_server_with_custom_key(args.flavor, args.image, args.servername, args.metadata, args.diskspace, args.volumename) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except nameException as e: - msg_type = TMessageType.REPLY - result.e = e - except ressourceException as r: - msg_type = TMessageType.REPLY - result.r = r - except serverNotFoundException as s: - msg_type = TMessageType.REPLY - result.s = s - except networkNotFoundException as n: - msg_type = TMessageType.REPLY - result.n = n - except imageNotFoundException as i: - msg_type = TMessageType.REPLY - result.i = i - except flavorNotFoundException as f: - msg_type = TMessageType.REPLY - result.f = f - except otherException as o: - msg_type = TMessageType.REPLY - result.o = o - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("start_server_with_custom_key", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + Parameters: + - openstack_id: Id of the server + - diskspace: diskspace of server(volume will be attached if server is active and diskpace >0) + - volume_id: Id of the volume - def process_exist_server(self, seqid, iprot, oprot): - args = exist_server_args() - args.read(iprot) - iprot.readMessageEnd() - result = exist_server_result() - try: - result.success = self._handler.exist_server(args.name) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION + """ + self.send_check_server_status(openstack_id, diskspace, volume_id) + return self.recv_check_server_status() + + def send_check_server_status(self, openstack_id, diskspace, volume_id): + self._oprot.writeMessageBegin('check_server_status', TMessageType.CALL, self._seqid) + args = check_server_status_args() + args.openstack_id = openstack_id + args.diskspace = diskspace + args.volume_id = volume_id + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_check_server_status(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = check_server_status_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.e is not None: + raise result.e + if result.r is not None: + raise result.r + raise TApplicationException(TApplicationException.MISSING_RESULT, "check_server_status failed: unknown result") + + def setUserPassword(self, user, password): + """ + Set Password of a User + Returns: the new password + + Parameters: + - user: Elixir-Id of the user which wants to set a password + - password: New password + + """ + self.send_setUserPassword(user, password) + return self.recv_setUserPassword() + + def send_setUserPassword(self, user, password): + self._oprot.writeMessageBegin('setUserPassword', TMessageType.CALL, self._seqid) + args = setUserPassword_args() + args.user = user + args.password = password + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_setUserPassword(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = setUserPassword_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.e is not None: + raise result.e + raise TApplicationException(TApplicationException.MISSING_RESULT, "setUserPassword failed: unknown result") + + def resume_server(self, openstack_id): + """ + Resume Server. + Returns: True if resumed False if not + + Parameters: + - openstack_id: Id of the server + + """ + self.send_resume_server(openstack_id) + return self.recv_resume_server() + + def send_resume_server(self, openstack_id): + self._oprot.writeMessageBegin('resume_server', TMessageType.CALL, self._seqid) + args = resume_server_args() + args.openstack_id = openstack_id + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_resume_server(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = resume_server_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.e is not None: + raise result.e + raise TApplicationException(TApplicationException.MISSING_RESULT, "resume_server failed: unknown result") + + def create_volume(self, volume_name, diskspace, metadata): + """ + Create volume. + Returns: Id of new volume + + Parameters: + - volume_name: Name of volume + - diskspace: Diskspace in GB for new volume + - metadata: Metadata for the new volume + + """ + self.send_create_volume(volume_name, diskspace, metadata) + return self.recv_create_volume() + + def send_create_volume(self, volume_name, diskspace, metadata): + self._oprot.writeMessageBegin('create_volume', TMessageType.CALL, self._seqid) + args = create_volume_args() + args.volume_name = volume_name + args.diskspace = diskspace + args.metadata = metadata + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_create_volume(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = create_volume_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.r is not None: + raise result.r + raise TApplicationException(TApplicationException.MISSING_RESULT, "create_volume failed: unknown result") + + def reboot_server(self, server_id, reboot_type): + """ + Reboot server. + Returns: True if rebooted False if not + + Parameters: + - server_id: Id of the server + - reboot_type: HARD or SOFT + + """ + self.send_reboot_server(server_id, reboot_type) + return self.recv_reboot_server() + + def send_reboot_server(self, server_id, reboot_type): + self._oprot.writeMessageBegin('reboot_server', TMessageType.CALL, self._seqid) + args = reboot_server_args() + args.server_id = server_id + args.reboot_type = reboot_type + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_reboot_server(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = reboot_server_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.e is not None: + raise result.e + raise TApplicationException(TApplicationException.MISSING_RESULT, "reboot_server failed: unknown result") + + +class Processor(Iface, TProcessor): + def __init__(self, handler): + self._handler = handler + self._processMap = {} + self._processMap["check_Version"] = Processor.process_check_Version + self._processMap["get_client_version"] = Processor.process_get_client_version + self._processMap["import_keypair"] = Processor.process_import_keypair + self._processMap["get_ip_ports"] = Processor.process_get_ip_ports + self._processMap["get_Flavors"] = Processor.process_get_Flavors + self._processMap["get_Images"] = Processor.process_get_Images + self._processMap["get_Image_with_Tag"] = Processor.process_get_Image_with_Tag + self._processMap["delete_server"] = Processor.process_delete_server + self._processMap["add_metadata_to_server"] = Processor.process_add_metadata_to_server + self._processMap["delete_metadata_from_server"] = Processor.process_delete_metadata_from_server + self._processMap["add_floating_ip_to_server"] = Processor.process_add_floating_ip_to_server + self._processMap["create_connection"] = Processor.process_create_connection + self._processMap["start_server"] = Processor.process_start_server + self._processMap["start_server_with_custom_key"] = Processor.process_start_server_with_custom_key + self._processMap["exist_server"] = Processor.process_exist_server + self._processMap["create_and_deploy_playbook"] = Processor.process_create_and_deploy_playbook + self._processMap["get_playbook_logs"] = Processor.process_get_playbook_logs + self._processMap["has_forc"] = Processor.process_has_forc + self._processMap["create_backend"] = Processor.process_create_backend + self._processMap["get_backends"] = Processor.process_get_backends + self._processMap["get_backends_by_owner"] = Processor.process_get_backends_by_owner + self._processMap["get_backends_by_template"] = Processor.process_get_backends_by_template + self._processMap["get_backend_by_id"] = Processor.process_get_backend_by_id + self._processMap["delete_backend"] = Processor.process_delete_backend + self._processMap["get_templates"] = Processor.process_get_templates + self._processMap["get_templates_by_template"] = Processor.process_get_templates_by_template + self._processMap["check_template"] = Processor.process_check_template + self._processMap["add_security_group_to_server"] = Processor.process_add_security_group_to_server + self._processMap["get_servers"] = Processor.process_get_servers + self._processMap["get_servers_by_ids"] = Processor.process_get_servers_by_ids + self._processMap["get_server"] = Processor.process_get_server + self._processMap["stop_server"] = Processor.process_stop_server + self._processMap["create_snapshot"] = Processor.process_create_snapshot + self._processMap["get_limits"] = Processor.process_get_limits + self._processMap["delete_image"] = Processor.process_delete_image + self._processMap["delete_volume_attachment"] = Processor.process_delete_volume_attachment + self._processMap["delete_volume"] = Processor.process_delete_volume + self._processMap["attach_volume_to_server"] = Processor.process_attach_volume_to_server + self._processMap["check_server_status"] = Processor.process_check_server_status + self._processMap["setUserPassword"] = Processor.process_setUserPassword + self._processMap["resume_server"] = Processor.process_resume_server + self._processMap["create_volume"] = Processor.process_create_volume + self._processMap["reboot_server"] = Processor.process_reboot_server + + def process(self, iprot, oprot): + (name, type, seqid) = iprot.readMessageBegin() + if name not in self._processMap: + iprot.skip(TType.STRUCT) + iprot.readMessageEnd() + x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) + oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) + x.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + return + else: + self._processMap[name](self, seqid, iprot, oprot) + return True + + def process_check_Version(self, seqid, iprot, oprot): + args = check_Version_args() + args.read(iprot) + iprot.readMessageEnd() + result = check_Version_result() + try: + result.success = self._handler.check_Version(args.version) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("exist_server", msg_type, seqid) + oprot.writeMessageBegin("check_Version", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_client_version(self, seqid, iprot, oprot): + args = get_client_version_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_client_version_result() + try: + result.success = self._handler.get_client_version() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_client_version", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_import_keypair(self, seqid, iprot, oprot): + args = import_keypair_args() + args.read(iprot) + iprot.readMessageEnd() + result = import_keypair_result() + try: + result.success = self._handler.import_keypair(args.keyname, args.public_key) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("import_keypair", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_ip_ports(self, seqid, iprot, oprot): + args = get_ip_ports_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_ip_ports_result() + try: + result.success = self._handler.get_ip_ports(args.openstack_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_ip_ports", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_Flavors(self, seqid, iprot, oprot): + args = get_Flavors_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_Flavors_result() + try: + result.success = self._handler.get_Flavors() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_Flavors", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_Images(self, seqid, iprot, oprot): + args = get_Images_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_Images_result() + try: + result.success = self._handler.get_Images() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_Images", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_Image_with_Tag(self, seqid, iprot, oprot): + args = get_Image_with_Tag_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_Image_with_Tag_result() + try: + result.success = self._handler.get_Image_with_Tag(args.openstack_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_Image_with_Tag", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_delete_server(self, seqid, iprot, oprot): + args = delete_server_args() + args.read(iprot) + iprot.readMessageEnd() + result = delete_server_result() + try: + result.success = self._handler.delete_server(args.openstack_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except serverNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("delete_server", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_add_metadata_to_server(self, seqid, iprot, oprot): + args = add_metadata_to_server_args() + args.read(iprot) + iprot.readMessageEnd() + result = add_metadata_to_server_result() + try: + result.success = self._handler.add_metadata_to_server(args.servername, args.metadata) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except serverNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("add_metadata_to_server", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_create_and_deploy_playbook(self, seqid, iprot, oprot): - args = create_and_deploy_playbook_args() - args.read(iprot) - iprot.readMessageEnd() - result = create_and_deploy_playbook_result() - try: - result.success = self._handler.create_and_deploy_playbook(args.public_key, args.playbooks_information, args.openstack_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("create_and_deploy_playbook", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def process_delete_metadata_from_server(self, seqid, iprot, oprot): + args = delete_metadata_from_server_args() + args.read(iprot) + iprot.readMessageEnd() + result = delete_metadata_from_server_result() + try: + result.success = self._handler.delete_metadata_from_server(args.servername, args.keys) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except serverNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("delete_metadata_from_server", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_add_floating_ip_to_server(self, seqid, iprot, oprot): + args = add_floating_ip_to_server_args() + args.read(iprot) + iprot.readMessageEnd() + result = add_floating_ip_to_server_result() + try: + result.success = self._handler.add_floating_ip_to_server(args.openstack_id, args.network) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except serverNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except networkNotFoundException as f: + msg_type = TMessageType.REPLY + result.f = f + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("add_floating_ip_to_server", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_create_connection(self, seqid, iprot, oprot): + args = create_connection_args() + args.read(iprot) + iprot.readMessageEnd() + result = create_connection_result() + try: + result.success = self._handler.create_connection(args.username, args.password, args.auth_url, args.user_domain_name, args.project_domain_name) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except authenticationException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("create_connection", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_start_server(self, seqid, iprot, oprot): + args = start_server_args() + args.read(iprot) + iprot.readMessageEnd() + result = start_server_result() + try: + result.success = self._handler.start_server(args.flavor, args.image, args.public_key, args.servername, args.metadata, args.diskspace, args.volumename, args.https, args.http) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except nameException as e: + msg_type = TMessageType.REPLY + result.e = e + except ressourceException as r: + msg_type = TMessageType.REPLY + result.r = r + except serverNotFoundException as s: + msg_type = TMessageType.REPLY + result.s = s + except networkNotFoundException as n: + msg_type = TMessageType.REPLY + result.n = n + except imageNotFoundException as i: + msg_type = TMessageType.REPLY + result.i = i + except flavorNotFoundException as f: + msg_type = TMessageType.REPLY + result.f = f + except otherException as o: + msg_type = TMessageType.REPLY + result.o = o + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("start_server", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_start_server_with_custom_key(self, seqid, iprot, oprot): + args = start_server_with_custom_key_args() + args.read(iprot) + iprot.readMessageEnd() + result = start_server_with_custom_key_result() + try: + result.success = self._handler.start_server_with_custom_key(args.flavor, args.image, args.servername, args.metadata, args.diskspace, args.volumename, args.http, args.https) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except nameException as e: + msg_type = TMessageType.REPLY + result.e = e + except ressourceException as r: + msg_type = TMessageType.REPLY + result.r = r + except serverNotFoundException as s: + msg_type = TMessageType.REPLY + result.s = s + except networkNotFoundException as n: + msg_type = TMessageType.REPLY + result.n = n + except imageNotFoundException as i: + msg_type = TMessageType.REPLY + result.i = i + except flavorNotFoundException as f: + msg_type = TMessageType.REPLY + result.f = f + except otherException as o: + msg_type = TMessageType.REPLY + result.o = o + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("start_server_with_custom_key", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_exist_server(self, seqid, iprot, oprot): + args = exist_server_args() + args.read(iprot) + iprot.readMessageEnd() + result = exist_server_result() + try: + result.success = self._handler.exist_server(args.name) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("exist_server", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_create_and_deploy_playbook(self, seqid, iprot, oprot): + args = create_and_deploy_playbook_args() + args.read(iprot) + iprot.readMessageEnd() + result = create_and_deploy_playbook_result() + try: + result.success = self._handler.create_and_deploy_playbook(args.public_key, args.playbooks_information, args.openstack_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("create_and_deploy_playbook", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_playbook_logs(self, seqid, iprot, oprot): + args = get_playbook_logs_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_playbook_logs_result() + try: + result.success = self._handler.get_playbook_logs(args.openstack_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_playbook_logs", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_has_forc(self, seqid, iprot, oprot): + args = has_forc_args() + args.read(iprot) + iprot.readMessageEnd() + result = has_forc_result() + try: + result.success = self._handler.has_forc() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("has_forc", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_create_backend(self, seqid, iprot, oprot): + args = create_backend_args() + args.read(iprot) + iprot.readMessageEnd() + result = create_backend_result() + try: + result.success = self._handler.create_backend(args.elixir_id, args.user_key_url, args.template, args.template_version, args.upstream_url) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("create_backend", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_backends(self, seqid, iprot, oprot): + args = get_backends_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_backends_result() + try: + result.success = self._handler.get_backends() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_backends", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_backends_by_owner(self, seqid, iprot, oprot): + args = get_backends_by_owner_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_backends_by_owner_result() + try: + result.success = self._handler.get_backends_by_owner(args.elixir_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_backends_by_owner", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_backends_by_template(self, seqid, iprot, oprot): + args = get_backends_by_template_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_backends_by_template_result() + try: + result.success = self._handler.get_backends_by_template(args.template) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_backends_by_template", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_backend_by_id(self, seqid, iprot, oprot): + args = get_backend_by_id_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_backend_by_id_result() + try: + result.success = self._handler.get_backend_by_id(args.id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_backend_by_id", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_delete_backend(self, seqid, iprot, oprot): + args = delete_backend_args() + args.read(iprot) + iprot.readMessageEnd() + result = delete_backend_result() + try: + result.success = self._handler.delete_backend(args.id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("delete_backend", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_templates(self, seqid, iprot, oprot): + args = get_templates_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_templates_result() + try: + result.success = self._handler.get_templates() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_templates", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_templates_by_template(self, seqid, iprot, oprot): + args = get_templates_by_template_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_templates_by_template_result() + try: + result.success = self._handler.get_templates_by_template(args.template_name) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_templates_by_template", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_check_template(self, seqid, iprot, oprot): + args = check_template_args() + args.read(iprot) + iprot.readMessageEnd() + result = check_template_result() + try: + result.success = self._handler.check_template(args.template_name, args.template_version) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("check_template", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_add_security_group_to_server(self, seqid, iprot, oprot): + args = add_security_group_to_server_args() + args.read(iprot) + iprot.readMessageEnd() + result = add_security_group_to_server_result() + try: + result.success = self._handler.add_security_group_to_server(args.http, args.https, args.udp, args.server_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except ressourceException as r: + msg_type = TMessageType.REPLY + result.r = r + except serverNotFoundException as s: + msg_type = TMessageType.REPLY + result.s = s + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("add_security_group_to_server", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_servers(self, seqid, iprot, oprot): + args = get_servers_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_servers_result() + try: + result.success = self._handler.get_servers() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_servers", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_servers_by_ids(self, seqid, iprot, oprot): + args = get_servers_by_ids_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_servers_by_ids_result() + try: + result.success = self._handler.get_servers_by_ids(args.server_ids) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_servers_by_ids", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_server(self, seqid, iprot, oprot): + args = get_server_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_server_result() + try: + result.success = self._handler.get_server(args.openstack_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except serverNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_server", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_stop_server(self, seqid, iprot, oprot): + args = stop_server_args() + args.read(iprot) + iprot.readMessageEnd() + result = stop_server_result() + try: + result.success = self._handler.stop_server(args.openstack_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except serverNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("stop_server", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_create_snapshot(self, seqid, iprot, oprot): + args = create_snapshot_args() + args.read(iprot) + iprot.readMessageEnd() + result = create_snapshot_result() + try: + result.success = self._handler.create_snapshot(args.openstack_id, args.name, args.elixir_id, args.base_tag, args.description) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except serverNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("create_snapshot", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_limits(self, seqid, iprot, oprot): + args = get_limits_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_limits_result() + try: + result.success = self._handler.get_limits() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_limits", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_delete_image(self, seqid, iprot, oprot): + args = delete_image_args() + args.read(iprot) + iprot.readMessageEnd() + result = delete_image_result() + try: + result.success = self._handler.delete_image(args.image_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except imageNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("delete_image", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_delete_volume_attachment(self, seqid, iprot, oprot): + args = delete_volume_attachment_args() + args.read(iprot) + iprot.readMessageEnd() + result = delete_volume_attachment_result() + try: + result.success = self._handler.delete_volume_attachment(args.volume_id, args.server_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except serverNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("delete_volume_attachment", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_delete_volume(self, seqid, iprot, oprot): + args = delete_volume_args() + args.read(iprot) + iprot.readMessageEnd() + result = delete_volume_result() + try: + result.success = self._handler.delete_volume(args.volume_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("delete_volume", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_attach_volume_to_server(self, seqid, iprot, oprot): + args = attach_volume_to_server_args() + args.read(iprot) + iprot.readMessageEnd() + result = attach_volume_to_server_result() + try: + result.success = self._handler.attach_volume_to_server(args.openstack_id, args.volume_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except serverNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("attach_volume_to_server", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_check_server_status(self, seqid, iprot, oprot): + args = check_server_status_args() + args.read(iprot) + iprot.readMessageEnd() + result = check_server_status_result() + try: + result.success = self._handler.check_server_status(args.openstack_id, args.diskspace, args.volume_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except serverNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except ressourceException as r: + msg_type = TMessageType.REPLY + result.r = r + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("check_server_status", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_setUserPassword(self, seqid, iprot, oprot): + args = setUserPassword_args() + args.read(iprot) + iprot.readMessageEnd() + result = setUserPassword_result() + try: + result.success = self._handler.setUserPassword(args.user, args.password) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except otherException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("setUserPassword", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_resume_server(self, seqid, iprot, oprot): + args = resume_server_args() + args.read(iprot) + iprot.readMessageEnd() + result = resume_server_result() + try: + result.success = self._handler.resume_server(args.openstack_id) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except serverNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("resume_server", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_create_volume(self, seqid, iprot, oprot): + args = create_volume_args() + args.read(iprot) + iprot.readMessageEnd() + result = create_volume_result() + try: + result.success = self._handler.create_volume(args.volume_name, args.diskspace, args.metadata) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except ressourceException as r: + msg_type = TMessageType.REPLY + result.r = r + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("create_volume", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_reboot_server(self, seqid, iprot, oprot): + args = reboot_server_args() + args.read(iprot) + iprot.readMessageEnd() + result = reboot_server_result() + try: + result.success = self._handler.reboot_server(args.server_id, args.reboot_type) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except serverNotFoundException as e: + msg_type = TMessageType.REPLY + result.e = e + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("reboot_server", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + +# HELPER FUNCTIONS AND STRUCTURES + + +class check_Version_args(object): + """ + Attributes: + - version + + """ + + + def __init__(self, version=None,): + self.version = version + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.DOUBLE: + self.version = iprot.readDouble() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('check_Version_args') + if self.version is not None: + oprot.writeFieldBegin('version', TType.DOUBLE, 1) + oprot.writeDouble(self.version) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(check_Version_args) +check_Version_args.thrift_spec = ( + None, # 0 + (1, TType.DOUBLE, 'version', None, None, ), # 1 +) + + +class check_Version_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.BOOL: + self.success = iprot.readBool() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('check_Version_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(check_Version_result) +check_Version_result.thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 +) + + +class get_client_version_args(object): + + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('get_client_version_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(get_client_version_args) +get_client_version_args.thrift_spec = ( +) + + +class get_client_version_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('get_client_version_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(get_client_version_result) +get_client_version_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 +) + + +class import_keypair_args(object): + """ + Attributes: + - keyname: Name for the keypair + - public_key: The public key + + """ + + + def __init__(self, keyname=None, public_key=None,): + self.keyname = keyname + self.public_key = public_key + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.keyname = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.public_key = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('import_keypair_args') + if self.keyname is not None: + oprot.writeFieldBegin('keyname', TType.STRING, 1) + oprot.writeString(self.keyname.encode('utf-8') if sys.version_info[0] == 2 else self.keyname) + oprot.writeFieldEnd() + if self.public_key is not None: + oprot.writeFieldBegin('public_key', TType.STRING, 2) + oprot.writeString(self.public_key.encode('utf-8') if sys.version_info[0] == 2 else self.public_key) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(import_keypair_args) +import_keypair_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'keyname', 'UTF8', None, ), # 1 + (2, TType.STRING, 'public_key', 'UTF8', None, ), # 2 +) + + +class import_keypair_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('import_keypair_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(import_keypair_result) +import_keypair_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 +) + + +class get_ip_ports_args(object): + """ + Attributes: + - openstack_id: Id of server + + """ + + + def __init__(self, openstack_id=None,): + self.openstack_id = openstack_id + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.openstack_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('get_ip_ports_args') + if self.openstack_id is not None: + oprot.writeFieldBegin('openstack_id', TType.STRING, 1) + oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(get_ip_ports_args) +get_ip_ports_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'openstack_id', 'UTF8', None, ), # 1 +) + + +class get_ip_ports_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.MAP: + self.success = {} + (_ktype24, _vtype25, _size23) = iprot.readMapBegin() + for _i27 in range(_size23): + _key28 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val29 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.success[_key28] = _val29 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('get_ip_ports_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.MAP, 0) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) + for kiter30, viter31 in self.success.items(): + oprot.writeString(kiter30.encode('utf-8') if sys.version_info[0] == 2 else kiter30) + oprot.writeString(viter31.encode('utf-8') if sys.version_info[0] == 2 else viter31) + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(get_ip_ports_result) +get_ip_ports_result.thrift_spec = ( + (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 0 +) + + +class get_Flavors_args(object): + + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('get_Flavors_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(get_Flavors_args) +get_Flavors_args.thrift_spec = ( +) + + +class get_Flavors_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype35, _size32) = iprot.readListBegin() + for _i36 in range(_size32): + _elem37 = Flavor() + _elem37.read(iprot) + self.success.append(_elem37) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('get_Flavors_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter38 in self.success: + iter38.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(get_Flavors_result) +get_Flavors_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT, [Flavor, None], False), None, ), # 0 +) + + +class get_Images_args(object): + + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('get_Images_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(get_Images_args) +get_Images_args.thrift_spec = ( +) + + +class get_Images_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype42, _size39) = iprot.readListBegin() + for _i43 in range(_size39): + _elem44 = Image() + _elem44.read(iprot) + self.success.append(_elem44) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('get_Images_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter45 in self.success: + iter45.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(get_Images_result) +get_Images_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT, [Image, None], False), None, ), # 0 +) + + +class get_Image_with_Tag_args(object): + """ + Attributes: + - openstack_id + + """ + + + def __init__(self, openstack_id=None,): + self.openstack_id = openstack_id + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.openstack_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('get_Image_with_Tag_args') + if self.openstack_id is not None: + oprot.writeFieldBegin('openstack_id', TType.STRING, 1) + oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(get_Image_with_Tag_args) +get_Image_with_Tag_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'openstack_id', 'UTF8', None, ), # 1 +) + + +class get_Image_with_Tag_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = Image() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('get_Image_with_Tag_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(get_Image_with_Tag_result) +get_Image_with_Tag_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [Image, None], None, ), # 0 +) + + +class delete_server_args(object): + """ + Attributes: + - openstack_id: Id of the server. + + """ + + + def __init__(self, openstack_id=None,): + self.openstack_id = openstack_id + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.openstack_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('delete_server_args') + if self.openstack_id is not None: + oprot.writeFieldBegin('openstack_id', TType.STRING, 1) + oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(delete_server_args) +delete_server_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'openstack_id', 'UTF8', None, ), # 1 +) + + +class delete_server_result(object): + """ + Attributes: + - success + - e + + """ + + + def __init__(self, success=None, e=None,): + self.success = success + self.e = e + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.BOOL: + self.success = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.e = serverNotFoundException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('delete_server_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) + oprot.writeFieldEnd() + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(delete_server_result) +delete_server_result.thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'e', [serverNotFoundException, None], None, ), # 1 +) + + +class add_metadata_to_server_args(object): + """ + Attributes: + - servername + - metadata + + """ + + + def __init__(self, servername=None, metadata=None,): + self.servername = servername + self.metadata = metadata + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.servername = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.MAP: + self.metadata = {} + (_ktype47, _vtype48, _size46) = iprot.readMapBegin() + for _i50 in range(_size46): + _key51 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val52 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.metadata[_key51] = _val52 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('add_metadata_to_server_args') + if self.servername is not None: + oprot.writeFieldBegin('servername', TType.STRING, 1) + oprot.writeString(self.servername.encode('utf-8') if sys.version_info[0] == 2 else self.servername) + oprot.writeFieldEnd() + if self.metadata is not None: + oprot.writeFieldBegin('metadata', TType.MAP, 2) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metadata)) + for kiter53, viter54 in self.metadata.items(): + oprot.writeString(kiter53.encode('utf-8') if sys.version_info[0] == 2 else kiter53) + oprot.writeString(viter54.encode('utf-8') if sys.version_info[0] == 2 else viter54) + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(add_metadata_to_server_args) +add_metadata_to_server_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'servername', 'UTF8', None, ), # 1 + (2, TType.MAP, 'metadata', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 2 +) + + +class add_metadata_to_server_result(object): + """ + Attributes: + - success + - e + + """ + + + def __init__(self, success=None, e=None,): + self.success = success + self.e = e + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.MAP: + self.success = {} + (_ktype56, _vtype57, _size55) = iprot.readMapBegin() + for _i59 in range(_size55): + _key60 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val61 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.success[_key60] = _val61 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.e = serverNotFoundException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('add_metadata_to_server_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.MAP, 0) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) + for kiter62, viter63 in self.success.items(): + oprot.writeString(kiter62.encode('utf-8') if sys.version_info[0] == 2 else kiter62) + oprot.writeString(viter63.encode('utf-8') if sys.version_info[0] == 2 else viter63) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(add_metadata_to_server_result) +add_metadata_to_server_result.thrift_spec = ( + (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 0 + (1, TType.STRUCT, 'e', [serverNotFoundException, None], None, ), # 1 +) + - def process_get_playbook_logs(self, seqid, iprot, oprot): - args = get_playbook_logs_args() - args.read(iprot) - iprot.readMessageEnd() - result = get_playbook_logs_result() - try: - result.success = self._handler.get_playbook_logs(args.openstack_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("get_playbook_logs", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() +class delete_metadata_from_server_args(object): + """ + Attributes: + - servername + - keys - def process_add_security_group_to_server(self, seqid, iprot, oprot): - args = add_security_group_to_server_args() - args.read(iprot) - iprot.readMessageEnd() - result = add_security_group_to_server_result() - try: - result.success = self._handler.add_security_group_to_server(args.http, args.https, args.udp, args.server_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except ressourceException as r: - msg_type = TMessageType.REPLY - result.r = r - except serverNotFoundException as s: - msg_type = TMessageType.REPLY - result.s = s - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("add_security_group_to_server", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + """ - def process_get_servers(self, seqid, iprot, oprot): - args = get_servers_args() - args.read(iprot) - iprot.readMessageEnd() - result = get_servers_result() - try: - result.success = self._handler.get_servers() - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("get_servers", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - def process_get_servers_by_ids(self, seqid, iprot, oprot): - args = get_servers_by_ids_args() - args.read(iprot) - iprot.readMessageEnd() - result = get_servers_by_ids_result() - try: - result.success = self._handler.get_servers_by_ids(args.server_ids) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("get_servers_by_ids", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def __init__(self, servername=None, keys=None,): + self.servername = servername + self.keys = keys - def process_get_server(self, seqid, iprot, oprot): - args = get_server_args() - args.read(iprot) - iprot.readMessageEnd() - result = get_server_result() - try: - result.success = self._handler.get_server(args.openstack_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except serverNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("get_server", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.servername = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.SET: + self.keys = set() + (_etype67, _size64) = iprot.readSetBegin() + for _i68 in range(_size64): + _elem69 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.keys.add(_elem69) + iprot.readSetEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() - def process_stop_server(self, seqid, iprot, oprot): - args = stop_server_args() - args.read(iprot) - iprot.readMessageEnd() - result = stop_server_result() - try: - result.success = self._handler.stop_server(args.openstack_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except serverNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("stop_server", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('delete_metadata_from_server_args') + if self.servername is not None: + oprot.writeFieldBegin('servername', TType.STRING, 1) + oprot.writeString(self.servername.encode('utf-8') if sys.version_info[0] == 2 else self.servername) + oprot.writeFieldEnd() + if self.keys is not None: + oprot.writeFieldBegin('keys', TType.SET, 2) + oprot.writeSetBegin(TType.STRING, len(self.keys)) + for iter70 in self.keys: + oprot.writeString(iter70.encode('utf-8') if sys.version_info[0] == 2 else iter70) + oprot.writeSetEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() - def process_create_snapshot(self, seqid, iprot, oprot): - args = create_snapshot_args() - args.read(iprot) - iprot.readMessageEnd() - result = create_snapshot_result() - try: - result.success = self._handler.create_snapshot(args.openstack_id, args.name, args.elixir_id, args.base_tag, args.description) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except serverNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("create_snapshot", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - def process_get_limits(self, seqid, iprot, oprot): - args = get_limits_args() - args.read(iprot) - iprot.readMessageEnd() - result = get_limits_result() - try: - result.success = self._handler.get_limits() - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("get_limits", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def __ne__(self, other): + return not (self == other) +all_structs.append(delete_metadata_from_server_args) +delete_metadata_from_server_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'servername', 'UTF8', None, ), # 1 + (2, TType.SET, 'keys', (TType.STRING, 'UTF8', False), None, ), # 2 +) - def process_delete_image(self, seqid, iprot, oprot): - args = delete_image_args() - args.read(iprot) - iprot.readMessageEnd() - result = delete_image_result() - try: - result.success = self._handler.delete_image(args.image_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except imageNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("delete_image", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - def process_delete_volume_attachment(self, seqid, iprot, oprot): - args = delete_volume_attachment_args() - args.read(iprot) - iprot.readMessageEnd() - result = delete_volume_attachment_result() - try: - result.success = self._handler.delete_volume_attachment(args.volume_id, args.server_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except serverNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("delete_volume_attachment", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() +class delete_metadata_from_server_result(object): + """ + Attributes: + - success + - e - def process_delete_volume(self, seqid, iprot, oprot): - args = delete_volume_args() - args.read(iprot) - iprot.readMessageEnd() - result = delete_volume_result() - try: - result.success = self._handler.delete_volume(args.volume_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("delete_volume", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + """ - def process_attach_volume_to_server(self, seqid, iprot, oprot): - args = attach_volume_to_server_args() - args.read(iprot) - iprot.readMessageEnd() - result = attach_volume_to_server_result() - try: - result.success = self._handler.attach_volume_to_server(args.openstack_id, args.volume_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except serverNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("attach_volume_to_server", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - def process_check_server_status(self, seqid, iprot, oprot): - args = check_server_status_args() - args.read(iprot) - iprot.readMessageEnd() - result = check_server_status_result() - try: - result.success = self._handler.check_server_status(args.openstack_id, args.diskspace, args.volume_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except serverNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except ressourceException as r: - msg_type = TMessageType.REPLY - result.r = r - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("check_server_status", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def __init__(self, success=None, e=None,): + self.success = success + self.e = e - def process_setUserPassword(self, seqid, iprot, oprot): - args = setUserPassword_args() - args.read(iprot) - iprot.readMessageEnd() - result = setUserPassword_result() - try: - result.success = self._handler.setUserPassword(args.user, args.password) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except otherException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("setUserPassword", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.SET: + self.success = set() + (_etype74, _size71) = iprot.readSetBegin() + for _i75 in range(_size71): + _elem76 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.success.add(_elem76) + iprot.readSetEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.e = serverNotFoundException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() - def process_resume_server(self, seqid, iprot, oprot): - args = resume_server_args() - args.read(iprot) - iprot.readMessageEnd() - result = resume_server_result() - try: - result.success = self._handler.resume_server(args.openstack_id) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except serverNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("resume_server", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('delete_metadata_from_server_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.SET, 0) + oprot.writeSetBegin(TType.STRING, len(self.success)) + for iter77 in self.success: + oprot.writeString(iter77.encode('utf-8') if sys.version_info[0] == 2 else iter77) + oprot.writeSetEnd() + oprot.writeFieldEnd() + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() - def process_create_volume(self, seqid, iprot, oprot): - args = create_volume_args() - args.read(iprot) - iprot.readMessageEnd() - result = create_volume_result() - try: - result.success = self._handler.create_volume(args.volume_name, args.diskspace, args.metadata) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except ressourceException as r: - msg_type = TMessageType.REPLY - result.r = r - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("create_volume", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def validate(self): + return - def process_reboot_server(self, seqid, iprot, oprot): - args = reboot_server_args() - args.read(iprot) - iprot.readMessageEnd() - result = reboot_server_result() - try: - result.success = self._handler.reboot_server(args.server_id, args.reboot_type) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except serverNotFoundException as e: - msg_type = TMessageType.REPLY - result.e = e - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("reboot_server", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) -# HELPER FUNCTIONS AND STRUCTURES + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(delete_metadata_from_server_result) +delete_metadata_from_server_result.thrift_spec = ( + (0, TType.SET, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 + (1, TType.STRUCT, 'e', [serverNotFoundException, None], None, ), # 1 +) -class check_Version_args(object): +class add_floating_ip_to_server_args(object): """ Attributes: - - version + - openstack_id: Id of the server + - network: Network name of the network which provides the floating Ip. """ - def __init__(self, version=None,): - self.version = version + def __init__(self, openstack_id=None, network=None,): + self.openstack_id = openstack_id + self.network = network def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -2615,8 +4600,13 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.DOUBLE: - self.version = iprot.readDouble() + if ftype == TType.STRING: + self.openstack_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.network = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -2628,10 +4618,14 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('check_Version_args') - if self.version is not None: - oprot.writeFieldBegin('version', TType.DOUBLE, 1) - oprot.writeDouble(self.version) + oprot.writeStructBegin('add_floating_ip_to_server_args') + if self.openstack_id is not None: + oprot.writeFieldBegin('openstack_id', TType.STRING, 1) + oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) + oprot.writeFieldEnd() + if self.network is not None: + oprot.writeFieldBegin('network', TType.STRING, 2) + oprot.writeString(self.network.encode('utf-8') if sys.version_info[0] == 2 else self.network) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2649,23 +4643,28 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(check_Version_args) -check_Version_args.thrift_spec = ( +all_structs.append(add_floating_ip_to_server_args) +add_floating_ip_to_server_args.thrift_spec = ( None, # 0 - (1, TType.DOUBLE, 'version', None, None, ), # 1 + (1, TType.STRING, 'openstack_id', 'UTF8', None, ), # 1 + (2, TType.STRING, 'network', 'UTF8', None, ), # 2 ) -class check_Version_result(object): +class add_floating_ip_to_server_result(object): """ Attributes: - success + - e + - f """ - def __init__(self, success=None,): + def __init__(self, success=None, e=None, f=None,): self.success = success + self.e = e + self.f = f def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -2677,8 +4676,20 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.BOOL: - self.success = iprot.readBool() + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.e = serverNotFoundException() + self.e.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.f = networkNotFoundException() + self.f.read(iprot) else: iprot.skip(ftype) else: @@ -2690,10 +4701,18 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('check_Version_result') + oprot.writeStructBegin('add_floating_ip_to_server_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.BOOL, 0) - oprot.writeBool(self.success) + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeFieldEnd() + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + if self.f is not None: + oprot.writeFieldBegin('f', TType.STRUCT, 2) + self.f.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2711,14 +4730,35 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(check_Version_result) -check_Version_result.thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 +all_structs.append(add_floating_ip_to_server_result) +add_floating_ip_to_server_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 + (1, TType.STRUCT, 'e', [serverNotFoundException, None], None, ), # 1 + (2, TType.STRUCT, 'f', [networkNotFoundException, None], None, ), # 2 ) -class get_client_version_args(object): +class create_connection_args(object): + """ + Attributes: + - username: Name of the OpenStack user. + - password: Password of the OpenStack user + - auth_url: Auth Url from OpenStack + - user_domain_name: Name of the project from the OpenStack user. + 4:string project_name, + /** Domain name of OpenStack + - project_domain_name: Project domain name of OpenStack + + """ + + + def __init__(self, username=None, password=None, auth_url=None, user_domain_name=None, project_domain_name=None,): + self.username = username + self.password = password + self.auth_url = auth_url + self.user_domain_name = user_domain_name + self.project_domain_name = project_domain_name def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -2729,6 +4769,31 @@ def read(self, iprot): (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break + if fid == 1: + if ftype == TType.STRING: + self.username = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.password = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.auth_url = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.user_domain_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.project_domain_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -2738,7 +4803,27 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('get_client_version_args') + oprot.writeStructBegin('create_connection_args') + if self.username is not None: + oprot.writeFieldBegin('username', TType.STRING, 1) + oprot.writeString(self.username.encode('utf-8') if sys.version_info[0] == 2 else self.username) + oprot.writeFieldEnd() + if self.password is not None: + oprot.writeFieldBegin('password', TType.STRING, 2) + oprot.writeString(self.password.encode('utf-8') if sys.version_info[0] == 2 else self.password) + oprot.writeFieldEnd() + if self.auth_url is not None: + oprot.writeFieldBegin('auth_url', TType.STRING, 3) + oprot.writeString(self.auth_url.encode('utf-8') if sys.version_info[0] == 2 else self.auth_url) + oprot.writeFieldEnd() + if self.user_domain_name is not None: + oprot.writeFieldBegin('user_domain_name', TType.STRING, 5) + oprot.writeString(self.user_domain_name.encode('utf-8') if sys.version_info[0] == 2 else self.user_domain_name) + oprot.writeFieldEnd() + if self.project_domain_name is not None: + oprot.writeFieldBegin('project_domain_name', TType.STRING, 6) + oprot.writeString(self.project_domain_name.encode('utf-8') if sys.version_info[0] == 2 else self.project_domain_name) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2755,21 +4840,30 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(get_client_version_args) -get_client_version_args.thrift_spec = ( +all_structs.append(create_connection_args) +create_connection_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'username', 'UTF8', None, ), # 1 + (2, TType.STRING, 'password', 'UTF8', None, ), # 2 + (3, TType.STRING, 'auth_url', 'UTF8', None, ), # 3 + None, # 4 + (5, TType.STRING, 'user_domain_name', 'UTF8', None, ), # 5 + (6, TType.STRING, 'project_domain_name', 'UTF8', None, ), # 6 ) -class get_client_version_result(object): +class create_connection_result(object): """ Attributes: - success + - e """ - def __init__(self, success=None,): + def __init__(self, success=None, e=None,): self.success = success + self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -2781,8 +4875,14 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRING: - self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + if ftype == TType.BOOL: + self.success = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.e = authenticationException() + self.e.read(iprot) else: iprot.skip(ftype) else: @@ -2794,10 +4894,14 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('get_client_version_result') + oprot.writeStructBegin('create_connection_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) + oprot.writeFieldEnd() + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2815,24 +4919,39 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(get_client_version_result) -get_client_version_result.thrift_spec = ( - (0, TType.STRING, 'success', 'UTF8', None, ), # 0 +all_structs.append(create_connection_result) +create_connection_result.thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'e', [authenticationException, None], None, ), # 1 ) -class import_keypair_args(object): +class start_server_args(object): """ Attributes: - - keyname: Name for the keypair - - public_key: The public key + - flavor: Name of the Flavor to use. + - image: Name of the image to use. + - public_key: Public Key to use + - servername: Name for the new server + - metadata: Metadata for the new instance + - diskspace: Diskspace in GB for additional volume. + - volumename: Name of additional Volume + - https + - http """ - def __init__(self, keyname=None, public_key=None,): - self.keyname = keyname + def __init__(self, flavor=None, image=None, public_key=None, servername=None, metadata=None, diskspace=None, volumename=None, https=None, http=None,): + self.flavor = flavor + self.image = image self.public_key = public_key + self.servername = servername + self.metadata = metadata + self.diskspace = diskspace + self.volumename = volumename + self.https = https + self.http = http def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -2845,14 +4964,55 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.keyname = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.flavor = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: + if ftype == TType.STRING: + self.image = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: if ftype == TType.STRING: self.public_key = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.servername = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.MAP: + self.metadata = {} + (_ktype79, _vtype80, _size78) = iprot.readMapBegin() + for _i82 in range(_size78): + _key83 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val84 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.metadata[_key83] = _val84 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.diskspace = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRING: + self.volumename = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.BOOL: + self.https = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 9: + if ftype == TType.BOOL: + self.http = iprot.readBool() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -2862,15 +5022,47 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('import_keypair_args') - if self.keyname is not None: - oprot.writeFieldBegin('keyname', TType.STRING, 1) - oprot.writeString(self.keyname.encode('utf-8') if sys.version_info[0] == 2 else self.keyname) + oprot.writeStructBegin('start_server_args') + if self.flavor is not None: + oprot.writeFieldBegin('flavor', TType.STRING, 1) + oprot.writeString(self.flavor.encode('utf-8') if sys.version_info[0] == 2 else self.flavor) + oprot.writeFieldEnd() + if self.image is not None: + oprot.writeFieldBegin('image', TType.STRING, 2) + oprot.writeString(self.image.encode('utf-8') if sys.version_info[0] == 2 else self.image) oprot.writeFieldEnd() if self.public_key is not None: - oprot.writeFieldBegin('public_key', TType.STRING, 2) + oprot.writeFieldBegin('public_key', TType.STRING, 3) oprot.writeString(self.public_key.encode('utf-8') if sys.version_info[0] == 2 else self.public_key) oprot.writeFieldEnd() + if self.servername is not None: + oprot.writeFieldBegin('servername', TType.STRING, 4) + oprot.writeString(self.servername.encode('utf-8') if sys.version_info[0] == 2 else self.servername) + oprot.writeFieldEnd() + if self.metadata is not None: + oprot.writeFieldBegin('metadata', TType.MAP, 5) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metadata)) + for kiter85, viter86 in self.metadata.items(): + oprot.writeString(kiter85.encode('utf-8') if sys.version_info[0] == 2 else kiter85) + oprot.writeString(viter86.encode('utf-8') if sys.version_info[0] == 2 else viter86) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.diskspace is not None: + oprot.writeFieldBegin('diskspace', TType.STRING, 6) + oprot.writeString(self.diskspace.encode('utf-8') if sys.version_info[0] == 2 else self.diskspace) + oprot.writeFieldEnd() + if self.volumename is not None: + oprot.writeFieldBegin('volumename', TType.STRING, 7) + oprot.writeString(self.volumename.encode('utf-8') if sys.version_info[0] == 2 else self.volumename) + oprot.writeFieldEnd() + if self.https is not None: + oprot.writeFieldBegin('https', TType.BOOL, 8) + oprot.writeBool(self.https) + oprot.writeFieldEnd() + if self.http is not None: + oprot.writeFieldBegin('http', TType.BOOL, 9) + oprot.writeBool(self.http) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2887,24 +5079,45 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(import_keypair_args) -import_keypair_args.thrift_spec = ( +all_structs.append(start_server_args) +start_server_args.thrift_spec = ( None, # 0 - (1, TType.STRING, 'keyname', 'UTF8', None, ), # 1 - (2, TType.STRING, 'public_key', 'UTF8', None, ), # 2 + (1, TType.STRING, 'flavor', 'UTF8', None, ), # 1 + (2, TType.STRING, 'image', 'UTF8', None, ), # 2 + (3, TType.STRING, 'public_key', 'UTF8', None, ), # 3 + (4, TType.STRING, 'servername', 'UTF8', None, ), # 4 + (5, TType.MAP, 'metadata', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 5 + (6, TType.STRING, 'diskspace', 'UTF8', None, ), # 6 + (7, TType.STRING, 'volumename', 'UTF8', None, ), # 7 + (8, TType.BOOL, 'https', None, None, ), # 8 + (9, TType.BOOL, 'http', None, None, ), # 9 ) -class import_keypair_result(object): +class start_server_result(object): """ Attributes: - success + - e + - r + - s + - n + - i + - f + - o """ - def __init__(self, success=None,): + def __init__(self, success=None, e=None, r=None, s=None, n=None, i=None, f=None, o=None,): self.success = success + self.e = e + self.r = r + self.s = s + self.n = n + self.i = i + self.f = f + self.o = o def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -2916,8 +5129,56 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRING: - self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + if ftype == TType.MAP: + self.success = {} + (_ktype88, _vtype89, _size87) = iprot.readMapBegin() + for _i91 in range(_size87): + _key92 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val93 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.success[_key92] = _val93 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.e = nameException() + self.e.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.r = ressourceException() + self.r.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.s = serverNotFoundException() + self.s.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.n = networkNotFoundException() + self.n.read(iprot) + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRUCT: + self.i = imageNotFoundException() + self.i.read(iprot) + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRUCT: + self.f = flavorNotFoundException() + self.f.read(iprot) + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRUCT: + self.o = otherException() + self.o.read(iprot) else: iprot.skip(ftype) else: @@ -2929,10 +5190,42 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('import_keypair_result') + oprot.writeStructBegin('start_server_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeFieldBegin('success', TType.MAP, 0) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) + for kiter94, viter95 in self.success.items(): + oprot.writeString(kiter94.encode('utf-8') if sys.version_info[0] == 2 else kiter94) + oprot.writeString(viter95.encode('utf-8') if sys.version_info[0] == 2 else viter95) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + if self.r is not None: + oprot.writeFieldBegin('r', TType.STRUCT, 2) + self.r.write(oprot) + oprot.writeFieldEnd() + if self.s is not None: + oprot.writeFieldBegin('s', TType.STRUCT, 3) + self.s.write(oprot) + oprot.writeFieldEnd() + if self.n is not None: + oprot.writeFieldBegin('n', TType.STRUCT, 4) + self.n.write(oprot) + oprot.writeFieldEnd() + if self.i is not None: + oprot.writeFieldBegin('i', TType.STRUCT, 5) + self.i.write(oprot) + oprot.writeFieldEnd() + if self.f is not None: + oprot.writeFieldBegin('f', TType.STRUCT, 6) + self.f.write(oprot) + oprot.writeFieldEnd() + if self.o is not None: + oprot.writeFieldBegin('o', TType.STRUCT, 7) + self.o.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2950,22 +5243,43 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(import_keypair_result) -import_keypair_result.thrift_spec = ( - (0, TType.STRING, 'success', 'UTF8', None, ), # 0 +all_structs.append(start_server_result) +start_server_result.thrift_spec = ( + (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 0 + (1, TType.STRUCT, 'e', [nameException, None], None, ), # 1 + (2, TType.STRUCT, 'r', [ressourceException, None], None, ), # 2 + (3, TType.STRUCT, 's', [serverNotFoundException, None], None, ), # 3 + (4, TType.STRUCT, 'n', [networkNotFoundException, None], None, ), # 4 + (5, TType.STRUCT, 'i', [imageNotFoundException, None], None, ), # 5 + (6, TType.STRUCT, 'f', [flavorNotFoundException, None], None, ), # 6 + (7, TType.STRUCT, 'o', [otherException, None], None, ), # 7 ) -class get_ip_ports_args(object): +class start_server_with_custom_key_args(object): """ Attributes: - - openstack_id: Id of server + - flavor: Name of the Flavor to use. + - image: Name of the image to use. + - servername: Name for the new server + - metadata: Metadata for the new instance + - diskspace: Diskspace in GB for additional volume. + - volumename: Name of additional Volume + - http: Boolean for http security rule + - https: Boolean for https security rule """ - def __init__(self, openstack_id=None,): - self.openstack_id = openstack_id + def __init__(self, flavor=None, image=None, servername=None, metadata=None, diskspace=None, volumename=None, http=None, https=None,): + self.flavor = flavor + self.image = image + self.servername = servername + self.metadata = metadata + self.diskspace = diskspace + self.volumename = volumename + self.http = http + self.https = https def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -2978,7 +5292,48 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.openstack_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.flavor = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.image = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.servername = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.MAP: + self.metadata = {} + (_ktype97, _vtype98, _size96) = iprot.readMapBegin() + for _i100 in range(_size96): + _key101 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val102 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.metadata[_key101] = _val102 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.diskspace = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.volumename = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.BOOL: + self.http = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.BOOL: + self.https = iprot.readBool() else: iprot.skip(ftype) else: @@ -2990,10 +5345,42 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('get_ip_ports_args') - if self.openstack_id is not None: - oprot.writeFieldBegin('openstack_id', TType.STRING, 1) - oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) + oprot.writeStructBegin('start_server_with_custom_key_args') + if self.flavor is not None: + oprot.writeFieldBegin('flavor', TType.STRING, 1) + oprot.writeString(self.flavor.encode('utf-8') if sys.version_info[0] == 2 else self.flavor) + oprot.writeFieldEnd() + if self.image is not None: + oprot.writeFieldBegin('image', TType.STRING, 2) + oprot.writeString(self.image.encode('utf-8') if sys.version_info[0] == 2 else self.image) + oprot.writeFieldEnd() + if self.servername is not None: + oprot.writeFieldBegin('servername', TType.STRING, 3) + oprot.writeString(self.servername.encode('utf-8') if sys.version_info[0] == 2 else self.servername) + oprot.writeFieldEnd() + if self.metadata is not None: + oprot.writeFieldBegin('metadata', TType.MAP, 4) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metadata)) + for kiter103, viter104 in self.metadata.items(): + oprot.writeString(kiter103.encode('utf-8') if sys.version_info[0] == 2 else kiter103) + oprot.writeString(viter104.encode('utf-8') if sys.version_info[0] == 2 else viter104) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.diskspace is not None: + oprot.writeFieldBegin('diskspace', TType.STRING, 5) + oprot.writeString(self.diskspace.encode('utf-8') if sys.version_info[0] == 2 else self.diskspace) + oprot.writeFieldEnd() + if self.volumename is not None: + oprot.writeFieldBegin('volumename', TType.STRING, 6) + oprot.writeString(self.volumename.encode('utf-8') if sys.version_info[0] == 2 else self.volumename) + oprot.writeFieldEnd() + if self.http is not None: + oprot.writeFieldBegin('http', TType.BOOL, 7) + oprot.writeBool(self.http) + oprot.writeFieldEnd() + if self.https is not None: + oprot.writeFieldBegin('https', TType.BOOL, 8) + oprot.writeBool(self.https) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3011,23 +5398,44 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(get_ip_ports_args) -get_ip_ports_args.thrift_spec = ( +all_structs.append(start_server_with_custom_key_args) +start_server_with_custom_key_args.thrift_spec = ( None, # 0 - (1, TType.STRING, 'openstack_id', 'UTF8', None, ), # 1 + (1, TType.STRING, 'flavor', 'UTF8', None, ), # 1 + (2, TType.STRING, 'image', 'UTF8', None, ), # 2 + (3, TType.STRING, 'servername', 'UTF8', None, ), # 3 + (4, TType.MAP, 'metadata', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 4 + (5, TType.STRING, 'diskspace', 'UTF8', None, ), # 5 + (6, TType.STRING, 'volumename', 'UTF8', None, ), # 6 + (7, TType.BOOL, 'http', None, None, ), # 7 + (8, TType.BOOL, 'https', None, None, ), # 8 ) -class get_ip_ports_result(object): +class start_server_with_custom_key_result(object): """ Attributes: - success + - e + - r + - s + - n + - i + - f + - o """ - def __init__(self, success=None,): + def __init__(self, success=None, e=None, r=None, s=None, n=None, i=None, f=None, o=None,): self.success = success + self.e = e + self.r = r + self.s = s + self.n = n + self.i = i + self.f = f + self.o = o def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3041,14 +5449,56 @@ def read(self, iprot): if fid == 0: if ftype == TType.MAP: self.success = {} - (_ktype33, _vtype34, _size32) = iprot.readMapBegin() - for _i36 in range(_size32): - _key37 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val38 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.success[_key37] = _val38 + (_ktype106, _vtype107, _size105) = iprot.readMapBegin() + for _i109 in range(_size105): + _key110 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val111 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.success[_key110] = _val111 iprot.readMapEnd() else: iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.e = nameException() + self.e.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.r = ressourceException() + self.r.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.s = serverNotFoundException() + self.s.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.n = networkNotFoundException() + self.n.read(iprot) + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRUCT: + self.i = imageNotFoundException() + self.i.read(iprot) + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRUCT: + self.f = flavorNotFoundException() + self.f.read(iprot) + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRUCT: + self.o = otherException() + self.o.read(iprot) + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -3058,15 +5508,43 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('get_ip_ports_result') + oprot.writeStructBegin('start_server_with_custom_key_result') if self.success is not None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) - for kiter39, viter40 in self.success.items(): - oprot.writeString(kiter39.encode('utf-8') if sys.version_info[0] == 2 else kiter39) - oprot.writeString(viter40.encode('utf-8') if sys.version_info[0] == 2 else viter40) + for kiter112, viter113 in self.success.items(): + oprot.writeString(kiter112.encode('utf-8') if sys.version_info[0] == 2 else kiter112) + oprot.writeString(viter113.encode('utf-8') if sys.version_info[0] == 2 else viter113) oprot.writeMapEnd() oprot.writeFieldEnd() + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + if self.r is not None: + oprot.writeFieldBegin('r', TType.STRUCT, 2) + self.r.write(oprot) + oprot.writeFieldEnd() + if self.s is not None: + oprot.writeFieldBegin('s', TType.STRUCT, 3) + self.s.write(oprot) + oprot.writeFieldEnd() + if self.n is not None: + oprot.writeFieldBegin('n', TType.STRUCT, 4) + self.n.write(oprot) + oprot.writeFieldEnd() + if self.i is not None: + oprot.writeFieldBegin('i', TType.STRUCT, 5) + self.i.write(oprot) + oprot.writeFieldEnd() + if self.f is not None: + oprot.writeFieldBegin('f', TType.STRUCT, 6) + self.f.write(oprot) + oprot.writeFieldEnd() + if self.o is not None: + oprot.writeFieldBegin('o', TType.STRUCT, 7) + self.o.write(oprot) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3083,15 +5561,30 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(get_ip_ports_result) -get_ip_ports_result.thrift_spec = ( +all_structs.append(start_server_with_custom_key_result) +start_server_with_custom_key_result.thrift_spec = ( (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 0 + (1, TType.STRUCT, 'e', [nameException, None], None, ), # 1 + (2, TType.STRUCT, 'r', [ressourceException, None], None, ), # 2 + (3, TType.STRUCT, 's', [serverNotFoundException, None], None, ), # 3 + (4, TType.STRUCT, 'n', [networkNotFoundException, None], None, ), # 4 + (5, TType.STRUCT, 'i', [imageNotFoundException, None], None, ), # 5 + (6, TType.STRUCT, 'f', [flavorNotFoundException, None], None, ), # 6 + (7, TType.STRUCT, 'o', [otherException, None], None, ), # 7 ) -class get_Flavors_args(object): +class exist_server_args(object): + """ + Attributes: + - name + + """ + def __init__(self, name=None,): + self.name = name + def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) @@ -3101,6 +5594,11 @@ def read(self, iprot): (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break + if fid == 1: + if ftype == TType.STRING: + self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -3110,7 +5608,11 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('get_Flavors_args') + oprot.writeStructBegin('exist_server_args') + if self.name is not None: + oprot.writeFieldBegin('name', TType.STRING, 1) + oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3127,12 +5629,14 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(get_Flavors_args) -get_Flavors_args.thrift_spec = ( +all_structs.append(exist_server_args) +exist_server_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', 'UTF8', None, ), # 1 ) -class get_Flavors_result(object): +class exist_server_result(object): """ Attributes: - success @@ -3153,14 +5657,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.LIST: - self.success = [] - (_etype44, _size41) = iprot.readListBegin() - for _i45 in range(_size41): - _elem46 = Flavor() - _elem46.read(iprot) - self.success.append(_elem46) - iprot.readListEnd() + if ftype == TType.BOOL: + self.success = iprot.readBool() else: iprot.skip(ftype) else: @@ -3172,13 +5670,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('get_Flavors_result') + oprot.writeStructBegin('exist_server_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.LIST, 0) - oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter47 in self.success: - iter47.write(oprot) - oprot.writeListEnd() + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3196,14 +5691,26 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(get_Flavors_result) -get_Flavors_result.thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT, [Flavor, None], False), None, ), # 0 +all_structs.append(exist_server_result) +exist_server_result.thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 ) -class get_Images_args(object): +class create_and_deploy_playbook_args(object): + """ + Attributes: + - public_key + - playbooks_information + - openstack_id + + """ + + def __init__(self, public_key=None, playbooks_information=None, openstack_id=None,): + self.public_key = public_key + self.playbooks_information = playbooks_information + self.openstack_id = openstack_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3214,6 +5721,33 @@ def read(self, iprot): (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break + if fid == 1: + if ftype == TType.STRING: + self.public_key = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.MAP: + self.playbooks_information = {} + (_ktype115, _vtype116, _size114) = iprot.readMapBegin() + for _i118 in range(_size114): + _key119 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val120 = {} + (_ktype122, _vtype123, _size121) = iprot.readMapBegin() + for _i125 in range(_size121): + _key126 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val127 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val120[_key126] = _val127 + iprot.readMapEnd() + self.playbooks_information[_key119] = _val120 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.openstack_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -3223,7 +5757,27 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('get_Images_args') + oprot.writeStructBegin('create_and_deploy_playbook_args') + if self.public_key is not None: + oprot.writeFieldBegin('public_key', TType.STRING, 1) + oprot.writeString(self.public_key.encode('utf-8') if sys.version_info[0] == 2 else self.public_key) + oprot.writeFieldEnd() + if self.playbooks_information is not None: + oprot.writeFieldBegin('playbooks_information', TType.MAP, 2) + oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.playbooks_information)) + for kiter128, viter129 in self.playbooks_information.items(): + oprot.writeString(kiter128.encode('utf-8') if sys.version_info[0] == 2 else kiter128) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(viter129)) + for kiter130, viter131 in viter129.items(): + oprot.writeString(kiter130.encode('utf-8') if sys.version_info[0] == 2 else kiter130) + oprot.writeString(viter131.encode('utf-8') if sys.version_info[0] == 2 else viter131) + oprot.writeMapEnd() + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.openstack_id is not None: + oprot.writeFieldBegin('openstack_id', TType.STRING, 3) + oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3240,12 +5794,16 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(get_Images_args) -get_Images_args.thrift_spec = ( +all_structs.append(create_and_deploy_playbook_args) +create_and_deploy_playbook_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'public_key', 'UTF8', None, ), # 1 + (2, TType.MAP, 'playbooks_information', (TType.STRING, 'UTF8', TType.MAP, (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), False), None, ), # 2 + (3, TType.STRING, 'openstack_id', 'UTF8', None, ), # 3 ) -class get_Images_result(object): +class create_and_deploy_playbook_result(object): """ Attributes: - success @@ -3266,14 +5824,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.LIST: - self.success = [] - (_etype51, _size48) = iprot.readListBegin() - for _i52 in range(_size48): - _elem53 = Image() - _elem53.read(iprot) - self.success.append(_elem53) - iprot.readListEnd() + if ftype == TType.I32: + self.success = iprot.readI32() else: iprot.skip(ftype) else: @@ -3285,13 +5837,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('get_Images_result') + oprot.writeStructBegin('create_and_deploy_playbook_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.LIST, 0) - oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter54 in self.success: - iter54.write(oprot) - oprot.writeListEnd() + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3309,13 +5858,13 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(get_Images_result) -get_Images_result.thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT, [Image, None], False), None, ), # 0 +all_structs.append(create_and_deploy_playbook_result) +create_and_deploy_playbook_result.thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 ) -class get_Image_with_Tag_args(object): +class get_playbook_logs_args(object): """ Attributes: - openstack_id @@ -3349,7 +5898,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('get_Image_with_Tag_args') + oprot.writeStructBegin('get_playbook_logs_args') if self.openstack_id is not None: oprot.writeFieldBegin('openstack_id', TType.STRING, 1) oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) @@ -3370,14 +5919,14 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(get_Image_with_Tag_args) -get_Image_with_Tag_args.thrift_spec = ( +all_structs.append(get_playbook_logs_args) +get_playbook_logs_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'openstack_id', 'UTF8', None, ), # 1 ) -class get_Image_with_Tag_result(object): +class get_playbook_logs_result(object): """ Attributes: - success @@ -3399,7 +5948,7 @@ def read(self, iprot): break if fid == 0: if ftype == TType.STRUCT: - self.success = Image() + self.success = PlaybookResult() self.success.read(iprot) else: iprot.skip(ftype) @@ -3412,7 +5961,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('get_Image_with_Tag_result') + oprot.writeStructBegin('get_playbook_logs_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) @@ -3433,22 +5982,14 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(get_Image_with_Tag_result) -get_Image_with_Tag_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [Image, None], None, ), # 0 +all_structs.append(get_playbook_logs_result) +get_playbook_logs_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [PlaybookResult, None], None, ), # 0 ) -class delete_server_args(object): - """ - Attributes: - - openstack_id: Id of the server. - - """ - +class has_forc_args(object): - def __init__(self, openstack_id=None,): - self.openstack_id = openstack_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3459,11 +6000,6 @@ def read(self, iprot): (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break - if fid == 1: - if ftype == TType.STRING: - self.openstack_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -3473,11 +6009,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('delete_server_args') - if self.openstack_id is not None: - oprot.writeFieldBegin('openstack_id', TType.STRING, 1) - oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) - oprot.writeFieldEnd() + oprot.writeStructBegin('has_forc_args') oprot.writeFieldStop() oprot.writeStructEnd() @@ -3494,25 +6026,21 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(delete_server_args) -delete_server_args.thrift_spec = ( - None, # 0 - (1, TType.STRING, 'openstack_id', 'UTF8', None, ), # 1 +all_structs.append(has_forc_args) +has_forc_args.thrift_spec = ( ) -class delete_server_result(object): +class has_forc_result(object): """ Attributes: - success - - e """ - def __init__(self, success=None, e=None,): + def __init__(self, success=None,): self.success = success - self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3528,12 +6056,6 @@ def read(self, iprot): self.success = iprot.readBool() else: iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.e = serverNotFoundException() - self.e.read(iprot) - else: - iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -3543,15 +6065,11 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('delete_server_result') + oprot.writeStructBegin('has_forc_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) oprot.writeFieldEnd() - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3568,25 +6086,30 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(delete_server_result) -delete_server_result.thrift_spec = ( +all_structs.append(has_forc_result) +has_forc_result.thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'e', [serverNotFoundException, None], None, ), # 1 ) -class add_metadata_to_server_args(object): +class create_backend_args(object): """ Attributes: - - servername - - metadata + - elixir_id + - user_key_url + - template + - template_version + - upstream_url """ - def __init__(self, servername=None, metadata=None,): - self.servername = servername - self.metadata = metadata + def __init__(self, elixir_id=None, user_key_url=None, template=None, template_version=None, upstream_url=None,): + self.elixir_id = elixir_id + self.user_key_url = user_key_url + self.template = template + self.template_version = template_version + self.upstream_url = upstream_url def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3599,18 +6122,27 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.servername = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.elixir_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.MAP: - self.metadata = {} - (_ktype56, _vtype57, _size55) = iprot.readMapBegin() - for _i59 in range(_size55): - _key60 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val61 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.metadata[_key60] = _val61 - iprot.readMapEnd() + if ftype == TType.STRING: + self.user_key_url = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.template = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.template_version = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.upstream_url = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -3622,18 +6154,26 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('add_metadata_to_server_args') - if self.servername is not None: - oprot.writeFieldBegin('servername', TType.STRING, 1) - oprot.writeString(self.servername.encode('utf-8') if sys.version_info[0] == 2 else self.servername) + oprot.writeStructBegin('create_backend_args') + if self.elixir_id is not None: + oprot.writeFieldBegin('elixir_id', TType.STRING, 1) + oprot.writeString(self.elixir_id.encode('utf-8') if sys.version_info[0] == 2 else self.elixir_id) oprot.writeFieldEnd() - if self.metadata is not None: - oprot.writeFieldBegin('metadata', TType.MAP, 2) - oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metadata)) - for kiter62, viter63 in self.metadata.items(): - oprot.writeString(kiter62.encode('utf-8') if sys.version_info[0] == 2 else kiter62) - oprot.writeString(viter63.encode('utf-8') if sys.version_info[0] == 2 else viter63) - oprot.writeMapEnd() + if self.user_key_url is not None: + oprot.writeFieldBegin('user_key_url', TType.STRING, 2) + oprot.writeString(self.user_key_url.encode('utf-8') if sys.version_info[0] == 2 else self.user_key_url) + oprot.writeFieldEnd() + if self.template is not None: + oprot.writeFieldBegin('template', TType.STRING, 3) + oprot.writeString(self.template.encode('utf-8') if sys.version_info[0] == 2 else self.template) + oprot.writeFieldEnd() + if self.template_version is not None: + oprot.writeFieldBegin('template_version', TType.STRING, 4) + oprot.writeString(self.template_version.encode('utf-8') if sys.version_info[0] == 2 else self.template_version) + oprot.writeFieldEnd() + if self.upstream_url is not None: + oprot.writeFieldBegin('upstream_url', TType.STRING, 5) + oprot.writeString(self.upstream_url.encode('utf-8') if sys.version_info[0] == 2 else self.upstream_url) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3651,26 +6191,27 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(add_metadata_to_server_args) -add_metadata_to_server_args.thrift_spec = ( +all_structs.append(create_backend_args) +create_backend_args.thrift_spec = ( None, # 0 - (1, TType.STRING, 'servername', 'UTF8', None, ), # 1 - (2, TType.MAP, 'metadata', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 2 + (1, TType.STRING, 'elixir_id', 'UTF8', None, ), # 1 + (2, TType.STRING, 'user_key_url', 'UTF8', None, ), # 2 + (3, TType.STRING, 'template', 'UTF8', None, ), # 3 + (4, TType.STRING, 'template_version', 'UTF8', None, ), # 4 + (5, TType.STRING, 'upstream_url', 'UTF8', None, ), # 5 ) -class add_metadata_to_server_result(object): +class create_backend_result(object): """ Attributes: - success - - e """ - def __init__(self, success=None, e=None,): + def __init__(self, success=None,): self.success = success - self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3682,20 +6223,9 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.MAP: - self.success = {} - (_ktype65, _vtype66, _size64) = iprot.readMapBegin() - for _i68 in range(_size64): - _key69 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val70 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.success[_key69] = _val70 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 1: if ftype == TType.STRUCT: - self.e = serverNotFoundException() - self.e.read(iprot) + self.success = Backend() + self.success.read(iprot) else: iprot.skip(ftype) else: @@ -3707,18 +6237,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('add_metadata_to_server_result') + oprot.writeStructBegin('create_backend_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.MAP, 0) - oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) - for kiter71, viter72 in self.success.items(): - oprot.writeString(kiter71.encode('utf-8') if sys.version_info[0] == 2 else kiter71) - oprot.writeString(viter72.encode('utf-8') if sys.version_info[0] == 2 else viter72) - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3736,25 +6258,14 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(add_metadata_to_server_result) -add_metadata_to_server_result.thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 0 - (1, TType.STRUCT, 'e', [serverNotFoundException, None], None, ), # 1 +all_structs.append(create_backend_result) +create_backend_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [Backend, None], None, ), # 0 ) -class delete_metadata_from_server_args(object): - """ - Attributes: - - servername - - keys - - """ - +class get_backends_args(object): - def __init__(self, servername=None, keys=None,): - self.servername = servername - self.keys = keys def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3765,21 +6276,6 @@ def read(self, iprot): (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break - if fid == 1: - if ftype == TType.STRING: - self.servername = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.SET: - self.keys = set() - (_etype76, _size73) = iprot.readSetBegin() - for _i77 in range(_size73): - _elem78 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.keys.add(_elem78) - iprot.readSetEnd() - else: - iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -3789,18 +6285,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('delete_metadata_from_server_args') - if self.servername is not None: - oprot.writeFieldBegin('servername', TType.STRING, 1) - oprot.writeString(self.servername.encode('utf-8') if sys.version_info[0] == 2 else self.servername) - oprot.writeFieldEnd() - if self.keys is not None: - oprot.writeFieldBegin('keys', TType.SET, 2) - oprot.writeSetBegin(TType.STRING, len(self.keys)) - for iter79 in self.keys: - oprot.writeString(iter79.encode('utf-8') if sys.version_info[0] == 2 else iter79) - oprot.writeSetEnd() - oprot.writeFieldEnd() + oprot.writeStructBegin('get_backends_args') oprot.writeFieldStop() oprot.writeStructEnd() @@ -3817,26 +6302,21 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(delete_metadata_from_server_args) -delete_metadata_from_server_args.thrift_spec = ( - None, # 0 - (1, TType.STRING, 'servername', 'UTF8', None, ), # 1 - (2, TType.SET, 'keys', (TType.STRING, 'UTF8', False), None, ), # 2 +all_structs.append(get_backends_args) +get_backends_args.thrift_spec = ( ) -class delete_metadata_from_server_result(object): +class get_backends_result(object): """ Attributes: - success - - e """ - def __init__(self, success=None, e=None,): + def __init__(self, success=None,): self.success = success - self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3848,19 +6328,14 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.SET: - self.success = set() - (_etype83, _size80) = iprot.readSetBegin() - for _i84 in range(_size80): - _elem85 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.success.add(_elem85) - iprot.readSetEnd() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.e = serverNotFoundException() - self.e.read(iprot) + if ftype == TType.LIST: + self.success = [] + (_etype135, _size132) = iprot.readListBegin() + for _i136 in range(_size132): + _elem137 = Backend() + _elem137.read(iprot) + self.success.append(_elem137) + iprot.readListEnd() else: iprot.skip(ftype) else: @@ -3872,17 +6347,13 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('delete_metadata_from_server_result') + oprot.writeStructBegin('get_backends_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.SET, 0) - oprot.writeSetBegin(TType.STRING, len(self.success)) - for iter86 in self.success: - oprot.writeString(iter86.encode('utf-8') if sys.version_info[0] == 2 else iter86) - oprot.writeSetEnd() - oprot.writeFieldEnd() - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter138 in self.success: + iter138.write(oprot) + oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3900,25 +6371,22 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(delete_metadata_from_server_result) -delete_metadata_from_server_result.thrift_spec = ( - (0, TType.SET, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 - (1, TType.STRUCT, 'e', [serverNotFoundException, None], None, ), # 1 +all_structs.append(get_backends_result) +get_backends_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT, [Backend, None], False), None, ), # 0 ) -class add_floating_ip_to_server_args(object): +class get_backends_by_owner_args(object): """ Attributes: - - openstack_id: Id of the server - - network: Network name of the network which provides the floating Ip. + - elixir_id """ - def __init__(self, openstack_id=None, network=None,): - self.openstack_id = openstack_id - self.network = network + def __init__(self, elixir_id=None,): + self.elixir_id = elixir_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3931,12 +6399,7 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.openstack_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.network = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.elixir_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -3948,14 +6411,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('add_floating_ip_to_server_args') - if self.openstack_id is not None: - oprot.writeFieldBegin('openstack_id', TType.STRING, 1) - oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) - oprot.writeFieldEnd() - if self.network is not None: - oprot.writeFieldBegin('network', TType.STRING, 2) - oprot.writeString(self.network.encode('utf-8') if sys.version_info[0] == 2 else self.network) + oprot.writeStructBegin('get_backends_by_owner_args') + if self.elixir_id is not None: + oprot.writeFieldBegin('elixir_id', TType.STRING, 1) + oprot.writeString(self.elixir_id.encode('utf-8') if sys.version_info[0] == 2 else self.elixir_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3973,28 +6432,23 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(add_floating_ip_to_server_args) -add_floating_ip_to_server_args.thrift_spec = ( +all_structs.append(get_backends_by_owner_args) +get_backends_by_owner_args.thrift_spec = ( None, # 0 - (1, TType.STRING, 'openstack_id', 'UTF8', None, ), # 1 - (2, TType.STRING, 'network', 'UTF8', None, ), # 2 + (1, TType.STRING, 'elixir_id', 'UTF8', None, ), # 1 ) -class add_floating_ip_to_server_result(object): +class get_backends_by_owner_result(object): """ Attributes: - success - - e - - f """ - def __init__(self, success=None, e=None, f=None,): + def __init__(self, success=None,): self.success = success - self.e = e - self.f = f def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -4006,20 +6460,14 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRING: - self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.e = serverNotFoundException() - self.e.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.f = networkNotFoundException() - self.f.read(iprot) + if ftype == TType.LIST: + self.success = [] + (_etype142, _size139) = iprot.readListBegin() + for _i143 in range(_size139): + _elem144 = Backend() + _elem144.read(iprot) + self.success.append(_elem144) + iprot.readListEnd() else: iprot.skip(ftype) else: @@ -4031,18 +6479,13 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('add_floating_ip_to_server_result') + oprot.writeStructBegin('get_backends_by_owner_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) - oprot.writeFieldEnd() - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - if self.f is not None: - oprot.writeFieldBegin('f', TType.STRUCT, 2) - self.f.write(oprot) + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter145 in self.success: + iter145.write(oprot) + oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -4060,35 +6503,22 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(add_floating_ip_to_server_result) -add_floating_ip_to_server_result.thrift_spec = ( - (0, TType.STRING, 'success', 'UTF8', None, ), # 0 - (1, TType.STRUCT, 'e', [serverNotFoundException, None], None, ), # 1 - (2, TType.STRUCT, 'f', [networkNotFoundException, None], None, ), # 2 +all_structs.append(get_backends_by_owner_result) +get_backends_by_owner_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT, [Backend, None], False), None, ), # 0 ) -class create_connection_args(object): +class get_backends_by_template_args(object): """ Attributes: - - username: Name of the OpenStack user. - - password: Password of the OpenStack user - - auth_url: Auth Url from OpenStack - - user_domain_name: Name of the project from the OpenStack user. - 4:string project_name, - - /** Domain name of OpenStack - - project_domain_name: Project domain name of OpenStack + - template """ - def __init__(self, username=None, password=None, auth_url=None, user_domain_name=None, project_domain_name=None,): - self.username = username - self.password = password - self.auth_url = auth_url - self.user_domain_name = user_domain_name - self.project_domain_name = project_domain_name + def __init__(self, template=None,): + self.template = template def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -4101,27 +6531,7 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.username = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.password = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.auth_url = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRING: - self.user_domain_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRING: - self.project_domain_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.template = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -4133,26 +6543,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('create_connection_args') - if self.username is not None: - oprot.writeFieldBegin('username', TType.STRING, 1) - oprot.writeString(self.username.encode('utf-8') if sys.version_info[0] == 2 else self.username) - oprot.writeFieldEnd() - if self.password is not None: - oprot.writeFieldBegin('password', TType.STRING, 2) - oprot.writeString(self.password.encode('utf-8') if sys.version_info[0] == 2 else self.password) - oprot.writeFieldEnd() - if self.auth_url is not None: - oprot.writeFieldBegin('auth_url', TType.STRING, 3) - oprot.writeString(self.auth_url.encode('utf-8') if sys.version_info[0] == 2 else self.auth_url) - oprot.writeFieldEnd() - if self.user_domain_name is not None: - oprot.writeFieldBegin('user_domain_name', TType.STRING, 5) - oprot.writeString(self.user_domain_name.encode('utf-8') if sys.version_info[0] == 2 else self.user_domain_name) - oprot.writeFieldEnd() - if self.project_domain_name is not None: - oprot.writeFieldBegin('project_domain_name', TType.STRING, 6) - oprot.writeString(self.project_domain_name.encode('utf-8') if sys.version_info[0] == 2 else self.project_domain_name) + oprot.writeStructBegin('get_backends_by_template_args') + if self.template is not None: + oprot.writeFieldBegin('template', TType.STRING, 1) + oprot.writeString(self.template.encode('utf-8') if sys.version_info[0] == 2 else self.template) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -4170,30 +6564,23 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(create_connection_args) -create_connection_args.thrift_spec = ( +all_structs.append(get_backends_by_template_args) +get_backends_by_template_args.thrift_spec = ( None, # 0 - (1, TType.STRING, 'username', 'UTF8', None, ), # 1 - (2, TType.STRING, 'password', 'UTF8', None, ), # 2 - (3, TType.STRING, 'auth_url', 'UTF8', None, ), # 3 - None, # 4 - (5, TType.STRING, 'user_domain_name', 'UTF8', None, ), # 5 - (6, TType.STRING, 'project_domain_name', 'UTF8', None, ), # 6 + (1, TType.STRING, 'template', 'UTF8', None, ), # 1 ) -class create_connection_result(object): +class get_backends_by_template_result(object): """ Attributes: - success - - e """ - def __init__(self, success=None, e=None,): + def __init__(self, success=None,): self.success = success - self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -4205,14 +6592,14 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.BOOL: - self.success = iprot.readBool() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.e = authenticationException() - self.e.read(iprot) + if ftype == TType.LIST: + self.success = [] + (_etype149, _size146) = iprot.readListBegin() + for _i150 in range(_size146): + _elem151 = Backend() + _elem151.read(iprot) + self.success.append(_elem151) + iprot.readListEnd() else: iprot.skip(ftype) else: @@ -4224,14 +6611,13 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('create_connection_result') + oprot.writeStructBegin('get_backends_by_template_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.BOOL, 0) - oprot.writeBool(self.success) - oprot.writeFieldEnd() - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter152 in self.success: + iter152.write(oprot) + oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -4244,89 +6630,40 @@ def __repr__(self): for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) -all_structs.append(create_connection_result) -create_connection_result.thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'e', [authenticationException, None], None, ), # 1 -) - - -class start_server_args(object): - """ - Attributes: - - flavor: Name of the Flavor to use. - - image: Name of the image to use. - - public_key: Public Key to use - - servername: Name for the new server - - metadata: Metadata for the new instance - - diskspace: Diskspace in GB for additional volume. - - volumename: Name of additional Volume - - """ - - - def __init__(self, flavor=None, image=None, public_key=None, servername=None, metadata=None, diskspace=None, volumename=None,): - self.flavor = flavor - self.image = image - self.public_key = public_key - self.servername = servername - self.metadata = metadata - self.diskspace = diskspace - self.volumename = volumename - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.flavor = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.image = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.public_key = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRING: - self.servername = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.MAP: - self.metadata = {} - (_ktype88, _vtype89, _size87) = iprot.readMapBegin() - for _i91 in range(_size87): - _key92 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val93 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.metadata[_key92] = _val93 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRING: - self.diskspace = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.STRING: - self.volumename = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(get_backends_by_template_result) +get_backends_by_template_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT, [Backend, None], False), None, ), # 0 +) + + +class get_backend_by_id_args(object): + """ + Attributes: + - id + + """ + + + def __init__(self, id=None,): + self.id = id + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I64: + self.id = iprot.readI64() else: iprot.skip(ftype) else: @@ -4338,38 +6675,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('start_server_args') - if self.flavor is not None: - oprot.writeFieldBegin('flavor', TType.STRING, 1) - oprot.writeString(self.flavor.encode('utf-8') if sys.version_info[0] == 2 else self.flavor) - oprot.writeFieldEnd() - if self.image is not None: - oprot.writeFieldBegin('image', TType.STRING, 2) - oprot.writeString(self.image.encode('utf-8') if sys.version_info[0] == 2 else self.image) - oprot.writeFieldEnd() - if self.public_key is not None: - oprot.writeFieldBegin('public_key', TType.STRING, 3) - oprot.writeString(self.public_key.encode('utf-8') if sys.version_info[0] == 2 else self.public_key) - oprot.writeFieldEnd() - if self.servername is not None: - oprot.writeFieldBegin('servername', TType.STRING, 4) - oprot.writeString(self.servername.encode('utf-8') if sys.version_info[0] == 2 else self.servername) - oprot.writeFieldEnd() - if self.metadata is not None: - oprot.writeFieldBegin('metadata', TType.MAP, 5) - oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metadata)) - for kiter94, viter95 in self.metadata.items(): - oprot.writeString(kiter94.encode('utf-8') if sys.version_info[0] == 2 else kiter94) - oprot.writeString(viter95.encode('utf-8') if sys.version_info[0] == 2 else viter95) - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.diskspace is not None: - oprot.writeFieldBegin('diskspace', TType.STRING, 6) - oprot.writeString(self.diskspace.encode('utf-8') if sys.version_info[0] == 2 else self.diskspace) - oprot.writeFieldEnd() - if self.volumename is not None: - oprot.writeFieldBegin('volumename', TType.STRING, 7) - oprot.writeString(self.volumename.encode('utf-8') if sys.version_info[0] == 2 else self.volumename) + oprot.writeStructBegin('get_backend_by_id_args') + if self.id is not None: + oprot.writeFieldBegin('id', TType.I64, 1) + oprot.writeI64(self.id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -4387,43 +6696,23 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(start_server_args) -start_server_args.thrift_spec = ( +all_structs.append(get_backend_by_id_args) +get_backend_by_id_args.thrift_spec = ( None, # 0 - (1, TType.STRING, 'flavor', 'UTF8', None, ), # 1 - (2, TType.STRING, 'image', 'UTF8', None, ), # 2 - (3, TType.STRING, 'public_key', 'UTF8', None, ), # 3 - (4, TType.STRING, 'servername', 'UTF8', None, ), # 4 - (5, TType.MAP, 'metadata', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 5 - (6, TType.STRING, 'diskspace', 'UTF8', None, ), # 6 - (7, TType.STRING, 'volumename', 'UTF8', None, ), # 7 + (1, TType.I64, 'id', None, None, ), # 1 ) -class start_server_result(object): +class get_backend_by_id_result(object): """ Attributes: - success - - e - - r - - s - - n - - i - - f - - o """ - def __init__(self, success=None, e=None, r=None, s=None, n=None, i=None, f=None, o=None,): + def __init__(self, success=None,): self.success = success - self.e = e - self.r = r - self.s = s - self.n = n - self.i = i - self.f = f - self.o = o def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -4435,56 +6724,9 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.MAP: - self.success = {} - (_ktype97, _vtype98, _size96) = iprot.readMapBegin() - for _i100 in range(_size96): - _key101 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val102 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.success[_key101] = _val102 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.e = nameException() - self.e.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.r = ressourceException() - self.r.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.s = serverNotFoundException() - self.s.read(iprot) - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRUCT: - self.n = networkNotFoundException() - self.n.read(iprot) - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRUCT: - self.i = imageNotFoundException() - self.i.read(iprot) - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRUCT: - self.f = flavorNotFoundException() - self.f.read(iprot) - else: - iprot.skip(ftype) - elif fid == 7: if ftype == TType.STRUCT: - self.o = otherException() - self.o.read(iprot) + self.success = Backend() + self.success.read(iprot) else: iprot.skip(ftype) else: @@ -4496,42 +6738,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('start_server_result') + oprot.writeStructBegin('get_backend_by_id_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.MAP, 0) - oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) - for kiter103, viter104 in self.success.items(): - oprot.writeString(kiter103.encode('utf-8') if sys.version_info[0] == 2 else kiter103) - oprot.writeString(viter104.encode('utf-8') if sys.version_info[0] == 2 else viter104) - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - if self.r is not None: - oprot.writeFieldBegin('r', TType.STRUCT, 2) - self.r.write(oprot) - oprot.writeFieldEnd() - if self.s is not None: - oprot.writeFieldBegin('s', TType.STRUCT, 3) - self.s.write(oprot) - oprot.writeFieldEnd() - if self.n is not None: - oprot.writeFieldBegin('n', TType.STRUCT, 4) - self.n.write(oprot) - oprot.writeFieldEnd() - if self.i is not None: - oprot.writeFieldBegin('i', TType.STRUCT, 5) - self.i.write(oprot) - oprot.writeFieldEnd() - if self.f is not None: - oprot.writeFieldBegin('f', TType.STRUCT, 6) - self.f.write(oprot) - oprot.writeFieldEnd() - if self.o is not None: - oprot.writeFieldBegin('o', TType.STRUCT, 7) - self.o.write(oprot) + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -4549,39 +6759,22 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(start_server_result) -start_server_result.thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 0 - (1, TType.STRUCT, 'e', [nameException, None], None, ), # 1 - (2, TType.STRUCT, 'r', [ressourceException, None], None, ), # 2 - (3, TType.STRUCT, 's', [serverNotFoundException, None], None, ), # 3 - (4, TType.STRUCT, 'n', [networkNotFoundException, None], None, ), # 4 - (5, TType.STRUCT, 'i', [imageNotFoundException, None], None, ), # 5 - (6, TType.STRUCT, 'f', [flavorNotFoundException, None], None, ), # 6 - (7, TType.STRUCT, 'o', [otherException, None], None, ), # 7 +all_structs.append(get_backend_by_id_result) +get_backend_by_id_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [Backend, None], None, ), # 0 ) -class start_server_with_custom_key_args(object): +class delete_backend_args(object): """ Attributes: - - flavor: Name of the Flavor to use. - - image: Name of the image to use. - - servername: Name for the new server - - metadata: Metadata for the new instance - - diskspace: Diskspace in GB for additional volume. - - volumename: Name of additional Volume + - id """ - def __init__(self, flavor=None, image=None, servername=None, metadata=None, diskspace=None, volumename=None,): - self.flavor = flavor - self.image = image - self.servername = servername - self.metadata = metadata - self.diskspace = diskspace - self.volumename = volumename + def __init__(self, id=None,): + self.id = id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -4593,78 +6786,23 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.STRING: - self.flavor = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.image = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.servername = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.MAP: - self.metadata = {} - (_ktype106, _vtype107, _size105) = iprot.readMapBegin() - for _i109 in range(_size105): - _key110 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val111 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.metadata[_key110] = _val111 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRING: - self.diskspace = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRING: - self.volumename = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + if ftype == TType.I64: + self.id = iprot.readI64() else: iprot.skip(ftype) else: iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('start_server_with_custom_key_args') - if self.flavor is not None: - oprot.writeFieldBegin('flavor', TType.STRING, 1) - oprot.writeString(self.flavor.encode('utf-8') if sys.version_info[0] == 2 else self.flavor) - oprot.writeFieldEnd() - if self.image is not None: - oprot.writeFieldBegin('image', TType.STRING, 2) - oprot.writeString(self.image.encode('utf-8') if sys.version_info[0] == 2 else self.image) - oprot.writeFieldEnd() - if self.servername is not None: - oprot.writeFieldBegin('servername', TType.STRING, 3) - oprot.writeString(self.servername.encode('utf-8') if sys.version_info[0] == 2 else self.servername) - oprot.writeFieldEnd() - if self.metadata is not None: - oprot.writeFieldBegin('metadata', TType.MAP, 4) - oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metadata)) - for kiter112, viter113 in self.metadata.items(): - oprot.writeString(kiter112.encode('utf-8') if sys.version_info[0] == 2 else kiter112) - oprot.writeString(viter113.encode('utf-8') if sys.version_info[0] == 2 else viter113) - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.diskspace is not None: - oprot.writeFieldBegin('diskspace', TType.STRING, 5) - oprot.writeString(self.diskspace.encode('utf-8') if sys.version_info[0] == 2 else self.diskspace) - oprot.writeFieldEnd() - if self.volumename is not None: - oprot.writeFieldBegin('volumename', TType.STRING, 6) - oprot.writeString(self.volumename.encode('utf-8') if sys.version_info[0] == 2 else self.volumename) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('delete_backend_args') + if self.id is not None: + oprot.writeFieldBegin('id', TType.I64, 1) + oprot.writeI64(self.id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -4682,42 +6820,23 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(start_server_with_custom_key_args) -start_server_with_custom_key_args.thrift_spec = ( +all_structs.append(delete_backend_args) +delete_backend_args.thrift_spec = ( None, # 0 - (1, TType.STRING, 'flavor', 'UTF8', None, ), # 1 - (2, TType.STRING, 'image', 'UTF8', None, ), # 2 - (3, TType.STRING, 'servername', 'UTF8', None, ), # 3 - (4, TType.MAP, 'metadata', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 4 - (5, TType.STRING, 'diskspace', 'UTF8', None, ), # 5 - (6, TType.STRING, 'volumename', 'UTF8', None, ), # 6 + (1, TType.I64, 'id', None, None, ), # 1 ) -class start_server_with_custom_key_result(object): +class delete_backend_result(object): """ Attributes: - success - - e - - r - - s - - n - - i - - f - - o """ - def __init__(self, success=None, e=None, r=None, s=None, n=None, i=None, f=None, o=None,): + def __init__(self, success=None,): self.success = success - self.e = e - self.r = r - self.s = s - self.n = n - self.i = i - self.f = f - self.o = o def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -4729,56 +6848,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.MAP: - self.success = {} - (_ktype115, _vtype116, _size114) = iprot.readMapBegin() - for _i118 in range(_size114): - _key119 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val120 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.success[_key119] = _val120 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.e = nameException() - self.e.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.r = ressourceException() - self.r.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.s = serverNotFoundException() - self.s.read(iprot) - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRUCT: - self.n = networkNotFoundException() - self.n.read(iprot) - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRUCT: - self.i = imageNotFoundException() - self.i.read(iprot) - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRUCT: - self.f = flavorNotFoundException() - self.f.read(iprot) - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.STRUCT: - self.o = otherException() - self.o.read(iprot) + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -4790,42 +6861,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('start_server_with_custom_key_result') + oprot.writeStructBegin('delete_backend_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.MAP, 0) - oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) - for kiter121, viter122 in self.success.items(): - oprot.writeString(kiter121.encode('utf-8') if sys.version_info[0] == 2 else kiter121) - oprot.writeString(viter122.encode('utf-8') if sys.version_info[0] == 2 else viter122) - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - if self.r is not None: - oprot.writeFieldBegin('r', TType.STRUCT, 2) - self.r.write(oprot) - oprot.writeFieldEnd() - if self.s is not None: - oprot.writeFieldBegin('s', TType.STRUCT, 3) - self.s.write(oprot) - oprot.writeFieldEnd() - if self.n is not None: - oprot.writeFieldBegin('n', TType.STRUCT, 4) - self.n.write(oprot) - oprot.writeFieldEnd() - if self.i is not None: - oprot.writeFieldBegin('i', TType.STRUCT, 5) - self.i.write(oprot) - oprot.writeFieldEnd() - if self.f is not None: - oprot.writeFieldBegin('f', TType.STRUCT, 6) - self.f.write(oprot) - oprot.writeFieldEnd() - if self.o is not None: - oprot.writeFieldBegin('o', TType.STRUCT, 7) - self.o.write(oprot) + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -4843,29 +6882,14 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(start_server_with_custom_key_result) -start_server_with_custom_key_result.thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 0 - (1, TType.STRUCT, 'e', [nameException, None], None, ), # 1 - (2, TType.STRUCT, 'r', [ressourceException, None], None, ), # 2 - (3, TType.STRUCT, 's', [serverNotFoundException, None], None, ), # 3 - (4, TType.STRUCT, 'n', [networkNotFoundException, None], None, ), # 4 - (5, TType.STRUCT, 'i', [imageNotFoundException, None], None, ), # 5 - (6, TType.STRUCT, 'f', [flavorNotFoundException, None], None, ), # 6 - (7, TType.STRUCT, 'o', [otherException, None], None, ), # 7 +all_structs.append(delete_backend_result) +delete_backend_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 ) -class exist_server_args(object): - """ - Attributes: - - name - - """ - +class get_templates_args(object): - def __init__(self, name=None,): - self.name = name def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -4876,11 +6900,6 @@ def read(self, iprot): (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break - if fid == 1: - if ftype == TType.STRING: - self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -4890,11 +6909,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('exist_server_args') - if self.name is not None: - oprot.writeFieldBegin('name', TType.STRING, 1) - oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) - oprot.writeFieldEnd() + oprot.writeStructBegin('get_templates_args') oprot.writeFieldStop() oprot.writeStructEnd() @@ -4911,14 +6926,12 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(exist_server_args) -exist_server_args.thrift_spec = ( - None, # 0 - (1, TType.STRING, 'name', 'UTF8', None, ), # 1 +all_structs.append(get_templates_args) +get_templates_args.thrift_spec = ( ) -class exist_server_result(object): +class get_templates_result(object): """ Attributes: - success @@ -4939,8 +6952,19 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.BOOL: - self.success = iprot.readBool() + if ftype == TType.LIST: + self.success = [] + (_etype156, _size153) = iprot.readListBegin() + for _i157 in range(_size153): + _elem158 = {} + (_ktype160, _vtype161, _size159) = iprot.readMapBegin() + for _i163 in range(_size159): + _key164 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val165 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _elem158[_key164] = _val165 + iprot.readMapEnd() + self.success.append(_elem158) + iprot.readListEnd() else: iprot.skip(ftype) else: @@ -4952,10 +6976,17 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('exist_server_result') + oprot.writeStructBegin('get_templates_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.BOOL, 0) - oprot.writeBool(self.success) + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.MAP, len(self.success)) + for iter166 in self.success: + oprot.writeMapBegin(TType.STRING, TType.STRING, len(iter166)) + for kiter167, viter168 in iter166.items(): + oprot.writeString(kiter167.encode('utf-8') if sys.version_info[0] == 2 else kiter167) + oprot.writeString(viter168.encode('utf-8') if sys.version_info[0] == 2 else viter168) + oprot.writeMapEnd() + oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -4973,26 +7004,22 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(exist_server_result) -exist_server_result.thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 +all_structs.append(get_templates_result) +get_templates_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.MAP, (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), False), None, ), # 0 ) -class create_and_deploy_playbook_args(object): +class get_templates_by_template_args(object): """ Attributes: - - public_key - - playbooks_information - - openstack_id + - template_name """ - def __init__(self, public_key=None, playbooks_information=None, openstack_id=None,): - self.public_key = public_key - self.playbooks_information = playbooks_information - self.openstack_id = openstack_id + def __init__(self, template_name=None,): + self.template_name = template_name def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -5005,29 +7032,7 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.public_key = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.MAP: - self.playbooks_information = {} - (_ktype124, _vtype125, _size123) = iprot.readMapBegin() - for _i127 in range(_size123): - _key128 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val129 = {} - (_ktype131, _vtype132, _size130) = iprot.readMapBegin() - for _i134 in range(_size130): - _key135 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val136 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val129[_key135] = _val136 - iprot.readMapEnd() - self.playbooks_information[_key128] = _val129 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.openstack_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.template_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -5039,26 +7044,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('create_and_deploy_playbook_args') - if self.public_key is not None: - oprot.writeFieldBegin('public_key', TType.STRING, 1) - oprot.writeString(self.public_key.encode('utf-8') if sys.version_info[0] == 2 else self.public_key) - oprot.writeFieldEnd() - if self.playbooks_information is not None: - oprot.writeFieldBegin('playbooks_information', TType.MAP, 2) - oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.playbooks_information)) - for kiter137, viter138 in self.playbooks_information.items(): - oprot.writeString(kiter137.encode('utf-8') if sys.version_info[0] == 2 else kiter137) - oprot.writeMapBegin(TType.STRING, TType.STRING, len(viter138)) - for kiter139, viter140 in viter138.items(): - oprot.writeString(kiter139.encode('utf-8') if sys.version_info[0] == 2 else kiter139) - oprot.writeString(viter140.encode('utf-8') if sys.version_info[0] == 2 else viter140) - oprot.writeMapEnd() - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.openstack_id is not None: - oprot.writeFieldBegin('openstack_id', TType.STRING, 3) - oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) + oprot.writeStructBegin('get_templates_by_template_args') + if self.template_name is not None: + oprot.writeFieldBegin('template_name', TType.STRING, 1) + oprot.writeString(self.template_name.encode('utf-8') if sys.version_info[0] == 2 else self.template_name) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -5076,16 +7065,14 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(create_and_deploy_playbook_args) -create_and_deploy_playbook_args.thrift_spec = ( +all_structs.append(get_templates_by_template_args) +get_templates_by_template_args.thrift_spec = ( None, # 0 - (1, TType.STRING, 'public_key', 'UTF8', None, ), # 1 - (2, TType.MAP, 'playbooks_information', (TType.STRING, 'UTF8', TType.MAP, (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), False), None, ), # 2 - (3, TType.STRING, 'openstack_id', 'UTF8', None, ), # 3 + (1, TType.STRING, 'template_name', 'UTF8', None, ), # 1 ) -class create_and_deploy_playbook_result(object): +class get_templates_by_template_result(object): """ Attributes: - success @@ -5106,8 +7093,19 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.I32: - self.success = iprot.readI32() + if ftype == TType.LIST: + self.success = [] + (_etype172, _size169) = iprot.readListBegin() + for _i173 in range(_size169): + _elem174 = {} + (_ktype176, _vtype177, _size175) = iprot.readMapBegin() + for _i179 in range(_size175): + _key180 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val181 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _elem174[_key180] = _val181 + iprot.readMapEnd() + self.success.append(_elem174) + iprot.readListEnd() else: iprot.skip(ftype) else: @@ -5119,10 +7117,17 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('create_and_deploy_playbook_result') + oprot.writeStructBegin('get_templates_by_template_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.I32, 0) - oprot.writeI32(self.success) + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.MAP, len(self.success)) + for iter182 in self.success: + oprot.writeMapBegin(TType.STRING, TType.STRING, len(iter182)) + for kiter183, viter184 in iter182.items(): + oprot.writeString(kiter183.encode('utf-8') if sys.version_info[0] == 2 else kiter183) + oprot.writeString(viter184.encode('utf-8') if sys.version_info[0] == 2 else viter184) + oprot.writeMapEnd() + oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -5140,22 +7145,24 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(create_and_deploy_playbook_result) -create_and_deploy_playbook_result.thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 +all_structs.append(get_templates_by_template_result) +get_templates_by_template_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.MAP, (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), False), None, ), # 0 ) -class get_playbook_logs_args(object): +class check_template_args(object): """ Attributes: - - openstack_id + - template_name + - template_version """ - def __init__(self, openstack_id=None,): - self.openstack_id = openstack_id + def __init__(self, template_name=None, template_version=None,): + self.template_name = template_name + self.template_version = template_version def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -5168,7 +7175,12 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.openstack_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.template_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.template_version = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -5180,10 +7192,14 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('get_playbook_logs_args') - if self.openstack_id is not None: - oprot.writeFieldBegin('openstack_id', TType.STRING, 1) - oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) + oprot.writeStructBegin('check_template_args') + if self.template_name is not None: + oprot.writeFieldBegin('template_name', TType.STRING, 1) + oprot.writeString(self.template_name.encode('utf-8') if sys.version_info[0] == 2 else self.template_name) + oprot.writeFieldEnd() + if self.template_version is not None: + oprot.writeFieldBegin('template_version', TType.STRING, 2) + oprot.writeString(self.template_version.encode('utf-8') if sys.version_info[0] == 2 else self.template_version) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -5201,14 +7217,15 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(get_playbook_logs_args) -get_playbook_logs_args.thrift_spec = ( +all_structs.append(check_template_args) +check_template_args.thrift_spec = ( None, # 0 - (1, TType.STRING, 'openstack_id', 'UTF8', None, ), # 1 + (1, TType.STRING, 'template_name', 'UTF8', None, ), # 1 + (2, TType.STRING, 'template_version', 'UTF8', None, ), # 2 ) -class get_playbook_logs_result(object): +class check_template_result(object): """ Attributes: - success @@ -5229,9 +7246,14 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRUCT: - self.success = PlaybookResult() - self.success.read(iprot) + if ftype == TType.MAP: + self.success = {} + (_ktype186, _vtype187, _size185) = iprot.readMapBegin() + for _i189 in range(_size185): + _key190 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val191 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.success[_key190] = _val191 + iprot.readMapEnd() else: iprot.skip(ftype) else: @@ -5243,10 +7265,14 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('get_playbook_logs_result') + oprot.writeStructBegin('check_template_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) + oprot.writeFieldBegin('success', TType.MAP, 0) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) + for kiter192, viter193 in self.success.items(): + oprot.writeString(kiter192.encode('utf-8') if sys.version_info[0] == 2 else kiter192) + oprot.writeString(viter193.encode('utf-8') if sys.version_info[0] == 2 else viter193) + oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -5264,9 +7290,9 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(get_playbook_logs_result) -get_playbook_logs_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [PlaybookResult, None], None, ), # 0 +all_structs.append(check_template_result) +check_template_result.thrift_spec = ( + (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 0 ) @@ -5521,11 +7547,11 @@ def read(self, iprot): if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype144, _size141) = iprot.readListBegin() - for _i145 in range(_size141): - _elem146 = VM() - _elem146.read(iprot) - self.success.append(_elem146) + (_etype197, _size194) = iprot.readListBegin() + for _i198 in range(_size194): + _elem199 = VM() + _elem199.read(iprot) + self.success.append(_elem199) iprot.readListEnd() else: iprot.skip(ftype) @@ -5542,8 +7568,8 @@ def write(self, oprot): if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter147 in self.success: - iter147.write(oprot) + for iter200 in self.success: + iter200.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -5591,10 +7617,10 @@ def read(self, iprot): if fid == 1: if ftype == TType.LIST: self.server_ids = [] - (_etype151, _size148) = iprot.readListBegin() - for _i152 in range(_size148): - _elem153 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.server_ids.append(_elem153) + (_etype204, _size201) = iprot.readListBegin() + for _i205 in range(_size201): + _elem206 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.server_ids.append(_elem206) iprot.readListEnd() else: iprot.skip(ftype) @@ -5611,8 +7637,8 @@ def write(self, oprot): if self.server_ids is not None: oprot.writeFieldBegin('server_ids', TType.LIST, 1) oprot.writeListBegin(TType.STRING, len(self.server_ids)) - for iter154 in self.server_ids: - oprot.writeString(iter154.encode('utf-8') if sys.version_info[0] == 2 else iter154) + for iter207 in self.server_ids: + oprot.writeString(iter207.encode('utf-8') if sys.version_info[0] == 2 else iter207) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -5661,11 +7687,11 @@ def read(self, iprot): if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype158, _size155) = iprot.readListBegin() - for _i159 in range(_size155): - _elem160 = VM() - _elem160.read(iprot) - self.success.append(_elem160) + (_etype211, _size208) = iprot.readListBegin() + for _i212 in range(_size208): + _elem213 = VM() + _elem213.read(iprot) + self.success.append(_elem213) iprot.readListEnd() else: iprot.skip(ftype) @@ -5682,8 +7708,8 @@ def write(self, oprot): if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter161 in self.success: - iter161.write(oprot) + for iter214 in self.success: + iter214.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -6231,11 +8257,11 @@ def read(self, iprot): if fid == 0: if ftype == TType.MAP: self.success = {} - (_ktype163, _vtype164, _size162) = iprot.readMapBegin() - for _i166 in range(_size162): - _key167 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val168 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.success[_key167] = _val168 + (_ktype216, _vtype217, _size215) = iprot.readMapBegin() + for _i219 in range(_size215): + _key220 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val221 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.success[_key220] = _val221 iprot.readMapEnd() else: iprot.skip(ftype) @@ -6252,9 +8278,9 @@ def write(self, oprot): if self.success is not None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) - for kiter169, viter170 in self.success.items(): - oprot.writeString(kiter169.encode('utf-8') if sys.version_info[0] == 2 else kiter169) - oprot.writeString(viter170.encode('utf-8') if sys.version_info[0] == 2 else viter170) + for kiter222, viter223 in self.success.items(): + oprot.writeString(kiter222.encode('utf-8') if sys.version_info[0] == 2 else kiter222) + oprot.writeString(viter223.encode('utf-8') if sys.version_info[0] == 2 else viter223) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7329,11 +9355,11 @@ def read(self, iprot): elif fid == 3: if ftype == TType.MAP: self.metadata = {} - (_ktype172, _vtype173, _size171) = iprot.readMapBegin() - for _i175 in range(_size171): - _key176 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val177 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.metadata[_key176] = _val177 + (_ktype225, _vtype226, _size224) = iprot.readMapBegin() + for _i228 in range(_size224): + _key229 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val230 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.metadata[_key229] = _val230 iprot.readMapEnd() else: iprot.skip(ftype) @@ -7358,9 +9384,9 @@ def write(self, oprot): if self.metadata is not None: oprot.writeFieldBegin('metadata', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metadata)) - for kiter178, viter179 in self.metadata.items(): - oprot.writeString(kiter178.encode('utf-8') if sys.version_info[0] == 2 else kiter178) - oprot.writeString(viter179.encode('utf-8') if sys.version_info[0] == 2 else viter179) + for kiter231, viter232 in self.metadata.items(): + oprot.writeString(kiter231.encode('utf-8') if sys.version_info[0] == 2 else kiter231) + oprot.writeString(viter232.encode('utf-8') if sys.version_info[0] == 2 else viter232) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() diff --git a/VirtualMachineService/ancon/Playbook.py b/VirtualMachineService/ancon/Playbook.py index 1763d074..944f7402 100644 --- a/VirtualMachineService/ancon/Playbook.py +++ b/VirtualMachineService/ancon/Playbook.py @@ -96,11 +96,12 @@ def load_vars(): data[playbook_name + "_tools"][k] = p_dict if playbook_name == THEIA: for k, v in playbook_vars.items(): - if k == "version": + if k == "template_version": data[playbook_name + "_vars"][k] = v if playbook_name == RSTUDIO: for k, v in playbook_vars.items(): - pass + if k == "template_version": + data[playbook_name + "_vars"][k] = v playbook_yml = "/{0}.yml".format(playbook_name) playbook_var_yml = "/{0}_vars_file.yml".format(playbook_name) diff --git a/VirtualMachineService/ancon/playbooks/rstudio.yml b/VirtualMachineService/ancon/playbooks/rstudio.yml new file mode 100644 index 00000000..d4bea451 --- /dev/null +++ b/VirtualMachineService/ancon/playbooks/rstudio.yml @@ -0,0 +1,2 @@ +- debug: + msg: "{{ rstudio_vars.template_version }}" diff --git a/VirtualMachineService/ancon/playbooks/rstudio_vars_file.yml b/VirtualMachineService/ancon/playbooks/rstudio_vars_file.yml new file mode 100644 index 00000000..e651f086 --- /dev/null +++ b/VirtualMachineService/ancon/playbooks/rstudio_vars_file.yml @@ -0,0 +1,2 @@ +rstudio_vars: + template_version: diff --git a/VirtualMachineService/ancon/playbooks/theia.yml b/VirtualMachineService/ancon/playbooks/theia.yml new file mode 100644 index 00000000..ea3fd691 --- /dev/null +++ b/VirtualMachineService/ancon/playbooks/theia.yml @@ -0,0 +1,2 @@ +- debug: + msg: "{{ theia_vars.template_version }}" diff --git a/VirtualMachineService/ancon/playbooks/theia_vars_file.yml b/VirtualMachineService/ancon/playbooks/theia_vars_file.yml new file mode 100644 index 00000000..16a71474 --- /dev/null +++ b/VirtualMachineService/ancon/playbooks/theia_vars_file.yml @@ -0,0 +1,2 @@ +theia_vars: + template_version: diff --git a/VirtualMachineService/config/config.yml b/VirtualMachineService/config/config.yml index e92897cb..ee8b61d8 100644 --- a/VirtualMachineService/config/config.yml +++ b/VirtualMachineService/config/config.yml @@ -7,9 +7,6 @@ openstack_connection: # If set to True the client will use a Gateway instead of providing floating IPs for each instance. use_gateway: True - # Id of the default simple vm security group - default_security_group: ec824d8f-0e45-4eb1-8f49-089867fef366 - set_password: False # network where the project is located network: portalexternalnetwork @@ -22,3 +19,6 @@ openstack_connection: # Used for gateway port calculation , x is always the last octet of the fixed ip (example : (x + 3) *3 ) ) ssh_port_calc_formular: 30000 + x udp_port_calc_formular: x * 10 + 30000 + +urls: + forc_url: https://proxy-dev.bi.denbi.de:5000/ diff --git a/VirtualMachineService/ttypes.py b/VirtualMachineService/ttypes.py index fd6b1475..df56fcfd 100644 --- a/VirtualMachineService/ttypes.py +++ b/VirtualMachineService/ttypes.py @@ -16,6 +16,107 @@ all_structs = [] +class Backend(object): + """ + Attributes: + - id + - owner + - location_url + - template + - template_version + + """ + + + def __init__(self, id=None, owner=None, location_url=None, template=None, template_version=None,): + self.id = id + self.owner = owner + self.location_url = location_url + self.template = template + self.template_version = template_version + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I64: + self.id = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.owner = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.location_url = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.template = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.template_version = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('Backend') + if self.id is not None: + oprot.writeFieldBegin('id', TType.I64, 1) + oprot.writeI64(self.id) + oprot.writeFieldEnd() + if self.owner is not None: + oprot.writeFieldBegin('owner', TType.STRING, 2) + oprot.writeString(self.owner.encode('utf-8') if sys.version_info[0] == 2 else self.owner) + oprot.writeFieldEnd() + if self.location_url is not None: + oprot.writeFieldBegin('location_url', TType.STRING, 3) + oprot.writeString(self.location_url.encode('utf-8') if sys.version_info[0] == 2 else self.location_url) + oprot.writeFieldEnd() + if self.template is not None: + oprot.writeFieldBegin('template', TType.STRING, 4) + oprot.writeString(self.template.encode('utf-8') if sys.version_info[0] == 2 else self.template) + oprot.writeFieldEnd() + if self.template_version is not None: + oprot.writeFieldBegin('template_version', TType.STRING, 5) + oprot.writeString(self.template_version.encode('utf-8') if sys.version_info[0] == 2 else self.template_version) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + class Flavor(object): """ This Struct defines a Flavor. @@ -645,77 +746,6 @@ def __ne__(self, other): return not (self == other) -class PlaybookVars(object): - """ - This struct contains a mapping of variable keys to their content. This struct should be mapped by a playbook name. - - Attributes: - - needed_variables: The mapping of variable key to variable content - - """ - - - def __init__(self, needed_variables=None,): - self.needed_variables = needed_variables - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.MAP: - self.needed_variables = {} - (_ktype24, _vtype25, _size23) = iprot.readMapBegin() - for _i27 in range(_size23): - _key28 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val29 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.needed_variables[_key28] = _val29 - iprot.readMapEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('PlaybookVars') - if self.needed_variables is not None: - oprot.writeFieldBegin('needed_variables', TType.MAP, 1) - oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.needed_variables)) - for kiter30, viter31 in self.needed_variables.items(): - oprot.writeString(kiter30.encode('utf-8') if sys.version_info[0] == 2 else kiter30) - oprot.writeString(viter31.encode('utf-8') if sys.version_info[0] == 2 else viter31) - oprot.writeMapEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.needed_variables is None: - raise TProtocolException(message='Required field needed_variables is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - class otherException(TException): """ Attributes: @@ -1196,6 +1226,15 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(Backend) +Backend.thrift_spec = ( + None, # 0 + (1, TType.I64, 'id', None, None, ), # 1 + (2, TType.STRING, 'owner', 'UTF8', None, ), # 2 + (3, TType.STRING, 'location_url', 'UTF8', None, ), # 3 + (4, TType.STRING, 'template', 'UTF8', None, ), # 4 + (5, TType.STRING, 'template_version', 'UTF8', None, ), # 5 +) all_structs.append(Flavor) Flavor.thrift_spec = ( None, # 0 @@ -1245,11 +1284,6 @@ def __ne__(self, other): (2, TType.STRING, 'stdout', 'UTF8', None, ), # 2 (3, TType.STRING, 'stderr', 'UTF8', None, ), # 3 ) -all_structs.append(PlaybookVars) -PlaybookVars.thrift_spec = ( - None, # 0 - (1, TType.MAP, 'needed_variables', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 1 -) all_structs.append(otherException) otherException.thrift_spec = ( None, # 0 diff --git a/docker-compose.yml b/docker-compose.yml index a4673a09..4505497d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,7 +28,6 @@ services: networks: - portal - networks: portal: name: portal_default diff --git a/portal_client.thrift b/portal_client.thrift index cc9f22eb..a5f02c5f 100644 --- a/portal_client.thrift +++ b/portal_client.thrift @@ -7,7 +7,13 @@ typedef i32 int const string VERSION= '1.0.0' - +struct Backend { + 1: i64 id, + 2: string owner, + 3: string location_url, + 4: string template, + 5: string template_version +} /** * This Struct defines a Flavor. @@ -33,8 +39,6 @@ const string VERSION= '1.0.0' /** List of tags from flavor */ 7: required list tags - - } /** * This Struct defines an Image. @@ -128,16 +132,6 @@ struct PlaybookResult { 3: required string stderr } -/** - * This struct contains a mapping of variable keys to their content. This struct should be mapped by a playbook name. - */ -struct PlaybookVars { - /**The mapping of variable key to variable content*/ - 1: required map needed_variables -} - - - exception otherException { /** Every other exception. */ 1: string Reason @@ -316,7 +310,7 @@ service VirtualMachineService { 6:string diskspace, /** Name of additional Volume*/ - 7:string volumename) + 7:string volumename, 8:bool https,9:bool http) throws (1:nameException e,2:ressourceException r,3:serverNotFoundException s,4: networkNotFoundException n,5:imageNotFoundException i,6:flavorNotFoundException f,7:otherException o) @@ -342,7 +336,13 @@ service VirtualMachineService { 5:string diskspace, /** Name of additional Volume*/ - 6:string volumename) + 6:string volumename, + + /** Boolean for http security rule*/ + 7:bool http, + + /** Boolean for https security rule*/ + 8:bool https) throws (1:nameException e,2:ressourceException r,3:serverNotFoundException s,4: networkNotFoundException n,5:imageNotFoundException i,6:flavorNotFoundException f,7:otherException o) @@ -363,6 +363,54 @@ service VirtualMachineService { 1:string openstack_id ) + + /** Get boolean if client has backend url configured*/ + bool has_forc() + + /** Create a backend*/ + Backend create_backend( + 1:string elixir_id, + 2:string user_key_url, + 3:string template, + 4:string template_version, + 5:string upstream_url + ) + + /** Get all backends*/ + list get_backends() + + /** Get all backends by owner*/ + list get_backends_by_owner( + 1:string elixir_id + ) + + /** Get all backends by template*/ + list get_backends_by_template( + 1:string template + ) + + /** Get a backend by id*/ + Backend get_backend_by_id( + 1:i64 id + ) + + /** Delete a backend*/ + string delete_backend( + 1:i64 id + ) + + list> get_templates() + + list> get_templates_by_template( + 1:string template_name + ) + + map check_template( + 1:string template_name + 2:string template_version + ) + + /** * Adds a security group to a server */ diff --git a/requirements.txt b/requirements.txt index 7cf30dbf..fb73360c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,4 @@ ruamel.yaml<0.16.00 paramiko==2.6.0 pyvim==2.0.24 redis==3.3.6 +requests==2.22.0