def submit_job(self, source_db_uri, target_db_uri, only_tables, skip_tables, update, drop, email): """ Submit a new job Arguments: source_db_uri : URI of MySQL schema to copy from target_db_uri : URI of MySQL schema to copy to only_tables : list of tables to copy (others are skipped) skip_tables : list of tables to skip from the copy update : set to True to run an incremental update drop : set to True to drop the schema first email : optional address for job completion email """ assert_mysql_db_uri(source_db_uri) assert_mysql_db_uri(target_db_uri) if only_tables: if (not re.search(r"^([^ ]+){1}$", only_tables) or not re.search(r"^([^ ]+){1}(,){1}([^ ]+){1}$", only_tables)): raise ValueError("List of tables need to be comma separated, eg: table1,table2,table3") if skip_tables: if (not re.search(r"^([^ ]+){1}$", skip_tables) or not re.search(r"^([^ ]+){1}(,){1}([^ ]+){1}$", skip_tables)): raise ValueError("List of tables need to be comma separated, eg: table1,table2,table3") logging.info("Submitting job") payload = { 'source_db_uri':source_db_uri, 'target_db_uri':target_db_uri, 'only_tables':only_tables, 'skip_tables':skip_tables, 'update':update, 'drop':drop, 'email':email } return super(DbCopyClient, self).submit_job(payload)
def submit_job(self, spec): """ Arguments: spec : dict containing keys `src_uri`, `type`, `comment` and `contact` """ assert_mysql_db_uri(spec['src_uri']) assert_email(spec['contact']) logging.info("Submitting {} for handover".format(spec['src_uri'])) logging.debug(spec) r = requests.post(self.handovers.format(self.uri), json=spec) r.raise_for_status() return r.json()
def submit_job(self, database_uri, e_release, eg_release, release_date, current_release, email, update_type, comment, source): assert_mysql_db_uri(database_uri) payload = { 'database_uri': database_uri, 'e_release': e_release, 'eg_release': eg_release, 'release_date': release_date, 'current_release': current_release, 'email': email, 'update_type': update_type, 'comment': comment, 'source': source } return super(MetadataClient, self).submit_job(payload)
def submit_job(self, db_uri, production_uri, compara_uri, staging_uri, live_uri, hc_names, hc_groups, data_files_path, email, tag): """ Submit a database for checkiing Arguments: db_uri - database to check production_uri - production database compara_uri - compara master database staging_uri - location of current staging databases (used to check different database types for same genome) live_uri - location of current release databases (used for checks comparing current and new databases) hc_names - list of healthchecks to run hc_groups - list of healthcheck groups to run data_files_path - location of non-relational datafiles email - optional address for an email on job completion tag - optional tag to allow jobs to be grouped for reporting """ assert_mysql_db_uri(db_uri) assert_mysql_db_uri(production_uri) assert_mysql_db_uri(compara_uri) assert_mysql_uri(staging_uri) assert_mysql_uri(live_uri) logging.info("Submitting job") payload = { 'db_uri': db_uri, 'production_uri': production_uri, 'compara_uri': compara_uri, 'staging_uri': staging_uri, 'live_uri': live_uri, 'hc_names': hc_names, 'hc_groups': hc_groups, 'data_files_path': data_files_path, 'email': email, 'tag': tag } return RestClient.submit_job(self, payload)