pyxetabase 4.0.0.dev56__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyxetabase might be problematic. Click here for more details.
- pyxetabase/__init__.py +0 -0
- pyxetabase/commons.py +347 -0
- pyxetabase/exceptions.py +8 -0
- pyxetabase/opencga_client.py +344 -0
- pyxetabase/opencga_config.py +211 -0
- pyxetabase/rest_clients/__init__.py +0 -0
- pyxetabase/rest_clients/_parent_rest_clients.py +144 -0
- pyxetabase/rest_clients/admin_client.py +179 -0
- pyxetabase/rest_clients/alignment_client.py +373 -0
- pyxetabase/rest_clients/clinical_analysis_client.py +1216 -0
- pyxetabase/rest_clients/cohort_client.py +349 -0
- pyxetabase/rest_clients/cvdb_client.py +2285 -0
- pyxetabase/rest_clients/disease_panel_client.py +345 -0
- pyxetabase/rest_clients/family_client.py +355 -0
- pyxetabase/rest_clients/federation_client.py +133 -0
- pyxetabase/rest_clients/file_client.py +710 -0
- pyxetabase/rest_clients/ga4gh_client.py +86 -0
- pyxetabase/rest_clients/individual_client.py +435 -0
- pyxetabase/rest_clients/job_client.py +416 -0
- pyxetabase/rest_clients/meta_client.py +85 -0
- pyxetabase/rest_clients/organization_client.py +216 -0
- pyxetabase/rest_clients/project_client.py +128 -0
- pyxetabase/rest_clients/sample_client.py +446 -0
- pyxetabase/rest_clients/study_client.py +462 -0
- pyxetabase/rest_clients/user_client.py +212 -0
- pyxetabase/rest_clients/user_tool_client.py +471 -0
- pyxetabase/rest_clients/variant_client.py +1378 -0
- pyxetabase/rest_clients/variant_operation_client.py +718 -0
- pyxetabase/rest_clients/workflow_client.py +263 -0
- pyxetabase/rest_response.py +220 -0
- pyxetabase/retry.py +57 -0
- pyxetabase-4.0.0.dev56.dist-info/METADATA +159 -0
- pyxetabase-4.0.0.dev56.dist-info/RECORD +36 -0
- pyxetabase-4.0.0.dev56.dist-info/WHEEL +5 -0
- pyxetabase-4.0.0.dev56.dist-info/licenses/LICENSE +202 -0
- pyxetabase-4.0.0.dev56.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
"""
|
|
2
|
+
WARNING: AUTOGENERATED CODE
|
|
3
|
+
|
|
4
|
+
This code was generated by a tool.
|
|
5
|
+
|
|
6
|
+
Manual changes to this file may cause unexpected behavior in your application.
|
|
7
|
+
Manual changes to this file will be overwritten if the code is regenerated.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from pyxetabase.rest_clients._parent_rest_clients import _ParentRestClient
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Study(_ParentRestClient):
|
|
14
|
+
"""
|
|
15
|
+
This class contains methods for the 'Studies' webservices
|
|
16
|
+
PATH: /{apiVersion}/studies
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(self, configuration, token=None, login_handler=None, *args, **kwargs):
|
|
20
|
+
super(Study, self).__init__(configuration, token, login_handler, *args, **kwargs)
|
|
21
|
+
|
|
22
|
+
def update_acl(self, members, action, data=None, **options):
|
|
23
|
+
"""
|
|
24
|
+
Update the set of permissions granted for the member.
|
|
25
|
+
PATH: /{apiVersion}/studies/acl/{members}/update
|
|
26
|
+
|
|
27
|
+
:param dict data: JSON containing the parameters to modify ACLs.
|
|
28
|
+
'template' could be either 'admin', 'analyst' or 'view_only'.
|
|
29
|
+
(REQUIRED)
|
|
30
|
+
:param str action: Action to be performed [ADD, SET, REMOVE or RESET].
|
|
31
|
+
Allowed values: ['SET ADD REMOVE RESET'] (REQUIRED)
|
|
32
|
+
:param str members: Comma separated list of user or group ids.
|
|
33
|
+
(REQUIRED)
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
options['action'] = action
|
|
37
|
+
return self._post(category='studies', resource='update', subcategory='acl', second_query_id=members, data=data, **options)
|
|
38
|
+
|
|
39
|
+
def create(self, data=None, **options):
|
|
40
|
+
"""
|
|
41
|
+
Create a new study.
|
|
42
|
+
PATH: /{apiVersion}/studies/create
|
|
43
|
+
|
|
44
|
+
:param dict data: study. (REQUIRED)
|
|
45
|
+
:param str include: Fields included in the response, whole JSON path
|
|
46
|
+
must be provided.
|
|
47
|
+
:param str exclude: Fields excluded in the response, whole JSON path
|
|
48
|
+
must be provided.
|
|
49
|
+
:param str project: Project [organization@]project where project can
|
|
50
|
+
be either the ID or the alias.
|
|
51
|
+
:param bool include_result: Flag indicating to include the created or
|
|
52
|
+
updated document result in the response.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
return self._post(category='studies', resource='create', data=data, **options)
|
|
56
|
+
|
|
57
|
+
def search(self, project, **options):
|
|
58
|
+
"""
|
|
59
|
+
Search studies.
|
|
60
|
+
PATH: /{apiVersion}/studies/search
|
|
61
|
+
|
|
62
|
+
:param str project: Project [organization@]project where project can
|
|
63
|
+
be either the ID or the alias. (REQUIRED)
|
|
64
|
+
:param str include: Fields included in the response, whole JSON path
|
|
65
|
+
must be provided.
|
|
66
|
+
:param str exclude: Fields excluded in the response, whole JSON path
|
|
67
|
+
must be provided.
|
|
68
|
+
:param int limit: Number of results to be returned.
|
|
69
|
+
:param int skip: Number of results to skip.
|
|
70
|
+
:param bool count: Get the total number of results matching the query.
|
|
71
|
+
Deactivated by default.
|
|
72
|
+
:param str name: Study name.
|
|
73
|
+
:param str id: Study ID.
|
|
74
|
+
:param str alias: Study alias.
|
|
75
|
+
:param str fqn: Study full qualified name.
|
|
76
|
+
:param str creation_date: Creation date. Format: yyyyMMddHHmmss.
|
|
77
|
+
Examples: >2018, 2017-2018, <201805.
|
|
78
|
+
:param str modification_date: Modification date. Format:
|
|
79
|
+
yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
|
|
80
|
+
:param str internal_status: Filter by internal status.
|
|
81
|
+
:param str status: Filter by status.
|
|
82
|
+
:param str attributes: Attributes.
|
|
83
|
+
:param str release: Release value.
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
options['project'] = project
|
|
87
|
+
return self._get(category='studies', resource='search', **options)
|
|
88
|
+
|
|
89
|
+
def acl(self, studies, **options):
|
|
90
|
+
"""
|
|
91
|
+
Return the acl of the study. If member is provided, it will only
|
|
92
|
+
return the acl for the member.
|
|
93
|
+
PATH: /{apiVersion}/studies/{studies}/acl
|
|
94
|
+
|
|
95
|
+
:param str studies: Comma separated list of Studies
|
|
96
|
+
[[organization@]project:]study where study and project can be
|
|
97
|
+
either the ID or UUID up to a maximum of 100. (REQUIRED)
|
|
98
|
+
:param str member: User or group id.
|
|
99
|
+
:param bool silent: Boolean to retrieve all possible entries that are
|
|
100
|
+
queried for, false to raise an exception whenever one of the
|
|
101
|
+
entries looked for cannot be shown for whichever reason.
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
return self._get(category='studies', resource='acl', query_id=studies, **options)
|
|
105
|
+
|
|
106
|
+
def info(self, studies, **options):
|
|
107
|
+
"""
|
|
108
|
+
Fetch study information.
|
|
109
|
+
PATH: /{apiVersion}/studies/{studies}/info
|
|
110
|
+
|
|
111
|
+
:param str studies: Comma separated list of Studies
|
|
112
|
+
[[organization@]project:]study where study and project can be
|
|
113
|
+
either the ID or UUID up to a maximum of 100. (REQUIRED)
|
|
114
|
+
:param str include: Fields included in the response, whole JSON path
|
|
115
|
+
must be provided.
|
|
116
|
+
:param str exclude: Fields excluded in the response, whole JSON path
|
|
117
|
+
must be provided.
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
return self._get(category='studies', resource='info', query_id=studies, **options)
|
|
121
|
+
|
|
122
|
+
def search_audit(self, study, **options):
|
|
123
|
+
"""
|
|
124
|
+
Search audit collection.
|
|
125
|
+
PATH: /{apiVersion}/studies/{study}/audit/search
|
|
126
|
+
|
|
127
|
+
:param str study: Study ID. (REQUIRED)
|
|
128
|
+
:param str include: Fields included in the response, whole JSON path
|
|
129
|
+
must be provided.
|
|
130
|
+
:param str exclude: Fields excluded in the response, whole JSON path
|
|
131
|
+
must be provided.
|
|
132
|
+
:param int limit: Number of results to be returned.
|
|
133
|
+
:param int skip: Number of results to skip.
|
|
134
|
+
:param bool count: Get the total number of results matching the query.
|
|
135
|
+
Deactivated by default.
|
|
136
|
+
:param str operation_id: Audit operation UUID.
|
|
137
|
+
:param str user_id: User ID.
|
|
138
|
+
:param str action: Action performed by the user.
|
|
139
|
+
:param str resource: Resource involved. Allowed values: ['AUDIT NOTE
|
|
140
|
+
ORGANIZATION USER PROJECT STUDY FILE SAMPLE JOB INDIVIDUAL COHORT
|
|
141
|
+
DISEASE_PANEL FAMILY CLINICAL_ANALYSIS INTERPRETATION VARIANT
|
|
142
|
+
ALIGNMENT CLINICAL EXPRESSION RGA FUNCTIONAL EXTERNAL_TOOL
|
|
143
|
+
RESOURCE']
|
|
144
|
+
:param str resource_id: Resource ID.
|
|
145
|
+
:param str resource_uuid: resource UUID.
|
|
146
|
+
:param str status: Filter by status. Allowed values: ['SUCCESS ERROR']
|
|
147
|
+
:param str date: Date. Format: yyyyMMddHHmmss. Examples: >2018,
|
|
148
|
+
2017-2018, <201805.
|
|
149
|
+
"""
|
|
150
|
+
|
|
151
|
+
return self._get(category='studies', resource='search', query_id=study, subcategory='audit', **options)
|
|
152
|
+
|
|
153
|
+
def groups(self, study, **options):
|
|
154
|
+
"""
|
|
155
|
+
Return the groups present in the study. For owners and administrators
|
|
156
|
+
only.
|
|
157
|
+
PATH: /{apiVersion}/studies/{study}/groups
|
|
158
|
+
|
|
159
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
160
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
161
|
+
:param str id: Group id. If provided, it will only fetch information
|
|
162
|
+
for the provided group.
|
|
163
|
+
:param bool silent: Boolean to retrieve all possible entries that are
|
|
164
|
+
queried for, false to raise an exception whenever one of the
|
|
165
|
+
entries looked for cannot be shown for whichever reason.
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
return self._get(category='studies', resource='groups', query_id=study, **options)
|
|
169
|
+
|
|
170
|
+
def sync_groups(self, study, data=None, **options):
|
|
171
|
+
"""
|
|
172
|
+
Associate a remote group from an authentication origin with a local
|
|
173
|
+
group in a study.
|
|
174
|
+
PATH: /{apiVersion}/studies/{study}/groups/sync
|
|
175
|
+
|
|
176
|
+
:param dict data: JSON containing the parameters. (REQUIRED)
|
|
177
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
178
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
179
|
+
"""
|
|
180
|
+
|
|
181
|
+
return self._post(category='studies', resource='sync', query_id=study, subcategory='groups', data=data, **options)
|
|
182
|
+
|
|
183
|
+
def update_groups(self, study, data=None, **options):
|
|
184
|
+
"""
|
|
185
|
+
Add or remove a group.
|
|
186
|
+
PATH: /{apiVersion}/studies/{study}/groups/update
|
|
187
|
+
|
|
188
|
+
:param dict data: JSON containing the parameters. (REQUIRED)
|
|
189
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
190
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
191
|
+
:param str action: Action to be performed: ADD or REMOVE a group.
|
|
192
|
+
Allowed values: ['ADD REMOVE']
|
|
193
|
+
"""
|
|
194
|
+
|
|
195
|
+
return self._post(category='studies', resource='update', query_id=study, subcategory='groups', data=data, **options)
|
|
196
|
+
|
|
197
|
+
def update_groups_users(self, study, group, data=None, **options):
|
|
198
|
+
"""
|
|
199
|
+
Add, set or remove users from an existing group.
|
|
200
|
+
PATH: /{apiVersion}/studies/{study}/groups/{group}/users/update
|
|
201
|
+
|
|
202
|
+
:param dict data: JSON containing the parameters. (REQUIRED)
|
|
203
|
+
:param str group: Group name. (REQUIRED)
|
|
204
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
205
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
206
|
+
:param str action: Action to be performed: ADD, SET or REMOVE users
|
|
207
|
+
to/from a group. Allowed values: ['ADD SET REMOVE']
|
|
208
|
+
"""
|
|
209
|
+
|
|
210
|
+
return self._post(category='studies', resource='users/update', query_id=study, subcategory='groups', second_query_id=group, data=data, **options)
|
|
211
|
+
|
|
212
|
+
def create_notes(self, study, data=None, **options):
|
|
213
|
+
"""
|
|
214
|
+
Create a new note.
|
|
215
|
+
PATH: /{apiVersion}/studies/{study}/notes/create
|
|
216
|
+
|
|
217
|
+
:param dict data: JSON containing the Note to be added. (REQUIRED)
|
|
218
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
219
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
220
|
+
:param str include: Fields included in the response, whole JSON path
|
|
221
|
+
must be provided.
|
|
222
|
+
:param str exclude: Fields excluded in the response, whole JSON path
|
|
223
|
+
must be provided.
|
|
224
|
+
:param bool include_result: Flag indicating to include the created or
|
|
225
|
+
updated document result in the response.
|
|
226
|
+
"""
|
|
227
|
+
|
|
228
|
+
return self._post(category='studies', resource='create', query_id=study, subcategory='notes', data=data, **options)
|
|
229
|
+
|
|
230
|
+
def search_notes(self, study, **options):
|
|
231
|
+
"""
|
|
232
|
+
Search for notes of scope STUDY.
|
|
233
|
+
PATH: /{apiVersion}/studies/{study}/notes/search
|
|
234
|
+
|
|
235
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
236
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
237
|
+
:param str include: Fields included in the response, whole JSON path
|
|
238
|
+
must be provided.
|
|
239
|
+
:param str exclude: Fields excluded in the response, whole JSON path
|
|
240
|
+
must be provided.
|
|
241
|
+
:param str creation_date: Creation date. Format: yyyyMMddHHmmss.
|
|
242
|
+
Examples: >2018, 2017-2018, <201805.
|
|
243
|
+
:param str modification_date: Modification date. Format:
|
|
244
|
+
yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
|
|
245
|
+
:param str id: Note unique identifier.
|
|
246
|
+
:param str type: Note type.
|
|
247
|
+
:param str uuid: Unique 32-character identifier assigned automatically
|
|
248
|
+
by OpenCGA.
|
|
249
|
+
:param str user_id: User that wrote that Note.
|
|
250
|
+
:param str tags: Note tags.
|
|
251
|
+
:param str visibility: Visibility of the Note.
|
|
252
|
+
:param str version: Autoincremental version assigned to the registered
|
|
253
|
+
entry. By default, updates does not create new versions. To enable
|
|
254
|
+
versioning, users must set the `incVersion` flag from the /update
|
|
255
|
+
web service when updating the document.
|
|
256
|
+
"""
|
|
257
|
+
|
|
258
|
+
return self._get(category='studies', resource='search', query_id=study, subcategory='notes', **options)
|
|
259
|
+
|
|
260
|
+
def delete_notes(self, study, id, **options):
|
|
261
|
+
"""
|
|
262
|
+
Delete note.
|
|
263
|
+
PATH: /{apiVersion}/studies/{study}/notes/{id}/delete
|
|
264
|
+
|
|
265
|
+
:param str id: Note unique identifier. (REQUIRED)
|
|
266
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
267
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
268
|
+
:param bool include_result: Flag indicating to include the created or
|
|
269
|
+
updated document result in the response.
|
|
270
|
+
"""
|
|
271
|
+
|
|
272
|
+
return self._delete(category='studies', resource='delete', query_id=study, subcategory='notes', second_query_id=id, **options)
|
|
273
|
+
|
|
274
|
+
def update_notes(self, study, id, data=None, **options):
|
|
275
|
+
"""
|
|
276
|
+
Update a note.
|
|
277
|
+
PATH: /{apiVersion}/studies/{study}/notes/{id}/update
|
|
278
|
+
|
|
279
|
+
:param dict data: JSON containing the Note fields to be updated.
|
|
280
|
+
(REQUIRED)
|
|
281
|
+
:param str id: Note unique identifier. (REQUIRED)
|
|
282
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
283
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
284
|
+
:param str include: Fields included in the response, whole JSON path
|
|
285
|
+
must be provided.
|
|
286
|
+
:param str exclude: Fields excluded in the response, whole JSON path
|
|
287
|
+
must be provided.
|
|
288
|
+
:param str tags_action: Action to be performed if the array of tags is
|
|
289
|
+
being updated. Allowed values: ['ADD SET REMOVE']
|
|
290
|
+
:param bool include_result: Flag indicating to include the created or
|
|
291
|
+
updated document result in the response.
|
|
292
|
+
"""
|
|
293
|
+
|
|
294
|
+
return self._post(category='studies', resource='update', query_id=study, subcategory='notes', second_query_id=id, data=data, **options)
|
|
295
|
+
|
|
296
|
+
def permission_rules(self, study, entity, **options):
|
|
297
|
+
"""
|
|
298
|
+
Fetch permission rules.
|
|
299
|
+
PATH: /{apiVersion}/studies/{study}/permissionRules
|
|
300
|
+
|
|
301
|
+
:param str entity: Entity where the permission rules should be applied
|
|
302
|
+
to. Allowed values: ['SAMPLES FILES COHORTS INDIVIDUALS FAMILIES
|
|
303
|
+
JOBS CLINICAL_ANALYSES DISEASE_PANELS'] (REQUIRED)
|
|
304
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
305
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
306
|
+
"""
|
|
307
|
+
|
|
308
|
+
options['entity'] = entity
|
|
309
|
+
return self._get(category='studies', resource='permissionRules', query_id=study, **options)
|
|
310
|
+
|
|
311
|
+
def update_permission_rules(self, study, entity, data=None, **options):
|
|
312
|
+
"""
|
|
313
|
+
Add or remove a permission rule.
|
|
314
|
+
PATH: /{apiVersion}/studies/{study}/permissionRules/update
|
|
315
|
+
|
|
316
|
+
:param dict data: JSON containing the permission rule to be created or
|
|
317
|
+
removed. (REQUIRED)
|
|
318
|
+
:param str entity: Entity where the permission rules should be applied
|
|
319
|
+
to. Allowed values: ['SAMPLES FILES COHORTS INDIVIDUALS FAMILIES
|
|
320
|
+
JOBS CLINICAL_ANALYSES DISEASE_PANELS'] (REQUIRED)
|
|
321
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
322
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
323
|
+
:param str action: Action to be performed: ADD to add a new permission
|
|
324
|
+
rule; REMOVE to remove all permissions assigned by an existing
|
|
325
|
+
permission rule (even if it overlaps any manual permission); REVERT
|
|
326
|
+
to remove all permissions assigned by an existing permission rule
|
|
327
|
+
(keep manual overlaps); NONE to remove an existing permission rule
|
|
328
|
+
without removing any permissions that could have been assigned
|
|
329
|
+
already by the permission rule. Allowed values: ['ADD REMOVE REVERT
|
|
330
|
+
NONE']
|
|
331
|
+
"""
|
|
332
|
+
|
|
333
|
+
options['entity'] = entity
|
|
334
|
+
return self._post(category='studies', resource='update', query_id=study, subcategory='permissionRules', data=data, **options)
|
|
335
|
+
|
|
336
|
+
def run_templates(self, study, data=None, **options):
|
|
337
|
+
"""
|
|
338
|
+
Execute template.
|
|
339
|
+
PATH: /{apiVersion}/studies/{study}/templates/run
|
|
340
|
+
|
|
341
|
+
:param dict data: Template loader parameters. (REQUIRED)
|
|
342
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
343
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
344
|
+
:param str job_id: Job ID. It must be a unique string within the
|
|
345
|
+
study. An ID will be autogenerated automatically if not provided.
|
|
346
|
+
:param str job_depends_on: Comma separated list of existing job IDs
|
|
347
|
+
the job will depend on.
|
|
348
|
+
:param str job_description: Job description.
|
|
349
|
+
:param str job_tags: Job tags.
|
|
350
|
+
:param str job_scheduled_start_time: Time when the job is scheduled to
|
|
351
|
+
start.
|
|
352
|
+
:param str job_priority: Priority of the job.
|
|
353
|
+
:param bool job_dry_run: Flag indicating that the job will be executed
|
|
354
|
+
in dry-run mode. In this mode, OpenCGA will validate that all
|
|
355
|
+
parameters and prerequisites are correctly set for successful
|
|
356
|
+
execution, but the job will not actually run.
|
|
357
|
+
"""
|
|
358
|
+
|
|
359
|
+
return self._post(category='studies', resource='run', query_id=study, subcategory='templates', data=data, **options)
|
|
360
|
+
|
|
361
|
+
def upload_templates(self, study, **options):
|
|
362
|
+
"""
|
|
363
|
+
Resource to upload a zipped template.
|
|
364
|
+
PATH: /{apiVersion}/studies/{study}/templates/upload
|
|
365
|
+
|
|
366
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
367
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
368
|
+
:param inputstream file: File to upload.
|
|
369
|
+
"""
|
|
370
|
+
|
|
371
|
+
return self._post(category='studies', resource='upload', query_id=study, subcategory='templates', **options)
|
|
372
|
+
|
|
373
|
+
def delete_templates(self, study, template_id, **options):
|
|
374
|
+
"""
|
|
375
|
+
Delete template.
|
|
376
|
+
PATH: /{apiVersion}/studies/{study}/templates/{templateId}/delete
|
|
377
|
+
|
|
378
|
+
:param str template_id: Template id. (REQUIRED)
|
|
379
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
380
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
381
|
+
"""
|
|
382
|
+
|
|
383
|
+
return self._delete(category='studies', resource='delete', query_id=study, subcategory='templates', second_query_id=template_id, **options)
|
|
384
|
+
|
|
385
|
+
def update(self, study, data=None, **options):
|
|
386
|
+
"""
|
|
387
|
+
Update some study attributes.
|
|
388
|
+
PATH: /{apiVersion}/studies/{study}/update
|
|
389
|
+
|
|
390
|
+
:param dict data: JSON containing the params to be updated. (REQUIRED)
|
|
391
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
392
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
393
|
+
:param str include: Fields included in the response, whole JSON path
|
|
394
|
+
must be provided.
|
|
395
|
+
:param str exclude: Fields excluded in the response, whole JSON path
|
|
396
|
+
must be provided.
|
|
397
|
+
:param bool include_result: Flag indicating to include the created or
|
|
398
|
+
updated document result in the response.
|
|
399
|
+
"""
|
|
400
|
+
|
|
401
|
+
return self._post(category='studies', resource='update', query_id=study, data=data, **options)
|
|
402
|
+
|
|
403
|
+
def sync_users(self, study, authentication_origin_id, **options):
|
|
404
|
+
"""
|
|
405
|
+
Synchronize all users from the remote groups of a given authentication
|
|
406
|
+
origin.
|
|
407
|
+
PATH: /{apiVersion}/studies/{study}/users/sync
|
|
408
|
+
|
|
409
|
+
:param str authentication_origin_id: Authentication origin ID.
|
|
410
|
+
(REQUIRED)
|
|
411
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
412
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
413
|
+
"""
|
|
414
|
+
|
|
415
|
+
options['authenticationOriginId'] = authentication_origin_id
|
|
416
|
+
return self._post(category='studies', resource='sync', query_id=study, subcategory='users', **options)
|
|
417
|
+
|
|
418
|
+
def variable_sets(self, study, **options):
|
|
419
|
+
"""
|
|
420
|
+
Fetch variableSets from a study.
|
|
421
|
+
PATH: /{apiVersion}/studies/{study}/variableSets
|
|
422
|
+
|
|
423
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
424
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
425
|
+
:param str id: Id of the variableSet to be retrieved. If no id is
|
|
426
|
+
passed, it will show all the variableSets of the study.
|
|
427
|
+
"""
|
|
428
|
+
|
|
429
|
+
return self._get(category='studies', resource='variableSets', query_id=study, **options)
|
|
430
|
+
|
|
431
|
+
def update_variable_sets(self, study, data=None, **options):
|
|
432
|
+
"""
|
|
433
|
+
Add or remove a variableSet.
|
|
434
|
+
PATH: /{apiVersion}/studies/{study}/variableSets/update
|
|
435
|
+
|
|
436
|
+
:param dict data: JSON containing the VariableSet to be created or
|
|
437
|
+
removed. (REQUIRED)
|
|
438
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
439
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
440
|
+
:param str action: Action to be performed: ADD, REMOVE or FORCE_REMOVE
|
|
441
|
+
a variableSet. Allowed values: ['ADD REMOVE FORCE_REMOVE']
|
|
442
|
+
"""
|
|
443
|
+
|
|
444
|
+
return self._post(category='studies', resource='update', query_id=study, subcategory='variableSets', data=data, **options)
|
|
445
|
+
|
|
446
|
+
def update_variable_sets_variables(self, study, variable_set, data=None, **options):
|
|
447
|
+
"""
|
|
448
|
+
Add or remove variables to a VariableSet.
|
|
449
|
+
PATH: /{apiVersion}/studies/{study}/variableSets/{variableSet}/variables/update
|
|
450
|
+
|
|
451
|
+
:param dict data: JSON containing the variable to be added or removed.
|
|
452
|
+
For removing, only the variable id will be needed. (REQUIRED)
|
|
453
|
+
:param str variable_set: VariableSet id of the VariableSet to be
|
|
454
|
+
updated. (REQUIRED)
|
|
455
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
456
|
+
project can be either the ID or UUID. (REQUIRED)
|
|
457
|
+
:param str action: Action to be performed: ADD or REMOVE a variable.
|
|
458
|
+
Allowed values: ['ADD REMOVE']
|
|
459
|
+
"""
|
|
460
|
+
|
|
461
|
+
return self._post(category='studies', resource='variables/update', query_id=study, subcategory='variableSets', second_query_id=variable_set, data=data, **options)
|
|
462
|
+
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"""
|
|
2
|
+
WARNING: AUTOGENERATED CODE
|
|
3
|
+
|
|
4
|
+
This code was generated by a tool.
|
|
5
|
+
|
|
6
|
+
Manual changes to this file may cause unexpected behavior in your application.
|
|
7
|
+
Manual changes to this file will be overwritten if the code is regenerated.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from pyxetabase.rest_clients._parent_rest_clients import _ParentRestClient
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class User(_ParentRestClient):
|
|
14
|
+
"""
|
|
15
|
+
This class contains methods for the 'Users' webservices
|
|
16
|
+
PATH: /{apiVersion}/users
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(self, configuration, token=None, login_handler=None, *args, **kwargs):
|
|
20
|
+
super(User, self).__init__(configuration, token, login_handler, *args, **kwargs)
|
|
21
|
+
|
|
22
|
+
def anonymous(self, organization, **options):
|
|
23
|
+
"""
|
|
24
|
+
Get an anonymous token to gain access to the system.
|
|
25
|
+
PATH: /{apiVersion}/users/anonymous
|
|
26
|
+
|
|
27
|
+
:param str organization: Organization id. (REQUIRED)
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
options['organization'] = organization
|
|
31
|
+
return self._post(category='users', resource='anonymous', **options)
|
|
32
|
+
|
|
33
|
+
def create(self, data=None, **options):
|
|
34
|
+
"""
|
|
35
|
+
Create a new user.
|
|
36
|
+
PATH: /{apiVersion}/users/create
|
|
37
|
+
|
|
38
|
+
:param dict data: JSON containing the parameters. (REQUIRED)
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
return self._post(category='users', resource='create', data=data, **options)
|
|
42
|
+
|
|
43
|
+
def login(self, data=None, **options):
|
|
44
|
+
"""
|
|
45
|
+
Get identified and gain access to the system.
|
|
46
|
+
PATH: /{apiVersion}/users/login
|
|
47
|
+
|
|
48
|
+
:param dict data: JSON containing the authentication parameters.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
return self._post(category='users', resource='login', data=data, **options)
|
|
52
|
+
|
|
53
|
+
def password(self, data=None, **options):
|
|
54
|
+
"""
|
|
55
|
+
Change the password of a user.
|
|
56
|
+
PATH: /{apiVersion}/users/password
|
|
57
|
+
|
|
58
|
+
:param dict data: JSON containing the change of password parameters.
|
|
59
|
+
(REQUIRED)
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
return self._post(category='users', resource='password', data=data, **options)
|
|
63
|
+
|
|
64
|
+
def search(self, **options):
|
|
65
|
+
"""
|
|
66
|
+
User search method.
|
|
67
|
+
PATH: /{apiVersion}/users/search
|
|
68
|
+
|
|
69
|
+
:param str include: Fields included in the response, whole JSON path
|
|
70
|
+
must be provided.
|
|
71
|
+
:param str exclude: Fields excluded in the response, whole JSON path
|
|
72
|
+
must be provided.
|
|
73
|
+
:param int limit: Number of results to be returned.
|
|
74
|
+
:param int skip: Number of results to skip.
|
|
75
|
+
:param bool count: Get the total number of results matching the query.
|
|
76
|
+
Deactivated by default.
|
|
77
|
+
:param str organization: Organization id.
|
|
78
|
+
:param str id: Comma separated list user IDs up to a maximum of 100.
|
|
79
|
+
Also admits basic regular expressions using the operator '~', i.e.
|
|
80
|
+
'~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for
|
|
81
|
+
case insensitive search.
|
|
82
|
+
:param str authentication_id: Authentication origin ID.
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
return self._get(category='users', resource='search', **options)
|
|
86
|
+
|
|
87
|
+
def login_sso(self, **options):
|
|
88
|
+
"""
|
|
89
|
+
Single Sign On.
|
|
90
|
+
PATH: /{apiVersion}/users/sso/login
|
|
91
|
+
|
|
92
|
+
:param str url: Callback URL.
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
return self._get(category='users', resource='login', subcategory='sso', **options)
|
|
96
|
+
|
|
97
|
+
def logout_sso(self, **options):
|
|
98
|
+
"""
|
|
99
|
+
Logout from Single Sign On.
|
|
100
|
+
PATH: /{apiVersion}/users/sso/logout
|
|
101
|
+
|
|
102
|
+
:param str url: Callback URL.
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
return self._get(category='users', resource='logout', subcategory='sso', **options)
|
|
106
|
+
|
|
107
|
+
def info(self, users, **options):
|
|
108
|
+
"""
|
|
109
|
+
Return the user information including its projects and studies.
|
|
110
|
+
PATH: /{apiVersion}/users/{users}/info
|
|
111
|
+
|
|
112
|
+
:param str users: Comma separated list of user IDs. (REQUIRED)
|
|
113
|
+
:param str include: Fields included in the response, whole JSON path
|
|
114
|
+
must be provided.
|
|
115
|
+
:param str exclude: Fields excluded in the response, whole JSON path
|
|
116
|
+
must be provided.
|
|
117
|
+
:param str organization: Organization id.
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
return self._get(category='users', resource='info', query_id=users, **options)
|
|
121
|
+
|
|
122
|
+
def configs(self, user, **options):
|
|
123
|
+
"""
|
|
124
|
+
Fetch a user configuration.
|
|
125
|
+
PATH: /{apiVersion}/users/{user}/configs
|
|
126
|
+
|
|
127
|
+
:param str user: User ID. (REQUIRED)
|
|
128
|
+
:param str name: Unique name (typically the name of the application).
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
return self._get(category='users', resource='configs', query_id=user, **options)
|
|
132
|
+
|
|
133
|
+
def update_configs(self, user, data=None, **options):
|
|
134
|
+
"""
|
|
135
|
+
Add or remove a custom user configuration.
|
|
136
|
+
PATH: /{apiVersion}/users/{user}/configs/update
|
|
137
|
+
|
|
138
|
+
:param dict data: JSON containing anything useful for the application
|
|
139
|
+
such as user or default preferences. When removing, only the id
|
|
140
|
+
will be necessary. (REQUIRED)
|
|
141
|
+
:param str user: User ID. (REQUIRED)
|
|
142
|
+
:param str action: Action to be performed: ADD or REMOVE a group.
|
|
143
|
+
Allowed values: ['ADD REMOVE']
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
return self._post(category='users', resource='update', query_id=user, subcategory='configs', data=data, **options)
|
|
147
|
+
|
|
148
|
+
def filters(self, user, **options):
|
|
149
|
+
"""
|
|
150
|
+
Fetch user filters.
|
|
151
|
+
PATH: /{apiVersion}/users/{user}/filters
|
|
152
|
+
|
|
153
|
+
:param str user: User ID. (REQUIRED)
|
|
154
|
+
:param str id: Filter id. If provided, it will only fetch the
|
|
155
|
+
specified filter.
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
return self._get(category='users', resource='filters', query_id=user, **options)
|
|
159
|
+
|
|
160
|
+
def update_filters(self, user, data=None, **options):
|
|
161
|
+
"""
|
|
162
|
+
Add or remove a custom user filter.
|
|
163
|
+
PATH: /{apiVersion}/users/{user}/filters/update
|
|
164
|
+
|
|
165
|
+
:param dict data: Filter parameters. When removing, only the 'name' of
|
|
166
|
+
the filter will be necessary. (REQUIRED)
|
|
167
|
+
:param str user: User ID. (REQUIRED)
|
|
168
|
+
:param str action: Action to be performed: ADD or REMOVE a group.
|
|
169
|
+
Allowed values: ['ADD REMOVE']
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
return self._post(category='users', resource='update', query_id=user, subcategory='filters', data=data, **options)
|
|
173
|
+
|
|
174
|
+
def update_filter(self, user, filter_id, data=None, **options):
|
|
175
|
+
"""
|
|
176
|
+
Update a custom filter.
|
|
177
|
+
PATH: /{apiVersion}/users/{user}/filters/{filterId}/update
|
|
178
|
+
|
|
179
|
+
:param dict data: Filter parameters. (REQUIRED)
|
|
180
|
+
:param str filter_id: Filter id. (REQUIRED)
|
|
181
|
+
:param str user: User ID. (REQUIRED)
|
|
182
|
+
"""
|
|
183
|
+
|
|
184
|
+
return self._post(category='users', resource='update', query_id=user, subcategory='filters', second_query_id=filter_id, data=data, **options)
|
|
185
|
+
|
|
186
|
+
def reset_password(self, user, **options):
|
|
187
|
+
"""
|
|
188
|
+
[DEPRECATED].
|
|
189
|
+
PATH: /{apiVersion}/users/{user}/password/reset
|
|
190
|
+
|
|
191
|
+
:param str user: User ID. (REQUIRED)
|
|
192
|
+
"""
|
|
193
|
+
|
|
194
|
+
return self._get(category='users', resource='reset', query_id=user, subcategory='password', **options)
|
|
195
|
+
|
|
196
|
+
def update(self, user, data=None, **options):
|
|
197
|
+
"""
|
|
198
|
+
Update some user attributes.
|
|
199
|
+
PATH: /{apiVersion}/users/{user}/update
|
|
200
|
+
|
|
201
|
+
:param dict data: JSON containing the params to be updated. (REQUIRED)
|
|
202
|
+
:param str user: User ID. (REQUIRED)
|
|
203
|
+
:param str include: Fields included in the response, whole JSON path
|
|
204
|
+
must be provided.
|
|
205
|
+
:param str exclude: Fields excluded in the response, whole JSON path
|
|
206
|
+
must be provided.
|
|
207
|
+
:param bool include_result: Flag indicating to include the created or
|
|
208
|
+
updated document result in the response.
|
|
209
|
+
"""
|
|
210
|
+
|
|
211
|
+
return self._post(category='users', resource='update', query_id=user, data=data, **options)
|
|
212
|
+
|