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.

classmethod delete_relationship(item)#

Delete a relationship instance.

Parameters:

item

Returns:

None

classmethod get_relationship(item, refresh=False)#

Return a relationship instance.

Parameters:
  • item (str or dict) – Name, ID, or dictionary representation of the relationship.

  • refresh (bool, 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:
  • filter (str, optional)

  • start (int, optional) – Zero-based index of the first item to return. Defaults to 0.

  • limit (int, 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:

item (dict)

Returns:

None