Skip to content

Commit 702ae75

Browse files
authored
Merge pull request #9 from sanderegg/director-sdk
Director sdk closes ITISFoundation#197
2 parents acac985 + 5e0d0a6 commit 702ae75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4639
-14
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export RUN_DOCKER_ENGINE_ROOT=0
1717
# TODO: Add a meaningfull call to retrieve the local docker group ID and the user ID in linux.
1818
endif
1919

20-
PY_FILES = $(strip $(shell find services packages -iname '*.py' -not -path "*egg*" -not -path "*contrib*" -not -path "*/generated_code/models*" -not -path "*/generated_code/util*"))
20+
PY_FILES = $(strip $(shell find services packages -iname '*.py' -not -path "*egg*" -not -path "*contrib*" -not -path "*/director-sdk/python*" -not -path "*/generated_code/models*" -not -path "*/generated_code/util*"))
2121

2222
export PYTHONPATH=${CURDIR}/packages/s3wrapper/src:${CURDIR}/packages/simcore-sdk/src
2323

packages/director-sdk/README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# simcore-director-sdk
2+
3+
The simcore-director-sdk is the client library needed to access the director REST Api.
4+
5+
It is currently available as an auto-generated python package but could be easily generated for other languages.
6+
7+
## Usage
8+
9+
pip install -v git+https://github.com/ITISFoundation/osparc-simcore.git@director-sdk#subdirectory=packages/director-sdk/python
10+
11+
## Development
12+
13+
No development as the code is automatically generated.
14+
15+
### local testing
16+
17+
Do the following:
18+
1. Start the oSparc swarm
19+
```bash
20+
make build
21+
make up-swarm
22+
```
23+
2. Execute __sample.py__ as an example
24+
3. Observe logs
25+
26+
## code generation from REST API "client side"
27+
28+
Python: The code was generated using the __codegen.sh__ script together with __codegen_config.json__.

