if server: # if server instance is provided navigate through server page server.summary.reload() if server.summary.relationships.middleware_deployments.value == 0: return server.summary.relationships.middleware_deployments.click() elif provider: # if provider instance is provided navigate through provider page provider.summary.reload() if provider.summary.relationships.middleware_deployments.value == 0: return provider.summary.relationships.middleware_deployments.click() else: # if None(provider and server) given navigate through all middleware deployments page sel.force_navigate('middleware_deployments') nav.add_branch( 'middleware_deployments', { 'middleware_deployment': lambda ctx: list_tbl.select_row('Deployment Name', ctx['name']), } ) class MiddlewareDeployment(MiddlewareBase): """ MiddlewareDeployment class provides details on deployment page. Class methods available to get existing deployments list Args: name: Name of the deployment provider: Provider object (HawkularProvider) server: Server object of the deployment (MiddlewareServer) nativeid: Native id (internal id) of deployment
provider.summary.reload() if provider.summary.relationships.middleware_servers.value == 0: return provider.summary.relationships.middleware_servers.click() elif server_group: # if server group instance is provided navigate through it's servers page server_group.summary.reload() if server_group.summary.relationships.middleware_servers.value == 0: return server_group.summary.relationships.middleware_servers.click() else: # if None(provider) given navigate through all middleware servers page sel.force_navigate('middleware_servers') nav.add_branch( 'middleware_servers', { 'middleware_server': lambda ctx: list_tbl.select_row('Server Name', ctx['name']), } ) timeout_form = Form( fields=[ ("timeout", Input("timeout", use_id=True)), ('suspend_button', FormButton("Suspend")), ('shutdown_button', FormButton("Shutdown")), ('cancel_button', FormButton("Cancel")) ] ) class MiddlewareServer(MiddlewareBase, Taggable, Container): """
if server.summary.relationships.middleware_datasources.value == 0: return server.summary.relationships.middleware_datasources.click() elif provider: # if provider instance is provided navigate through provider page provider.summary.reload() if provider.summary.relationships.middleware_datasources.value == 0: return provider.summary.relationships.middleware_datasources.click() else: # if None(provider and server) given navigate through all middleware datasources page sel.force_navigate('middleware_datasources') nav.add_branch( 'middleware_datasources', { 'middleware_datasource': lambda ctx: list_tbl.select_row('Datasource Name', ctx['name']), }) class MiddlewareDatasource(MiddlewareBase, Taggable): """ MiddlewareDatasource class provides details on datasource page. Class methods available to get existing datasources list Args: name: Name of the datasource provider: Provider object (HawkularProvider) nativeid: Native id (internal id) of datasource server: Server object of the datasource (MiddlewareServer) properties: Datasource driver name, connection URL and JNDI name db_id: database row id of datasource
def _get_servers_page(provider): if provider: # if provider instance is provided navigate through provider's servers page provider.summary.reload() if provider.summary.relationships.middleware_servers.value == 0: return provider.summary.relationships.middleware_servers.click() else: # if None(provider) given navigate through all middleware servers page sel.force_navigate('middleware_servers') nav.add_branch( 'middleware_servers', { 'middleware_server': lambda ctx: list_tbl.select_row('Server Name', ctx['name']), }) class MiddlewareServer(MiddlewareBase, Taggable): """ MiddlewareServer class provides actions and details on Server page. Class method available to get existing servers list Args: name: name of the server hostname: Host name of the server provider: Provider object (HawkularProvider) product: Product type of the server feed: feed of the server
query = cfmedb().session.query(t_mds.nativeid, t_mds.name, t_mds.ems_ref, t_ms.name, t_ems.name, t_mds.properties).join(t_ms, t_mds.server_id == t_ms.id).join(t_ems, t_mds.ems_id == t_ems.id) if name: query = query.filter(t_mds.name == name) if server: query = query.filter(t_mds.nativeid.like('%{}%'.format(server))) if provider: query = query.filter(t_ems.name == provider) return query nav.add_branch( 'middleware_datasources', { 'middleware_datasource': lambda ctx: list_tbl.select_row('Datasource Name', ctx['name']), 'middleware_datasource_detail': lambda ctx: list_tbl.click_row_by_cells({'Datasource Name': ctx['name']}), } ) class MiddlewareDatasource(MiddlewareBase, Taggable): """ MiddlewareDatasource class provides details on datasource page. Class methods available to get existing datasources list Args: name: Name of the datasource provider: Provider object (HawkularProvider) id: Native id (internal id) of datasource
if server: # if server instance is provided navigate through server page server.summary.reload() if server.summary.relationships.middleware_deployments.value == 0: return server.summary.relationships.middleware_deployments.click() elif provider: # if provider instance is provided navigate through provider page provider.summary.reload() if provider.summary.relationships.middleware_deployments.value == 0: return provider.summary.relationships.middleware_deployments.click() else: # if None(provider and server) given navigate through all middleware deployments page sel.force_navigate("middleware_deployments") nav.add_branch( "middleware_deployments", {"middleware_deployment": lambda ctx: list_tbl.select_row("Deployment Name", ctx["name"])} ) class MiddlewareDeployment(MiddlewareBase, Taggable, Deployable): """ MiddlewareDeployment class provides details on deployment page. Class methods available to get existing deployments list Args: name: Name of the deployment provider: Provider object (HawkularProvider) server: Server object of the deployment (MiddlewareServer) nativeid: Native id (internal id) of deployment db_id: database row id of deployment
if server: # if server instance is provided navigate through server page server.summary.reload() if server.summary.relationships.middleware_deployments.value == 0: return server.summary.relationships.middleware_deployments.click() elif provider: # if provider instance is provided navigate through provider page provider.summary.reload() if provider.summary.relationships.middleware_deployments.value == 0: return provider.summary.relationships.middleware_deployments.click() else: # if None(provider and server) given navigate through all middleware deployments page sel.force_navigate('middleware_deployments') nav.add_branch( 'middleware_deployments', { 'middleware_deployment': lambda ctx: list_tbl.select_row('Deployment Name', ctx['name']), } ) class MiddlewareDeployment(MiddlewareBase, Taggable): """ MiddlewareDeployment class provides details on deployment page. Class methods available to get existing deployments list Args: name: Name of the deployment provider: Provider object (HawkularProvider) server: Server object of the deployment (MiddlewareServer) nativeid: Native id (internal id) of deployment db_id: database row id of deployment
if server.summary.relationships.middleware_deployments.value == 0: return server.summary.relationships.middleware_deployments.click() elif provider: # if provider instance is provided navigate through provider page provider.summary.reload() if provider.summary.relationships.middleware_deployments.value == 0: return provider.summary.relationships.middleware_deployments.click() else: # if None(provider and server) given navigate through all middleware deployments page sel.force_navigate('middleware_deployments') nav.add_branch( 'middleware_deployments', { 'middleware_deployment': lambda ctx: list_tbl.select_row('Deployment Name', ctx['name']), }) class MiddlewareDeployment(MiddlewareBase): """ MiddlewareDeployment class provides details on deployment page. Class methods available to get existing deployments list Args: name: Name of the deployment provider: Provider object (HawkularProvider) server: Server object of the deployment (MiddlewareServer) nativeid: Native id (internal id) of deployment Usage:
from cfme.fixtures import pytest_selenium as sel from utils.varmeth import variable from . import cfg_btn, mon_btn, pol_btn, LIST_TABLE_LOCATOR, MiddlewareBase list_tbl = CheckboxTable(table_locator=LIST_TABLE_LOCATOR) details_page = Region(infoblock_type='detail') nav.add_branch( 'middleware_providers', { 'middleware_provider_new': lambda _: cfg_btn('Add a New Middleware Provider'), 'middleware_provider': [ lambda ctx: list_tbl.select_row('name', ctx['provider'].name), { 'middleware_provider_edit': lambda _: cfg_btn('Edit Selected Middleware Provider'), 'middleware_provider_edit_tags': lambda _: pol_btn('Edit Tags') }], 'middleware_provider_detail': [ lambda ctx: list_tbl.click_cells({'name': ctx['provider'].name}), { 'middleware_provider_edit_detail': lambda _: cfg_btn('Edit this Middleware Provider'), 'middleware_provider_timelines_detail': lambda _: mon_btn('Timelines'), 'middleware_provider_edit_tags_detail':
server.summary.reload() if server.summary.relationships.middleware_messagings.value == 0: return server.summary.relationships.middleware_messagings.click() elif provider: # if provider instance is provided navigate through provider page provider.summary.reload() if provider.summary.relationships.middleware_messagings.value == 0: return provider.summary.relationships.middleware_messagings.click() else: # if None(provider and server) given navigate through all middleware messagings page sel.force_navigate('middleware_messagings') nav.add_branch( 'middleware_messagings', { 'middleware_messaging': lambda ctx: list_tbl.select_row('Messaging Name', ctx['name']), } ) class MiddlewareMessaging(MiddlewareBase, Taggable): """ MiddlewareMessaging class provides details on messaging page. Class methods available to get existing messagings list Args: name: Name of the messaging provider: Provider object (HawkularProvider) nativeid: Native id (internal id) of messaging server: Server object of the messaging (MiddlewareServer) properties: Messaging providers
query = query.filter(t_ems.name == provider.name) return query def _get_domains_page(provider): if provider: # if provider instance is provided navigate through provider's domains page provider.summary.reload() if provider.summary.relationships.middleware_domains.value == 0: return provider.summary.relationships.middleware_domains.click() else: # if None(provider) given navigate through all middleware domains page sel.force_navigate('middleware_domains') nav.add_branch( 'middleware_domains', { 'middleware_domain': lambda ctx: list_tbl.select_row('Domain Name', ctx['name']), } ) class MiddlewareDomain(MiddlewareBase, Taggable): """ MiddlewareDomain class provides actions and details on Domain page. Class method available to get existing domains list Args: name: name of the domain provider: Provider object (HawkularProvider) product: Product type of the domain feed: feed of the domain db_id: database row id of domain
server.summary.reload() if server.summary.relationships.middleware_datasources.value == 0: return server.summary.relationships.middleware_datasources.click() elif provider: # if provider instance is provided navigate through provider page provider.summary.reload() if provider.summary.relationships.middleware_datasources.value == 0: return provider.summary.relationships.middleware_datasources.click() else: # if None(provider and server) given navigate through all middleware datasources page sel.force_navigate('middleware_datasources') nav.add_branch( 'middleware_datasources', { 'middleware_datasource': lambda ctx: list_tbl.select_row('Datasource Name', ctx['name']), } ) class MiddlewareDatasource(MiddlewareBase, Taggable): """ MiddlewareDatasource class provides details on datasource page. Class methods available to get existing datasources list Args: name: Name of the datasource provider: Provider object (HawkularProvider) nativeid: Native id (internal id) of datasource server: Server object of the datasource (MiddlewareServer) properties: Datasource driver name, connection URL and JNDI name