Logging Open Service Interface Definitions logging version 3.0.0
The Logging OSID provides a means to read and wite to logs. A Log
represents a collection of log entries. Each log entry is composed of a
priority Type, timestamp, Agent, the agent’s associated
Resource, and a record.
Logs can be organized into hierarchies for federation. A log that is a parent of another log makes visible the log entries of its children.
- Example
LoggingSession out = manager.getLoggingSession(); out.log(warningLogEntryPriorityType, “hello world”, stringLogEntryContentType);
LogReadingSession in = manager.getLogReadingSession(); LogEntryList entries = inn.getLogEntries(); while (entries.hasNext()) {
LogEntry entry = entries.getNextLogEntry(); printEntry(entry);}
Service Managers¶
Logging Profile¶
-
class
dlkit.services.logging_.LoggingProfile¶ Bases:
dlkit.osid.managers.OsidProfileThe logging profile describes the interoperability among logging services.
-
supports_logging()¶ Tests if logging is supported.
Returns: trueif logging is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_log_entry_lookup()¶ Tests if reading logs is supported.
Returns: trueif reading logs is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_log_entry_query()¶ Tests if querying log entries is supported.
Returns: trueif querying log entries is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_log_lookup()¶ Tests for the availability of a log lookup service.
Returns: trueif log lookup is available,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_log_admin()¶ Tests for the availability of a log administrative service for creating and deleting logs.
Returns: trueif log administration is available,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
log_entry_record_types¶ Gets the supported
Logrecord types.Returns: a list containing the supported log record types Return type: osid.type.TypeListcompliance: mandatory – This method must be implemented.
-
log_entry_search_record_types¶ Gets the supported log entry search record types.
Returns: a list containing the supported log entry search record types Return type: osid.type.TypeListcompliance: mandatory – This method must be implemented.
-
log_record_types¶ Gets the supported
Logrecord types.Returns: a list containing the supported log record types Return type: osid.type.TypeListcompliance: mandatory – This method must be implemented.
-
log_search_record_types¶ Gets the supported log search record types.
Returns: a list containing the supported log search record types Return type: osid.type.TypeListcompliance: mandatory – This method must be implemented.
-
priority_types¶ Gets the priority types supported, in ascending order of the priority level.
Returns: a list containing the supported priority types Return type: osid.type.TypeListcompliance: mandatory – This method must be implemented.
-
content_types¶ Gets the content types supported.
Returns: a list containing the supported content types Return type: osid.type.TypeListcompliance: mandatory – This method must be implemented.
-
supports_log_entry_admin()¶ Tests if log entry admin is supported.
Returns: trueif log entry admin is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
Logging Manager¶
-
class
dlkit.services.logging_.LoggingManager(proxy=None)¶ Bases:
dlkit.osid.managers.OsidManager,dlkit.osid.sessions.OsidSession,dlkit.services.logging_.LoggingProfileThe logging manager provides access to logging sessions and provides interoperability tests for various aspects of this service.
The sessions included in this manager are:
LoggingSession:a session to write to a logLogEntryLookupSession:a session to read a logLogEntryQuerySession:a session to search a logLogEntrySearchSession:a session to search a logLogEntryAdminSession:a session to manage log entries in a logLogEntryNotificationSession:a session to subscribe to notifications of new log entriesLogEntryLogSession:a session to examine log entry to log mappingsLogEntryLogAssignmentSession:a session to manage log entry to log mappingsLogEntrySmartLogSession:a session to manage dynamic logsLogLookupSession:a session to retrieve log objectsLogQuerySession:a session to search for logsLogSearchSession:a session to search for logsLogAdminSession:a session to create, update and delete logsLogNotificationSession:a session to receive notifications for changes in logsLogHierarchyTraversalSession:a session to traverse hierarchies of logsLogHierarchyDesignSession:a session to manage hierarchies of logs
The logging manager also provides a profile for determing the supported search types supported by this service.
-
logging_batch_manager¶ Gets a
LoggingBatchManager.Returns: a LoggingBatchManagerReturn type: osid.logging.batch.LoggingBatchManagerRaise: OperationFailed– unable to complete requestRaise: Unimplemented–supports_logging_batch()isfalsecompliance: optional – This method must be implemented if ``supports_logging_batch()`` is ``true``.
Logging Methods¶
LoggingManager.log_id¶Gets the
LogIdassociated with this session.
Returns: the Log Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
LoggingManager.log¶Gets the
Logassociated with this session.
Returns: the Logassociated with this sessionReturn type: osid.logging.LogRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.can_log()¶Tests if this user can log.
A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a
PermissionDenied. This is intended as a hint to an application that may opt not to offer logging operations.
Returns: falseif logging methods are not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
LoggingManager.log()Gets the
Logassociated with this session.
Returns: the Logassociated with this sessionReturn type: osid.logging.LogRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.log_at_priority(priority_type, content, content_type)¶Logs an item.
Parameters:
- priority_type (
osid.type.Type) – the entry priority- content (
object) – the entry to log- content_type (
osid.type.Type) – the type of this entry which must be one of the types returned byLoggingManager.getContentTypes()Raise:
InvalidArgument–contentis not ofcontent_typeRaise:
NullArgument–content,content_typeorpriority_typeisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failureRaise:
Unsupported–LoggingManager.supportsContentType(contentType)isfalseorLoggingManager.supportsPriorityType(priorityType)isfalsecompliance: mandatory – This method must be implemented.
LoggingManager.log_entry_form¶Gets a log entry form for creating a log entry.
Returns: the log entry form Return type: osid.logging.LogEntryFormcompliance: mandatory – This method must be implemented.
LoggingManager.create_log_entry(log_entry_form)¶Creates a new
LogEntry.
Parameters: log_entry_form ( osid.logging.LogEntryForm) – the form for thisLogEntryReturns: the new LogEntryReturn type: osid.logging.LogEntryRaise: IllegalState–log_entry_formalready used in a create transactionRaise: InvalidArgument– one or more of the form elements is invalidRaise: NullArgument–log_entry_formisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–log_entry_formdid not originate fromget_log_entry_form_for_create()compliance: mandatory – This method must be implemented.
Log Entry Lookup Methods¶
LoggingManager.log_idGets the
LogIdassociated with this session.
Returns: the Log Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
LoggingManager.logGets the
Logassociated with this session.
Returns: the Logassociated with this sessionReturn type: osid.logging.LogRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.can_read_log()¶Tests if this user can read the log.
A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a
PermissionDenied. This is intended as a hint to an application that may opt not to offer reading operations.
Returns: falseif reading methods are not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
LoggingManager.use_comparative_log_entry_view()¶The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.
This view is used when greater interoperability is desired at the expense of precision.
compliance: mandatory – This method is must be implemented.
LoggingManager.use_plenary_log_entry_view()¶A complete view of the
LogEntryreturns is desired.Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.
compliance: mandatory – This method is must be implemented.
LoggingManager.use_federated_log_view()¶Federates the view for methods in this session.
A federated view will include entries in logs which are children of this log in the log hierarchy.
compliance: mandatory – This method is must be implemented.
LoggingManager.use_isolated_log_view()¶Isolates the view for methods in this session.
An isolated view restricts lookups to this log only.
compliance: mandatory – This method is must be implemented.
LoggingManager.get_log_entry(log_entry_id)¶Gets the
LogEntryspecified by itsId.In plenary mode, the exact
Idis found or aNotFoundresults. Otherwise, the returnedLogEntrymay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aLogEntryand retained for compatibility.
Parameters: log_entry_id ( osid.id.Id) – theIdof theLogEntryto retrieveReturns: the returned LogEntryReturn type: osid.logging.LogEntryRaise: NotFound– noLogEntryfound with the givenIdRaise: NullArgument–log_entry_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entries_by_ids(log_entry_ids)¶Gets a
LogEntryListcorresponding to the givenIdList.In plenary mode, the returned list contains all of the entries specified in the
Idlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessible logentries may be omitted from the list and may present the elements in any order including returning a unique set.
Parameters: log_entry_ids ( osid.id.IdList) – the list ofIdsto retrieveReturns: the returned LogEntry listReturn type: osid.logging.LogEntryListRaise: NotFound– anId wasnot foundRaise: NullArgument–log_entry_idsisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entries_by_genus_type(log_entry_genus_type)¶Gets a
LogEntryListcorresponding to the given log entry genusTypewhich doe snot include entries of genus types derived form the specifiedType.In plenary mode, the returned list contains all known entries or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session
Parameters: log_entry_genus_type ( osid.type.Type) – a log entry genus typeReturns: the returned LogEntrylistReturn type: osid.logging.LogEntryListRaise: NullArgument–log_entry_genus_typeisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entries_by_parent_genus_type(log_entry_genus_type)¶Gets a
LogEntryListcorresponding to the given log entry genusTypeand include any additional entries with genus types derived from the specifiedType.In plenary mode, the returned list contains all known entries or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
Parameters: log_entry_genus_type ( osid.type.Type) – a log entry genus typeReturns: the returned LogEntrylistReturn type: osid.logging.LogEntryListRaise: NullArgument–log_entry_genus_typeisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entries_by_record_type(log_entry_genus_type)¶Gets a
LogEntryListcontaining the given log entry recordType.In plenary mode, the returned list contains all known log entries or an error results. Otherwise, the returned list may contain only those log entries that are accessible through this session.
Parameters: log_entry_genus_type ( osid.type.Type) – a log entry genus typeReturns: the returned LogEntrylistReturn type: osid.logging.LogEntryListRaise: NullArgument–log_entry_genus_typeisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entries_by_priority_type(priority_type)¶Gets a
LogEntryListfiltering the list to log entries including and above the given priorityType.In plenary mode, the returned list contains all known entries or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
Parameters: priority_type ( osid.type.Type) – a log entry priority typeReturns: the returned LogEntrylistReturn type: osid.logging.LogEntryListRaise: NullArgument–priority_typeisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entries_by_date(start, end)¶Gets a
LogEntryListcorresponding to the given time interval inclusive.In plenary mode, the returned list contains all known entries or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
Parameters:
- start (
osid.calendaring.DateTime) – a starting time- end (
osid.calendaring.DateTime) – a starting timeReturns: the returned
LogEntrylistReturn type:
osid.logging.LogEntryListRaise:
InvalidArgument–startis greater thanendRaise:
NullArgument–startorendisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entries_by_priority_type_and_date(priority_type, start, end)¶Gets a
LogEntryListcorresponding to the given time interval inclusive filtering the list to log entries including and above the given priorityType.In plenary mode, the returned list contains all known entries or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
Parameters:
- priority_type (
osid.type.Type) – a log entry priority type- start (
osid.calendaring.DateTime) – a starting time- end (
osid.calendaring.DateTime) – a starting timeReturns: the returned
LogEntrylistReturn type:
osid.logging.LogEntryListRaise:
InvalidArgument–startis greater thanendRaise:
NullArgument–priority_type, startorendisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entries_for_resource(resource_id)¶Gets a
LogEntryListfor an agent associated with the given resource.In plenary mode, the returned list contains all known entries or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
Parameters: resource_id ( osid.id.Id) – a resourceIdReturns: the returned LogEntrylistReturn type: osid.logging.LogEntryListRaise: NullArgument–resource_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entries_by_date_for_resource(resource_id, start, end)¶Gets a
LogEntryListcorresponding to the given time interval inclusive for an agent associated with the given resource.In plenary mode, the returned list contains all known entries or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
Parameters:
- resource_id (
osid.id.Id) – a resourceId- start (
osid.calendaring.DateTime) – a starting time- end (
osid.calendaring.DateTime) – a starting timeReturns: the returned
LogEntrylistReturn type:
osid.logging.LogEntryListRaise:
InvalidArgument–startis greater thanendRaise:
NullArgument–resource_id, startorendisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entries_by_priority_type_and_date_for_resource(resource_id, priority_type, start, end)¶Gets a
LogEntryListcorresponding to the given time interval inclusive for an agent associated with the given resource filtering the list to log entries including and above the given priorityType.In plenary mode, the returned list contains all known entries or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
Parameters:
- resource_id (
osid.id.Id) – a resourceId- priority_type (
osid.type.Type) – a log entry priority type- start (
osid.calendaring.DateTime) – a starting time- end (
osid.calendaring.DateTime) – a starting timeReturns: the returned
LogEntrylistReturn type:
osid.logging.LogEntryListRaise:
InvalidArgument–startis greater thanendRaise:
NullArgument–resource_id, priority_type, startorendisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.log_entries¶Gets all log entries.
In plenary mode, the returned list contains all known entries or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
Returns: a list of log entries Return type: osid.logging.LogEntryListRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Log Entry Query Methods¶
LoggingManager.log_idGets the
LogIdassociated with this session.
Returns: the Log Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
LoggingManager.logGets the
Logassociated with this session.
Returns: the Logassociated with this sessionReturn type: osid.logging.LogRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.can_search_log_entries()¶Tests if this user can perform
LogEntrysearches.A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a
PermissionDenied. This is intended as a hint to an application that may opt not to offer search operations to unauthorized users.
Returns: falseif search methods are not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
LoggingManager.use_federated_log_view()Federates the view for methods in this session.
A federated view will include entries in logs which are children of this log in the log hierarchy.
compliance: mandatory – This method is must be implemented.
LoggingManager.use_isolated_log_view()Isolates the view for methods in this session.
An isolated view restricts lookups to this log only.
compliance: mandatory – This method is must be implemented.
LoggingManager.log_entry_query¶Gets a log entry query.
Returns: the log entry query Return type: osid.logging.LogEntryQuerycompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entries_by_query(log_entry_query)¶Gets a list of log entries matching the given log entry query.
Parameters: log_entry_query ( osid.logging.LogEntryQuery) – the log entry queryReturns: the returned LogEntryListReturn type: osid.logging.LogEntryListRaise: NullArgument–log_entry_queryisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–log_entry_queryis not of this servicecompliance: mandatory – This method must be implemented.
Log Entry Admin Methods¶
LoggingManager.log_idGets the
LogIdassociated with this session.
Returns: the Log Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
LoggingManager.logGets the
Logassociated with this session.
Returns: the Logassociated with this sessionReturn type: osid.logging.LogRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.can_create_log_entries()¶Tests if this user can create log entries.
A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a
LogEntrywill result in aPermissionDenied. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
Returns: falseifLogEntrycreation is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
LoggingManager.can_create_log_entry_with_record_types(log_entry_record_types)¶Tests if this user can create a single
LogEntryusing the desired record types.While
LoggingManager.getLogEntryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificLogEntry. Providing an empty array tests if aLogEntrycan be created with no records.
Parameters: log_entry_record_types ( osid.type.Type[]) – array of log entry record typesReturns: trueifLogEntrycreation using the specified recordTypesis supported,falseotherwiseReturn type: booleanRaise: NullArgument–log_entry_record_typesisnullcompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entry_form_for_create(log_entry_record_types)¶Gets the log entry form for creating new log entries.
A new form should be requested for each create transaction.
Parameters: log_entry_record_types ( osid.type.Type[]) – array of log entry record typesReturns: the log entry form Return type: osid.logging.LogEntryFormRaise: NullArgument–log_entry_record_typesisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported– unable to get form for requested record typescompliance: mandatory – This method must be implemented.
LoggingManager.create_log_entry(log_entry_form)Creates a new
LogEntry.
Parameters: log_entry_form ( osid.logging.LogEntryForm) – the form for thisLogEntryReturns: the new LogEntryReturn type: osid.logging.LogEntryRaise: IllegalState–log_entry_formalready used in a create transactionRaise: InvalidArgument– one or more of the form elements is invalidRaise: NullArgument–log_entry_formisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–log_entry_formdid not originate fromget_log_entry_form_for_create()compliance: mandatory – This method must be implemented.
LoggingManager.can_update_log_entries()¶Tests if this user can update log entries.
A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a
Logwill result in aPermissionDenied. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
Returns: falseifLogEntrymodification is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
LoggingManager.get_log_entry_form_for_update(log_entry_id)¶Gets the log entry form for updating an existing log.
A new log entry form should be requested for each update transaction.
Parameters: log_entry_id ( osid.id.Id) – theIdof theLogEntryReturns: the log entry form Return type: osid.logging.LogEntryFormRaise: NotFound–log_entry_idis not foundRaise: NullArgument–log_entry_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.update_log_entry(log_entry_form)¶Updates an existing log entry.
Parameters: log_entry_form ( osid.logging.LogEntryForm) – the form containing the elements to be updatedRaise: IllegalState–log_entry_formalready used in an update transactionRaise: InvalidArgument– the form contains an invalid valueRaise: NullArgument–log_entry_formisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–log_entry_formdid not originate fromget_log_entry_form_for_update()compliance: mandatory – This method must be implemented.
LoggingManager.can_delete_log_entries()¶Tests if this user can delete log entries.
A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a
LogEntrywill result in aPermissionDenied. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
Returns: falseifLogEntrydeletion is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
LoggingManager.delete_log_entry(log_entry_id)¶Deletes a
LogEntry.
Parameters: log_entry_id ( osid.id.Id) – theIdof thelog_entry_idto removeRaise: NotFound–log_entry_idnot foundRaise: NullArgument–log_entry_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.can_manage_log_entry_aliases()¶Tests if this user can manage
Idaliases for log entries.A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a
PermissionDenied. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
Returns: falseifLogEntryaliasing is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
LoggingManager.alias_log_entry(log_entry_id, alias_id)¶Adds an
Idto aLogEntryfor the purpose of creating compatibility.The primary
Idof theLogEntryis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another log entry, it is reassigned to the given log entryId.
Parameters:
- log_entry_id (
osid.id.Id) – theIdof aLogEntry- alias_id (
osid.id.Id) – the aliasIdRaise:
AlreadyExists–alias_idis already assignedRaise:
NotFound–log_entry_idnot foundRaise:
NullArgument–log_entry_idoralias_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Log Lookup Methods¶
LoggingManager.can_lookup_logs()¶Tests if this user can perform
Loglookups.A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a
PermissionDenied. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.
Returns: falseif lookup methods are not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
LoggingManager.use_comparative_log_view()¶The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.
This view is used when greater interoperability is desired at the expense of precision.
compliance: mandatory – This method is must be implemented.
LoggingManager.use_plenary_log_view()¶A complete view of the
Logreturns is desired.Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.
compliance: mandatory – This method is must be implemented.
LoggingManager.get_log(log_id)¶Gets the
Logspecified by itsId.In plenary mode, the exact
Idis found or aNotFoundresults. Otherwise, the returnedLogmay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aLogand retained for compatibility.
Parameters: log_id ( osid.id.Id) –Idof theLogReturns: the log Return type: osid.logging.LogRaise: NotFound–log_idnot foundRaise: NullArgument–log_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method is must be implemented.
LoggingManager.get_logs_by_ids(log_ids)¶Gets a
LogListcorresponding to the givenIdList.In plenary mode, the returned list contains all of the logs specified in the
Idlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessibleLogsmay be omitted from the list and may present the elements in any order including returning a unique set.
Parameters: log_ids ( osid.id.IdList) – the list ofIdsto retrieveReturns: the returned Log listReturn type: osid.logging.LogListRaise: NotFound– anId wasnot foundRaise: NullArgument–log_idsisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_logs_by_genus_type(log_genus_type)¶Gets a
LogListcorresponding to the given log genusTypewhich does not include logs of genus types derived from the specifiedType.In plenary mode, the returned list contains all known logs or an error results. Otherwise, the returned list may contain only those logs that are accessible through this session.
Parameters: log_genus_type ( osid.type.Type) – a log genus typeReturns: the returned Log listReturn type: osid.logging.LogListRaise: NullArgument–log_genus_typeisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_logs_by_parent_genus_type(log_genus_type)¶Gets a
LogListcorresponding to the given log genusTypeand include any additional logs with genus types derived from the specifiedType.In plenary mode, the returned list contains all known logs or an error results. Otherwise, the returned list may contain only those logs that are accessible through this session.
Parameters: log_genus_type ( osid.type.Type) – a log genus typeReturns: the returned Log listReturn type: osid.logging.LogListRaise: NullArgument–log_genus_typeisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_logs_by_record_type(log_record_type)¶Gets a
LogListcontaining the given log recordType.In plenary mode, the returned list contains all known logs or an error results. Otherwise, the returned list may contain only those logs that are accessible through this session.
Parameters: log_record_type ( osid.type.Type) – a log record typeReturns: the returned Log listReturn type: osid.logging.LogListRaise: NullArgument–log_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.get_logs_by_provider(resource_id)¶Gets a
LogListfor a given provider.In plenary mode, the returned list contains all known logs or an error results. Otherwise, the returned list may contain only those logs that are accessible through this session.
Parameters: resource_id ( osid.id.Id) – a resourceIdReturns: the returned Log listReturn type: osid.logging.LogListRaise: NullArgument–resource_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.logs¶Gets all
Logs.In plenary mode, the returned list contains all known logs or an error results. Otherwise, the returned list may contain only those logs that are accessible through this session.
Returns: a list of LogsReturn type: osid.logging.LogListRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Log Admin Methods¶
LoggingManager.can_create_logs()¶Tests if this user can create
Logs.A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a
Logwill result in aPermissionDenied. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
Returns: falseifLogcreation is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
LoggingManager.can_create_log_with_record_types(log_record_types)¶Tests if this user can create a single
Logusing the desired record types.While
LoggingManager.getLogRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificLog. Providing an empty array tests if aLogcan be created with no records.
Parameters: log_record_types ( osid.type.Type[]) – array of log record typesReturns: trueifLogcreation using the specified recordTypesis supported,falseotherwiseReturn type: booleanRaise: NullArgument–log_record_typesisnullcompliance: mandatory – This method must be implemented.
LoggingManager.get_log_form_for_create(log_record_types)¶Gets the log form for creating new logs.
A new form should be requested for each create transaction.
Parameters: log_record_types ( osid.type.Type[]) – array of log record typesReturns: the log form Return type: osid.logging.LogFormRaise: NullArgument–log_record_typesisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported– unable to get form with requested record typescompliance: mandatory – This method must be implemented.
LoggingManager.create_log(log_form)¶Creates a new
Log.
Parameters: log_form ( osid.logging.LogForm) – the form for thisLogReturns: the new LogReturn type: osid.logging.LogRaise: IllegalState–log_formalready used in a create transactionRaise: InvalidArgument– one or more of the form elements is invalidRaise: NullArgument–log_formisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–log_formdid not originate fromget_log_form_for_create()compliance: mandatory – This method must be implemented.
LoggingManager.can_update_logs()¶Tests if this user can update
Logs.A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a
Logwill result in aPermissionDenied. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
Returns: falseifLogmodification is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
LoggingManager.get_log_form_for_update(log_id)¶Gets the log form for updating an existing log.
A new log form should be requested for each update transaction.
Parameters: log_id ( osid.id.Id) – theIdof theLogReturns: the log form Return type: osid.logging.LogFormRaise: NotFound–log_idis not foundRaise: NullArgument–log_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.update_log(log_form)¶Updates an existing log.
Parameters: log_form ( osid.logging.LogForm) – the form containing the elements to be updatedRaise: IllegalState–log_formalready used in an update transactionRaise: InvalidArgument– the form contains an invalid valueRaise: NullArgument–log_idorlog_formisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–log_formdid not originate fromget_log_form_for_update()compliance: mandatory – This method must be implemented.
LoggingManager.can_delete_logs()¶Tests if this user can delete
Logs.A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a
Logwill result in aPermissionDenied. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
Returns: falseifLogdeletion is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
LoggingManager.delete_log(log_id)¶Deletes a
Log.
Parameters: log_id ( osid.id.Id) – theIdof theLogto removeRaise: NotFound–log_idnot foundRaise: NullArgument–log_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.can_manage_log_aliases()¶Tests if this user can manage
Idaliases forLogs.A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a
PermissionDenied. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
Returns: falseifLogaliasing is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
LoggingManager.alias_log(log_id, alias_id)¶Adds an
Idto aLogfor the purpose of creating compatibility.The primary
Idof theLogis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another log, it is reassigned to the given logId.
Parameters:
- log_id (
osid.id.Id) – theIdof aLog- alias_id (
osid.id.Id) – the aliasIdRaise:
AlreadyExists–alias_idis already assignedRaise:
NotFound–log_idnot foundRaise:
NullArgument–log_idoralias_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.