Bin¶
Bin¶
-
class
dlkit.services.resource.Bin(provider_manager, catalog, runtime, proxy, **kwargs)¶ Bases:
dlkit.osid.objects.OsidCatalog,dlkit.osid.sessions.OsidSessionAn inventory defines a collection of resources.
-
get_bin_record(bin_record_type)¶ Gets the bin record corresponding to the given
BinrecordType.This method is used to retrieve an object implementing the requested record. The
bin_record_typemay be theTypereturned inget_record_types()or any of its parents in aTypehierarchy 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.BinRecordRaise: NullArgument–bin_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: Unsupported–has_record_type(bin_record_type)isfalsecompliance: mandatory – This method must be implemented.
-
Resource Lookup Methods¶
Bin.bin_id¶Gets the
BinIdassociated with this session.
Returns: the Bin Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
Bin.bin¶Gets the
Binassociated with this session.
Returns: the Binassociated with this sessionReturn type: osid.resource.BinRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Bin.can_lookup_resources()¶Tests if this user can perform
Resourcelookups.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: falseif lookup methods are not authorized,trueotherwiseReturn type: booleancompliance: 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
Resourcereturns 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
Resourcespecified by itsId.In plenary mode, the exact
Idis found or aNotFoundresults. Otherwise, the returnedResourcemay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aResourceand retained for compatibility.
Parameters: resource_id ( osid.id.Id) – theIdof theResourceto retrieveReturns: the returned ResourceReturn type: osid.resource.ResourceRaise: NotFound– noResourcefound with the givenIdRaise: NullArgument–resource_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Bin.get_resources_by_ids(resource_ids)¶Gets a
ResourceListcorresponding to the givenIdList.In plenary mode, the returned list contains all of the resources 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, inaccessibleResourcesmay 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 ofIdsto retrieveReturns: the returned ResourcelistReturn type: osid.resource.ResourceListRaise: NotFound– anId wasnot foundRaise: NullArgument–resource_idsisnullRaise: 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
ResourceListcorresponding to the given resource genusTypewhich 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 ResourcelistReturn type: osid.resource.ResourceListRaise: NullArgument–resource_genus_typeisnullRaise: 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
ResourceListcorresponding to the given resource genusTypeand 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 ResourcelistReturn type: osid.resource.ResourceListRaise: NullArgument–resource_genus_typeisnullRaise: 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
ResourceListcontaining 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 ResourcelistReturn type: osid.resource.ResourceListRaise: NullArgument–resource_record_typeisnullRaise: 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 ResourcesReturn type: osid.resource.ResourceListRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Resource Query Methods¶
Bin.bin_idGets the
BinIdassociated with this session.
Returns: the Bin Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
Bin.binGets the
Binassociated with this session.
Returns: the Binassociated with this sessionReturn type: osid.resource.BinRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Bin.can_search_resources()¶Tests if this user can perform
Resourcesearches.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.
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.ResourceQuerycompliance: mandatory – This method must be implemented.
Bin.get_resources_by_query(resource_query)¶Gets a list of
Resourcesmatching the given resource query.
Parameters: resource_query ( osid.resource.ResourceQuery) – the resource queryReturns: the returned ResourceListReturn type: osid.resource.ResourceListRaise: NullArgument–resource_queryisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–resource_queryis 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.ResourceSearchcompliance: mandatory – This method must be implemented.
Bin.resource_search_order¶Gets a resource search order.
The
ResourceSearchOrderis supplied to aResourceSearchto specify the ordering of results.
Returns: the resource search order Return type: osid.resource.ResourceSearchOrdercompliance: 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.ResourceSearchResultsRaise:
NullArgument–resource_queryorresource_searchisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failureRaise:
Unsupported–resource_queryorresource_searchis 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.ResourceQueryRaise: NullArgument–resource_query_inspectorisnullRaise: Unsupported–resource_query_inspectoris not of this servicecompliance: mandatory – This method must be implemented.
Resource Admin Methods¶
Bin.bin_idGets the
BinIdassociated with this session.
Returns: the Bin Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
Bin.binGets the
Binassociated with this session.
Returns: the Binassociated with this sessionReturn type: osid.resource.BinRaise: 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
Resourcewill 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: falseifResourcecreation is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
Bin.can_create_resource_with_record_types(resource_record_types)¶Tests if this user can create a single
Resourceusing 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 aResourcecan be created with no records.
Parameters: resource_record_types ( osid.type.Type[]) – array of resource record typesReturns: trueifResourcecreation using the specifiedTypesis supported,falseotherwiseReturn type: booleanRaise: NullArgument–resource_record_typesisnullcompliance: 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.ResourceFormRaise: NullArgument–resource_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.
Bin.create_resource(resource_form)¶Creates a new
Resource.
Parameters: resource_form ( osid.resource.ResourceForm) – the form for thisResourceReturns: the new ResourceReturn type: osid.resource.ResourceRaise: IllegalState–resource_formalready used in a create transactionRaise: InvalidArgument– one or more of the form elements is invalidRaise: NullArgument–resource_formisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–resource_formdid 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
Resourcewill 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: falseifResourcemodification is not authorized,trueotherwiseReturn type: booleancompliance: 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) – theIdof theResourceReturns: the resource form Return type: osid.resource.ResourceFormRaise: NotFound–resource_idis not foundRaise: NullArgument–resource_idisnullRaise: 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_formalready used in an update transactionRaise: InvalidArgument– the form contains an invalid valueRaise: NullArgument–resource_formisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–resource_formdid 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
Resourcewill 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: falseifResourcedeletion is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
Bin.delete_resource(resource_id)¶Deletes a
Resource.
Parameters: resource_id ( osid.id.Id) – theIdof theResourceto removeRaise: NotFound–resource_idnot foundRaise: NullArgument–resource_idisnullRaise: 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
Idaliases 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: falseifResourcealiasing is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
Bin.alias_resource(resource_id, alias_id)¶Adds an
Idto aResourcefor the purpose of creating compatibility.The primary
Idof theResourceis determined by the provider. The newIdperforms 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) – theIdof aResource- alias_id (
osid.id.Id) – the aliasIdRaise:
AlreadyExists–alias_idis already assignedRaise:
NotFound–resource_idnot foundRaise:
NullArgument–alias_idorresource_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Resource Notification Methods¶
Bin.bin_idGets the
BinIdassociated with this session.
Returns: the Bin Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
Bin.binGets the
Binassociated with this session.
Returns: the Binassociated with this sessionReturn type: osid.resource.BinRaise: 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
Resourcenotifications.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: falseif notification methods are not authorized,trueotherwiseReturn type: booleancompliance: 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 newResourceis 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) – theIdof theResourceto monitorRaise: NullArgument–resource_idisnullRaise: 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) – theIdof theResourceto monitorRaise: NullArgument–resource_idisnullRaise: 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) – theIdof 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
ResourceandBinreturns 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: falseif looking up mappings is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
Bin.get_resource_ids_by_bin(bin_id)¶Gets the list of
ResourceIdsassociated with aBin.
Parameters: bin_id ( osid.id.Id) –Idof aBinReturns: list of related resource IdsReturn type: osid.id.IdListRaise: NotFound–bin_idis not foundRaise: NullArgument–bin_idisnullRaise: 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
Resourcesassociated with aBin.
Parameters: bin_id ( osid.id.Id) –Idof aBinReturns: list of related resources Return type: osid.resource.ResourceListRaise: NotFound–bin_idis not foundRaise: NullArgument–bin_idisnullRaise: 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 Idscorresponding to a list ofBinobjects.
Parameters: bin_ids ( osid.id.IdList) – list of binIdsReturns: list of resource IdsReturn type: osid.id.IdListRaise: NullArgument–bin_idsisnullRaise: 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
Resourcescorresponding to a list ofBins.
Parameters: bin_ids ( osid.id.IdList) – list of binIdsReturns: list of resources Return type: osid.resource.ResourceListRaise: NullArgument–bin_idsisnullRaise: 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
BinIdsmapped to aResource.
Parameters: resource_id ( osid.id.Id) –Idof aResourceReturns: list of bin IdsReturn type: osid.id.IdListRaise: NotFound–resource_idis not foundRaise: NullArgument–resource_idisnullRaise: 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
Binobjects mapped to aResource.
Parameters: resource_id ( osid.id.Id) –Idof aResourceReturns: list of bins Return type: osid.resource.BinListRaise: NotFound–resource_idis not foundRaise: NullArgument–resource_idisnullRaise: 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: falseif mapping is not authorized,trueotherwiseReturn type: booleancompliance: 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) – theIdof theBinReturns: falseif mapping is not authorized,trueotherwiseReturn type: booleanRaise: NullArgument–bin_idisnullcompliance: 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) – theIdof theBinReturns: list of assignable bin IdsReturn type: osid.id.IdListRaise: NullArgument–bin_idisnullRaise: 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) – theIdof theBin- resource_id (
osid.id.Id) – theIdof theResourceReturns: list of assignable bin
IdsReturn type:
osid.id.IdListRaise:
NullArgument–bin_idorresource_idisnullRaise:
OperationFailed– unable to complete requestcompliance: mandatory – This method must be implemented.
Bin.assign_resource_to_bin(resource_id, bin_id)¶Adds an existing
Resourceto aBin.
Parameters:
- resource_id (
osid.id.Id) – theIdof theResource- bin_id (
osid.id.Id) – theIdof theBinRaise:
AlreadyExists–resource_idis already assigned tobin_idRaise:
NotFound–resource_idorbin_idnot foundRaise:
NullArgument–resource_idorbin_idisnullRaise:
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
Resourcefrom aBin.
Parameters:
- resource_id (
osid.id.Id) – theIdof theResource- bin_id (
osid.id.Id) – theIdof theBinRaise:
NotFound–resource_idorbin_idnot found orresource_idnot assigned tobin_idRaise:
NullArgument–resource_idorbin_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Resource Agent Methods¶
Bin.bin_idGets the
BinIdassociated with this session.
Returns: the Bin Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
Bin.binGets the
Binassociated with this session.
Returns: the Binassociated with this sessionReturn type: osid.resource.BinRaise: 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: falseif looking up mappings is not authorized,trueotherwiseReturn type: booleancompliance: 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
Agentreturns 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
ResourceIdassociated with the given agent.
Parameters: agent_id ( osid.id.Id) –Idof theAgentReturns: associated resource Return type: osid.id.IdRaise: NotFound–agent_idis not foundRaise: NullArgument–agent_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Bin.get_resource_by_agent(agent_id)¶Gets the
Resourceassociated with the given agent.
Parameters: agent_id ( osid.id.Id) –Idof theAgentReturns: associated resource Return type: osid.resource.ResourceRaise: NotFound–agent_idis not foundRaise: NullArgument–agent_idisnullRaise: 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
AgentIdsmapped to aResource.
Parameters: resource_id ( osid.id.Id) –Idof aResourceReturns: list of agent IdsReturn type: osid.id.IdListRaise: NotFound–resource_idis not foundRaise: NullArgument–resource_idisnullRaise: 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
Agentsmapped to aResource.
Parameters: resource_id ( osid.id.Id) –Idof aResourceReturns: list of agents Return type: osid.authentication.AgentListRaise: NotFound–resource_idis not foundRaise: NullArgument–resource_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Resource Agent Assignment Methods¶
Bin.bin_idGets the
BinIdassociated with this session.
Returns: the Bin Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
Bin.binGets the
Binassociated with this session.
Returns: the Binassociated with this sessionReturn type: osid.resource.BinRaise: 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: falseif mapping is not authorized,trueotherwiseReturn type: booleancompliance: 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) – theIdof theResourceReturns: falseif mapping is not authorized,trueotherwiseReturn type: booleanRaise: NullArgument–resource_idisnullcompliance: mandatory – This method must be implemented.
Bin.assign_agent_to_resource(agent_id, resource_id)¶Adds an existing
Agentto aResource.
Parameters:
- agent_id (
osid.id.Id) – theIdof theAgent- resource_id (
osid.id.Id) – theIdof theResourceRaise:
AlreadyExists–agent_idis already assigned toresource_idRaise:
NotFound–agent_idorresource_idnot foundRaise:
NullArgument–agent_idorresource_idisnullRaise:
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
Agentfrom aResource.
Parameters:
- agent_id (
osid.id.Id) – theIdof theAgent- resource_id (
osid.id.Id) – theIdof theResourceRaise:
NotFound–agent_idorresource_idnot found oragent_idnot assigned toresource_idRaise:
NullArgument–agent_idorresource_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.