4.3. Accounts

The accounts module contains interfaces for all of the various Account management features offered by the dyn.tm REST API

4.3.1. Search/List Functions

The following functions are primarily helper functions which will perform API “Get All” calls. These functions all return a single list containing class representations of their respective types. For instance get_all_users() returns a list of User objects.

dyn.tm.accounts.get_updateusers(search=None)[source]

Return a list of UpdateUser objects. If search is specified, then only UpdateUsers who match those search criteria will be returned in the list. Otherwise, all UpdateUsers‘s will be returned.

Parameters:search – A dict of search criteria. Key’s in this dict much map to an attribute a UpdateUsers instance and the value mapped to by that key will be used as the search criteria for that key when searching.
Returns:a list of UpdateUser objects
dyn.tm.accounts.get_users(search=None)[source]

Return a list of User objects. If search is specified, then only users who match those search parameters will be returned in the list. Otherwise, all User‘s will be returned.

Parameters:search – A dict of search criteria. Key’s in this dict much map to an attribute a User instance and the value mapped to by that key will be used as the search criteria for that key when searching.
Returns:a list of User objects
dyn.tm.accounts.get_permissions_groups(search=None)[source]

Return a list of PermissionGroup objects. If search is specified, then only PermissionGroup‘s that match those search criteria will be returned in the list. Otherwise, all PermissionGroup‘s will be returned.

Parameters:search – A dict of search criteria. Key’s in this dict much map to an attribute a PermissionGroup instance and the value mapped to by that key will be used as the search criteria for that key when searching.
Returns:a list of PermissionGroup objects
dyn.tm.accounts.get_contacts(search=None)[source]

Return a list of Contact objects. If search is specified, then only Contact‘s who match those search criteria will be returned in the list. Otherwise, all Contact‘s will be returned.

Parameters:search – A dict of search criteria. Key’s in this dict much map to an attribute a Contact instance and the value mapped to by that key will be used as the search criteria for that key when searching.
Returns:a list of Contact objects
dyn.tm.accounts.get_notifiers(search=None)[source]

Return a list of Notifier objects. If search is specified, then only Notifier‘s who match those search criteria will be returned in the list. Otherwise, all Notifier‘s will be returned.

Parameters:search – A dict of search criteria. Key’s in this dict much map to an attribute a Notifier instance and the value mapped to by that key will be used as the search criteria for that key when searching.
Returns:a list of Notifier objects

4.3.1.1. Search/List Function Examples

Using these search functions is a fairly straightforward endeavour, you can either leave your search criteria as None and get a list of ALL objects of that type, or you can specify a search dict like so

>>> from dyn.tm.accounts import get_users
>>> all_users = get_users()
>>> all_users
[User: <jnappi>, User: <rshort>, User: <tmpuser35932>,...]
>>> search_criteria = {'first_name': 'Jon'}
>>> jons = get_users(search_criteria)
>>> jons
[User: <jnappi>, User: <jsmith>]