Skip to content

Latest commit

 

History

History
338 lines (226 loc) · 10.5 KB

File metadata and controls

338 lines (226 loc) · 10.5 KB

opensilexClientToolsPython.ProjectsApi

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

create_project

str create_project(authorization, body=body, accept_language=accept_language)

Add a project

Example

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)

Parameters

Name Type Description Notes
body ProjectCreationDTO Project description [optional]

Return type

str

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_project

str delete_project(uri, authorization, accept_language=accept_language)

Delete a project

Example

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)

Parameters

Name Type Description Notes
uri str Project URI

Return type

str

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_project

ProjectGetDetailDTO get_project(uri, authorization, accept_language=accept_language)

Get a project

Example

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)

Parameters

Name Type Description Notes
uri str Project URI

Return type

ProjectGetDetailDTO

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_projects_by_uri

list[ProjectGetDTO] get_projects_by_uri(uris, authorization, accept_language=accept_language)

Get projects by their URIs

Example

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)

Parameters

Name Type Description Notes
uris list[str] Projects URIs

Return type

list[ProjectGetDTO]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

search_projects

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

Example

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)

Parameters

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]

Return type

list[ProjectGetDTO]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_project

str update_project(authorization, body=body, accept_language=accept_language)

Update a project

Example

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)

Parameters

Name Type Description Notes
body ProjectCreationDTO Project description [optional]

Return type

str

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]