Comments (49)
2
@HannaTrotsenko commented on Mon Mar 12 2018
- add ticket for api for removing
api-version
from response - remove
api-version
from example in docs - continue hiding
selected_data_samples
,out_data_samples
,dynamic_select_model
anddynamic_metadata
in docs - create ticket like "do something with
selected_data_samples
,out_data_samples
,dynamic_select_model
anddynamic_metadata
" - add other missing fields to the doc
- doc is updated
Retrieve all flows
Use the next cURL for retrieving flows with parameters
curl 'https://api-sparrow.elastic.io/v2/flows?filter[status]=active&filter[user]=59d22e7eeb865b0018adc248&filter[type]=ordinary' \
-g -u [email protected]:a398e3fe-dc28-4d32-9a2d-2a55654468ce
AR: The response in terminal is :
{
"data": [
{
"id": "5aa683400581b5000739c192",
"type": "flow",
"links": {
"self": "/v2/flows/5aa683400581b5000739c192"
},
"attributes": {
"api_version": "2.0",
"created_at": "2018-03-12T13:40:16.090Z",
"current_status": "active",
"default_mapper_type": "jsonata",
"description": null,
"graph": {
"nodes": [
{
"id": "step_1",
"command": "elasticio/code:executeTrigger@latest",
"name": "",
"description": "",
"fields": {
"code": "// Please note only Node.js code is supported here\nconsole.log('Hello code, incoming message is msg=%j', msg);\n\n// Create message to be emitted\nvar data = messages.newMessageWithBody({message: 'hello world'});\n\n// Emit the data event\nemitter.emit('data', data);\n\n// No need to emit end\nconsole.log('Finished execution');"
},
"selected_data_samples": [
"5aa6834c0581b5000739c193"
],
"out_data_samples": [
"5aa6834c0581b5000739c193"
]
}
],
"edges": []
},
"name": "active",
"status": "active",
"type": "ordinary",
"updated_at": "2018-03-12T13:44:56.037Z"
},
"relationships": {
"user": {
"data": {
"id": "59d22e7eeb865b0018adc248",
"type": "user"
},
"links": {
"self": "/v2/users/59d22e7eeb865b0018adc248"
}
},
"organization": {
"data": {
"id": "5aa681800581b5000739c190",
"type": "organization"
},
"links": {
"self": "/v2/organizations/5aa681800581b5000739c190"
}
},
"versions": {
"links": {
"related": "/v2/flows/5aa683400581b5000739c192/versions"
}
},
"latest_version": {
"data": {
"id": "12cf7376a34e34b2c4bcda3e35ae84cecc88519c",
"type": "flow-version"
},
"links": {
"self": "/v2/flows/5aa683400581b5000739c192/versions/12cf7376a34e34b2c4bcda3e35ae84cecc88519c",
"related": "/v2/flows/5aa683400581b5000739c192/versions/12cf7376a34e34b2c4bcda3e35ae84cecc88519c"
}
}
}
},
}
ER: The API docs Example Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": [
{
"type": "flow",
"id": "585918da586224001b96de89",
"attributes": {
"name": "Timer to E-Mail Test",
"status": "inactive",
"type": "ordinary",
"graph": {
"nodes": [
{
"id": "step_1",
"command": "elasticio/timer:timer",
"fields": {
"interval": "minute"
}
},
{
"id": "step_2",
"command": "elasticio/email:send"
}
],
"edges": [
{
"source": "step_1",
"target": "step_2",
"config": {
"mapper": {
"to": "[email protected]",
"subject": "Test",
"textBody": "{{fireTime}}"
}
}
}
]
}
},
"relationships": {
"user": {
"data": {
"type": "user",
"id": "560e5a27734d480a00000002"
},
"links": {
"self": "/v2/users/560e5a27734d480a00000002"
}
},
"organization": {
"data": {
"type": "organization",
"id": "573dd76962436c349f000003"
},
"links": {
"self": "/v2/organizations/573dd76962436c349f000003"
}
}
}
}
],
"meta": {
"page": 1,
"per_page": 20,
"total": 1,
"total_pages": 1
}
}
from api-docs.
3
- update docs with actual example
- doc is updated
Retrieve a user by ID
AR: The real response
{
"data": {
"id": "59d3562c68ed850019bde27f",
"type": "user",
"links": {
"self": "/v2/users/59d3562c68ed850019bde27f"
},
"attributes": {
"first_name": "Oksana",
"last_name": "Luzha",
"email": "[email protected]",
"company": "qaz",
"registered": "2017-10-03T09:19:40.598Z",
"last_login": "2018-03-16T10:30:38.656Z"
}
},
"meta": {}
}
ER: Example Response
{
"data": {
"id": "54f4be3fe7d5224f91000002",
"type": "user",
"attributes": {
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]"
}
}
}
from api-docs.
4
- update docs with actual example
- doc is updated
Retrieve all users
Preconditions: https://api-sparrow.elastic.io/v2/users/?page[size]=1&page[number]=1
AR: The real response
{
"data": [
{
"id": "560e5a27734d480a00000002",
"type": "user",
"links": {
"self": "/v2/users/560e5a27734d480a00000002"
},
"attributes": {
"first_name": "Igor",
"last_name": "Drobiazko",
"email": "[email protected]",
"company": "elastic.io GmbH",
"registered": "2015-10-02T10:19:19.697Z",
"last_login": "2018-02-08T16:07:52.495Z"
}
}
],
"meta": {
"page": 1,
"per_page": 1,
"total": 646,
"total_pages": 646
}
}
ER: Example Response
{
"meta": {
"total": 6,
"page": 5,
"per_page": 1,
"total_pages": 6
},
"data": [
{
"id": "588f8bd23abb797f8c293646",
"type": "user",
"attributes": {
"first_name": "Robyn",
"last_name": "Kerluke",
"email": "[email protected]",
"company": "Olson Group"
}
}
]
}
from api-docs.
5
- update docs with actual example
- doc is updated
Create a user
AR: the real response
{
"data": {
"id": "5aabc258bd6d6400079b4592",
"type": "user",
"links": {
"self": "/v2/users/5aabc258bd6d6400079b4592"
},
"attributes": {
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"company": "Doe & Partners",
"registered": "2018-03-16T13:10:48.221Z",
"last_login": "2018-03-16T13:10:48.221Z"
}
},
"meta": {}
}
ER: Example Response
{
"data": {
"id": "54f4be3fe7d5224f91000001",
"type": "user",
"attributes": {
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"company": "Doe & Partners"
}
}
}
from api-docs.
6
- update docs with
204 status
- update API (add item elasticio/api#661)
- doc is updated
Remove member from organization
AR: the real response
200 OK
{
"data": {},
"meta": {}
}
HTTP/1.1 200 OK
from api-docs.
7
- update docs with actual example
- doc is updated
Retrieve all components
- sections of response in the doc just only 2: "data" and "meta". Actual there are 4 sections: "data" and "meta", "included". "links"
- the section "included" has to be the same level as the section "data"
- absent in the doc "links":
from api-docs.
8
- update docs with actual example
- doc is updated
Retrieve all teams
AR: the real response
{
"data": [
{
"id": "5aa7de77a0c086000785c53e",
"type": "team",
"links": {
"self": "/v2/teams/5aa7de77a0c086000785c53e"
},
"attributes": {
"name": "stanislav"
},
"relationships": {
"organization": {
"data": {
"id": "59d341e9037f7200184a408b",
"type": "organization"
},
"links": {
"self": "/v2/organizations/59d341e9037f7200184a408b"
}
},
"users": {
"data": [
{
"id": "5a816bebcad2b40007adcaf2",
"type": "user"
}
]
}
}
}
],
"meta": {},
"links": {
"self": "/v2/teams"
}
}
ER: Example Response
{
"data":[
{
"attributes":{
"name":"singleteam"
},
"id":"5508411b34e5ac0300000019",
"type":"team",
"relationships":{
"users":{
"data":[
{
"type":"user",
"id":"5508411b34e5ac0300000020"
}
]
}
}
}
],
"meta":{}
}
from api-docs.
9
- update docs with actual example
- doc is updated
Create a team
AR: the real response
{
"data": {
"id": "5aabe01bbd6d6400079b45c4",
"type": "team",
"links": {
"self": "/v2/teams/5aabe01bbd6d6400079b45c4"
},
"attributes": {
"name": "1503myteam"
},
"relationships": {
"organization": {
"data": {
"id": "59d341e9037f7200184a408b",
"type": "organization"
},
"links": {
"self": "/v2/organizations/59d341e9037f7200184a408b"
}
},
"users": {
"data": [
{
"id": "59d22e7eeb865b0018adc248",
"type": "user"
}
]
}
}
},
"meta": {}
}
ER: Example Response
{
"data":[
{
"attributes":{
"name":"myteam"
},
"id":"5508411b34e5ac0300000019",
"type":"team",
"relationships":{
"users":{
"data":[
{
"type":"user",
"id":"5508411b34e5ac0300000020"
}
]
}
}
}
],
"meta":{
}
}
from api-docs.
10
- update docs with actual example
- doc is updated
Add a new member to a team
AR: the real response
{
"data": {
"id": "59d3ace74a819c0018e9bb92",
"type": "team",
"links": {
"self": "/v2/teams/59d3ace74a819c0018e9bb92"
},
"attributes": {
"name": "Test_Team"
},
"relationships": {
"organization": {
"data": {
"id": "59d22e7eeb865b0018adc247",
"type": "organization"
},
"links": {
"self": "/v2/organizations/59d22e7eeb865b0018adc247"
}
},
"users": {
"data": [
{
"id": "59d22e7eeb865b0018adc248",
"type": "user"
},
{
"id": "59f747c33f1d3c001901a44e",
"type": "user"
},
{
"id": "59d3562c68ed850019bde27f",
"type": "user"
}
]
}
}
},
"meta": {}
}
ER: Example Response
{
"data":[
{
"attributes":{
"name":"myteam"
},
"id":"5508411b34e5ac0300000019",
"type":"team",
"relationships":{
"users":{
"data":[
{
"type":"user",
"id":"{USER_ID}"
}
]
}
}
}
],
"meta":{}
}
from api-docs.
11
- update docs with
204 status
- update API (add item elasticio/api#661)
- doc is updated
Remove a member from a team
AR: the real response
{
"data": {
"id": "59d3ace74a819c0018e9bb92",
"type": "team",
"links": {
"self": "/v2/teams/59d3ace74a819c0018e9bb92"
},
"attributes": {
"name": "Test_Team"
},
"relationships": {
"organization": {
"data": {
"id": "59d22e7eeb865b0018adc247",
"type": "organization"
},
"links": {
"self": "/v2/organizations/59d22e7eeb865b0018adc247"
}
},
"users": {
"data": [
{
"id": "59d22e7eeb865b0018adc248",
"type": "user"
},
{
"id": "59f747c33f1d3c001901a44e",
"type": "user"
}
]
}
}
},
"meta": {}
}
ER: Example Response
{
"data":[
{
"attributes":{
"name":"myteam"
},
"id":"5508411b34e5ac0300000019",
"type":"team",
"relationships":{
"users":{
"data":[
{
"type":"user",
"id":"{user_id}"
}
]
}
}
}
],
"meta":{}
}
from api-docs.
12
- update docs with actual example
- doc is updated
Retrieve a component by ID
- absent in the doc "links":
- sections of response in the doc just only 2: "data" and "meta". Actual there are 4 sections: "data" and "meta", "included". "links"
- the section "included" has to be the same level as the section "data"
from api-docs.
13
- update docs with
204 status
- update API (add item elasticio/api#661)
- doc is updated
Delete a team
AR: the real response
{
"data": {},
"meta": {}
}
ER: Example Response
{}
from api-docs.
14
- update docs with actual example
- doc is updated
Retrieve all SSH keys
AR: the real response
{
"data": [
{
"id": "5a4f59dbcbe7940019697ec5",
"type": "sshkey",
"links": {
"self": "/v2/sshkeys/5a4f59dbcbe7940019697ec5"
},
"attributes": {
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDf0QiuqfcAMXK58vbHcS6DjPLk48ksR6xj/ApRF8GhzzEUtPdeqLEsf1MIJx61dd0E6UdmW4AIbwDcTOMWz0f+9Ue7AypkPwn+kt9y6JOdW+GC+f+2wJzR3ySgq8XGHwsHmANlegZIlzyFGqm4YbGdxqTtBENrJZGQpayGMcI72662HxAsCrAoENyCLPml+lWr6cYaK7r0WLEmoZefzuLgO3VMVIaGK9B+5unQ0R2UMozwJJutYTCJAlnTIvO3BceHcrNnEAjYuvx1khdNd3+4Mrs/Q1LTzavqVy/Ot9ZpK3xah4bnFHbcunVzlCeiY5HLTfrcSgmsa9xhgj+viMJj",
"title": "hanna@hanna-UX430UQ",
"fingerprint": "fd:d4:98:92:ed:d7:3a:0c:a2:42:ff:78:57:15:88:fa"
},
"relationships": {
"user": {
"data": {
"id": "59d22e7eeb865b0018adc248",
"type": "user"
},
"links": {
"self": "/v2/users/59d22e7eeb865b0018adc248"
}
}
}
}
],
"meta": {},
"links": {
"self": "/v2/sshkeys"
}
}
ER: Example Response
{
"data": [
{
"id": "589df8b024dbdd0e461fc309",
"type": "sshkey",
"attributes": {
"title": "My Key",
"fingerprint": "fingerprint",
"user_id": "user_id",
"key":"ssh_key"
}
}
]
}
from api-docs.
15
ask wtf?
- done (remember about wrong cURL #92 )
Create a new SSH key
AR: the real response
{
"data": {
"id": "5aabedf5bd6d6400079b45f1",
"type": "sshkey",
"links": {
"self": "/v2/sshkeys/5aabedf5bd6d6400079b45f1"
},
"attributes": {
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDf0QiuqfcAMXK58vbHcS6DjPLk48ksR6xj/ApRF8GhzzEUtPdeqLEsf1MIJx61dd0E6UdmW4AIbwDcTOMWz0f+9Ue7AypkPwn+kt9y6JOdW+GC+f+2wJzR3ySgq8XGrgsHmANlegZIlzyFGqm4YbGdxqTtBENrJZGQpayGMcI72662HxAsCrAoENyCLPml+lWr6cYaK7r0WLEmoZefzuLgO3VMVIaGK9B+5unQ0R2UMozwJJutYTCJAlnTIvO3BceHcrNnEAjYuvx1khdNd3+4Mrs/Q1LTzavqVy/Ot9ZpK3xah4bnFHbcunVzlCeiY5HLTfrcSgmsa9xhgj+viMJj",
"title": "1603testAndDelMe",
"fingerprint": "3a:2b:8e:7c:dc:82:3e:de:54:f4:58:8a:7d:55:fb:15"
},
"relationships": {
"user": {
"data": {
"id": "59d22e7eeb865b0018adc248",
"type": "user"
},
"links": {
"self": "/v2/users/59d22e7eeb865b0018adc248"
}
}
}
},
"meta": {}
}
ER: Example Response
{
"id": "589df8a924dbdd0e461fc308",
"type": "sshkey",
"attributes": {
"title": "My Key",
"fingerprint": "fingerprint",
"user_id": "user_id",
"key":"ssh_key"
}
}
from api-docs.
16
- update docs with actual example
- doc is updated
Retrieve component versions
See the screen:
from api-docs.
17
- update docs with actual example
- doc is updated
Verify credentials
AR: the real response
{
"data": {
"id": "5aaf90a2d0516d00077556cf",
"type": "execution-result",
"links": {
"self": "/v2/exec/result/5aaf90a2d0516d00077556cf"
},
"attributes": {
"result": {},
"status": "Pending request, waiting other process"
}
},
"meta": {}
}
ER: Example Response
{
"data": {
"type": "execution-result",
"id": "58becb8259a65f18c5c60eb0",
"attributes": {
"result": {},
"status": "Pending request, waiting other process"
}
}
}
from api-docs.
18
- update docs with actual example
- doc is updated
Retrieve a component descriptor
See the screen:
from api-docs.
19
- update docs with actual example
- doc is updated
Retrieve component’s metamodel
AR: the real response
{
"data": {
"id": "5aaf9d5bd0516d000775621c",
"type": "execution-result",
"links": {
"self": "/v2/exec/result/5aaf9d5bd0516d000775621c"
},
"attributes": {
"result": {},
"status": "Pending request, waiting other process"
}
},
"meta": {}
}
ER: Example Response
{
"data": {
"type": "execution-result",
"id": "58becb8359a65f18c5c60ec4",
"attributes": {
"result": {},
"status": "Pending request, waiting other process"
}
}
}
from api-docs.
20
- update docs with actual example
- doc is updated
Retrieve component’s select model
AR: the real response
{
"data": {
"id": "5aafb9e1d0516d0007757b71",
"type": "execution-result",
"links": {
"self": "/v2/exec/result/5aafb9e1d0516d0007757b71"
},
"attributes": {
"result": {},
"status": "Pending request, waiting other process"
}
},
"meta": {}
}
ER: Example Response
{
"data": {
"type": "execution-result",
"id": "58becb8059a65f18c5c60e41",
"attributes": {
"result": {},
"status": "Pending request, waiting other process"
}
}
}
from api-docs.
21
- update docs with actual example
- doc is updated
Create a component repository
from api-docs.
22
- update docs with actual example
- doc is updated
Update component access
See the screen:
from api-docs.
23
- update docs with actual example (add
links
) - add ticket for api for missing
status
- doc is updated
Poll a result of an execution
from api-docs.
21
- add
links
to the doc - it's ok that
result.data
is different between ER and AR - doc is updated
Retrieve execution result
AR: the real response
{
"data": {
"id": "5aafcd56d0516d0007758cff",
"type": "execution-result",
"links": {
"self": "/v2/exec/result/5aafcd56d0516d0007758cff"
},
"attributes": {
"result": {
"data": {
"available": "Available",
"pending": "Pending",
"sold": "Sold"
}
}
}
},
"meta": {}
}
ER: Example Response
{
"data": {
"type": "execution-result",
"id": "58becb8059a65f18c5c60e41",
"attributes": {
"result": {
"data": {
"some_field_of_result": "value",
"another_field": "another_value"
}
}
}
}
}
from api-docs.
22
- update docs with
204 status
- update API (add item elasticio/api#661)
- doc is updated
Delete a component
See the screen:
from api-docs.
23
- update docs with actual example
- doc is updated
Create an organization
from api-docs.
24
- update docs with actual example
- doc is updated
Retrieve component’s environment variables
See the screen:
from api-docs.
25
- update docs with actual example
- doc is updated
Update component’s environment variables
See the screen:
from api-docs.
26
- update docs with actual example (e.g. missing
links
) - doc is updated
Get a list of members of Organization
from api-docs.
27
- update docs with actual example
- doc is updated
Get a list of pending members (invites) of Organization
AR: the real response
{
"data": [
{
"id": "5aafd335bd6d6400079b4617",
"type": "organization-invite",
"links": {
"self": "/v2/organizations/59d22e7eeb865b0018adc247/invite/5aafd335bd6d6400079b4617"
},
"attributes": {
"email": "[email protected]",
"role": "integrator"
}
},
{
"id": "5aafda89bd6d6400079b4618",
"type": "organization-invite",
"links": {
"self": "/v2/organizations/59d22e7eeb865b0018adc247/invite/5aafda89bd6d6400079b4618"
},
"attributes": {
"email": "[email protected]",
"role": "guest"
}
}
],
"meta": {}
}
ER: Example Response
{
"meta": {},
"data": [
{
"type": "organization-invite",
"id": "588f832b87d7c27c7d5cc37e",
"attributes": {
"email": "[email protected]",
"role": "guest"
}
},
{
"type": "organization-invite",
"id": "588f832b87d7c27c7d5cc37f",
"attributes": {
"email": "[email protected]",
"role": "integrator"
}
}
]
}
from api-docs.
28
- update docs with actual example
- doc is updated
Retrieve all credentials
See the screen:
from api-docs.
29
- update docs with actual example
- doc is updated
Invite a user to organization
from api-docs.
30
- update docs with actual example
- doc is updated
Retrieve a credential by ID
See the screen:
from api-docs.
31
- update docs with actual example
- doc is updated
Update membership in Organization
from api-docs.
32
- update docs with actual example
- doc is updated
Create a credential
See the screen:
from api-docs.
33
- update docs with actual example
- doc is updated
Update a credential
See the screen:
from api-docs.
34
- update API (add item elasticio/api#661)
- doc is ok
Delete a credential
See the screen:
from api-docs.
35
- add
links
with anorganization
to the doc - it's ok that
attributes.result
is different between ER and AR - doc is updated
Retrieve data sample
See the screen:
from api-docs.
36
- update docs with actual example
- doc is updated
Create data sample
See the screen:
from api-docs.
37
- update docs with actual example (but remember about "hidden" fields)
- doc is updated
Retrieve a flow draft
from api-docs.
38
- update docs with actual example
- doc is updated
Update data sample
See the screen:
from api-docs.
39
- update docs with actual example (but remember about "hidden" fields)
- doc is updated
Retrieve all flows
See the screen:
from api-docs.
40
- update docs with actual example (but remember about "hidden" fields)
- doc is updated
Create/update a flow draft
from api-docs.
41
- update docs with actual example (but remember about "hidden" fields)
- doc is updated
Retrieve a flow by ID
See the screen:
from api-docs.
42
- update docs with actual example (but remember about "hidden" fields)
- doc is updated
Retrieve all flow versions
from api-docs.
43
- update docs with actual example (but remember about "hidden" fields)
- doc is updated
Retrieve flow version by hash
from api-docs.
44
- update docs with actual example
- doc is updated
Start a flow
from api-docs.
45
- update docs with actual example
- doc is updated
Stop a flow
from api-docs.
46
- update docs with actual example (but remember about "hidden" fields)
- doc is updated
Update a flow
from api-docs.
47
- update docs with actual example (but remember about "hidden" fields)
- doc is updated
from api-docs.
Related Issues (20)
- Retrieve all credentials: wrong information in the doc
- Retrieve a credential by ID: incorrect information in the doc
- API docs describe the not-existing feature
- What we have to do with "Lookup tables" in api-docs HOT 2
- Retrieve data sample: wrong information in the doc HOT 1
- Create a flow: total update of cUrl
- Remove all the Node.js tabs and all the TBD examples HOT 1
- Remove blank grey are after every Example of response HOT 1
- Resource /storage/signed-url is documented in API docs
- Document /v2/flows last_modified sort HOT 1
- API-Docs – add Contracts and Workspaces HOT 1
- Update api-docs: add information about access level for Components-requests HOT 2
- Create a page or a section about Delete HOT 1
- POST /v2/workspaces is located under Contracts
- Change object to array in all endpoints which use role
- Add information about list of service account permissions HOT 2
- _tenants.md should also include rebranded information HOT 2
- Get rid of elasticio mentions HOT 1
- I should be able to expand the left-hand menu bar to see the full entry
- Documentation should be added to indicate that pages in the API are 1 based not 0 based
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-docs.