packages/director-sdk/codegen.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#/bin/bash
2+
exec ../../scripts/openapi/openapi_codegen.sh \
3+
-i ../../services/director/src/simcore_service_director/.openapi/v1/director_api.yaml \
4+
-o . \
5+
-g python \
6+
-c ./codegen_config.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"packageName":"simcore_director_sdk",
3+
"projectName":"simcore-director-sdk",
4+
"packageVersion":"1.0.0",
5+
"packageUrl":"https://github.com/ITISFoundation/osparc-simcore/tree/master/packages/director-sdk/python",
6+
"library":"asyncio"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.2.2
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ref: https://docs.travis-ci.com/user/languages/python
2+
language: python
3+
python:
4+
- "2.7"
5+
- "3.2"
6+
- "3.3"
7+
- "3.4"
8+
- "3.5"
9+
#- "3.5-dev" # 3.5 development branch
10+
#- "nightly" # points to the latest development branch e.g. 3.6-dev
11+
# command to install dependencies
12+
install: "pip install -r requirements.txt"
13+
# command to run tests
14+
script: nosetests
+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# simcore-director-sdk
2+
This is the oSparc's director API
3+
4+
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
5+
6+
- API version: 1.0.0
7+
- Package version: 1.0.0
8+
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
9+
10+
## Requirements.
11+
12+
Python 2.7 and 3.4+
13+
14+
## Installation & Usage
15+
### pip install
16+
17+
If the python package is hosted on Github, you can install directly from Github
18+
19+
```sh
20+
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
21+
```
22+
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
23+
24+
Then import the package:
25+
```python
26+
import simcore_director_sdk
27+
```
28+
29+
### Setuptools
30+
31+
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
32+
33+
```sh
34+
python setup.py install --user
35+
```
36+
(or `sudo python setup.py install` to install the package for all users)
37+
38+
Then import the package:
39+
```python
40+
import simcore_director_sdk
41+
```
42+
43+
## Getting Started
44+
45+
Please follow the [installation procedure](#installation--usage) and then run the following:
46+
47+
```python
48+
from __future__ import print_function
49+
import time
50+
import simcore_director_sdk
51+
from simcore_director_sdk.rest import ApiException
52+
from pprint import pprint
53+
54+
# create an instance of the API class
55+
api_instance = simcore_director_sdk.UsersApi(simcore_director_sdk.ApiClient(configuration))
56+
57+
try:
58+
# Service health-check endpoint
59+
api_response = api_instance.root_get()
60+
pprint(api_response)
61+
except ApiException as e:
62+
print("Exception when calling UsersApi->root_get: %s\n" % e)
63+
64+
```
65+
66+
## Documentation for API Endpoints
67+
68+
All URIs are relative to *http://localhost:{port}/{basePath}*
69+
70+
Class | Method | HTTP request | Description
71+
------------ | ------------- | ------------- | -------------
72+
*UsersApi* | [**root_get**](docs/UsersApi.md#root_get) | **GET** / | Service health-check endpoint
73+
*UsersApi* | [**running_interactive_services_delete**](docs/UsersApi.md#running_interactive_services_delete) | **DELETE** /running_interactive_services/{service_uuid} | Stops and removes an interactive service from the oSparc platform
74+
*UsersApi* | [**running_interactive_services_get**](docs/UsersApi.md#running_interactive_services_get) | **GET** /running_interactive_services/{service_uuid} | Succesfully returns if a service with the defined uuid is up and running
75+
*UsersApi* | [**running_interactive_services_post**](docs/UsersApi.md#running_interactive_services_post) | **POST** /running_interactive_services | Starts an interactive service in the oSparc platform and returns its entrypoint
76+
*UsersApi* | [**services_get**](docs/UsersApi.md#services_get) | **GET** /services | Lists available services in the oSparc platform
77+
78+
79+
## Documentation For Models
80+
81+
- [Error](docs/Error.md)
82+
- [ErrorEnveloped](docs/ErrorEnveloped.md)
83+
- [HealthCheck](docs/HealthCheck.md)
84+
- [HealthCheckEnveloped](docs/HealthCheckEnveloped.md)
85+
- [NodeMetaV0](docs/NodeMetaV0.md)
86+
- [Nodemetav0Authors](docs/Nodemetav0Authors.md)
87+
- [Response204Enveloped](docs/Response204Enveloped.md)
88+
- [RunningService](docs/RunningService.md)
89+
- [RunningServiceEnveloped](docs/RunningServiceEnveloped.md)
90+
- [ServicesEnveloped](docs/ServicesEnveloped.md)
91+
92+
93+
## Documentation For Authorization
94+
95+
All endpoints do not require authorization.
96+
97+
98+
## Author
99+
100+
101+
102+
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Error
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**message** | **str** | Error message |
7+
**errors** | **list[object]** | | [optional]
8+
**status** | **int** | Error code |
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ErrorEnveloped
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**data** | [**Error**](Error.md) | | [optional]
7+
**status** | **int** | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# HealthCheck
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**name** | **str** | | [optional]
7+
**status** | **str** | | [optional]
8+
**api_version** | **str** | | [optional]
9+
**version** | **str** | | [optional]
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
13+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# HealthCheckEnveloped
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**data** | [**HealthCheck**](HealthCheck.md) | | [optional]
7+
**status** | **int** | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# NodeMetaV0
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**key** | **str** | distinctive name for the node based on the docker registry path |
7+
**version** | **str** | semantic version number |
8+
**type** | **str** | service type |
9+
**name** | **str** | short, human readable name for the node |
10+
**description** | **str** | human readable description of the purpose of the node |
11+
**authors** | [**list[Nodemetav0Authors]**](Nodemetav0Authors.md) | |
12+
**contact** | **str** | email to correspond to the authors about the node |
13+
**inputs** | **object** | definition of the inputs of this node |
14+
**outputs** | **object** | definition of the outputs of this node |
15+
16+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
17+
18+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Nodemetav0Authors
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**name** | **str** | Name of the author | [optional]
7+
**email** | **str** | Email address | [optional]
8+
**affiliation** | **str** | Affiliation of the author | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Response204Enveloped
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**data** | **str** | | [optional]
7+
**status** | **int** | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# RunningService
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**published_port** | **int** | The ports where the service provides its interface |
7+
**entry_point** | **str** | The entry point where the service provides its interface if specified | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# RunningServiceEnveloped
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**data** | [**RunningService**](RunningService.md) | | [optional]
7+
**status** | **int** | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ServicesEnveloped
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**data** | [**list[NodeMetaV0]**](NodeMetaV0.md) | | [optional]
7+
**status** | **int** | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

0 commit comments

Comments
 (0)