odm_api.GroupsApi¶
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| create_group | POST /api/v1/scim/Groups | Add a new user group |
| delete_group | DELETE /api/v1/scim/Groups/{id} | Delete a group |
| find_groups | GET /api/v1/scim/Groups | Retrieve a list of available groups |
| get_group | GET /api/v1/scim/Groups/{id} | Retrieve a group by id |
| patch_group | PATCH /api/v1/scim/Groups/{id} | Update a group |
create_group¶
CreateGroup201Response create_group(body)
Add a new user group
The endpoint creates a new user group in ODM. The endpoint does not update an existing group. A user who calls the endpoint is added to the group automatically with the "Group admin" role. The "members" attribute in the request body must be empty, otherwise the endpoint returns an error. The endpoint does not require any user permission. The endpoint does not check the uniqueness of the group name. The user can create any number of groups with the same name. If there are attributes in the request body that ODM does not support, then ODM ignores them.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.create_group201_response import CreateGroup201Response
from odm_api.models.create_group_request import CreateGroupRequest
from odm_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'
# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = odm_api.GroupsApi(api_client)
body = odm_api.CreateGroupRequest() # CreateGroupRequest |
try:
# Add a new user group
api_response = api_instance.create_group(body)
print("The response of GroupsApi->create_group:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling GroupsApi->create_group: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateGroupRequest |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: application/json
- Accept: application/scim+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 201 | The operation is successful. The response body contains the representation of the newly created group. | - |
| 400 | The object cannot be created, the supplied data or metadata are incorrect. See the error message for details. | - |
| 401 | User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). | - |
| 409 | The object cannot be created, data conflict. See the error message for details. | - |
| 500 | An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_group¶
delete_group(id)
Delete a group
The endpoint deletes a group in ODM. The group can be deleted, even if it has members: admins and not admins. Users of this group are not deactivated. Permissions to call the endpoint: - If the user does not have the "Manage groups" permission: the user has "Group admin" role - the user can delete the group; the user has "Group member" role - the group can not be deleted, an error is returned; * the user is not a member of the specified group - the group can not be deleted, an error is returned. - If the user has the "Manage groups" permission - the user can delete the group regardless of user’s membership in this group.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'
# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = odm_api.GroupsApi(api_client)
id = 'id_example' # str | String, unique identifier of the group in ODM.
try:
# Delete a group
api_instance.delete_group(id)
except Exception as e:
print("Exception when calling GroupsApi->delete_group: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | String, unique identifier of the group in ODM. |
Return type¶
void (empty response body)
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/scim+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 204 | The group has been successfully removed. No data is returned. | - |
| 400 | The supplied group ID is invalid. | - |
| 401 | User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). | - |
| 403 | Operation is not permitted. The \"Group admin\" role in the group or the \"Manage groups\" permission is required. | - |
| 404 | There are no groups with the specified id. | - |
| 500 | An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
find_groups¶
FilterGroupsResponse find_groups(filter=filter, excluded_attributes=excluded_attributes, start_index=start_index, count=count)
Retrieve a list of available groups
The endpoint returns a list of groups that the user has access to: where the user is a member of the group or if the user has the "Manage Groups" permission, then a list of all groups. The list can be filtered by group attributes using the filter parameter. If no filtering parameters are passed, then all available groups are returned. If there are no groups in the response body, the endpoint returns 200 OK.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.filter_groups_response import FilterGroupsResponse
from odm_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'
# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = odm_api.GroupsApi(api_client)
filter = 'filter_example' # str | Filter by group attributes. The parameter name is case-sensitive, therefore parameters FILTER, fiLter, and other options are ignored. Supported operators: eq - equal, the attribute and operator values must be identical for a match; Using other operators returns an error. Groups can be filtered by displayName only. Attribute names and attribute operators used in filters are case insensitive. Examples of the request: filter=displayName eq \"Curator\". (optional)
excluded_attributes = 'excluded_attributes_example' # str | If excludedAttributes=members is specified in the request, groups are returned without the members attribute. Other attributes are not supported in excludedAttributes parameter and ignored in the request → all attributes are returned in the response body. (optional)
start_index = 56 # int | The 1-based index of the first result in the current set of list results. (optional)
count = 56 # int | The number of resources returned in a list response page. The value by default is 100. (optional)
try:
# Retrieve a list of available groups
api_response = api_instance.find_groups(filter=filter, excluded_attributes=excluded_attributes, start_index=start_index, count=count)
print("The response of GroupsApi->find_groups:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling GroupsApi->find_groups: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| filter | str | Filter by group attributes. The parameter name is case-sensitive, therefore parameters FILTER, fiLter, and other options are ignored. Supported operators: eq - equal, the attribute and operator values must be identical for a match; Using other operators returns an error. Groups can be filtered by displayName only. Attribute names and attribute operators used in filters are case insensitive. Examples of the request: filter=displayName eq \"Curator\". | [optional] |
| excluded_attributes | str | If excludedAttributes=members is specified in the request, groups are returned without the members attribute. Other attributes are not supported in excludedAttributes parameter and ignored in the request → all attributes are returned in the response body. | [optional] |
| start_index | int | The 1-based index of the first result in the current set of list results. | [optional] |
| count | int | The number of resources returned in a list response page. The value by default is 100. | [optional] |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/scim+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | The request was successful. | - |
| 400 | Incorrect syntax in the request. See the error message for details. | - |
| 401 | User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). | - |
| 500 | An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_group¶
CreateGroup201Response get_group(id, excluded_attributes=excluded_attributes)
Retrieve a group by id
The endpoint returns a not deleted group by id, where id is an internal group id in ODM. Access to the group is required: - If the user has the "Manage groups" permission, the endpoint returns not deleted group on the instance regardless of user’s membership in this group; - If the user does not have the "Manage groups" permission, the endpoint returns only groups in which the user is a member. Otherwise, 404 Not Found is returned.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.create_group201_response import CreateGroup201Response
from odm_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'
# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = odm_api.GroupsApi(api_client)
id = 'id_example' # str | String, unique identifier of the group in ODM.
excluded_attributes = 'excluded_attributes_example' # str | If excludedAttributes=members is specified in the request, Groups are returned without the members attribute. Other attributes are not supported in excludedAttributes parameter and ignored in the request → all attributes are returned in the response body. (optional)
try:
# Retrieve a group by id
api_response = api_instance.get_group(id, excluded_attributes=excluded_attributes)
print("The response of GroupsApi->get_group:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling GroupsApi->get_group: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | String, unique identifier of the group in ODM. | |
| excluded_attributes | str | If excludedAttributes=members is specified in the request, Groups are returned without the members attribute. Other attributes are not supported in excludedAttributes parameter and ignored in the request → all attributes are returned in the response body. | [optional] |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/scim+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | The request was successful. | - |
| 400 | The supplied group ID is invalid. | - |
| 401 | User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). | - |
| 404 | There are no available groups with the specified id. | - |
| 500 | An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
patch_group¶
patch_group(id, body)
Update a group
The endpoint updates one or several attributes of a specific group, where id is internal group id in ODM. Also the endpoints adds a new user to the group and removes users from the group.
Supported operators in the request body: replace, add, remove. For details of the syntax of using these operators, we recommend that you refer to the SCIM 2.0 specification.
The list of group attributes that can be edited: displayName, externalId, members. If the user tries to edit other attributes, e.g. id, an error is returned. If the user tries to edit attributes that are not supported in the ODM group scheme, this attribute is ignored. If the request body includes only attributes that are not supported by ODM, the endpoint returns 200 OK.
A PATCH request, regardless of the number of operations, is treated as atomic. If a single operation encounters an error condition, the original user attributes are restored, and a failure status is returned.
The endpoint requires access to the group as admin of the group: the user has the "Admin group" role in the group or the user has the "Manage groups" permission.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.group_patch import GroupPatch
from odm_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'
# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = odm_api.GroupsApi(api_client)
id = 'id_example' # str | String, unique identifier of the group in ODM.
body = odm_api.GroupPatch() # GroupPatch |
try:
# Update a group
api_instance.patch_group(id, body)
except Exception as e:
print("Exception when calling GroupsApi->patch_group: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | String, unique identifier of the group in ODM. | |
| body | GroupPatch |
Return type¶
void (empty response body)
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: application/json
- Accept: application/scim+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 204 | Group is successfully updated. No data is returned | - |
| 400 | The object cannot be updated, the supplied data or metadata are incorrect. See the error message for details. | - |
| 401 | User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). | - |
| 403 | Operation is not permitted. The \"Group admin\" role in the group or the \"Manage groups\" permission is required. | - |
| 404 | There are no groups with the specified id. | - |
| 500 | An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]