You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api_tutorial.md
+47-3Lines changed: 47 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ You only need a ``curl`` and [elastic.io account](http://www.elastic.io) for tha
8
8
Create new request bin, we'll going to use it in our integration sample to push the data.
9
9
10
10
```
11
-
curl -X POST http://requestb.in/api/v1/bins
11
+
curl -X POST http://requestb.in/api/v1/bins
12
12
```
13
13
14
14
you'll ge a response that would looks like this:
@@ -26,7 +26,7 @@ you'll ge a response that would looks like this:
26
26
}
27
27
```
28
28
29
-
Remember the ``name`` of your bin. You can also check it's empty now:
29
+
Remember the ``name`` of your bin (``xuhpomxu`` in our sample above). You can also check it's empty now:
30
30
31
31
```
32
32
curl http://requestb.in/api/v1/bins/xuhpomxu
@@ -63,6 +63,7 @@ First create a new file called ``task.json`` with following content:
63
63
```json
64
64
{
65
65
"name": "Embedded Tutorial",
66
+
"cron": "*/1 * * * *",
66
67
"nodes": [
67
68
{
68
69
"action": "elasticio/timer:timer",
@@ -98,7 +99,7 @@ And you'll see the result like this:
98
99
{"id":"123456789"}
99
100
```
100
101
101
-
We just created a new task. Now we can start it.
102
+
We just created a new task with ``id`` 123456789. Now we can start it.
102
103
103
104
## Start integration flow
104
105
@@ -120,8 +121,51 @@ As a response you'll see something like this:
120
121
}
121
122
```
122
123
124
+
Your first integration task has just started on elastic.io. Every minute elastic.io platform will trigger an execution of the [timer component](https://github.com/elasticio/timer). Timer component [will emit](https://github.com/elasticio/timer/blob/master/timer.js#L27) a message with the fire time in it, this message will be placed into the output data queue which is in turn connected to the [webhook component](https://github.com/elasticio/webhook) which will POST the body of the message to the configured URL.
125
+
123
126
## See your integration flow working
124
127
128
+
After 10-15 seconds you can check the request bin you created in the first step of this tutorial:
129
+
130
+
```
131
+
curl http://requestb.in/api/v1/bins/xuhpomxu
132
+
```
125
133
126
134
135
+
```json
136
+
{
137
+
"name": "xuhpomxu",
138
+
"request_count": 1,
139
+
"color": [
140
+
240,
141
+
220,
142
+
190
143
+
],
144
+
"private": false
145
+
}
146
+
```
147
+
148
+
As you can see we have a new request in the bin. You can also open a URL in your browser ``http://requestb.in/your-bin-name?inspect`` to see the visualization statistics like this:
And you can be sure every minute a new request will be posted.
153
+
154
+
## Stop your integration flow
155
+
156
+
Don't forget to stop your task so that resources allocated to your account won't be wasted, use the [stop task](http://api.elastic.io/docs/#stop-a-task) API:
0 commit comments