Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
27087eb
Merge pull request #225 from Syncano/release-v5.3.0
opalczynski Jul 26, 2016
a03fd8c
Merge pull request #226 from Syncano/master
opalczynski Jul 26, 2016
90c4333
[LIB-821] add retry-after handling;
opalczynski Aug 9, 2016
3801a26
[LIB-821] correct isort issues;
opalczynski Aug 9, 2016
49fa010
Merge pull request #227 from Syncano/LIB-821
opalczynski Aug 9, 2016
12cda74
[LIB-837][WIP] working on custom sockets in LIB
opalczynski Aug 10, 2016
460006f
[LIB-837] Add missing docs about custom_sockets; move utils to anothe…
opalczynski Aug 11, 2016
5eca906
[LIB-837] add missing fields in doc string;
opalczynski Aug 11, 2016
cb5f0ab
[readme_changes] Some readme changes
23doors Aug 12, 2016
9a7c280
Merge pull request #229 from Syncano/readme_changes
23doors Aug 12, 2016
c0f75cb
[LIB-837] correct documentation; add possibility to read all endpoint…
opalczynski Aug 12, 2016
e108b5a
[LIB-837] Correct after tests;
opalczynski Aug 12, 2016
5eab464
[LIB-837] another portion of corrects;
opalczynski Aug 12, 2016
1afcd9f
[LIB-837] correct tests again;
opalczynski Aug 12, 2016
48eb08e
[LIB-837] change tests instead of doing a magic in ModelField;
opalczynski Aug 12, 2016
4e2ee33
Language updates
MariuszWisniewski Aug 12, 2016
fe52e7a
[ci skip] readme
MariuszWisniewski Aug 12, 2016
7bc974a
[ci skip] Endpoints readme update
MariuszWisniewski Aug 15, 2016
bc71ad1
[LIB-837] revert ModelField on script in script endpoint model;
opalczynski Aug 16, 2016
327a3fc
[LIB-837] correct data passing on run methods;
opalczynski Aug 16, 2016
d50344b
[LIB-837] correct custom socket behaviour;
opalczynski Aug 16, 2016
c2ffd3a
Merge branch 'LIB-837' of github.com:Syncano/syncano-python into LIB-837
opalczynski Aug 16, 2016
42e4373
[LIB-837] corrects after qa;
opalczynski Aug 16, 2016
04c5ef6
[LIB-837] corrects after qa;
opalczynski Aug 16, 2016
9f5adba
[LIB-837] correct docs examples, polish the tests;
opalczynski Aug 16, 2016
69f3a11
[LIB-837] remove default custom socket in setupclass;
opalczynski Aug 16, 2016
3d1f4dd
[LIB-837] remove default custom socket in setupclass;
opalczynski Aug 16, 2016
d982fd0
[LIB-837] final test correction;
opalczynski Aug 16, 2016
8662e42
Update language
devintyler Aug 16, 2016
2ff6c68
[LIB-819] - Add support for creating objects through DataEndpoint
ilu2112 Aug 18, 2016
0864163
[LIB-837] add possibility to directly point instance name when gettin…
opalczynski Aug 18, 2016
9246b98
[LIB-837] change interface: publish to install in custom socket context;
opalczynski Aug 19, 2016
31c51b9
Merge branch 'LIB-837' of github.com:Syncano/syncano-python into LIB-837
opalczynski Aug 19, 2016
14f6ff7
[LIB-837] add status badges to README
opalczynski Aug 19, 2016
2372986
[LIB-837] small changes after CORE change;
opalczynski Aug 22, 2016
515e50b
[LIB-837] correct SocketEndpoint behaviour (run mainly);
opalczynski Aug 22, 2016
16795dd
[LIB-837] correct run in CustomSocket;
opalczynski Aug 22, 2016
b8c252f
[LIB-837] add possiblity to install from url;
opalczynski Aug 23, 2016
3cf2465
[LIB-837] update documentation for installing socket from url;
opalczynski Aug 23, 2016
ef39be6
[LIB-837] fixes after qa;
opalczynski Aug 24, 2016
38e94ad
Merge pull request #230 from Syncano/LIB-819
opalczynski Aug 24, 2016
6ab2429
Merge pull request #228 from Syncano/LIB-837
opalczynski Aug 24, 2016
21ddeaf
[RELEASE v5.4] bump the version;
opalczynski Aug 24, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[ci skip] Endpoints readme update
  • Loading branch information
MariuszWisniewski authored Aug 15, 2016
commit 7bc974a80e2a0bc3e8c4113a4f6638ffd5c7abb8
35 changes: 24 additions & 11 deletions docs/source/custom_sockets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,23 @@ To create a custom socket follow these steps::
my_endpoint.add_call(ScriptCall(name='custom_script'), methods=['GET'])
my_endpoint.add_call(ScriptCall(name='another_custom_script'), methods=['POST'])

# Explanation of the above lines:
# Defined endpoint will be visible under `my_endpoint` name:
# On this syncano API endpoint the above endpoint will be called (after custom socket creation)
# <host>://<api_version>/instances/<instance_name>/endpoints/sockets/my_endpoint/
# On this syncano API endpoint the details of the defined endpoint will be returned
# What happened here:
# - We defined a new endpoint, that will be visible under `my_endpoint` name.
# - You will be able to call this endpoint (execute attached `call`),
# by sending a reuqest, using any defined method to following API route:
# <host>://<api_version>/instances/<instance_name>/endpoints/sockets/my_endpoint/
# - To get details on that endpoint, you need to send a GET request to following API route:
# <host>://<api_version>/instances/<instance_name>/sockets/my_custom_socket/endpoints/my_endpoint/
# For the above endpoint - the two calls are defined, one uses GET method - the custom_script will be executed
# there, second uses the POST method and then the another_custom_script will be called;
# Currently only script are available for calls;
#
# Following example above - we defined two calls on our endpoint.
# First one means that using GET method will call the `custom_script` script,
# and second one means that using POST method will call the `another_custom_script` script.
# At the moment, only scripts are available as endpoint calls.
#
# As a general rule - to get endpoints details (but not call them), use following API route:
# <host>://<api_version>/instances/<instance_name>/sockets/my_custom_socket/endpoints/<endpoint>/
# and to run your endpoints (e.g. execute Script connected to them(, use following API route:
# <host>://<api_version>/instances/<instance_name>/endpoints/sockets/<endpoint>/

# 3. After creation of the endpoint, add it to your custom_socket.
custom_socket.add_endpoint(my_endpoint)
Expand Down Expand Up @@ -136,11 +144,16 @@ To get all endpoints that are defined in all custom sockets::

socket_endpoint_list = SocketEndpoint.get_all_endpoints()

Above code will return a list with SocketEndpoint objects. To run such endpoint, use::
Above code will return a list with SocketEndpoint objects. To run an endpoint,
choose one endpoint first, e.g.:

socket_endpoint_list.run(method='GET')
endpoint = socket_endpoint_list[0]

and now run it::

endpoint.run(method='GET')
# or:
socket_endpoint_list.run(method='POST', data={'custom_data': 1})
endpoint.run(method='POST', data={'custom_data': 1})

Custom sockets endpoints
------------------------
Expand Down