Bin¶
Bin¶
-
class
dlkit.services.resource.
Bin
(provider_manager, catalog, runtime, proxy, **kwargs)¶ Bases:
dlkit.osid.objects.OsidCatalog
,dlkit.osid.sessions.OsidSession
An inventory defines a collection of resources.
-
get_bin_record
(bin_record_type)¶ Gets the bin record corresponding to the given
Bin
recordType
.This method is used to retrieve an object implementing the requested record. The
bin_record_type
may be theType
returned inget_record_types()
or any of its parents in aType
hierarchy wherehas_record_type(bin_record_type)
istrue
.Parameters: bin_record_type ( osid.type.Type
) – the bin record typeReturns: the bin record Return type: osid.resource.records.BinRecord
Raise: NullArgument
–bin_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(bin_record_type)
isfalse
compliance: mandatory – This method must be implemented.
-
Resource Lookup Methods¶
Bin.
bin_id
¶Gets the
Bin
Id
associated with this session.
Returns: the Bin Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Bin.
bin
¶Gets the
Bin
associated with this session.
Returns: the Bin
associated with this sessionReturn type: osid.resource.Bin
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
can_lookup_resources
()¶Tests if this user can perform
Resource
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.
Returns: false
if lookup methods are not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Bin.
use_comparative_resource_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.
Bin.
use_plenary_resource_view
()¶A complete view of the
Resource
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.
Bin.
use_federated_bin_view
()¶Federates the view for methods in this session.
A federated view will include resources in bins which are children of this bin in the bin hierarchy.
compliance: mandatory – This method is must be implemented.
Bin.
use_isolated_bin_view
()¶Isolates the view for methods in this session.
An isolated view restricts lookups to this bin only.
compliance: mandatory – This method is must be implemented.
Bin.
get_resource
(resource_id)¶Gets the
Resource
specified by itsId
.In plenary mode, the exact
Id
is found or aNotFound
results. Otherwise, the returnedResource
may have a differentId
than requested, such as the case where a duplicateId
was assigned to aResource
and retained for compatibility.
Parameters: resource_id ( osid.id.Id
) – theId
of theResource
to retrieveReturns: the returned Resource
Return type: osid.resource.Resource
Raise: NotFound
– noResource
found with the givenId
Raise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
get_resources_by_ids
(resource_ids)¶Gets a
ResourceList
corresponding to the givenIdList
.In plenary mode, the returned list contains all of the resources 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, inaccessibleResources
may be omitted from the list and may present the elements in any order including returning a unique set.
Parameters: resource_ids ( osid.id.IdList
) – the list ofIds
to retrieveReturns: the returned Resource
listReturn type: osid.resource.ResourceList
Raise: NotFound
– anId was
not foundRaise: NullArgument
–resource_ids
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
get_resources_by_genus_type
(resource_genus_type)¶Gets a
ResourceList
corresponding to the given resource genusType
which does not include resources of types derived from the specifiedType
.In plenary mode, the returned list contains all known resources or an error results. Otherwise, the returned list may contain only those resources that are accessible through this session.
Parameters: resource_genus_type ( osid.type.Type
) – a resource genus typeReturns: the returned Resource
listReturn type: osid.resource.ResourceList
Raise: NullArgument
–resource_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
get_resources_by_parent_genus_type
(resource_genus_type)¶Gets a
ResourceList
corresponding to the given resource genusType
and include any additional resources with genus types derived from the specifiedType
.In plenary mode, the returned list contains all known resources or an error results. Otherwise, the returned list may contain only those resources that are accessible through this session.
Parameters: resource_genus_type ( osid.type.Type
) – a resource genus typeReturns: the returned Resource
listReturn type: osid.resource.ResourceList
Raise: NullArgument
–resource_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
get_resources_by_record_type
(resource_record_type)¶Gets a
ResourceList
containing the given resource recordType
.In plenary mode, the returned list contains all known resources or an error results. Otherwise, the returned list may contain only those resources that are accessible through this session.
Parameters: resource_record_type ( osid.type.Type
) – a resource record typeReturns: the returned Resource
listReturn type: osid.resource.ResourceList
Raise: NullArgument
–resource_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
resources
¶Gets all
Resources
.In plenary mode, the returned list contains all known resources or an error results. Otherwise, the returned list may contain only those resources that are accessible through this session.
Returns: a list of Resources
Return type: osid.resource.ResourceList
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Resource Query Methods¶
Bin.
bin_id
Gets the
Bin
Id
associated with this session.
Returns: the Bin Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Bin.
bin
Gets the
Bin
associated with this session.
Returns: the Bin
associated with this sessionReturn type: osid.resource.Bin
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
can_search_resources
()¶Tests if this user can perform
Resource
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.
Bin.
use_federated_bin_view
()Federates the view for methods in this session.
A federated view will include resources in bins which are children of this bin in the bin hierarchy.
compliance: mandatory – This method is must be implemented.
Bin.
use_isolated_bin_view
()Isolates the view for methods in this session.
An isolated view restricts lookups to this bin only.
compliance: mandatory – This method is must be implemented.
Bin.
resource_query
¶Gets a resource query.
The returned query will not have an extension query.
Returns: the resource query Return type: osid.resource.ResourceQuery
compliance: mandatory – This method must be implemented.
Bin.
get_resources_by_query
(resource_query)¶Gets a list of
Resources
matching the given resource query.
Parameters: resource_query ( osid.resource.ResourceQuery
) – the resource queryReturns: the returned ResourceList
Return type: osid.resource.ResourceList
Raise: NullArgument
–resource_query
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–resource_query
is not of this servicecompliance: mandatory – This method must be implemented.
Resource Search Methods¶
Bin.
resource_search
¶Gets a resource search.
Returns: the resource search Return type: osid.resource.ResourceSearch
compliance: mandatory – This method must be implemented.
Bin.
resource_search_order
¶Gets a resource search order.
The
ResourceSearchOrder
is supplied to aResourceSearch
to specify the ordering of results.
Returns: the resource search order Return type: osid.resource.ResourceSearchOrder
compliance: mandatory – This method must be implemented.
Bin.
get_resources_by_search
(resource_query, resource_search)¶Gets the search results matching the given search query using the given search.
Parameters:
- resource_query (
osid.resource.ResourceQuery
) – the resource query- resource_search (
osid.resource.ResourceSearch
) – the resource searchReturns: the resource search results
Return type:
osid.resource.ResourceSearchResults
Raise:
NullArgument
–resource_query
orresource_search
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failureRaise:
Unsupported
–resource_query
orresource_search
is not of this servicecompliance: mandatory – This method must be implemented.
Bin.
get_resource_query_from_inspector
(resource_query_inspector)¶Gets a resource query from an inspector.
The inspector is available from a
ResourceSearchResults
.
Parameters: resource_query_inspector ( osid.resource.ResourceQueryInspector
) – a resource query inspectorReturns: the resource query Return type: osid.resource.ResourceQuery
Raise: NullArgument
–resource_query_inspector
isnull
Raise: Unsupported
–resource_query_inspector
is not of this servicecompliance: mandatory – This method must be implemented.
Resource Admin Methods¶
Bin.
bin_id
Gets the
Bin
Id
associated with this session.
Returns: the Bin Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Bin.
bin
Gets the
Bin
associated with this session.
Returns: the Bin
associated with this sessionReturn type: osid.resource.Bin
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
can_create_resources
()¶Tests if this user can create
Resources
.A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a
Resource
will result in aPermissionDenied
. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
Returns: false
ifResource
creation is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Bin.
can_create_resource_with_record_types
(resource_record_types)¶Tests if this user can create a single
Resource
using the desired record types.While
ResourceManager.getResourceRecordTypes()
can be used to examine which records are supported, this method tests which record(s) are required for creating a specificResource
. Providing an empty array tests if aResource
can be created with no records.
Parameters: resource_record_types ( osid.type.Type[]
) – array of resource record typesReturns: true
ifResource
creation using the specifiedTypes
is supported,false
otherwiseReturn type: boolean
Raise: NullArgument
–resource_record_types
isnull
compliance: mandatory – This method must be implemented.
Bin.
get_resource_form_for_create
(resource_record_types)¶Gets the resource form for creating new resources.
A new form should be requested for each create transaction.
Parameters: resource_record_types ( osid.type.Type[]
) – array of resource record typesReturns: the resource form Return type: osid.resource.ResourceForm
Raise: NullArgument
–resource_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.
Bin.
create_resource
(resource_form)¶Creates a new
Resource
.
Parameters: resource_form ( osid.resource.ResourceForm
) – the form for thisResource
Returns: the new Resource
Return type: osid.resource.Resource
Raise: IllegalState
–resource_form
already used in a create transactionRaise: InvalidArgument
– one or more of the form elements is invalidRaise: NullArgument
–resource_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–resource_form
did not originate fromget_resource_form_for_create()
compliance: mandatory – This method must be implemented.
Bin.
can_update_resources
()¶Tests if this user can update
Resources
.A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a
Resource
will result in aPermissionDenied
. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
Returns: false
ifResource
modification is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Bin.
get_resource_form_for_update
(resource_id)¶Gets the resource form for updating an existing resource.
A new resource form should be requested for each update transaction.
Parameters: resource_id ( osid.id.Id
) – theId
of theResource
Returns: the resource form Return type: osid.resource.ResourceForm
Raise: NotFound
–resource_id
is not foundRaise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
update_resource
(resource_form)¶Updates an existing resource.
Parameters: resource_form ( osid.resource.ResourceForm
) – the form containing the elements to be updatedRaise: IllegalState
–resource_form
already used in an update transactionRaise: InvalidArgument
– the form contains an invalid valueRaise: NullArgument
–resource_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–resource_form
did not originate fromget_resource_form_for_update()
compliance: mandatory – This method must be implemented.
Bin.
can_delete_resources
()¶Tests if this user can delete
Resources
.A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a
Resource
will result in aPermissionDenied
. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
Returns: false
ifResource
deletion is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Bin.
delete_resource
(resource_id)¶Deletes a
Resource
.
Parameters: resource_id ( osid.id.Id
) – theId
of theResource
to removeRaise: NotFound
–resource_id
not foundRaise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
can_manage_resource_aliases
()¶Tests if this user can manage
Id
aliases forResources
.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
ifResource
aliasing is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Bin.
alias_resource
(resource_id, alias_id)¶Adds an
Id
to aResource
for the purpose of creating compatibility.The primary
Id
of theResource
is determined by the provider. The newId
performs as an alias to the primaryId
. If the alias is a pointer to another resource it is reassigned to the given resourceId
.
Parameters:
- resource_id (
osid.id.Id
) – theId
of aResource
- alias_id (
osid.id.Id
) – the aliasId
Raise:
AlreadyExists
–alias_id
is already assignedRaise:
NotFound
–resource_id
not foundRaise:
NullArgument
–alias_id
orresource_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Resource Notification Methods¶
Bin.
bin_id
Gets the
Bin
Id
associated with this session.
Returns: the Bin Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Bin.
bin
Gets the
Bin
associated with this session.
Returns: the Bin
associated with this sessionReturn type: osid.resource.Bin
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
can_register_for_resource_notifications
()¶Tests if this user can register for
Resource
notifications.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 notification operations.
Returns: false
if notification methods are not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Bin.
use_federated_bin_view
()Federates the view for methods in this session.
A federated view will include resources in bins which are children of this bin in the bin hierarchy.
compliance: mandatory – This method is must be implemented.
Bin.
use_isolated_bin_view
()Isolates the view for methods in this session.
An isolated view restricts lookups to this bin only.
compliance: mandatory – This method is must be implemented.
Bin.
register_for_new_resources
()¶Register for notifications of new resources.
ResourceReceiver.newResources()
is invoked when a newResource
is appears in this bin.
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
register_for_changed_resources
()¶Registers for notification of updated resources.
ResourceReceiver.changedResources()
is invoked when a resource in this bin is changed.
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
register_for_changed_resource
(resource_id)¶Registers for notification of an updated resource.
ResourceReceiver.changedResources()
is invoked when the specified resource in this bin is changed.
Parameters: resource_id ( osid.id.Id
) – theId
of theResource
to monitorRaise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
register_for_deleted_resources
()¶Registers for notification of deleted resources.
ResourceReceiver.deletedResources()
is invoked when a resource is deleted or removed from this bin.
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
register_for_deleted_resource
(resource_id)¶Registers for notification of a deleted resource.
ResourceReceiver.deletedResources()
is invoked when the specified resource is deleted or removed from this bin.
Parameters: resource_id ( osid.id.Id
) – theId
of theResource
to monitorRaise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
reliable_resource_notifications
()¶Reliable notifications are desired.
In reliable mode, notifications are to be acknowledged using
acknowledge_item_notification()
.compliance: mandatory – This method is must be implemented.
Bin.
unreliable_resource_notifications
()¶Unreliable notifications are desired.
In unreliable mode, notifications do not need to be acknowledged.
compliance: mandatory – This method is must be implemented.
Bin.
acknowledge_resource_notification
(notification_id)¶Acknowledge an resource notification.
Parameters: notification_id ( osid.id.Id
) – theId
of the notificationRaise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Resource Bin Methods¶
Bin.
use_comparative_bin_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.
Bin.
use_plenary_bin_view
()¶A complete view of the
Resource
andBin
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.
Bin.
can_lookup_resource_bin_mappings
()¶Tests if this user can perform lookups of resource/bin mappings.
A return of true does not guarantee successful authorization. A return of false indicates that it is known lookup 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 looking up mappings is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Bin.
get_resource_ids_by_bin
(bin_id)¶Gets the list of
Resource
Ids
associated with aBin
.
Parameters: bin_id ( osid.id.Id
) –Id
of aBin
Returns: list of related resource Ids
Return type: osid.id.IdList
Raise: NotFound
–bin_id
is not foundRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
get_resources_by_bin
(bin_id)¶Gets the list of
Resources
associated with aBin
.
Parameters: bin_id ( osid.id.Id
) –Id
of aBin
Returns: list of related resources Return type: osid.resource.ResourceList
Raise: NotFound
–bin_id
is not foundRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
get_resource_ids_by_bins
(bin_ids)¶Gets the list of
Resource Ids
corresponding to a list ofBin
objects.
Parameters: bin_ids ( osid.id.IdList
) – list of binIds
Returns: list of resource Ids
Return type: osid.id.IdList
Raise: NullArgument
–bin_ids
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
get_resources_by_bins
(bin_ids)¶Gets the list of
Resources
corresponding to a list ofBins
.
Parameters: bin_ids ( osid.id.IdList
) – list of binIds
Returns: list of resources Return type: osid.resource.ResourceList
Raise: NullArgument
–bin_ids
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
get_bin_ids_by_resource
(resource_id)¶Gets the list of
Bin
Ids
mapped to aResource
.
Parameters: resource_id ( osid.id.Id
) –Id
of aResource
Returns: list of bin Ids
Return type: osid.id.IdList
Raise: NotFound
–resource_id
is not foundRaise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
get_bins_by_resource
(resource_id)¶Gets the list of
Bin
objects mapped to aResource
.
Parameters: resource_id ( osid.id.Id
) –Id
of aResource
Returns: list of bins Return type: osid.resource.BinList
Raise: NotFound
–resource_id
is not foundRaise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Resource Bin Assignment Methods¶
Bin.
can_assign_resources
()¶Tests if this user can alter resource/bin mappings.
A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a
PermissionDenied
. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
Returns: false
if mapping is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Bin.
can_assign_resources_to_bin
(bin_id)¶Tests if this user can alter resource/bin mappings.
A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a
PermissionDenied
. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
Parameters: bin_id ( osid.id.Id
) – theId
of theBin
Returns: false
if mapping is not authorized,true
otherwiseReturn type: boolean
Raise: NullArgument
–bin_id
isnull
compliance: mandatory – This method must be implemented.
Bin.
get_assignable_bin_ids
(bin_id)¶Gets a list of bins including and under the given bin node in which any resource can be assigned.
Parameters: bin_id ( osid.id.Id
) – theId
of theBin
Returns: list of assignable bin Ids
Return type: osid.id.IdList
Raise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.
Bin.
get_assignable_bin_ids_for_resource
(bin_id, resource_id)¶Gets a list of bins including and under the given bin node in which a specific resource can be assigned.
Parameters:
- bin_id (
osid.id.Id
) – theId
of theBin
- resource_id (
osid.id.Id
) – theId
of theResource
Returns: list of assignable bin
Ids
Return type:
osid.id.IdList
Raise:
NullArgument
–bin_id
orresource_id
isnull
Raise:
OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.
Bin.
assign_resource_to_bin
(resource_id, bin_id)¶Adds an existing
Resource
to aBin
.
Parameters:
- resource_id (
osid.id.Id
) – theId
of theResource
- bin_id (
osid.id.Id
) – theId
of theBin
Raise:
AlreadyExists
–resource_id
is already assigned tobin_id
Raise:
NotFound
–resource_id
orbin_id
not foundRaise:
NullArgument
–resource_id
orbin_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
unassign_resource_from_bin
(resource_id, bin_id)¶Removes a
Resource
from aBin
.
Parameters:
- resource_id (
osid.id.Id
) – theId
of theResource
- bin_id (
osid.id.Id
) – theId
of theBin
Raise:
NotFound
–resource_id
orbin_id
not found orresource_id
not assigned tobin_id
Raise:
NullArgument
–resource_id
orbin_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Resource Agent Methods¶
Bin.
bin_id
Gets the
Bin
Id
associated with this session.
Returns: the Bin Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Bin.
bin
Gets the
Bin
associated with this session.
Returns: the Bin
associated with this sessionReturn type: osid.resource.Bin
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
can_lookup_resource_agent_mappings
()¶Tests if this user can perform lookups of resource/agent mappings.
A return of true does not guarantee successful authorization. A return of false indicates that it is known lookup 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 looking up mappings is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Bin.
use_comparative_agent_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.
Bin.
use_plenary_agent_view
()¶A complete view of the
Agent
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.
Bin.
use_federated_bin_view
()Federates the view for methods in this session.
A federated view will include resources in bins which are children of this bin in the bin hierarchy.
compliance: mandatory – This method is must be implemented.
Bin.
use_isolated_bin_view
()Isolates the view for methods in this session.
An isolated view restricts lookups to this bin only.
compliance: mandatory – This method is must be implemented.
Bin.
get_resource_id_by_agent
(agent_id)¶Gets the
Resource
Id
associated with the given agent.
Parameters: agent_id ( osid.id.Id
) –Id
of theAgent
Returns: associated resource Return type: osid.id.Id
Raise: NotFound
–agent_id
is not foundRaise: NullArgument
–agent_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
get_resource_by_agent
(agent_id)¶Gets the
Resource
associated with the given agent.
Parameters: agent_id ( osid.id.Id
) –Id
of theAgent
Returns: associated resource Return type: osid.resource.Resource
Raise: NotFound
–agent_id
is not foundRaise: NullArgument
–agent_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
get_agent_ids_by_resource
(resource_id)¶Gets the list of
Agent
Ids
mapped to aResource
.
Parameters: resource_id ( osid.id.Id
) –Id
of aResource
Returns: list of agent Ids
Return type: osid.id.IdList
Raise: NotFound
–resource_id
is not foundRaise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
get_agents_by_resource
(resource_id)¶Gets the list of
Agents
mapped to aResource
.
Parameters: resource_id ( osid.id.Id
) –Id
of aResource
Returns: list of agents Return type: osid.authentication.AgentList
Raise: NotFound
–resource_id
is not foundRaise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Resource Agent Assignment Methods¶
Bin.
bin_id
Gets the
Bin
Id
associated with this session.
Returns: the Bin Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Bin.
bin
Gets the
Bin
associated with this session.
Returns: the Bin
associated with this sessionReturn type: osid.resource.Bin
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
can_assign_agents
()¶Tests if this user can alter resource/agent mappings.
A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a
PermissionDenied
. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
Returns: false
if mapping is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Bin.
can_assign_agents_to_resource
(resource_id)¶Tests if this user can alter resource/agent mappings.
A return of true does not guarantee successful authorization. A return of false indicates that it is known location methods in this session will result in a
PermissionDenied
. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
Parameters: resource_id ( osid.id.Id
) – theId
of theResource
Returns: false
if mapping is not authorized,true
otherwiseReturn type: boolean
Raise: NullArgument
–resource_id
isnull
compliance: mandatory – This method must be implemented.
Bin.
assign_agent_to_resource
(agent_id, resource_id)¶Adds an existing
Agent
to aResource
.
Parameters:
- agent_id (
osid.id.Id
) – theId
of theAgent
- resource_id (
osid.id.Id
) – theId
of theResource
Raise:
AlreadyExists
–agent_id
is already assigned toresource_id
Raise:
NotFound
–agent_id
orresource_id
not foundRaise:
NullArgument
–agent_id
orresource_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin.
unassign_agent_from_resource
(agent_id, resource_id)¶Removes an
Agent
from aResource
.
Parameters:
- agent_id (
osid.id.Id
) – theId
of theAgent
- resource_id (
osid.id.Id
) – theId
of theResource
Raise:
NotFound
–agent_id
orresource_id
not found oragent_id
not assigned toresource_id
Raise:
NullArgument
–agent_id
orresource_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.