All URIs are relative to https://localhost
| Method | HTTP request | Description |
|---|---|---|
| create_project | POST /core/projects | Add a project |
| delete_project | DELETE /core/projects/{uri} | Delete a project |
| get_project | GET /core/projects/{uri} | Get a project |
| get_projects_by_uri | GET /core/projects/by_uris | Get projects by their URIs |
| search_projects | GET /core/projects | Search projects |
| update_project | PUT /core/projects | Update a project |
str create_project(authorization, body=body, accept_language=accept_language)
Add a project
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.ProjectsApi(pythonClient)
body = opensilexClientToolsPython.ProjectCreationDTO() # ProjectCreationDTO | Project description (optional)
try:
# Add a project
api_response = api_instance.create_project(body=body, )
pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling ProjectsApi->create_project: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| body | ProjectCreationDTO | Project description | [optional] |
str
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str delete_project(uri, authorization, accept_language=accept_language)
Delete a project
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.ProjectsApi(pythonClient)
uri = 'http://opensilex/set/project/BW1' # str | Project URI
try:
# Delete a project
api_response = api_instance.delete_project(uri, )
pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling ProjectsApi->delete_project: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| uri | str | Project URI |
str
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ProjectGetDetailDTO get_project(uri, authorization, accept_language=accept_language)
Get a project
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.ProjectsApi(pythonClient)
uri = 'http://example.com/' # str | Project URI
try:
# Get a project
api_response = api_instance.get_project(uri, )
pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling ProjectsApi->get_project: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| uri | str | Project URI |
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[ProjectGetDTO] get_projects_by_uri(uris, authorization, accept_language=accept_language)
Get projects by their URIs
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.ProjectsApi(pythonClient)
uris = ['uris_example'] # list[str] | Projects URIs
try:
# Get projects by their URIs
api_response = api_instance.get_projects_by_uri(uris, )
pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling ProjectsApi->get_projects_by_uri: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| uris | list[str] | Projects URIs |
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[ProjectGetDTO] search_projects(authorization, name=name, year=year, keyword=keyword, financial_funding=financial_funding, order_by=order_by, page=page, page_size=page_size, accept_language=accept_language)
Search projects
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.ProjectsApi(pythonClient)
name = 'PJ17' # str | Regex pattern for filtering by name or shortname (optional)
year = 2017 # int | Search by year (optional)
keyword = 'climate' # str | Regex pattern for filtering on description or objective (optional)
financial_funding = 'ANR' # str | Regex pattern for filtering by financial funding (optional)
order_by = ['uri=asc'] # list[str] | List of fields to sort as an array of fieldName=asc|desc (optional)
page = 0 # int | Page number (optional) (default to 0)
page_size = 20 # int | Page size (optional) (default to 20)
try:
# Search projects
api_response = api_instance.search_projects(name=name, year=year, keyword=keyword, financial_funding=financial_funding, order_by=order_by, page=page, page_size=page_size, )
pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling ProjectsApi->search_projects: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Regex pattern for filtering by name or shortname | [optional] |
| year | int | Search by year | [optional] |
| keyword | str | Regex pattern for filtering on description or objective | [optional] |
| financial_funding | str | Regex pattern for filtering by financial funding | [optional] |
| order_by | list[str] | List of fields to sort as an array of fieldName=asc | desc |
| page | int | Page number | [optional] [default to 0] |
| page_size | int | Page size | [optional] [default to 20] |
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str update_project(authorization, body=body, accept_language=accept_language)
Update a project
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.ProjectsApi(pythonClient)
body = opensilexClientToolsPython.ProjectCreationDTO() # ProjectCreationDTO | Project description (optional)
try:
# Update a project
api_response = api_instance.update_project(body=body, )
pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling ProjectsApi->update_project: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| body | ProjectCreationDTO | Project description | [optional] |
str
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]