def is_daemon_ready(host, auth): '''Performs an isDaemonReady operation on the given host and returns True or False. Parameters: - host (string): a host:port pair - auth (ZSI authentication object): an authentication object ''' req = DaemonStatusServiceImplService_client.isDaemonReady() return _ws_port(host, auth).isDaemonReady(req).Return
def _ws_port(host, auth, tracefile=None): url = 'http://%s/ws/DaemonStatusService' % (host, ) locator = DaemonStatusServiceImplService_client.DaemonStatusServiceImplServiceLocator( ) if tracefile is None: return locator.getDaemonStatusServiceImplPort(url=url, auth=auth) else: return locator.getDaemonStatusServiceImplPort(url=url, auth=auth, tracefile=tracefile)
def get_auids(host, auth): '''Performs a getAuids operation on the given host, which really produces a sequence of all AUIDs with the AU names, and returns a list of records with these fields: - Id (string) - Name (string) Parameters: - host (string): a host:port pair - auth (ZSI authentication object): an authentication object ''' req = DaemonStatusServiceImplService_client.getAuIds() return _ws_port(host, auth).getAuIds(req).Return
def get_au_status(host, auth, auid): '''Performs a getAuStatus operation on the given host for the given AUID, and returns a record with these fields (or None if ZSI.FaultException starting with 'No Archival Unit with provided identifier' is raised): - AccessType (string) - AvailableFromPublisher (boolean) - ContentSize (numeric) - CrawlPool (string) - CrawlProxy (string) - CrawlWindow (string) - CreationTime (numeric) - CurrentlyCrawling (boolean) - CurrentlyPolling (boolean) - DiskUsage (numeric) - JournalTitle (string) - LastCompletedCrawl (numeric) - LastCompletedPoll (numeric) - LastCrawl (numeric) - LastCrawlResult (string) - LastCompletedDeepCrawl (numeric) - LastDeepCrawl (numeric) - LastDeepCrawlResult (string) - LastCompletedDeepCrawlDepth (numeric) - LastPoll (numeric) - LastPollResult (string) - LastMetadataIndex (numeric) - PluginName (string) - Provider (string) - Publisher (string) - PublishingPlatform (string) - RecentPollAgreement (floating point) - Repository (string) - Status (string) - SubscriptionStatus (string) - SubstanceState (string) - Volume (string) (the AU name) - Year (string) Parameters: - host (string): a host:port pair - auth (ZSI authentication object): an authentication object - auid (string): an AUID ''' req = DaemonStatusServiceImplService_client.getAuStatus() req.AuId = auid try: ret = _ws_port(host, auth).getAuStatus(req) return ret.Return except ZSI.FaultException as e: if str(e).startswith('No Archival Unit with provided identifier'): return None raise
def get_au_urls(host, auth, auid, prefix=None): '''Performs a getAuUrls operation on the given host for the given AUID and returns a list of URLs (strings) in the AU. If the optional prefix argument is given, limits the results to URLs with that prefix (including the URL itself). Parameters: - host (string): a host:port pair - auth (ZSI authentication object): an authentication object - auid (string): an AUID - prefix (string): a URL prefix (default: None) ''' req = DaemonStatusServiceImplService_client.getAuUrls() req.AuId = auid if prefix is not None: req.url = prefix return _ws_port(host, auth).getAuUrls(req).Return
def get_au_status(host, auth, auid): '''Performs a getAuStatus operation on the given host for the given AUID, and returns a record with these fields (or None if ZSI.FaultException starting with 'No Archival Unit with provided identifier' is raised): - AccessType (string) - AvailableFromPublisher (boolean) - ContentSize (numeric) - CrawlPool (string) - CrawlProxy (string) - CrawlWindow (string) - CreationTime (numeric) - CurrentlyCrawling (boolean) - CurrentlyPolling (boolean) - DiskUsage (numeric) - JournalTitle (string) - LastCompletedCrawl (numeric) - LastCompletedPoll (numeric) - LastCrawl (numeric) - LastCrawlResult (string) - LastPoll (numeric) - LastPollResult (string) - PluginName (string) - Provider (string) - Publisher (string) - PublishingPlatform (string) - RecentPollAgreement (floating point) - Repository (string) - Status (string) - SubscriptionStatus (string) - SubstanceState (string) - Volume (string) (the AU name) - Year (string) Parameters: - host (string): a host:port pair - auth (ZSI authentication object): an authentication object - auid (string): an AUID ''' req = DaemonStatusServiceImplService_client.getAuStatus() req.AuId = auid try: ret = _ws_port(host, auth).getAuStatus(req) return ret.Return except ZSI.FaultException as e: if str(e).startswith('No Archival Unit with provided identifier'): return None raise
def query_crawls(host, auth, select, where=None): '''Performs a queryCrawls operation on the given host, using the given field names to build a SELECT clause, optionally using the given string to build a WHERE clause, and returns a list of records with these fields (populated or not depending on the SELECT clause): - AuId (string) - AuName (string) - BytesFetchedCount (long) - CrawlKey (string) - CrawlStatus (string) - CrawlType (string) - Duration (long) - LinkDepth (int) - MimeTypeCount (int) - MimeTypes (list of strings) - OffSiteUrlsExcludedCount (int) - PagesExcluded (list of strings) - PagesExcludedCount (int) - PagesFetched (list of strings) - PagesFetchedCount (int) - PagesNotModified (list of strings) - PagesNotModifiedCount (int) - PagesParsed (list of strings) - PagesParsedCount (int) - PagesPending (list of strings) - PagesPendingCount (int) - PagesWithErrors, a list of records with these fields: - Message (string) - Severity (string) - Url (string) - PagesWithErrorsCount (int) - RefetchDepth (int) - Sources (list of strings) - StartTime (long) - StartingUrls (list of strings) ''' if type(select) is list: query = 'SELECT %s' % (', '.join(select)) elif type(select) is str: query = 'SELECT %s' % (select,) else: raise ValueError, 'invalid type for select parameter: %s' % (type(select),) if where is not None: query = '%s WHERE %s' % (query, where) req = DaemonStatusServiceImplService_client.queryCrawls() req.CrawlQuery = query return _ws_port(host, auth).queryCrawls(req).Return
def get_au_status(host, auth, auid): '''Performs a getAuStatus operation on the given host for the given AUID, and returns a record with these fields: - AccessType (string) - AvailableFromPublisher (boolean) - ContentSize (numeric) - CrawlPool (string) - CrawlProxy (string) - CrawlWindow (string) - CreationTime (numeric) - CurrentlyCrawling (boolean) - CurrentlyPolling (boolean) - DiskUsage (numeric) - JournalTitle (string) - LastCompletedCrawl (numeric) - LastCompletedPoll (numeric) - LastCrawl (numeric) - LastCrawlResult (string) - LastPoll (numeric) - LastPollResult (string) - PluginName (string) - Publisher (string) - PublishingPlatform (string) - RecentPollAgreement (floating point) - Repository (string) - Status (string) - SubscriptionStatus (string) - SubstanceState (string) - Volume (string) (the AU name) - Year (string) Parameters: - host (string): a host:port pair - auth (ZSI authentication object): an authentication object - auid (string): an AUID ''' req = DaemonStatusServiceImplService_client.getAuStatus() req.AuId = auid return _ws_port(host, auth).getAuStatus(req).Return
def get_au_status(host, auth, auid): '''Performs a getAuStatus operation on the given host for the given AUID, and returns a record with these fields: - AccessType (string) - AvailableFromPublisher (boolean) - ContentSize (numeric) - CrawlPool (string) - CrawlProxy (string) - CrawlWindow (string) - CreationTime (numeric) - CurrentlyCrawling (boolean) - CurrentlyPolling (boolean) - DiskUsage (numeric) - JournalTitle (string) - LastCompletedCrawl (numeric) - LastCompletedPoll (numeric) - LastCrawl (numeric) - LastCrawlResult (string) - LastPoll (numeric) - LastPollResult (string) - PluginName (string) - Publisher (string) - PublishingPlatform (string) - RecentPollAgreement (numeric) - Repository (string) - Status (string) - SubscriptionStatus (string) - SubstanceState (string) - Volume (string) (the AU name) - Year (string) Parameters: - host (string): a host:port pair - auth (ZSI authentication object): an authentication object - auid (string): an AUID ''' req = DaemonStatusServiceImplService_client.getAuStatus() req.AuId = auid return _ws_port(host, auth).getAuStatus(req).Return
def get_platform_configuration(host, auth): '''Performs a getPlatformConfiguration operation on the given host and returns a record with these fields: - AdminEmail (string) - BuildHost (string) - BuildTimestamp (numeric) - CurrentTime (numeric) - CurrentWorkingDirectory (string) - DaemonVersion, a record with these fields: - BuildVersion (numeric) - FullVersion (string) - MajorVersion (numeric) - MinorVersion (numeric) - Disks (list of strings) - Groups (list of strings) - HostName (string) - IpAddress (string) - JavaVersion, a record with these fields: - RuntimeName (string) - RuntimeVersion (string) - SpecificationVersion (string) - Version (string) - MailRelay (string) - Platform, a record with these fields: - Name (string) - Suffix (string) - Version (string) - Project (string) - Properties (list of strings) - Uptime (numeric) - V3Identity (string) Parameters: - host (string): a host:port pair - auth (ZSI authentication object): an authentication object ''' req = DaemonStatusServiceImplService_client.getPlatformConfiguration() return _ws_port(host, auth).getPlatformConfiguration(req).Return
def query_aus(host, auth, select, where=None): '''Performs a queryAus operation on the given host, using the given field names to build a SELECT clause, optionally using the given string to build a WHERE clause, and returns a list of records with these fields (populated or not depending on the SELECT clause): - AccessType (string) - AuConfiguration, a record with these fields: - DefParams, a list of records with these fields: - Key (string) - Value (string) - NonDefParams, a list of records with these fields: - Key (string) - Value (string) - AuId (string) - AvailableFromPublisher (boolean) - ContentSize (numeric) - CrawlPool (string) - CrawlProxy (string) - CrawlWindow (string) - CreationTime (numeric) - CurrentlyCrawling (boolean) - CurrentlyPolling (boolean) - DiskUsage (numeric) - IsBulkContent (boolean) - LastCompletedCrawl (numeric) - LastCompletedPoll (numeric) - LastCrawl (numeric) - LastCrawlResult (string) - LastPoll (numeric) - LastPollResult (string) - Name (string) - NewContentCrawlUrls (list of strings) - PeerAgreements, a list of records with these fields: - Agreements, a record with these fields: - Entry, a list of records with these fields: - Key, a string among: - "POR" - "POP" - "SYMMETRIC_POR" - "SYMMETRIC_POP" - "POR_HINT" - "POP_HINT" - "SYMMETRIC_POR_HINT" - "SYMMETRIC_POP_HINT" - Value, a record with these fields: - HighestPercentAgreement (floating point) - HighestPercentAgreementTimestamp (numeric) - PercentAgreement (floating point) - PercentAgreementTimestamp (numeric) - PeerId (string) - PluginName (string) - PublishingPlatform (string) - RecentPollAgreement (numeric) - RepositoryPath (string) - SubscriptionStatus (string) - SubstanceState (string) - TdbPublisher (string) - TdbYear (string) - UrlStems (list of strings) - Volume (string) Parameters: - host (string): a host:port pair - auth (ZSI authentication object): an authentication object - select (string or list of strings): if a list of strings, the field names to be used in the SELECT clause; if a string, the single field name to be used in the SELECT clause - where (string): optional statement for the WHERE clause (default: None) Raises: - ValueError if select is not of the right type ''' if type(select) is list: query = 'SELECT %s' % (', '.join(select)) elif type(select) is str: query = 'SELECT %s' % (select,) else: raise ValueError, 'invalid type for select parameter: %s' % (type(select),) if where is not None: query = '%s WHERE %s' % (query, where) req = DaemonStatusServiceImplService_client.queryAus() req.AuQuery = query return _ws_port(host, auth).queryAus(req).Return
def query_aus(host, auth, select, where=None): '''Performs a queryAus operation on the given host, using the given field names to build a SELECT clause, optionally using the given string to build a WHERE clause, and returns a list of records with these fields (populated or not depending on the SELECT clause): - AccessType (string) - AuConfiguration, a record with these fields: - DefParams, a list of records with these fields: - Key (string) - Value (string) - NonDefParams, a list of records with these fields: - Key (string) - Value (string) - AuId (string) - AvailableFromPublisher (boolean) - ContentSize (numeric) - CrawlPool (string) - CrawlProxy (string) - CrawlWindow (string) - CreationTime (numeric) - CurrentlyCrawling (boolean) - CurrentlyPolling (boolean) - DiskUsage (numeric) - IsBulkContent (boolean) - LastCompletedCrawl (numeric) - LastCompletedPoll (numeric) - LastCrawl (numeric) - LastCrawlResult (string) - LastPoll (numeric) - LastPollResult (string) - Name (string) - NewContentCrawlUrls (list of strings) - PeerAgreements, a list of records with these fields: - Agreements, a record with these fields: - Entry, a list of records with these fields: - Key, a string among: - "POR" - "POP" - "SYMMETRIC_POR" - "SYMMETRIC_POP" - "POR_HINT" - "POP_HINT" - "SYMMETRIC_POR_HINT" - "SYMMETRIC_POP_HINT" - Value, a record with these fields: - HighestPercentAgreement (floating point) - HighestPercentAgreementTimestamp (numeric) - PercentAgreement (floating point) - PercentAgreementTimestamp (numeric) - PeerId (string) - PluginName (string) - PublishingPlatform (string) - RecentPollAgreement (numeric) - RepositoryPath (string) - SubscriptionStatus (string) - SubstanceState (string) - TdbPublisher (string) - TdbYear (string) - UrlStems (list of strings) - Volume (string) Parameters: - host (string): a host:port pair - auth (ZSI authentication object): an authentication object - select (string or list of strings): if a list of strings, the field names to be used in the SELECT clause; if a string, the single field name to be used in the SELECT clause - where (string): optional statement for the WHERE clause (default: None) Raises: - ValueError if select is not of the right type ''' if type(select) is list: query = 'SELECT %s' % (', '.join(select)) elif type(select) is str: query = 'SELECT %s' % (select, ) else: raise ValueError, 'invalid type for select parameter: %s' % ( type(select), ) if where is not None: query = '%s WHERE %s' % (query, where) req = DaemonStatusServiceImplService_client.queryAus() req.AuQuery = query return _ws_port(host, auth).queryAus(req).Return