OrganizationsApi class reference
All URIs are relative tohttp://localhost
Method | HTTP request | Description |
---|---|---|
create | POST /api/organizations | Create an organization |
destroy | DELETE /api/organizations/{id} | Delete an organization |
list | GET /api/organizations | List organizations |
partial_update | PATCH /api/organizations/{id} | Update an organization |
retrieve | GET /api/organizations/{id} | Get organization details |
create
create(organization_write_request,**kwargs)
Create an organization
Example
frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:organization_write_request=OrganizationWriteRequest(slug="z",name="name_example",description="description_example",contact={},)# OrganizationWriteRequest |try:(data,response)=api_client.organizations_api.create(organization_write_request,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling OrganizationsApi.create():%s\n"%e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
organization_write_request | OrganizationWriteRequest |
There are also optional kwargs that control the function invocation behavior.Read more here.
Returned values
Returned type:Tuple[OrganizationRead, urllib3.HTTPResponse]
.
Returns a tuple with 2 values:(parsed_response, raw_response)
.
The first value is a model parsed from the response data.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.
Authentication
basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: application/json
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | - |
destroy
destroy(id,**kwargs)
Delete an organization
Example
frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this organization.try:api_client.organizations_api.destroy(id,)exceptexceptions.ApiExceptionase:print("Exception when calling OrganizationsApi.destroy():%s\n"%e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this organization. |
There are also optional kwargs that control the function invocation behavior.Read more here.
Returned values
Returned type:Tuple[None, urllib3.HTTPResponse]
.
Returns a tuple with 2 values:(None, raw_response)
.
This endpoint does not have any return value, soNone
is always returned as the first value.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.
Authentication
basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
204 | The organization has been deleted | - |
list
list(filter=None,name=None,owner=None,page=None,page_size=None,search=None,slug=None,sort=None,**kwargs)
List organizations
Example
frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:filter="filter_example"# str | JSON Logic filter. This filter can be used to perform complex filtering by grouping rules. For example, using such a filter you can get all resources created by you: - {\"and\":[{\"==\":[{\"var\":\"owner\"},\"<user>\"]}]} Details about the syntax used can be found at the link: https://jsonlogic.com/ Available filter_fields: ['name', 'owner', 'slug', 'id']. (optional)name="name_example"# str | A simple equality filter for the name field (optional)owner="owner_example"# str | A simple equality filter for the owner field (optional)page=1# int | A page number within the paginated result set. (optional)page_size=1# int | Number of results to return per page. (optional)search="search_example"# str | A search term. Available search_fields: ('name', 'owner', 'slug') (optional)slug="slug_example"# str | A simple equality filter for the slug field (optional)sort="sort_example"# str | Which field to use when ordering the results. Available ordering_fields: ['name', 'owner', 'slug', 'id'] (optional)try:(data,response)=api_client.organizations_api.list(filter=filter,name=name,owner=owner,page=page,page_size=page_size,search=search,slug=slug,sort=sort,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling OrganizationsApi.list():%s\n"%e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
filter | str | JSON Logic filter. This filter can be used to perform complex filtering by grouping rules. For example, using such a filter you can get all resources created by you: - {"and":[{"==":[{"var":"owner"}," | [optional] |
name | str | A simple equality filter for the name field | [optional] |
owner | str | A simple equality filter for the owner field | [optional] |
page | int | A page number within the paginated result set. | [optional] |
page_size | int | Number of results to return per page. | [optional] |
search | str | A search term. Available search_fields: (’name’, ‘owner’, ‘slug’) | [optional] |
slug | str | A simple equality filter for the slug field | [optional] |
sort | str | Which field to use when ordering the results. Available ordering_fields: [’name’, ‘owner’, ‘slug’, ‘id’] | [optional] |
There are also optional kwargs that control the function invocation behavior.Read more here.
Returned values
Returned type:Tuple[PaginatedOrganizationReadList, urllib3.HTTPResponse]
.
Returns a tuple with 2 values:(parsed_response, raw_response)
.
The first value is a model parsed from the response data.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.
Authentication
basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | - |
partial_update
partial_update(id,patched_organization_write_request=None,**kwargs)
Update an organization
Example
frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this organization.patched_organization_write_request=PatchedOrganizationWriteRequest(slug="z",name="name_example",description="description_example",contact={},)# PatchedOrganizationWriteRequest | (optional)try:(data,response)=api_client.organizations_api.partial_update(id,patched_organization_write_request=patched_organization_write_request,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling OrganizationsApi.partial_update():%s\n"%e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this organization. | |
patched_organization_write_request | PatchedOrganizationWriteRequest | [optional] |
There are also optional kwargs that control the function invocation behavior.Read more here.
Returned values
Returned type:Tuple[OrganizationRead, urllib3.HTTPResponse]
.
Returns a tuple with 2 values:(parsed_response, raw_response)
.
The first value is a model parsed from the response data.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.
Authentication
basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: application/json
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | - |
retrieve
retrieve(id,**kwargs)
Get organization details
Example
frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this organization.try:(data,response)=api_client.organizations_api.retrieve(id,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling OrganizationsApi.retrieve():%s\n"%e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this organization. |
There are also optional kwargs that control the function invocation behavior.Read more here.
Returned values
Returned type:Tuple[OrganizationRead, urllib3.HTTPResponse]
.
Returns a tuple with 2 values:(parsed_response, raw_response)
.
The first value is a model parsed from the response data.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.
Authentication
basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | - |