def deployment_in_db(self): deployment = _db_select_query(name=self.name, server=self.server, provider=self.provider).first() if deployment: _provider = get_crud(get_provider_key(deployment.provider_name)) _server = MiddlewareServer(name=deployment.server_name, feed=deployment.feed, provider=_provider) return MiddlewareDeployment(nativeid=deployment.nativeid, name=deployment.name, server=_server, provider=_provider) return None
def deployment_in_db(self): deployment = _db_select_query(name=self.name, server=self.server, provider=self.provider).first() if deployment: _provider = get_crud(get_provider_key(deployment.provider_name)) _server = MiddlewareServer(name=deployment.server_name, feed=deployment.feed, provider=_provider) return MiddlewareDeployment(nativeid=deployment.nativeid, name=deployment.name, server=_server, provider=_provider, db_id=deployment.id) return None
def servers_in_db(cls, name=None, feed=None, provider=None, strict=True): servers = [] rows = _db_select_query(name=name, feed=feed, provider=provider).all() for server in rows: if strict: _provider = get_crud(get_provider_key(server.provider_name)) servers.append(MiddlewareServer(name=server.name, hostname=server.hostname, feed=server.feed, product=server.product, db_id=server.id, provider=_provider, properties=parse_properties(server.properties))) return servers
def deployments_in_db(cls, server=None, provider=None, strict=True): deployments = [] rows = _db_select_query(server=server, provider=provider).all() _provider = provider for deployment in rows: if strict: _provider = get_crud(get_provider_key(deployment.provider_name)) _server = MiddlewareServer(name=deployment.server_name, feed=deployment.feed, provider=provider) deployments.append(MiddlewareDeployment(nativeid=deployment.nativeid, name=deployment.name, server=_server, provider=_provider)) return deployments
def deployments_in_db(cls, server=None, provider=None, strict=True): deployments = [] rows = _db_select_query(server=server, provider=provider).all() _provider = provider for deployment in rows: if strict: _provider = get_crud(get_provider_key(deployment.provider_name)) _server = MiddlewareServer(name=deployment.server_name, feed=deployment.feed, provider=provider) deployments.append(MiddlewareDeployment(nativeid=deployment.nativeid, name=deployment.name, db_id=deployment.id, server=_server, provider=_provider)) return deployments
def domains_in_db(cls, name=None, feed=None, provider=None, strict=True): domains = [] rows = _db_select_query(name=name, feed=feed, provider=provider).all() for domain in rows: if strict: _provider = get_crud(get_provider_key(domain.provider_name)) domains.append(MiddlewareDomain( name=domain.name, feed=domain.feed, db_id=domain.id, provider=_provider, properties=parse_properties(domain.properties))) return domains
def servers(cls, provider=None, strict=True): servers = [] _get_servers_page(provider=provider) if sel.is_displayed(list_tbl): _provider = provider for _ in paginator.pages(): for row in list_tbl.rows(): if strict: _provider = get_crud(get_provider_key(row.provider.text)) servers.append(MiddlewareServer(name=row.server_name.text, feed=row.feed.text, product=row.product.text, provider=_provider)) return servers
def domains(cls, provider=None, strict=True): domains = [] _get_domains_page(provider=provider) if sel.is_displayed(list_tbl): _provider = provider for _ in paginator.pages(): for row in list_tbl.rows(): if strict: _provider = get_crud(get_provider_key(row.provider.text)) domains.append(MiddlewareDomain( name=row.domain_name.text, feed=row.feed.text, provider=_provider)) return domains
def datasources_in_db(cls, server=None, provider=None, strict=True): datasources = [] rows = _db_select_query(server=server, provider=provider).all() _provider = provider for datasource in rows: if strict: _provider = get_crud(get_provider_key(datasource.provider_name)) _server = MiddlewareServer(name=datasource.server_name, feed=datasource.feed, provider=provider) datasources.append(MiddlewareDatasource(nativeid=datasource.nativeid, name=datasource.name, server=_server, provider=_provider, properties=datasource.properties)) return datasources
def datasources_in_db(cls, server=None, provider=None, strict=True): datasources = [] rows = _db_select_query(server=server, provider=provider).all() _provider = provider for datasource in rows: if strict: _provider = get_crud(get_provider_key(datasource.provider_name)) _server = MiddlewareServer(name=datasource.server_name, feed=datasource.feed, provider=provider) datasources.append(MiddlewareDatasource(nativeid=datasource.nativeid, name=datasource.name, server=_server, provider=_provider, properties=parse_properties(datasource.properties))) return datasources
def servers_in_db(cls, name=None, feed=None, provider=None, strict=True): servers = [] rows = _db_select_query(name=name, feed=feed, provider=provider).all() for server in rows: if strict: _provider = get_crud(get_provider_key(server.provider_name)) servers.append( MiddlewareServer(name=server.name, hostname=server.hostname, feed=server.feed, product=server.product, provider=_provider, properties=parse_properties( server.properties))) return servers
def __init__(self, name=None, provider_key=None): self.name = name self._short_name = self.name.split('in')[0].strip() col = rest_api().collections cluster = [cl for cl in col.clusters.all if cl.name == self._short_name][-1] self._cluster_id = cluster.id provider_id = cluster.ems_id # fixme: to remove this part when provider_key becomes mandatory field if not provider_key: provider_name = [pr.name for pr in col.providers.all if pr.id == provider_id][-1] provider_key = get_provider_key(provider_name) self.provider = get_crud(provider_key)
def servers(cls, provider=None, strict=True): servers = [] _get_servers_page(provider=provider) if sel.is_displayed(list_tbl): _provider = provider for _ in paginator.pages(): for row in list_tbl.rows(): if strict: _provider = get_crud( get_provider_key(row.provider.text)) servers.append( MiddlewareServer(name=row.server_name.text, feed=row.feed.text, product=row.product.text, provider=_provider)) return servers
def messagings_in_db(cls, server=None, provider=None, strict=True): messagings = [] rows = _db_select_query(server=server, provider=provider).all() _provider = provider for messaging in rows: if strict: _provider = get_crud(get_provider_key(messaging.provider_name)) _server = MiddlewareServer( name=messaging.server_name, feed=messaging.feed, provider=provider) messagings.append(MiddlewareMessaging( nativeid=messaging.nativeid, name=messaging.name, db_id=messaging.id, server=_server, provider=_provider, messaging_type=messaging.messaging_type, properties=parse_properties(messaging.properties))) return messagings