losant_rest 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +23 -0
- data/.rbenv-version +1 -0
- data/.travis.yml +5 -0
- data/Gemfile +2 -0
- data/LICENSE +21 -0
- data/README.md +237 -0
- data/Rakefile +12 -0
- data/docs/_schemas.md +6348 -0
- data/docs/accessToken.md +107 -0
- data/docs/accessTokens.md +68 -0
- data/docs/application.md +107 -0
- data/docs/applicationKey.md +115 -0
- data/docs/applicationKeys.md +81 -0
- data/docs/applications.md +76 -0
- data/docs/auth.md +104 -0
- data/docs/dashboard.md +107 -0
- data/docs/dashboards.md +76 -0
- data/docs/data.md +78 -0
- data/docs/device.md +300 -0
- data/docs/deviceRecipe.md +152 -0
- data/docs/deviceRecipes.md +81 -0
- data/docs/devices.md +117 -0
- data/docs/event.md +115 -0
- data/docs/events.md +153 -0
- data/docs/flow.md +261 -0
- data/docs/flows.md +81 -0
- data/docs/me.md +312 -0
- data/docs/org.md +279 -0
- data/docs/orgs.md +75 -0
- data/docs/webhook.md +115 -0
- data/docs/webhooks.md +81 -0
- data/examples/auth.rb +32 -0
- data/examples/list_devices.rb +45 -0
- data/lib/losant_rest/access_token.rb +122 -0
- data/lib/losant_rest/access_tokens.rb +80 -0
- data/lib/losant_rest/application.rb +122 -0
- data/lib/losant_rest/application_key.rb +128 -0
- data/lib/losant_rest/application_keys.rb +98 -0
- data/lib/losant_rest/applications.rb +94 -0
- data/lib/losant_rest/auth.rb +122 -0
- data/lib/losant_rest/client.rb +132 -0
- data/lib/losant_rest/dashboard.rb +122 -0
- data/lib/losant_rest/dashboards.rb +94 -0
- data/lib/losant_rest/data.rb +89 -0
- data/lib/losant_rest/device.rb +336 -0
- data/lib/losant_rest/device_recipe.rb +169 -0
- data/lib/losant_rest/device_recipes.rb +98 -0
- data/lib/losant_rest/devices.rb +139 -0
- data/lib/losant_rest/error.rb +12 -0
- data/lib/losant_rest/event.rb +128 -0
- data/lib/losant_rest/events.rb +183 -0
- data/lib/losant_rest/flow.rb +290 -0
- data/lib/losant_rest/flows.rb +98 -0
- data/lib/losant_rest/me.rb +362 -0
- data/lib/losant_rest/org.rb +314 -0
- data/lib/losant_rest/orgs.rb +92 -0
- data/lib/losant_rest/utils.rb +22 -0
- data/lib/losant_rest/version.rb +3 -0
- data/lib/losant_rest/webhook.rb +128 -0
- data/lib/losant_rest/webhooks.rb +98 -0
- data/lib/losant_rest.rb +43 -0
- data/losant_rest.gemspec +25 -0
- data/schemas/accessToken.json +52 -0
- data/schemas/accessTokenPatch.json +19 -0
- data/schemas/accessTokenPost.json +32 -0
- data/schemas/accessTokens.json +65 -0
- data/schemas/application.json +65 -0
- data/schemas/applicationKey.json +68 -0
- data/schemas/applicationKeyPatch.json +18 -0
- data/schemas/applicationKeyPost.json +36 -0
- data/schemas/applicationKeys.json +110 -0
- data/schemas/applicationPatch.json +16 -0
- data/schemas/applicationPost.json +23 -0
- data/schemas/applications.json +103 -0
- data/schemas/authedDevice.json +34 -0
- data/schemas/authedUser.json +18 -0
- data/schemas/dashboard.json +95 -0
- data/schemas/dashboardPatch.json +69 -0
- data/schemas/dashboardPost.json +76 -0
- data/schemas/dashboards.json +133 -0
- data/schemas/device.json +113 -0
- data/schemas/deviceCommand.json +20 -0
- data/schemas/deviceCommands.json +25 -0
- data/schemas/deviceCredentials.json +22 -0
- data/schemas/deviceLog.json +28 -0
- data/schemas/devicePatch.json +78 -0
- data/schemas/devicePost.json +81 -0
- data/schemas/deviceRecipe.json +106 -0
- data/schemas/deviceRecipeBulkCreate.json +15 -0
- data/schemas/deviceRecipeBulkCreatePost.json +19 -0
- data/schemas/deviceRecipePatch.json +87 -0
- data/schemas/deviceRecipePost.json +90 -0
- data/schemas/deviceRecipes.json +148 -0
- data/schemas/deviceState.json +30 -0
- data/schemas/deviceStates.json +35 -0
- data/schemas/deviceTagFilter.json +19 -0
- data/schemas/devices.json +155 -0
- data/schemas/disableTwoFactorAuth.json +20 -0
- data/schemas/enableTwoFactorAuth.json +21 -0
- data/schemas/error.json +12 -0
- data/schemas/event.json +115 -0
- data/schemas/eventPatch.json +20 -0
- data/schemas/eventPost.json +39 -0
- data/schemas/events.json +165 -0
- data/schemas/flow.json +137 -0
- data/schemas/flowLog.json +46 -0
- data/schemas/flowPatch.json +107 -0
- data/schemas/flowPost.json +110 -0
- data/schemas/flowStorageEntries.json +7 -0
- data/schemas/flowStorageEntry.json +16 -0
- data/schemas/flows.json +179 -0
- data/schemas/githubLogin.json +14 -0
- data/schemas/lastValueData.json +34 -0
- data/schemas/lastValueQuery.json +36 -0
- data/schemas/me.json +173 -0
- data/schemas/mePatch.json +43 -0
- data/schemas/multiDeviceCommand.json +45 -0
- data/schemas/org.json +81 -0
- data/schemas/orgInvitePost.json +24 -0
- data/schemas/orgInvites.json +36 -0
- data/schemas/orgMemberPatch.json +23 -0
- data/schemas/orgPatch.json +16 -0
- data/schemas/orgPost.json +19 -0
- data/schemas/orgs.json +119 -0
- data/schemas/recentItem.json +27 -0
- data/schemas/recentItemList.json +36 -0
- data/schemas/success.json +12 -0
- data/schemas/timeSeriesData.json +89 -0
- data/schemas/timeSeriesQuery.json +64 -0
- data/schemas/userCredentials.json +25 -0
- data/schemas/virtualButtonPress.json +14 -0
- data/schemas/webhook.json +52 -0
- data/schemas/webhookPatch.json +29 -0
- data/schemas/webhookPost.json +32 -0
- data/schemas/webhooks.json +94 -0
- data/test/basic_test.rb +67 -0
- data/test/test_helper.rb +14 -0
- metadata +239 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Device Recipes Actions
|
|
2
|
+
|
|
3
|
+
Details on the various actions that can be performed on the
|
|
4
|
+
Device Recipes resource, including the expected
|
|
5
|
+
parameters and the potential responses.
|
|
6
|
+
|
|
7
|
+
##### Contents
|
|
8
|
+
|
|
9
|
+
* [Get](#get)
|
|
10
|
+
* [Post](#post)
|
|
11
|
+
|
|
12
|
+
<br/>
|
|
13
|
+
|
|
14
|
+
## Get
|
|
15
|
+
|
|
16
|
+
Returns the device recipes for an application
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
result = client.device_recipes.get(applicationId: my_application_id)
|
|
20
|
+
|
|
21
|
+
puts result
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
#### Available Parameters
|
|
25
|
+
|
|
26
|
+
| Name | Type | Required | Description | Default | Example |
|
|
27
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
28
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
29
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate | name | name |
|
|
30
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
|
31
|
+
| page | string | N | Which page of results to return | 0 | 0 |
|
|
32
|
+
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
|
33
|
+
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
|
|
34
|
+
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my * recipe |
|
|
35
|
+
|
|
36
|
+
#### Successful Responses
|
|
37
|
+
|
|
38
|
+
| Code | Type | Description |
|
|
39
|
+
| ---- | ---- | ----------- |
|
|
40
|
+
| 200 | [Device Recipes](_schemas.md#device-recipes) | Collection of device recipes |
|
|
41
|
+
|
|
42
|
+
#### Error Responses
|
|
43
|
+
|
|
44
|
+
| Code | Type | Description |
|
|
45
|
+
| ---- | ---- | ----------- |
|
|
46
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
47
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
|
48
|
+
|
|
49
|
+
<br/>
|
|
50
|
+
|
|
51
|
+
## Post
|
|
52
|
+
|
|
53
|
+
Create a new device recipe for an application
|
|
54
|
+
|
|
55
|
+
```ruby
|
|
56
|
+
result = client.device_recipes.post(
|
|
57
|
+
applicationId: my_application_id,
|
|
58
|
+
deviceRecipe: my_device_recipe)
|
|
59
|
+
|
|
60
|
+
puts result
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
#### Available Parameters
|
|
64
|
+
|
|
65
|
+
| Name | Type | Required | Description | Default | Example |
|
|
66
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
67
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
68
|
+
| deviceRecipe | [Device Recipe Post](_schemas.md#device-recipe-post) | Y | New device recipe information | | [Device Recipe Post Example](_schemas.md#device-recipe-post-example) |
|
|
69
|
+
|
|
70
|
+
#### Successful Responses
|
|
71
|
+
|
|
72
|
+
| Code | Type | Description |
|
|
73
|
+
| ---- | ---- | ----------- |
|
|
74
|
+
| 201 | [Device Recipe](_schemas.md#device-recipe) | Successfully created device recipe |
|
|
75
|
+
|
|
76
|
+
#### Error Responses
|
|
77
|
+
|
|
78
|
+
| Code | Type | Description |
|
|
79
|
+
| ---- | ---- | ----------- |
|
|
80
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
81
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
data/docs/devices.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Devices Actions
|
|
2
|
+
|
|
3
|
+
Details on the various actions that can be performed on the
|
|
4
|
+
Devices resource, including the expected
|
|
5
|
+
parameters and the potential responses.
|
|
6
|
+
|
|
7
|
+
##### Contents
|
|
8
|
+
|
|
9
|
+
* [Get](#get)
|
|
10
|
+
* [Post](#post)
|
|
11
|
+
* [Send Command](#send-command)
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
## Get
|
|
16
|
+
|
|
17
|
+
Returns the devices for an application
|
|
18
|
+
|
|
19
|
+
```ruby
|
|
20
|
+
result = client.devices.get(applicationId: my_application_id)
|
|
21
|
+
|
|
22
|
+
puts result
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
#### Available Parameters
|
|
26
|
+
|
|
27
|
+
| Name | Type | Required | Description | Default | Example |
|
|
28
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
29
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
30
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate | name | name |
|
|
31
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
|
32
|
+
| page | string | N | Which page of results to return | 0 | 0 |
|
|
33
|
+
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
|
34
|
+
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
|
|
35
|
+
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my * device |
|
|
36
|
+
| tagFilter | [Device Tag Filter](_schemas.md#device-tag-filter) | N | Array of tag pairs to filter by. | | [Device Tag Filter Example](_schemas.md#device-tag-filter-example) |
|
|
37
|
+
|
|
38
|
+
#### Successful Responses
|
|
39
|
+
|
|
40
|
+
| Code | Type | Description |
|
|
41
|
+
| ---- | ---- | ----------- |
|
|
42
|
+
| 200 | [Devices](_schemas.md#devices) | Collection of devices |
|
|
43
|
+
|
|
44
|
+
#### Error Responses
|
|
45
|
+
|
|
46
|
+
| Code | Type | Description |
|
|
47
|
+
| ---- | ---- | ----------- |
|
|
48
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
49
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
|
50
|
+
|
|
51
|
+
<br/>
|
|
52
|
+
|
|
53
|
+
## Post
|
|
54
|
+
|
|
55
|
+
Create a new device for an application
|
|
56
|
+
|
|
57
|
+
```ruby
|
|
58
|
+
result = client.devices.post(
|
|
59
|
+
applicationId: my_application_id,
|
|
60
|
+
device: my_device)
|
|
61
|
+
|
|
62
|
+
puts result
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### Available Parameters
|
|
66
|
+
|
|
67
|
+
| Name | Type | Required | Description | Default | Example |
|
|
68
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
69
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
70
|
+
| device | [Device Post](_schemas.md#device-post) | Y | New device information | | [Device Post Example](_schemas.md#device-post-example) |
|
|
71
|
+
|
|
72
|
+
#### Successful Responses
|
|
73
|
+
|
|
74
|
+
| Code | Type | Description |
|
|
75
|
+
| ---- | ---- | ----------- |
|
|
76
|
+
| 201 | [Device](_schemas.md#device) | Successfully created device |
|
|
77
|
+
|
|
78
|
+
#### Error Responses
|
|
79
|
+
|
|
80
|
+
| Code | Type | Description |
|
|
81
|
+
| ---- | ---- | ----------- |
|
|
82
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
83
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
|
84
|
+
|
|
85
|
+
<br/>
|
|
86
|
+
|
|
87
|
+
## Send Command
|
|
88
|
+
|
|
89
|
+
Send a command to multiple devices
|
|
90
|
+
|
|
91
|
+
```ruby
|
|
92
|
+
result = client.devices.send_command(
|
|
93
|
+
applicationId: my_application_id,
|
|
94
|
+
multiDeviceCommand: my_multi_device_command)
|
|
95
|
+
|
|
96
|
+
puts result
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### Available Parameters
|
|
100
|
+
|
|
101
|
+
| Name | Type | Required | Description | Default | Example |
|
|
102
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
103
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
104
|
+
| multiDeviceCommand | [Multi Device Command](_schemas.md#multi-device-command) | Y | Command to send to the device | | [Multi Device Command Example](_schemas.md#multi-device-command-example) |
|
|
105
|
+
|
|
106
|
+
#### Successful Responses
|
|
107
|
+
|
|
108
|
+
| Code | Type | Description |
|
|
109
|
+
| ---- | ---- | ----------- |
|
|
110
|
+
| 200 | [Success](_schemas.md#success) | If command was successfully sent |
|
|
111
|
+
|
|
112
|
+
#### Error Responses
|
|
113
|
+
|
|
114
|
+
| Code | Type | Description |
|
|
115
|
+
| ---- | ---- | ----------- |
|
|
116
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
117
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
data/docs/event.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Event Actions
|
|
2
|
+
|
|
3
|
+
Details on the various actions that can be performed on the
|
|
4
|
+
Event resource, including the expected
|
|
5
|
+
parameters and the potential responses.
|
|
6
|
+
|
|
7
|
+
##### Contents
|
|
8
|
+
|
|
9
|
+
* [Delete](#delete)
|
|
10
|
+
* [Get](#get)
|
|
11
|
+
* [Patch](#patch)
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
## Delete
|
|
16
|
+
|
|
17
|
+
Deletes an event
|
|
18
|
+
|
|
19
|
+
```ruby
|
|
20
|
+
result = client.event.delete(
|
|
21
|
+
applicationId: my_application_id,
|
|
22
|
+
eventId: my_event_id)
|
|
23
|
+
|
|
24
|
+
puts result
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### Available Parameters
|
|
28
|
+
|
|
29
|
+
| Name | Type | Required | Description | Default | Example |
|
|
30
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
31
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
32
|
+
| eventId | string | Y | ID associated with the event | | 575ed0de7ae143cd83dc4aa5 |
|
|
33
|
+
|
|
34
|
+
#### Successful Responses
|
|
35
|
+
|
|
36
|
+
| Code | Type | Description |
|
|
37
|
+
| ---- | ---- | ----------- |
|
|
38
|
+
| 200 | [Success](_schemas.md#success) | If event was successfully deleted |
|
|
39
|
+
|
|
40
|
+
#### Error Responses
|
|
41
|
+
|
|
42
|
+
| Code | Type | Description |
|
|
43
|
+
| ---- | ---- | ----------- |
|
|
44
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
45
|
+
| 404 | [Error](_schemas.md#error) | Error if event was not found |
|
|
46
|
+
|
|
47
|
+
<br/>
|
|
48
|
+
|
|
49
|
+
## Get
|
|
50
|
+
|
|
51
|
+
Retrieves information on an event
|
|
52
|
+
|
|
53
|
+
```ruby
|
|
54
|
+
result = client.event.get(
|
|
55
|
+
applicationId: my_application_id,
|
|
56
|
+
eventId: my_event_id)
|
|
57
|
+
|
|
58
|
+
puts result
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Available Parameters
|
|
62
|
+
|
|
63
|
+
| Name | Type | Required | Description | Default | Example |
|
|
64
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
65
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
66
|
+
| eventId | string | Y | ID associated with the event | | 575ed0de7ae143cd83dc4aa5 |
|
|
67
|
+
|
|
68
|
+
#### Successful Responses
|
|
69
|
+
|
|
70
|
+
| Code | Type | Description |
|
|
71
|
+
| ---- | ---- | ----------- |
|
|
72
|
+
| 200 | [Event](_schemas.md#event) | Event information |
|
|
73
|
+
|
|
74
|
+
#### Error Responses
|
|
75
|
+
|
|
76
|
+
| Code | Type | Description |
|
|
77
|
+
| ---- | ---- | ----------- |
|
|
78
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
79
|
+
| 404 | [Error](_schemas.md#error) | Error if event was not found |
|
|
80
|
+
|
|
81
|
+
<br/>
|
|
82
|
+
|
|
83
|
+
## Patch
|
|
84
|
+
|
|
85
|
+
Updates information about an event
|
|
86
|
+
|
|
87
|
+
```ruby
|
|
88
|
+
result = client.event.patch(
|
|
89
|
+
applicationId: my_application_id,
|
|
90
|
+
eventId: my_event_id,
|
|
91
|
+
event: my_event)
|
|
92
|
+
|
|
93
|
+
puts result
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### Available Parameters
|
|
97
|
+
|
|
98
|
+
| Name | Type | Required | Description | Default | Example |
|
|
99
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
100
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
101
|
+
| eventId | string | Y | ID associated with the event | | 575ed0de7ae143cd83dc4aa5 |
|
|
102
|
+
| event | [Event Patch](_schemas.md#event-patch) | Y | Object containing new properties of the event | | [Event Patch Example](_schemas.md#event-patch-example) |
|
|
103
|
+
|
|
104
|
+
#### Successful Responses
|
|
105
|
+
|
|
106
|
+
| Code | Type | Description |
|
|
107
|
+
| ---- | ---- | ----------- |
|
|
108
|
+
| 200 | [Event](_schemas.md#event) | Updated event information |
|
|
109
|
+
|
|
110
|
+
#### Error Responses
|
|
111
|
+
|
|
112
|
+
| Code | Type | Description |
|
|
113
|
+
| ---- | ---- | ----------- |
|
|
114
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
115
|
+
| 404 | [Error](_schemas.md#error) | Error if event is not found |
|
data/docs/events.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Events Actions
|
|
2
|
+
|
|
3
|
+
Details on the various actions that can be performed on the
|
|
4
|
+
Events resource, including the expected
|
|
5
|
+
parameters and the potential responses.
|
|
6
|
+
|
|
7
|
+
##### Contents
|
|
8
|
+
|
|
9
|
+
* [Get](#get)
|
|
10
|
+
* [Most Recent by Severity](#most-recent-by-severity)
|
|
11
|
+
* [Patch](#patch)
|
|
12
|
+
* [Post](#post)
|
|
13
|
+
|
|
14
|
+
<br/>
|
|
15
|
+
|
|
16
|
+
## Get
|
|
17
|
+
|
|
18
|
+
Returns the events for an application
|
|
19
|
+
|
|
20
|
+
```ruby
|
|
21
|
+
result = client.events.get(applicationId: my_application_id)
|
|
22
|
+
|
|
23
|
+
puts result
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
#### Available Parameters
|
|
27
|
+
|
|
28
|
+
| Name | Type | Required | Description | Default | Example |
|
|
29
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
30
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
31
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: subject, id, creationDate | creationDate | subject |
|
|
32
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | desc | asc |
|
|
33
|
+
| page | string | N | Which page of results to return | 0 | 0 |
|
|
34
|
+
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
|
35
|
+
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: subject | | subject |
|
|
36
|
+
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | abnormal power to * |
|
|
37
|
+
| state | string | N | If provided, return events only in the given state. Accepted values are: new, acknowledged, resolved | | new |
|
|
38
|
+
|
|
39
|
+
#### Successful Responses
|
|
40
|
+
|
|
41
|
+
| Code | Type | Description |
|
|
42
|
+
| ---- | ---- | ----------- |
|
|
43
|
+
| 200 | [Events](_schemas.md#events) | Collection of events |
|
|
44
|
+
|
|
45
|
+
#### Error Responses
|
|
46
|
+
|
|
47
|
+
| Code | Type | Description |
|
|
48
|
+
| ---- | ---- | ----------- |
|
|
49
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
50
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
|
51
|
+
|
|
52
|
+
<br/>
|
|
53
|
+
|
|
54
|
+
## Most Recent by Severity
|
|
55
|
+
|
|
56
|
+
Returns the first new event ordered by severity and then creation
|
|
57
|
+
|
|
58
|
+
```ruby
|
|
59
|
+
result = client.events.most_recent_by_severity(applicationId: my_application_id)
|
|
60
|
+
|
|
61
|
+
puts result
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Available Parameters
|
|
65
|
+
|
|
66
|
+
| Name | Type | Required | Description | Default | Example |
|
|
67
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
68
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
69
|
+
| filter | string | N | Filter to apply against event subjects. Supports globbing. Blank or not provided means no filtering. | | abnormal power to * |
|
|
70
|
+
|
|
71
|
+
#### Successful Responses
|
|
72
|
+
|
|
73
|
+
| Code | Type | Description |
|
|
74
|
+
| ---- | ---- | ----------- |
|
|
75
|
+
| 200 | undefined | The event, plus count of currently new events |
|
|
76
|
+
|
|
77
|
+
#### Error Responses
|
|
78
|
+
|
|
79
|
+
| Code | Type | Description |
|
|
80
|
+
| ---- | ---- | ----------- |
|
|
81
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
|
82
|
+
|
|
83
|
+
<br/>
|
|
84
|
+
|
|
85
|
+
## Patch
|
|
86
|
+
|
|
87
|
+
Updates information for matching events by subject and/or current state
|
|
88
|
+
|
|
89
|
+
```ruby
|
|
90
|
+
result = client.events.patch(
|
|
91
|
+
applicationId: my_application_id,
|
|
92
|
+
updates: my_updates)
|
|
93
|
+
|
|
94
|
+
puts result
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
#### Available Parameters
|
|
98
|
+
|
|
99
|
+
| Name | Type | Required | Description | Default | Example |
|
|
100
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
101
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
102
|
+
| filterField | string | N | Field to filter the events to act on by. Blank or not provided means no filtering. Accepted values are: subject | | subject |
|
|
103
|
+
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | abnormal power to * |
|
|
104
|
+
| state | string | N | If provided, act on events only in the given state. Accepted values are: new, acknowledged, resolved | | new |
|
|
105
|
+
| updates | [Event Patch](_schemas.md#event-patch) | Y | Object containing updated information for the events | | [Event Patch Example](_schemas.md#event-patch-example) |
|
|
106
|
+
|
|
107
|
+
#### Successful Responses
|
|
108
|
+
|
|
109
|
+
| Code | Type | Description |
|
|
110
|
+
| ---- | ---- | ----------- |
|
|
111
|
+
| 200 | [Success](_schemas.md#success) | If updates were successfully applied |
|
|
112
|
+
|
|
113
|
+
#### Error Responses
|
|
114
|
+
|
|
115
|
+
| Code | Type | Description |
|
|
116
|
+
| ---- | ---- | ----------- |
|
|
117
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
118
|
+
| 404 | [Error](_schemas.md#error) | Error if application is not found |
|
|
119
|
+
|
|
120
|
+
<br/>
|
|
121
|
+
|
|
122
|
+
## Post
|
|
123
|
+
|
|
124
|
+
Create a new event for an application
|
|
125
|
+
|
|
126
|
+
```ruby
|
|
127
|
+
result = client.events.post(
|
|
128
|
+
applicationId: my_application_id,
|
|
129
|
+
event: my_event)
|
|
130
|
+
|
|
131
|
+
puts result
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### Available Parameters
|
|
135
|
+
|
|
136
|
+
| Name | Type | Required | Description | Default | Example |
|
|
137
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
138
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
139
|
+
| event | [Event Post](_schemas.md#event-post) | Y | New event information | | [Event Post Example](_schemas.md#event-post-example) |
|
|
140
|
+
|
|
141
|
+
#### Successful Responses
|
|
142
|
+
|
|
143
|
+
| Code | Type | Description |
|
|
144
|
+
| ---- | ---- | ----------- |
|
|
145
|
+
| 201 | [Event](_schemas.md#event) | Successfully created event |
|
|
146
|
+
|
|
147
|
+
#### Error Responses
|
|
148
|
+
|
|
149
|
+
| Code | Type | Description |
|
|
150
|
+
| ---- | ---- | ----------- |
|
|
151
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
152
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
|
153
|
+
| 429 | [Error](_schemas.md#error) | Error if event creation rate limit exceeded |
|