cfme.configure.configuration package

Module contents

class cfme.configure.configuration.DatabaseBackupSchedule(name, description, active=True, protocol=None, depot_name=None, uri=None, username=None, password=None, password_verify=None, run_type='Once', run_every=None, time_zone=None, start_date=None, start_hour=None, start_min=None)[source]

Bases: cfme.configure.configuration.Schedule

Configure/Configuration/Region/Schedules - Database Backup type

Parameters:
  • name – Schedule name
  • description – Schedule description
  • active – Whether the schedule should be active (default True)
  • protocol – One of {'Samba', 'Network File System'}
  • run_type – Once, Hourly, Daily, ...
  • run_every – If run_type is not Once, then you can specify how often it should be run
  • time_zone – Time zone selection
  • start_date – Specify start date (mm/dd/yyyy or datetime.datetime())
  • start_hour – Starting hour
  • start_min – Starting minute

Usage:

smb_schedule = DatabaseBackupSchedule(
    name="Bi-hourly Samba Database Backup",
    description="Everybody's favorite backup schedule",
    protocol="Samba",
    uri="samba.example.com/share_name",
    username="samba_user",
    password="secret",
    password_verify="secret",
    time_zone="UTC",
    start_date=datetime.datetime.utcnow(),
    run_type="Hourly",
    run_every="2 Hours"
)
smb_schedule.create()
smb_schedule.delete()

... or ...

nfs_schedule = DatabaseBackupSchedule(
    name="One-time NFS Database Backup",
    description="The other backup schedule",
    protocol="Network File System",
    uri="nfs.example.com/path/to/share",
    time_zone="Chihuahua",
    start_date="21/6/2014",
    start_hour="7",
    start_min="45"
)
nfs_schedule.create()
nfs_schedule.delete()
create(cancel=False, samba_validate=False)[source]

Create a new schedule from the informations stored in the object.

Parameters:
  • cancel – Whether to click on the cancel button to interrupt the creation.
  • samba_validate – Samba-only option to click the Validate button to check if entered samba credentials are valid or not
delete()[source]
form = <cfme.web_ui.Form fields=[('name', <cfme.web_ui.Input _names=('name',), _use_id=False>), ('description', <cfme.web_ui.Input _names=('description',), _use_id=False>), ('active', <cfme.web_ui.Input _names=('enabled',), _use_id=False>), ('action', {Version('lowest'): Select('select#action_typ', multi=False), '5.5': <cfme.web_ui.AngularSelect _loc="//button[@data-id='action_typ']", none=None, multi=False, exact=False>}), ('log_protocol', {Version('lowest'): Select('select#log_protocol', multi=False), '5.5': <cfme.web_ui.AngularSelect _loc="//button[@data-id='log_protocol']", none=None, multi=False, exact=False>}), ('depot_name', <cfme.web_ui.Input _names=('depot_name',), _use_id=False>), ('uri', <cfme.web_ui.Input _names=('uri',), _use_id=False>), ('log_userid', <cfme.web_ui.Input _names=('log_userid',), _use_id=False>), ('log_password', <cfme.web_ui.Input _names=('log_password',), _use_id=False>), ('log_verify', <cfme.web_ui.Input _names=('log_verify',), _use_id=False>), ('timer_type', {Version('lowest'): Select('select#timer_typ', multi=False), '5.5': <cfme.web_ui.AngularSelect _loc="//button[@data-id='timer_typ']", none=None, multi=False, exact=False>}), ('timer_hours', Select('select#timer_hours', multi=False)), ('timer_days', Select('select#timer_days', multi=False)), ('timer_weeks', Select('select#timer_weekss', multi=False)), ('timer_months', Select('select#timer_months', multi=False)), ('timer_value', <cfme.web_ui.AngularSelect _loc="//button[@data-id='timer_value']", none=None, multi=False, exact=False>, {'appeared_in': '5.5'}), ('time_zone', <cfme.web_ui.AngularSelect _loc="//button[@data-id='time_zone']", none=None, multi=False, exact=False>), ('start_date', <cfme.web_ui.Calendar >), ('start_hour', <cfme.web_ui.AngularSelect _loc="//button[@data-id='start_hour']", none=None, multi=False, exact=False>), ('start_min', <cfme.web_ui.AngularSelect _loc="//button[@data-id='start_min']", none=None, multi=False, exact=False>)]>
last_date
update(updates, cancel=False, samba_validate=False)[source]

