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.OsidProfile
The logging profile describes the interoperability among logging services.
-
supports_logging
()¶ Tests if logging is supported.
Returns: true
if logging is supported,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_log_entry_lookup
()¶ Tests if reading logs is supported.
Returns: true
if reading logs is supported,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_log_entry_query
()¶ Tests if querying log entries is supported.
Returns: true
if querying log entries is supported,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_log_lookup
()¶ Tests for the availability of a log lookup service.
Returns: true
if log lookup is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_log_admin
()¶ Tests for the availability of a log administrative service for creating and deleting logs.
Returns: true
if log administration is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
log_entry_record_types
¶ Gets the supported
Log
record types.Returns: a list containing the supported log record types Return type: osid.type.TypeList
compliance: 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.TypeList
compliance: mandatory – This method must be implemented.
-
log_record_types
¶ Gets the supported
Log
record types.Returns: a list containing the supported log record types Return type: osid.type.TypeList
compliance: 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.TypeList
compliance: 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.TypeList
compliance: 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.TypeList
compliance: mandatory – This method must be implemented.
-
supports_log_entry_admin
()¶ Tests if log entry admin is supported.
Returns: true
if log entry admin is supported,false
otherwiseReturn type: boolean
compliance: 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_.LoggingProfile
The 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 LoggingBatchManager
Return type: osid.logging.batch.LoggingBatchManager
Raise: OperationFailed
– unable to complete requestRaise: Unimplemented
–supports_logging_batch()
isfalse
compliance: optional – This method must be implemented if ``supports_logging_batch()`` is ``true``.
Logging Methods¶
LoggingManager.
log_id
¶Gets the
Log
Id
associated with this session.
Returns: the Log Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
LoggingManager.
log
¶Gets the
Log
associated with this session.
Returns: the Log
associated with this sessionReturn type: osid.logging.Log
Raise: 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: false
if logging methods are not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
LoggingManager.
log
()Gets the
Log
associated with this session.
Returns: the Log
associated with this sessionReturn type: osid.logging.Log
Raise: 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
–content
is not ofcontent_type
Raise:
NullArgument
–content
,content_type
orpriority_type
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failureRaise:
Unsupported
–LoggingManager.supportsContentType(contentType)
isfalse
orLoggingManager.supportsPriorityType(priorityType)
isfalse
compliance: 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.LogEntryForm
compliance: 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 thisLogEntry
Returns: the new LogEntry
Return type: osid.logging.LogEntry
Raise: IllegalState
–log_entry_form
already used in a create transactionRaise: InvalidArgument
– one or more of the form elements is invalidRaise: NullArgument
–log_entry_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–log_entry_form
did not originate fromget_log_entry_form_for_create()
compliance: mandatory – This method must be implemented.
Log Entry Lookup Methods¶
LoggingManager.
log_id
Gets the
Log
Id
associated with this session.
Returns: the Log Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
LoggingManager.
log
Gets the
Log
associated with this session.
Returns: the Log
associated with this sessionReturn type: osid.logging.Log
Raise: 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: false
if reading methods are not authorized,true
otherwiseReturn type: boolean
compliance: 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
LogEntry
returns 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
LogEntry
specified by itsId
.In plenary mode, the exact
Id
is found or aNotFound
results. Otherwise, the returnedLogEntry
may have a differentId
than requested, such as the case where a duplicateId
was assigned to aLogEntry
and retained for compatibility.
Parameters: log_entry_id ( osid.id.Id
) – theId
of theLogEntry
to retrieveReturns: the returned LogEntry
Return type: osid.logging.LogEntry
Raise: NotFound
– noLogEntry
found with the givenId
Raise: NullArgument
–log_entry_id
isnull
Raise: 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
LogEntryList
corresponding to the givenIdList
.In plenary mode, the returned list contains all of the entries specified in the
Id
list, in the order of the list, including duplicates, or an error results if anId
in 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 ofIds
to retrieveReturns: the returned LogEntry list
Return type: osid.logging.LogEntryList
Raise: NotFound
– anId was
not foundRaise: NullArgument
–log_entry_ids
isnull
Raise: 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
LogEntryList
corresponding to the given log entry genusType
which 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 LogEntry
listReturn type: osid.logging.LogEntryList
Raise: NullArgument
–log_entry_genus_type
isnull
Raise: 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
LogEntryList
corresponding to the given log entry genusType
and 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 LogEntry
listReturn type: osid.logging.LogEntryList
Raise: NullArgument
–log_entry_genus_type
isnull
Raise: 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
LogEntryList
containing 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 LogEntry
listReturn type: osid.logging.LogEntryList
Raise: NullArgument
–log_entry_genus_type
isnull
Raise: 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
LogEntryList
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 typeReturns: the returned LogEntry
listReturn type: osid.logging.LogEntryList
Raise: NullArgument
–priority_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.
get_log_entries_by_date
(start, end)¶Gets a
LogEntryList
corresponding 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
LogEntry
listReturn type:
osid.logging.LogEntryList
Raise:
InvalidArgument
–start
is greater thanend
Raise:
NullArgument
–start
orend
isnull
Raise:
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
LogEntryList
corresponding 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
LogEntry
listReturn type:
osid.logging.LogEntryList
Raise:
InvalidArgument
–start
is greater thanend
Raise:
NullArgument
–priority_type, start
orend
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.
get_log_entries_for_resource
(resource_id)¶Gets a
LogEntryList
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
Returns: the returned LogEntry
listReturn type: osid.logging.LogEntryList
Raise: NullArgument
–resource_id
isnull
Raise: 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
LogEntryList
corresponding 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
LogEntry
listReturn type:
osid.logging.LogEntryList
Raise:
InvalidArgument
–start
is greater thanend
Raise:
NullArgument
–resource_id, start
orend
isnull
Raise:
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
LogEntryList
corresponding 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
LogEntry
listReturn type:
osid.logging.LogEntryList
Raise:
InvalidArgument
–start
is greater thanend
Raise:
NullArgument
–resource_id, priority_type, start
orend
isnull
Raise:
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.LogEntryList
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Log Entry Query Methods¶
LoggingManager.
log_id
Gets the
Log
Id
associated with this session.
Returns: the Log Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
LoggingManager.
log
Gets the
Log
associated with this session.
Returns: the Log
associated with this sessionReturn type: osid.logging.Log
Raise: 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
LogEntry
searches.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: false
if search methods are not authorized,true
otherwiseReturn type: boolean
compliance: 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.LogEntryQuery
compliance: 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 LogEntryList
Return type: osid.logging.LogEntryList
Raise: NullArgument
–log_entry_query
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–log_entry_query
is not of this servicecompliance: mandatory – This method must be implemented.
Log Entry Admin Methods¶
LoggingManager.
log_id
Gets the
Log
Id
associated with this session.
Returns: the Log Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
LoggingManager.
log
Gets the
Log
associated with this session.
Returns: the Log
associated with this sessionReturn type: osid.logging.Log
Raise: 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
LogEntry
will result in aPermissionDenied
. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
Returns: false
ifLogEntry
creation is not authorized,true
otherwiseReturn type: boolean
compliance: 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
LogEntry
using 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 aLogEntry
can be created with no records.
Parameters: log_entry_record_types ( osid.type.Type[]
) – array of log entry record typesReturns: true
ifLogEntry
creation using the specified recordTypes
is supported,false
otherwiseReturn type: boolean
Raise: NullArgument
–log_entry_record_types
isnull
compliance: 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.LogEntryForm
Raise: NullArgument
–log_entry_record_types
isnull
Raise: 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 thisLogEntry
Returns: the new LogEntry
Return type: osid.logging.LogEntry
Raise: IllegalState
–log_entry_form
already used in a create transactionRaise: InvalidArgument
– one or more of the form elements is invalidRaise: NullArgument
–log_entry_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–log_entry_form
did 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
Log
will result in aPermissionDenied
. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
Returns: false
ifLogEntry
modification is not authorized,true
otherwiseReturn type: boolean
compliance: 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
) – theId
of theLogEntry
Returns: the log entry form Return type: osid.logging.LogEntryForm
Raise: NotFound
–log_entry_id
is not foundRaise: NullArgument
–log_entry_id
isnull
Raise: 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_form
already used in an update transactionRaise: InvalidArgument
– the form contains an invalid valueRaise: NullArgument
–log_entry_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–log_entry_form
did 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
LogEntry
will result in aPermissionDenied
. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
Returns: false
ifLogEntry
deletion is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
LoggingManager.
delete_log_entry
(log_entry_id)¶Deletes a
LogEntry
.
Parameters: log_entry_id ( osid.id.Id
) – theId
of thelog_entry_id
to removeRaise: NotFound
–log_entry_id
not foundRaise: NullArgument
–log_entry_id
isnull
Raise: 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
Id
aliases 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: false
ifLogEntry
aliasing is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
LoggingManager.
alias_log_entry
(log_entry_id, alias_id)¶Adds an
Id
to aLogEntry
for the purpose of creating compatibility.The primary
Id
of theLogEntry
is determined by the provider. The newId
performs 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
) – theId
of aLogEntry
- alias_id (
osid.id.Id
) – the aliasId
Raise:
AlreadyExists
–alias_id
is already assignedRaise:
NotFound
–log_entry_id
not foundRaise:
NullArgument
–log_entry_id
oralias_id
isnull
Raise:
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
Log
lookups.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: false
if lookup methods are not authorized,true
otherwiseReturn type: boolean
compliance: 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
Log
returns 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
Log
specified by itsId
.In plenary mode, the exact
Id
is found or aNotFound
results. Otherwise, the returnedLog
may have a differentId
than requested, such as the case where a duplicateId
was assigned to aLog
and retained for compatibility.
Parameters: log_id ( osid.id.Id
) –Id
of theLog
Returns: the log Return type: osid.logging.Log
Raise: NotFound
–log_id
not foundRaise: NullArgument
–log_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method is must be implemented.
LoggingManager.
get_logs_by_ids
(log_ids)¶Gets a
LogList
corresponding to the givenIdList
.In plenary mode, the returned list contains all of the logs specified in the
Id
list, in the order of the list, including duplicates, or an error results if anId
in the supplied list is not found or inaccessible. Otherwise, inaccessibleLogs
may 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 ofIds
to retrieveReturns: the returned Log list
Return type: osid.logging.LogList
Raise: NotFound
– anId was
not foundRaise: NullArgument
–log_ids
isnull
Raise: 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
LogList
corresponding to the given log genusType
which 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 list
Return type: osid.logging.LogList
Raise: NullArgument
–log_genus_type
isnull
Raise: 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
LogList
corresponding to the given log genusType
and 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 list
Return type: osid.logging.LogList
Raise: NullArgument
–log_genus_type
isnull
Raise: 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
LogList
containing 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 list
Return type: osid.logging.LogList
Raise: NullArgument
–log_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
LoggingManager.
get_logs_by_provider
(resource_id)¶Gets a
LogList
for 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 resourceId
Returns: the returned Log list
Return type: osid.logging.LogList
Raise: NullArgument
–resource_id
isnull
Raise: 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 Logs
Return type: osid.logging.LogList
Raise: 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
Log
will result in aPermissionDenied
. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
Returns: false
ifLog
creation is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
LoggingManager.
can_create_log_with_record_types
(log_record_types)¶Tests if this user can create a single
Log
using 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 aLog
can be created with no records.
Parameters: log_record_types ( osid.type.Type[]
) – array of log record typesReturns: true
ifLog
creation using the specified recordTypes
is supported,false
otherwiseReturn type: boolean
Raise: NullArgument
–log_record_types
isnull
compliance: 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.LogForm
Raise: NullArgument
–log_record_types
isnull
Raise: 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 thisLog
Returns: the new Log
Return type: osid.logging.Log
Raise: IllegalState
–log_form
already used in a create transactionRaise: InvalidArgument
– one or more of the form elements is invalidRaise: NullArgument
–log_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–log_form
did 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
Log
will result in aPermissionDenied
. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
Returns: false
ifLog
modification is not authorized,true
otherwiseReturn type: boolean
compliance: 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
) – theId
of theLog
Returns: the log form Return type: osid.logging.LogForm
Raise: NotFound
–log_id
is not foundRaise: NullArgument
–log_id
isnull
Raise: 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_form
already used in an update transactionRaise: InvalidArgument
– the form contains an invalid valueRaise: NullArgument
–log_id
orlog_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–log_form
did 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
Log
will result in aPermissionDenied
. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
Returns: false
ifLog
deletion is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
LoggingManager.
delete_log
(log_id)¶Deletes a
Log
.
Parameters: log_id ( osid.id.Id
) – theId
of theLog
to removeRaise: NotFound
–log_id
not foundRaise: NullArgument
–log_id
isnull
Raise: 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
Id
aliases 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: false
ifLog
aliasing is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
LoggingManager.
alias_log
(log_id, alias_id)¶Adds an
Id
to aLog
for the purpose of creating compatibility.The primary
Id
of theLog
is determined by the provider. The newId
performs 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
) – theId
of aLog
- alias_id (
osid.id.Id
) – the aliasId
Raise:
AlreadyExists
–alias_id
is already assignedRaise:
NotFound
–log_id
not foundRaise:
NullArgument
–log_id
oralias_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.