Revision 95641ecc kamaki/clients/astakos/__init__.py
b/kamaki/clients/astakos/__init__.py | ||
---|---|---|
155 | 155 |
"""Get (cached) term, from user credentials""" |
156 | 156 |
return self.user_info(token).get(key, None) |
157 | 157 |
|
158 |
def post_user_catalogs(self, uuids): |
|
158 |
def post_user_catalogs(self, uuids=None, displaynames=None):
|
|
159 | 159 |
"""POST base_url/user_catalogs |
160 | 160 |
|
161 | 161 |
:param uuids: (list or tuple) user uuids |
162 | 162 |
|
163 |
:returns: (dict) {uuid1: name1, uuid2: name2, ...} |
|
163 |
:param displaynames: (list or tuple) usernames (mut. excl. to uuids) |
|
164 |
|
|
165 |
:returns: (dict) {uuid1: name1, uuid2: name2, ...} or oposite |
|
164 | 166 |
""" |
165 | 167 |
account_url = self.get_service_endpoints('account')['publicURL'] |
166 | 168 |
account = AstakosClient(account_url, self.token) |
167 |
json_data = dict(uuids=uuids) |
|
169 |
json_data = dict(uuids=uuids) if ( |
|
170 |
uuids) else dict(displaynames=displaynames) |
|
168 | 171 |
return account.post('user_catalogs', json=json_data) |
Also available in: Unified diff