Modify an existing schedule with informations from this instance.

Parameters:
  • updates – Dict with fields to be updated
  • cancel – Whether to click on the cancel button to interrupt the editation.
  • samba_validate – Samba-only option to click the Validate button to check if entered samba credentials are valid or not
class cfme.configure.configuration.Schedule(name, description, active=True, action=None, filter_type=None, filter_value=None, run_type='Once', run_every=None, time_zone=None, start_date=None, start_hour=None, start_min=None, appliance=None)[source]

Bases: cfme.utils.pretty.Pretty, cfme.utils.appliance.Navigatable

Configure/Configuration/Region/Schedules functionality

Create, Update, Delete functionality.

Parameters:
  • name – Schedule’s name.
  • description – Schedule description.
  • active – Whether the schedule should be active (default True)
  • action – Action type
  • filter_type – Filtering type
  • filter_value – If a more specific filter_type is selected, here is the place to choose hostnames, machines and so ...
  • run_type – Once, Hourly, Daily, ...
  • run_every – If run_type is not Once, then you can specify how often it should be run.
  • time_zone – Time zone selection.
  • start_date – Specify start date (mm/dd/yyyy or datetime.datetime()).
  • start_hour – Starting hour
  • start_min – Starting minute.

Usage:

schedule = Schedule(
    "My very schedule",
    "Some description here.",
    action="Datastore Analysis",
    filter_type="All Datastores for Host",
    filter_value="datastore.intra.acme.com",
    run_type="Hourly",
    run_every="2 Hours"
)
schedule.create()
schedule.disable()
schedule.enable()
schedule.delete()
# Or
Schedule.enable_by_names("One schedule", "Other schedule")
# And so.

Note: TODO: Maybe the row handling might go into Table class?

create(cancel=False)[source]

Create a new schedule from the informations stored in the object.

Parameters:cancel – Whether to click on the cancel button to interrupt the creation.
delete(cancel=False)[source]

Delete the schedule represented by this object.

Calls the class method with the name of the schedule taken out from the object.

Parameters:cancel – Whether to click on the cancel button in the pop-up.
disable()[source]

Enable the schedule via table checkbox and Configuration menu.

enable()[source]

Enable the schedule via table checkbox and Configuration menu.

form = <cfme.web_ui.Form fields=[('name', <cfme.web_ui.Input _names=('name',), _use_id=False>), ('description', <cfme.web_ui.Input _names=('description',), _use_id=False>), ('active', <cfme.web_ui.Input _names=('enabled',), _use_id=False>), ('action', {Version('lowest'): Select('select#action_typ', multi=False), '5.5': <cfme.web_ui.AngularSelect _loc="//button[@data-id='action_typ']", none=None, multi=False, exact=False>}), ('filter_type', {Version('lowest'): Select('select#filter_typ', multi=False), '5.5': <cfme.web_ui.AngularSelect _loc="//button[@data-id='filter_typ']", none=None, multi=False, exact=False>}), ('filter_value', {Version('lowest'): Select('select#filter_value', multi=False), '5.5': <cfme.web_ui.AngularSelect _loc="//button[@data-id='filter_value']", none=None, multi=False, exact=False>}), ('timer_type', {Version('lowest'): Select('select#timer_typ', multi=False), '5.5': <cfme.web_ui.AngularSelect _loc="//button[@data-id='timer_typ']", none=None, multi=False, exact=False>}), ('timer_hours', Select('select#timer_hours', multi=False)), ('timer_days', Select('select#timer_days', multi=False)), ('timer_weeks', Select('select#timer_weekss', multi=False)), ('timer_months', Select('select#timer_months', multi=False)), ('timer_value', <cfme.web_ui.AngularSelect _loc="//button[@data-id='timer_value']", none=None, multi=False, exact=False>, {'appeared_in': '5.5'}), ('time_zone', {Version('lowest'): Select('select#time_zone', multi=False), '5.5': <cfme.web_ui.AngularSelect _loc="//button[@data-id='time_zone']", none=None, multi=False, exact=False>}), ('start_date', <cfme.web_ui.Calendar >), ('start_hour', {Version('lowest'): Select('select#start_hour', multi=False), '5.5': <cfme.web_ui.AngularSelect _loc="//button[@data-id='start_hour']", none=None, multi=False, exact=False>}), ('start_min', {Version('lowest'): Select('select#start_min', multi=False), '5.5': <cfme.web_ui.AngularSelect _loc="//button[@data-id='start_min']", none=None, multi=False, exact=False>})]>
pretty_attrs = ['name', 'description', 'run_type', 'run_every', 'start_date', 'start_hour', 'start_min']
select()[source]

