losant_rest 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/docs/_schemas.md +44 -26
- data/docs/dashboard.md +1 -0
- data/lib/losant_rest/client.rb +2 -2
- data/lib/losant_rest/dashboard.rb +2 -0
- data/lib/losant_rest/version.rb +1 -1
- data/schemas/authedDevice.json +2 -2
- data/schemas/dashboard.json +3 -0
- data/schemas/dashboardPatch.json +6 -0
- data/schemas/dashboardPost.json +6 -0
- data/schemas/dashboards.json +3 -0
- data/schemas/device.json +3 -3
- data/schemas/devicePatch.json +3 -3
- data/schemas/devicePost.json +3 -3
- data/schemas/deviceRecipe.json +3 -3
- data/schemas/deviceRecipePatch.json +3 -3
- data/schemas/deviceRecipePost.json +3 -3
- data/schemas/deviceRecipes.json +3 -3
- data/schemas/devices.json +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: feef8330911e8b103858f9a7c52fab99d5d6d6ce
|
4
|
+
data.tar.gz: ed34d8331125fc2376651d1266ae60d18bfe0bde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0612fe46ccdb7b55d93c2abd3c5f7c3e9be3581d7aafe0d7306829a05fd54d0fa70104c343c3e4ae98179cac3429c1cc37285d978abbbc0f74316ed5d14c04c2
|
7
|
+
data.tar.gz: 27a4ab8e19548f3b6d596630325e5bacd422d0740f049360033a2f505e19477587583095ae192bc3989dce7d7da045a83f8cd0e637629eb062db21865c49627a
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Losant Ruby REST API Client
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/Losant/losant-rest-ruby.svg?branch=master)](https://travis-ci.org/Losant/losant-rest-ruby)
|
3
|
+
[![Build Status](https://travis-ci.org/Losant/losant-rest-ruby.svg?branch=master)](https://travis-ci.org/Losant/losant-rest-ruby) [![Gem Version](https://badge.fury.io/rb/losant_rest.svg)](https://badge.fury.io/rb/losant_rest)
|
4
4
|
|
5
|
-
The [Losant](https://www.losant.com
|
5
|
+
The [Losant](https://www.losant.com) REST API client provides a simple way to
|
6
6
|
use the comprehensive Losant API. You can authenticate either as a Losant
|
7
7
|
device or with your user account, and have access to all the functionality
|
8
8
|
of the Losant platform.
|
data/docs/_schemas.md
CHANGED
@@ -1024,8 +1024,8 @@ Schema for the sucessful response when authenticating a Device
|
|
1024
1024
|
"type": "string",
|
1025
1025
|
"enum": [
|
1026
1026
|
"standalone",
|
1027
|
-
"
|
1028
|
-
"
|
1027
|
+
"gateway",
|
1028
|
+
"peripheral",
|
1029
1029
|
"floating",
|
1030
1030
|
"virtual"
|
1031
1031
|
]
|
@@ -1145,6 +1145,9 @@ Schema for a single Dashboard
|
|
1145
1145
|
"minimum": 5,
|
1146
1146
|
"maximum": 600
|
1147
1147
|
},
|
1148
|
+
"isPasswordProtected": {
|
1149
|
+
"type": "boolean"
|
1150
|
+
},
|
1148
1151
|
"public": {
|
1149
1152
|
"type": "boolean"
|
1150
1153
|
},
|
@@ -1288,6 +1291,12 @@ Schema for the body of a Dashboard modification request
|
|
1288
1291
|
},
|
1289
1292
|
"public": {
|
1290
1293
|
"type": "boolean"
|
1294
|
+
},
|
1295
|
+
"password": {
|
1296
|
+
"type": [
|
1297
|
+
"string",
|
1298
|
+
"null"
|
1299
|
+
]
|
1291
1300
|
}
|
1292
1301
|
},
|
1293
1302
|
"additionalProperties": false
|
@@ -1382,6 +1391,12 @@ Schema for the body of a Dashboard creation request
|
|
1382
1391
|
},
|
1383
1392
|
"public": {
|
1384
1393
|
"type": "boolean"
|
1394
|
+
},
|
1395
|
+
"password": {
|
1396
|
+
"type": [
|
1397
|
+
"string",
|
1398
|
+
"null"
|
1399
|
+
]
|
1385
1400
|
}
|
1386
1401
|
},
|
1387
1402
|
"additionalProperties": false,
|
@@ -1460,6 +1475,9 @@ Schema for a collection of Dashboards
|
|
1460
1475
|
"minimum": 5,
|
1461
1476
|
"maximum": 600
|
1462
1477
|
},
|
1478
|
+
"isPasswordProtected": {
|
1479
|
+
"type": "boolean"
|
1480
|
+
},
|
1463
1481
|
"public": {
|
1464
1482
|
"type": "boolean"
|
1465
1483
|
},
|
@@ -1664,13 +1682,13 @@ Schema for a single Device
|
|
1664
1682
|
"type": "string",
|
1665
1683
|
"enum": [
|
1666
1684
|
"standalone",
|
1667
|
-
"
|
1668
|
-
"
|
1685
|
+
"gateway",
|
1686
|
+
"peripheral",
|
1669
1687
|
"floating",
|
1670
1688
|
"virtual"
|
1671
1689
|
]
|
1672
1690
|
},
|
1673
|
-
"
|
1691
|
+
"gatewayId": {
|
1674
1692
|
"type": "string",
|
1675
1693
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
1676
1694
|
},
|
@@ -2025,13 +2043,13 @@ Schema for the body of a Device modification request
|
|
2025
2043
|
"type": "string",
|
2026
2044
|
"enum": [
|
2027
2045
|
"standalone",
|
2028
|
-
"
|
2029
|
-
"
|
2046
|
+
"gateway",
|
2047
|
+
"peripheral",
|
2030
2048
|
"floating",
|
2031
2049
|
"virtual"
|
2032
2050
|
]
|
2033
2051
|
},
|
2034
|
-
"
|
2052
|
+
"gatewayId": {
|
2035
2053
|
"type": "string",
|
2036
2054
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
2037
2055
|
}
|
@@ -2135,13 +2153,13 @@ Schema for the body of a Device creation request
|
|
2135
2153
|
"type": "string",
|
2136
2154
|
"enum": [
|
2137
2155
|
"standalone",
|
2138
|
-
"
|
2139
|
-
"
|
2156
|
+
"gateway",
|
2157
|
+
"peripheral",
|
2140
2158
|
"floating",
|
2141
2159
|
"virtual"
|
2142
2160
|
]
|
2143
2161
|
},
|
2144
|
-
"
|
2162
|
+
"gatewayId": {
|
2145
2163
|
"type": "string",
|
2146
2164
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
2147
2165
|
}
|
@@ -2277,13 +2295,13 @@ Schema for a single Device Recipe
|
|
2277
2295
|
"type": "string",
|
2278
2296
|
"enum": [
|
2279
2297
|
"standalone",
|
2280
|
-
"
|
2281
|
-
"
|
2298
|
+
"gateway",
|
2299
|
+
"peripheral",
|
2282
2300
|
"floating",
|
2283
2301
|
"virtual"
|
2284
2302
|
]
|
2285
2303
|
},
|
2286
|
-
"
|
2304
|
+
"gatewayId": {
|
2287
2305
|
"type": "string",
|
2288
2306
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
2289
2307
|
}
|
@@ -2476,13 +2494,13 @@ Schema for the body of a Device Recipe modification request
|
|
2476
2494
|
"type": "string",
|
2477
2495
|
"enum": [
|
2478
2496
|
"standalone",
|
2479
|
-
"
|
2480
|
-
"
|
2497
|
+
"gateway",
|
2498
|
+
"peripheral",
|
2481
2499
|
"floating",
|
2482
2500
|
"virtual"
|
2483
2501
|
]
|
2484
2502
|
},
|
2485
|
-
"
|
2503
|
+
"gatewayId": {
|
2486
2504
|
"type": "string",
|
2487
2505
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
2488
2506
|
}
|
@@ -2597,13 +2615,13 @@ Schema for the body of a Device Recipe creation request
|
|
2597
2615
|
"type": "string",
|
2598
2616
|
"enum": [
|
2599
2617
|
"standalone",
|
2600
|
-
"
|
2601
|
-
"
|
2618
|
+
"gateway",
|
2619
|
+
"peripheral",
|
2602
2620
|
"floating",
|
2603
2621
|
"virtual"
|
2604
2622
|
]
|
2605
2623
|
},
|
2606
|
-
"
|
2624
|
+
"gatewayId": {
|
2607
2625
|
"type": "string",
|
2608
2626
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
2609
2627
|
}
|
@@ -2748,13 +2766,13 @@ Schema for a collection of Device Recipes
|
|
2748
2766
|
"type": "string",
|
2749
2767
|
"enum": [
|
2750
2768
|
"standalone",
|
2751
|
-
"
|
2752
|
-
"
|
2769
|
+
"gateway",
|
2770
|
+
"peripheral",
|
2753
2771
|
"floating",
|
2754
2772
|
"virtual"
|
2755
2773
|
]
|
2756
2774
|
},
|
2757
|
-
"
|
2775
|
+
"gatewayId": {
|
2758
2776
|
"type": "string",
|
2759
2777
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
2760
2778
|
}
|
@@ -3089,13 +3107,13 @@ Schema for a collection of Devices
|
|
3089
3107
|
"type": "string",
|
3090
3108
|
"enum": [
|
3091
3109
|
"standalone",
|
3092
|
-
"
|
3093
|
-
"
|
3110
|
+
"gateway",
|
3111
|
+
"peripheral",
|
3094
3112
|
"floating",
|
3095
3113
|
"virtual"
|
3096
3114
|
]
|
3097
3115
|
},
|
3098
|
-
"
|
3116
|
+
"gatewayId": {
|
3099
3117
|
"type": "string",
|
3100
3118
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
3101
3119
|
},
|
data/docs/dashboard.md
CHANGED
@@ -58,6 +58,7 @@ puts result
|
|
58
58
|
| Name | Type | Required | Description | Default | Example |
|
59
59
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
60
60
|
| dashboardId | string | Y | ID of the associated dashboard | | 575ece2b7ae143cd83dc4a9b |
|
61
|
+
| password | string | N | Password for password-protected dashboards | | undefined |
|
61
62
|
|
62
63
|
#### Successful Responses
|
63
64
|
|
data/lib/losant_rest/client.rb
CHANGED
@@ -5,7 +5,7 @@ module LosantRest
|
|
5
5
|
#
|
6
6
|
# User API for accessing Losant data
|
7
7
|
#
|
8
|
-
# Built For Version 1.3.
|
8
|
+
# Built For Version 1.3.10
|
9
9
|
class Client
|
10
10
|
attr_accessor :auth_token, :url
|
11
11
|
|
@@ -112,7 +112,7 @@ module LosantRest
|
|
112
112
|
|
113
113
|
headers["Accept"] = "application/json"
|
114
114
|
headers["Content-Type"] = "application/json"
|
115
|
-
headers["Accept-Version"] = "^1.3.
|
115
|
+
headers["Accept-Version"] = "^1.3.10"
|
116
116
|
headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
|
117
117
|
path = self.url + options.fetch(:path, "")
|
118
118
|
|
@@ -47,6 +47,7 @@ module LosantRest
|
|
47
47
|
#
|
48
48
|
# Parameters:
|
49
49
|
# * {string} dashboardId - ID of the associated dashboard
|
50
|
+
# * {string} password - Password for password-protected dashboards
|
50
51
|
# * {boolean} _actions - Return resource actions in response
|
51
52
|
# * {boolean} _links - Return resource link in response
|
52
53
|
# * {boolean} _embedded - Return embedded resources in response
|
@@ -65,6 +66,7 @@ module LosantRest
|
|
65
66
|
|
66
67
|
raise ArgumentError.new("dashboardId is required") unless params.has_key?(:dashboardId)
|
67
68
|
|
69
|
+
query_params[:password] = params[:password] if params.has_key?(:password)
|
68
70
|
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
69
71
|
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
70
72
|
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
data/lib/losant_rest/version.rb
CHANGED
data/schemas/authedDevice.json
CHANGED
data/schemas/dashboard.json
CHANGED
data/schemas/dashboardPatch.json
CHANGED
data/schemas/dashboardPost.json
CHANGED
data/schemas/dashboards.json
CHANGED
data/schemas/device.json
CHANGED
@@ -83,13 +83,13 @@
|
|
83
83
|
"type": "string",
|
84
84
|
"enum": [
|
85
85
|
"standalone",
|
86
|
-
"
|
87
|
-
"
|
86
|
+
"gateway",
|
87
|
+
"peripheral",
|
88
88
|
"floating",
|
89
89
|
"virtual"
|
90
90
|
]
|
91
91
|
},
|
92
|
-
"
|
92
|
+
"gatewayId": {
|
93
93
|
"type": "string",
|
94
94
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
95
95
|
},
|
data/schemas/devicePatch.json
CHANGED
@@ -63,13 +63,13 @@
|
|
63
63
|
"type": "string",
|
64
64
|
"enum": [
|
65
65
|
"standalone",
|
66
|
-
"
|
67
|
-
"
|
66
|
+
"gateway",
|
67
|
+
"peripheral",
|
68
68
|
"floating",
|
69
69
|
"virtual"
|
70
70
|
]
|
71
71
|
},
|
72
|
-
"
|
72
|
+
"gatewayId": {
|
73
73
|
"type": "string",
|
74
74
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
75
75
|
}
|
data/schemas/devicePost.json
CHANGED
@@ -63,13 +63,13 @@
|
|
63
63
|
"type": "string",
|
64
64
|
"enum": [
|
65
65
|
"standalone",
|
66
|
-
"
|
67
|
-
"
|
66
|
+
"gateway",
|
67
|
+
"peripheral",
|
68
68
|
"floating",
|
69
69
|
"virtual"
|
70
70
|
]
|
71
71
|
},
|
72
|
-
"
|
72
|
+
"gatewayId": {
|
73
73
|
"type": "string",
|
74
74
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
75
75
|
}
|
data/schemas/deviceRecipe.json
CHANGED
@@ -92,13 +92,13 @@
|
|
92
92
|
"type": "string",
|
93
93
|
"enum": [
|
94
94
|
"standalone",
|
95
|
-
"
|
96
|
-
"
|
95
|
+
"gateway",
|
96
|
+
"peripheral",
|
97
97
|
"floating",
|
98
98
|
"virtual"
|
99
99
|
]
|
100
100
|
},
|
101
|
-
"
|
101
|
+
"gatewayId": {
|
102
102
|
"type": "string",
|
103
103
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
104
104
|
}
|
@@ -72,13 +72,13 @@
|
|
72
72
|
"type": "string",
|
73
73
|
"enum": [
|
74
74
|
"standalone",
|
75
|
-
"
|
76
|
-
"
|
75
|
+
"gateway",
|
76
|
+
"peripheral",
|
77
77
|
"floating",
|
78
78
|
"virtual"
|
79
79
|
]
|
80
80
|
},
|
81
|
-
"
|
81
|
+
"gatewayId": {
|
82
82
|
"type": "string",
|
83
83
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
84
84
|
}
|
@@ -72,13 +72,13 @@
|
|
72
72
|
"type": "string",
|
73
73
|
"enum": [
|
74
74
|
"standalone",
|
75
|
-
"
|
76
|
-
"
|
75
|
+
"gateway",
|
76
|
+
"peripheral",
|
77
77
|
"floating",
|
78
78
|
"virtual"
|
79
79
|
]
|
80
80
|
},
|
81
|
-
"
|
81
|
+
"gatewayId": {
|
82
82
|
"type": "string",
|
83
83
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
84
84
|
}
|
data/schemas/deviceRecipes.json
CHANGED
@@ -99,13 +99,13 @@
|
|
99
99
|
"type": "string",
|
100
100
|
"enum": [
|
101
101
|
"standalone",
|
102
|
-
"
|
103
|
-
"
|
102
|
+
"gateway",
|
103
|
+
"peripheral",
|
104
104
|
"floating",
|
105
105
|
"virtual"
|
106
106
|
]
|
107
107
|
},
|
108
|
-
"
|
108
|
+
"gatewayId": {
|
109
109
|
"type": "string",
|
110
110
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
111
111
|
}
|
data/schemas/devices.json
CHANGED
@@ -90,13 +90,13 @@
|
|
90
90
|
"type": "string",
|
91
91
|
"enum": [
|
92
92
|
"standalone",
|
93
|
-
"
|
94
|
-
"
|
93
|
+
"gateway",
|
94
|
+
"peripheral",
|
95
95
|
"floating",
|
96
96
|
"virtual"
|
97
97
|
]
|
98
98
|
},
|
99
|
-
"
|
99
|
+
"gatewayId": {
|
100
100
|
"type": "string",
|
101
101
|
"pattern": "^[A-Fa-f\\d]{24}$"
|
102
102
|
},
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: losant_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Kuehl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|