sasctl.services.relationships#
- class sasctl._services.relationships.Relationships[source]#
Bases:
Service
The Relationships API manages a repository of relationships.
A relationship describes how two resources are connected. A relationship contains a subject resource, the related resource, and the relationship type. A relationship type describes the nature of the relationship between two resources. The relationship type includes a name, label, and description.
Methods
delete
(*args, **kwargs)Send a DELETE request.
delete_relationship
(item)Delete a relationship instance.
get
(*args, **kwargs)Send a GET request.
get_link
(obj, rel)Get link information from a resource.
get_relationship
(item[, refresh])Return a relationship instance.
head
(*args, **kwargs)Send a HEAD request.
info
()Version and build information for the service.
is_available
()Check if the service is currently available.
list_relationships
([filter, start, limit])List all relationships available in the environment.
post
(*args, **kwargs)Send a POST request.
put
(*args, **kwargs)Send a PUT request.
request
(verb, path[, session, format_])Send an HTTP request with a session.
request_link
(obj, rel, **kwargs)Request a link from a resource.
update_relationship
(item)Update a relationship instance.
is_uuid
- classmethod delete_relationship(item)#
Delete a relationship instance.
- Parameters:
- item
- Returns:
- None
- classmethod get_relationship(item, refresh=False)#
Return a relationship instance.
- Parameters:
- itemstr or dict
Name, ID, or dictionary representation of the relationship.
- refreshbool, optional
Obtain an updated copy of the relationship.
- Returns:
- RestObj or None
A dictionary containing the relationship attributes or None.
Notes
If item is a complete representation of the relationship it will be returned unless refresh is set. This prevents unnecessary REST calls when data is already available on the client.
- classmethod list_relationships(filter=None, start=None, limit=None, **kwargs)#
List all relationships available in the environment.
- Parameters:
- filterstr, optional
- startint, optional
Zero-based index of the first item to return. Defaults to 0.
- limitint, optional
The maximum number of items to return. Defaults to 20.
- Returns:
- list
A list of dictionaries containing the relationships.
Notes
See the filtering reference for details on the filter parameter.
- classmethod update_relationship(item)#
Update a relationship instance.
- Parameters:
- itemdict
- Returns:
- None