Select the checkbox for current schedule

tab = {'Monthly': 'timer_months', 'Hourly': 'timer_hours', 'Daily': 'timer_days', 'Weekly': 'timer_weeks'}
update(updates, cancel=False)[source]

Modify an existing schedule with informations from this instance.

Parameters:
  • updates – Dict with fields to be updated
  • cancel – Whether to click on the cancel button to interrupt the editation.
class cfme.configure.configuration.ScheduleAdd(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

prerequisite

This is a helper descriptor for navigation destinations which are linked to the same class.

For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.configure.configuration.ScheduleAll(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

prerequisite

This is a helper descriptor for navigation destinations which are on another class/object.

For instance, imagine you have a different object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToObject as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step on the other object.

step()[source]
class cfme.configure.configuration.ScheduleDetails(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

prerequisite

This is a helper descriptor for navigation destinations which are linked to the same class.

For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.configure.configuration.ScheduleEdit(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

prerequisite

This is a helper descriptor for navigation destinations which are linked to the same class.

For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.configure.configuration.ServerLogDepot(depot_type, depot_name=None, uri=None, username=None, password=None, zone_collect=False, second_server_collect=False, appliance=None)[source]

Bases: cfme.utils.pretty.Pretty, cfme.utils.appliance.Navigatable

This class represents the ‘Collect logs’ for the server.

Usage:

log_credentials = configure.ServerLogDepot("anon_ftp",
                                       depot_name=fauxfactory.gen_alphanumeric(),
                                       uri=fauxfactory.gen_alphanumeric())
log_credentials.create()
log_credentials.clear()
clear()[source]

Set depot type to “No Depot”

collect_all()[source]

Initiate and wait for collection of all logs to finish.

collect_current()[source]

Initiate and wait for collection of the current log to finish.

create(cancel=False)[source]
is_cleared
last_collection
last_message
cfme.configure.configuration.get_replication_backlog(navigate=True)[source]

Gets replication backlog from Configure / Configuration pages.

Returns: int representing the remaining items in the replication backlog.

cfme.configure.configuration.get_replication_status(navigate=True)[source]

Gets replication status from Configure / Configuration pages.

Returns: bool of whether replication is Active or Inactive.

cfme.configure.configuration.get_workers_list(do_not_navigate=False, refresh=True)[source]

Retrieves all workers.

Returns a dictionary where keys are names of the workers and values are lists (because worker can have multiple instances) which contain dictionaries with some columns.

cfme.configure.configuration.restart_workers(name, wait_time_min=1)[source]

Restarts workers by their name.

Parameters:name – Name of the worker. Multiple workers can have the same name. Name is matched with in

Returns: bool whether the restart succeeded.

cfme.configure.configuration.set_replication_worker_host(host, port='5432')[source]

Set replication worker host on Configure / Configuration pages.

Parameters:host – Address of the hostname to replicate to.