ruby-miradore 4.0.3 → 4.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/fixtures/vcr_cassettes/Change_User_Email_Address.yml +16 -9
- data/fixtures/vcr_cassettes/Get__Mobile_Device.yml +22 -9
- data/fixtures/vcr_cassettes/InvDevice.yml +12 -100
- data/fixtures/vcr_cassettes/InvDevice_test.yml +311 -0
- data/fixtures/vcr_cassettes/LockDevice_all.yml +9 -4
- data/fixtures/vcr_cassettes/all_criteria.yml +252 -49
- data/fixtures/vcr_cassettes/auth_not_found.yml +9 -5
- data/fixtures/vcr_cassettes/error_by_serial_number.yml +10 -4
- data/fixtures/vcr_cassettes/full_list_and_details.yml +11 -7
- data/fixtures/vcr_cassettes/get_computer_device_to_update.yml +14 -8
- data/fixtures/vcr_cassettes/get_computer_device_to_update_dell.yml +19 -22
- data/fixtures/vcr_cassettes/get_location.yml +13 -6
- data/fixtures/vcr_cassettes/get_user_from_miradore.yml +13 -6
- data/fixtures/vcr_cassettes/search_by_serial_number.yml +20 -10
- data/fixtures/vcr_cassettes/update_model_of_a_computer_device_dell.yml +12 -7
- data/fixtures/vcr_cassettes/user_alredy_exist_in_miradore.yml +18 -58
- data/lib/ruby/miradore/version.rb +1 -1
- data/lib/ruby/miradore.rb +3 -7
- metadata +2 -2
- data/fixtures/vcr_cassettes/get_computer_device_to_update_2.yml +0 -51
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://test634.online.miradore.com/API/Device/?auth
|
5
|
+
uri: https://test634.online.miradore.com/API/Device/?auth=1_8,Yo-TV8QyCiBUF&filters=(InvDevice.SerialNumber%20eq%2015P7D72)&options=&select=*,*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -11,8 +11,6 @@ http_interactions:
|
|
11
11
|
- application/json
|
12
12
|
Accept:
|
13
13
|
- application/json
|
14
|
-
X-Api-Key:
|
15
|
-
- ''
|
16
14
|
Accept-Encoding:
|
17
15
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
16
|
User-Agent:
|
@@ -36,29 +34,28 @@ http_interactions:
|
|
36
34
|
- Microsoft-IIS/10.0
|
37
35
|
X-Aspnet-Version:
|
38
36
|
- 4.0.30319
|
37
|
+
X-Content-Type-Options:
|
38
|
+
- nosniff
|
39
39
|
X-Frame-Options:
|
40
40
|
- SAMEORIGIN
|
41
|
+
Referrer-Policy:
|
42
|
+
- same-origin
|
43
|
+
Strict-Transport-Security:
|
44
|
+
- max-age=31536000; includeSubDomains
|
41
45
|
Date:
|
42
|
-
-
|
46
|
+
- Thu, 24 Feb 2022 15:22:15 GMT
|
43
47
|
Content-Length:
|
44
|
-
- '
|
48
|
+
- '786'
|
45
49
|
body:
|
46
50
|
encoding: ASCII-8BIT
|
47
|
-
string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="
|
48
|
-
|
49
|
-
10 Pro
|
50
|
-
/><Status>Deleted</Status><Created>
|
51
|
-
|
52
|
-
|
53
|
-
10 Professionnel (
|
54
|
-
/><Status>
|
55
|
-
|
56
|
-
|
57
|
-
10 Pro (20H2)</OSVersionName><Client><ID>4</ID></Client><ConfigProfileDeployments
|
58
|
-
/><Status>Deleted</Status><Created>04.10.2021 10:26:25</Created><Modified>12.10.2021
|
59
|
-
10:50:17</Modified><Source>MiradoreOnline</Source></Device><Device><ID>9</ID><Location><ID>1</ID></Location><Category><ID>3</ID></Category><Enrollment><ID>36</ID></Enrollment><OnlineStatus>Unknown</OnlineStatus><LastReported>04.11.2021
|
60
|
-
14:31:00</LastReported><LastReportedDays>11</LastReportedDays><LastReportedHours>270</LastReportedHours><LastReportedMinutes>16192</LastReportedMinutes><IPAddress>185.21.34</IPAddress><LocalIPAddress>172.18.193.32</LocalIPAddress><MACAddress>F8:5:81:CF</MACAddress><Platform>WindowsDesktop</Platform><PurchaseDate>08.11.2021
|
61
|
-
00:00:00</PurchaseDate><OSVersionName>Windows 10 Professionnel (20H2)</OSVersionName><Client><ID>9</ID></Client><ConfigProfileDeployments><ConfigProfileDeployment><ID>1</ID><ConfigProfile><ID>7</ID></ConfigProfile></ConfigProfileDeployment></ConfigProfileDeployments><Status>Active</Status><Created>27.10.2021
|
62
|
-
08:10:37</Created><Modified>15.11.2021 19:55:20</Modified><Source>MiradoreOnline</Source></Device></Items></Content>
|
63
|
-
recorded_at: Mon, 15 Nov 2021 20:23:34 GMT
|
51
|
+
string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="2"><Device><ID>36</ID><Enrollment><ID>48</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>26.11.2021
|
52
|
+
15:58:00</LastReported><LastReportedDays>90</LastReportedDays><LastReportedHours>2160</LastReportedHours><LastReportedMinutes>129564</LastReportedMinutes><IPAddress>185.212.21.34</IPAddress><LocalIPAddress>172.18.193.20</LocalIPAddress><MACAddress>F8:CA:B8:24:9D:3A</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
|
53
|
+
10 Pro</OSVersionName><Client><ID>36</ID></Client><ConfigProfileDeployments
|
54
|
+
/><Status>Deleted</Status><Created>15.11.2021 17:09:32</Created><Modified>08.12.2021
|
55
|
+
14:08:44</Modified><Source>MiradoreOnline</Source></Device><Device><ID>53</ID><User><ID>2</ID></User><Location><ID>1</ID></Location><Category><ID>3</ID></Category><Enrollment><ID>72</ID></Enrollment><OnlineStatus>Unknown</OnlineStatus><LastReported>01.02.2022
|
56
|
+
09:44:00</LastReported><LastReportedDays>23</LastReportedDays><LastReportedHours>558</LastReportedHours><LastReportedMinutes>33458</LastReportedMinutes><IPAddress>185.212.21.34</IPAddress><LocalIPAddress>172.18.193.35</LocalIPAddress><MACAddress>F8:CA:B8:24:9D:3A</MACAddress><Platform>WindowsDesktop</Platform><PurchaseDate>24.02.2022
|
57
|
+
00:00:00</PurchaseDate><OSVersionName>Windows 10 Professionnel (21H2)</OSVersionName><Client><ID>53</ID></Client><ConfigProfileDeployments
|
58
|
+
/><Status>Active</Status><Created>26.01.2022 14:21:27</Created><Modified>24.02.2022
|
59
|
+
15:20:37</Modified><Source>MiradoreOnline</Source></Device></Items></Content>
|
60
|
+
recorded_at: Thu, 24 Feb 2022 15:22:15 GMT
|
64
61
|
recorded_with: VCR 6.0.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://rzilient.online.miradore.com/API/Organization/?auth
|
5
|
+
uri: https://rzilient.online.miradore.com/API/Organization/?auth=3_IHBPttQ.ub%5BOG27&filters=&options=&select=*,*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -32,16 +32,23 @@ http_interactions:
|
|
32
32
|
- Microsoft-IIS/10.0
|
33
33
|
X-Aspnet-Version:
|
34
34
|
- 4.0.30319
|
35
|
+
X-Content-Type-Options:
|
36
|
+
- nosniff
|
35
37
|
X-Frame-Options:
|
36
38
|
- SAMEORIGIN
|
39
|
+
Referrer-Policy:
|
40
|
+
- same-origin
|
41
|
+
Strict-Transport-Security:
|
42
|
+
- max-age=31536000; includeSubDomains
|
37
43
|
Date:
|
38
|
-
-
|
44
|
+
- Thu, 24 Feb 2022 15:05:44 GMT
|
39
45
|
Content-Length:
|
40
|
-
- '
|
46
|
+
- '327'
|
41
47
|
body:
|
42
48
|
encoding: ASCII-8BIT
|
43
|
-
string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="
|
49
|
+
string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="2"><Organization><ID>1</ID><Name>PUR
|
44
50
|
Projet</Name><FullName>PUR Projet</FullName><Created>17.05.2021 09:02:43</Created><Modified>17.05.2021
|
45
|
-
09:02:43</Modified></Organization
|
46
|
-
|
51
|
+
09:02:43</Modified></Organization><Organization><ID>2</ID><Name>Rzilient</Name><FullName>Rzilient</FullName><Created>15.11.2021
|
52
|
+
13:12:28</Created><Modified>15.11.2021 13:12:28</Modified></Organization></Items></Content>
|
53
|
+
recorded_at: Thu, 24 Feb 2022 15:05:45 GMT
|
47
54
|
recorded_with: VCR 6.0.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://rzilient.online.miradore.com/API/User/?auth
|
5
|
+
uri: https://rzilient.online.miradore.com/API/User/?auth=3_IHBPttQ.ub%5BOG27&filters=(ID%20eq%202)&options=&select=*,*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -32,15 +32,22 @@ http_interactions:
|
|
32
32
|
- Microsoft-IIS/10.0
|
33
33
|
X-Aspnet-Version:
|
34
34
|
- 4.0.30319
|
35
|
+
X-Content-Type-Options:
|
36
|
+
- nosniff
|
35
37
|
X-Frame-Options:
|
36
38
|
- SAMEORIGIN
|
39
|
+
Referrer-Policy:
|
40
|
+
- same-origin
|
41
|
+
Strict-Transport-Security:
|
42
|
+
- max-age=31536000; includeSubDomains
|
37
43
|
Date:
|
38
|
-
-
|
44
|
+
- Thu, 24 Feb 2022 15:07:05 GMT
|
39
45
|
Content-Length:
|
40
|
-
- '
|
46
|
+
- '377'
|
41
47
|
body:
|
42
48
|
encoding: ASCII-8BIT
|
43
|
-
string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="1"><User><ID>2</ID><
|
44
|
-
|
45
|
-
|
49
|
+
string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="1"><User><ID>2</ID><Name>c1qpvzdyrn
|
50
|
+
3jeldrmqkr</Name><Email>l3s3kof0cg@c3e0l2kfak.com</Email><Firstname>3jeldrmqkr</Firstname><Lastname>c1qpvzdyrn</Lastname><Source>GUI</Source><Status>Retired</Status><Created>22.04.2021
|
51
|
+
06:32:00</Created><Modified>03.11.2021 08:55:12</Modified></User></Items></Content>
|
52
|
+
recorded_at: Thu, 24 Feb 2022 15:07:06 GMT
|
46
53
|
recorded_with: VCR 6.0.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://rzilient.online.miradore.com/API/Device/?auth
|
5
|
+
uri: https://rzilient.online.miradore.com/API/Device/?auth=3_IHBPttQ.ub%5BOG27&filters=(InvDevice.SerialNumber%20eq%2087DB6H2)&options=&select=*,*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -12,7 +12,7 @@ http_interactions:
|
|
12
12
|
Accept:
|
13
13
|
- application/json
|
14
14
|
X-Api-Key:
|
15
|
-
-
|
15
|
+
- ''
|
16
16
|
Accept-Encoding:
|
17
17
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
18
|
User-Agent:
|
@@ -36,18 +36,28 @@ http_interactions:
|
|
36
36
|
- Microsoft-IIS/10.0
|
37
37
|
X-Aspnet-Version:
|
38
38
|
- 4.0.30319
|
39
|
+
X-Content-Type-Options:
|
40
|
+
- nosniff
|
39
41
|
X-Frame-Options:
|
40
42
|
- SAMEORIGIN
|
43
|
+
Referrer-Policy:
|
44
|
+
- same-origin
|
45
|
+
Strict-Transport-Security:
|
46
|
+
- max-age=31536000; includeSubDomains
|
41
47
|
Date:
|
42
|
-
-
|
48
|
+
- Thu, 24 Feb 2022 15:16:09 GMT
|
43
49
|
Content-Length:
|
44
|
-
- '
|
50
|
+
- '751'
|
45
51
|
body:
|
46
52
|
encoding: ASCII-8BIT
|
47
|
-
string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="
|
48
|
-
|
49
|
-
10
|
50
|
-
/><Status>
|
51
|
-
|
52
|
-
|
53
|
+
string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="2"><Device><ID>57</ID><User><ID>22</ID></User><Enrollment><ID>86</ID><User><ID>53</ID></User></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>18.01.2022
|
54
|
+
14:01:45</LastReported><LastReportedDays>37</LastReportedDays><LastReportedHours>889</LastReportedHours><LastReportedMinutes>53355</LastReportedMinutes><IPAddress>185.212.21.34</IPAddress><LocalIPAddress>172.18.193.31</LocalIPAddress><MACAddress>D4:81:D7:F8:52:85</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
|
55
|
+
10 Pro (20H2)</OSVersionName><Client><ID>57</ID></Client><ConfigProfileDeployments
|
56
|
+
/><Status>Deleted</Status><Created>10.12.2021 11:14:12</Created><Modified>18.01.2022
|
57
|
+
14:01:41</Modified><Source>MiradoreOnline</Source></Device><Device><ID>76</ID><User><ID>53</ID></User><Enrollment><ID>88</ID></Enrollment><OnlineStatus>Active</OnlineStatus><LastReported>24.02.2022
|
58
|
+
14:24:00</LastReported><LastReportedDays>0</LastReportedDays><LastReportedHours>1</LastReportedHours><LastReportedMinutes>52</LastReportedMinutes><IPAddress>90.166.166.21</IPAddress><LocalIPAddress>192.168.1.130</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
|
59
|
+
10 Pro</OSVersionName><Client><ID>76</ID></Client><ConfigProfileDeployments
|
60
|
+
/><Status>Active</Status><Created>18.01.2022 14:03:30</Created><Modified>18.02.2022
|
61
|
+
10:33:15</Modified><Source>MiradoreOnline</Source></Device></Items></Content>
|
62
|
+
recorded_at: Thu, 24 Feb 2022 15:16:09 GMT
|
53
63
|
recorded_with: VCR 6.0.0
|
@@ -2,18 +2,18 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: patch
|
5
|
-
uri: https://test634.online.miradore.com/API/v2/Device/
|
5
|
+
uri: https://test634.online.miradore.com/API/v2/Device/53/
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"category":"Laptops","friendlyName":"Eduard personal","userEmailAddress":"eduard@rzilient.club","location":["Barcelona"],"tags":["Personal"],"ownershipStartDate":"
|
9
|
-
|
8
|
+
string: '{"category":"Laptops","friendlyName":"Eduard personal","userEmailAddress":"eduard@rzilient.club","location":["Barcelona"],"tags":["Personal"],"ownershipStartDate":"2022-02-24
|
9
|
+
16:22:49 +0100"}'
|
10
10
|
headers:
|
11
11
|
Content-Type:
|
12
12
|
- application/json
|
13
13
|
Accept:
|
14
14
|
- application/json
|
15
15
|
X-Api-Key:
|
16
|
-
|
16
|
+
- 1_8,Yo-TV8QyCiBUF
|
17
17
|
Accept-Encoding:
|
18
18
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
19
19
|
User-Agent:
|
@@ -25,15 +25,20 @@ http_interactions:
|
|
25
25
|
headers:
|
26
26
|
Server:
|
27
27
|
- Microsoft-IIS/10.0
|
28
|
+
X-Content-Type-Options:
|
29
|
+
- nosniff
|
28
30
|
X-Frame-Options:
|
29
31
|
- SAMEORIGIN
|
30
|
-
-
|
32
|
+
Referrer-Policy:
|
33
|
+
- same-origin
|
34
|
+
Strict-Transport-Security:
|
35
|
+
- max-age=31536000; includeSubDomains
|
31
36
|
Date:
|
32
|
-
-
|
37
|
+
- Thu, 24 Feb 2022 15:22:49 GMT
|
33
38
|
Content-Length:
|
34
39
|
- '0'
|
35
40
|
body:
|
36
41
|
encoding: UTF-8
|
37
42
|
string: ''
|
38
|
-
recorded_at:
|
43
|
+
recorded_at: Thu, 24 Feb 2022 15:22:50 GMT
|
39
44
|
recorded_with: VCR 6.0.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://rzilient.online.miradore.com/API/User/?auth
|
5
|
+
uri: https://rzilient.online.miradore.com/API/User/?auth=3_IHBPttQ.ub%5BOG27&filters=&options=&select=*,ID
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: |
|
@@ -43,18 +43,24 @@ http_interactions:
|
|
43
43
|
- Microsoft-IIS/10.0
|
44
44
|
X-Aspnet-Version:
|
45
45
|
- 4.0.30319
|
46
|
+
X-Content-Type-Options:
|
47
|
+
- nosniff
|
46
48
|
X-Frame-Options:
|
47
49
|
- SAMEORIGIN
|
50
|
+
Referrer-Policy:
|
51
|
+
- same-origin
|
52
|
+
Strict-Transport-Security:
|
53
|
+
- max-age=31536000; includeSubDomains
|
48
54
|
Date:
|
49
|
-
-
|
55
|
+
- Thu, 24 Feb 2022 15:03:58 GMT
|
50
56
|
body:
|
51
57
|
encoding: UTF-8
|
52
58
|
string: "<Content><Error><Description>Failed to validate imported 'User':
|
53
59
|
Email 'jim.straw@trestacom.com' is already in use.</Description><Code>400</Code></Error></Content>"
|
54
|
-
recorded_at:
|
60
|
+
recorded_at: Thu, 24 Feb 2022 15:03:58 GMT
|
55
61
|
- request:
|
56
62
|
method: post
|
57
|
-
uri: https://rzilient.online.miradore.com/API/User
|
63
|
+
uri: https://rzilient.online.miradore.com/API/User/?auth=3_IHBPttQ.ub%5BOG27&filters=&options=&select=*,ID
|
58
64
|
body:
|
59
65
|
encoding: UTF-8
|
60
66
|
string: |
|
@@ -95,65 +101,19 @@ http_interactions:
|
|
95
101
|
- Microsoft-IIS/10.0
|
96
102
|
X-Aspnet-Version:
|
97
103
|
- 4.0.30319
|
104
|
+
X-Content-Type-Options:
|
105
|
+
- nosniff
|
98
106
|
X-Frame-Options:
|
99
107
|
- SAMEORIGIN
|
108
|
+
Referrer-Policy:
|
109
|
+
- same-origin
|
110
|
+
Strict-Transport-Security:
|
111
|
+
- max-age=31536000; includeSubDomains
|
100
112
|
Date:
|
101
|
-
-
|
113
|
+
- Thu, 24 Feb 2022 15:04:08 GMT
|
102
114
|
body:
|
103
115
|
encoding: UTF-8
|
104
116
|
string: "<Content><Error><Description>Failed to validate imported 'User':
|
105
117
|
Email 'jim.straw@trestacom.com' is already in use.</Description><Code>400</Code></Error></Content>"
|
106
|
-
recorded_at:
|
107
|
-
- request:
|
108
|
-
method: post
|
109
|
-
uri: https://rzilient.online.miradore.com/API/User?auth=&filters=&select=*,ID
|
110
|
-
body:
|
111
|
-
encoding: UTF-8
|
112
|
-
string: |
|
113
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
114
|
-
<Content>
|
115
|
-
<Items>
|
116
|
-
<User>
|
117
|
-
<Email>jim.straw@trestacom.com</Email>
|
118
|
-
<Firstname>Jim</Firstname>
|
119
|
-
<Lastname>Straw</Lastname>
|
120
|
-
<PhoneNumber>123456789</PhoneNumber>
|
121
|
-
</User>
|
122
|
-
</Items>
|
123
|
-
</Content>
|
124
|
-
headers:
|
125
|
-
Accept-Encoding:
|
126
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
127
|
-
Accept:
|
128
|
-
- "*/*"
|
129
|
-
User-Agent:
|
130
|
-
- Ruby
|
131
|
-
response:
|
132
|
-
status:
|
133
|
-
code: 400
|
134
|
-
message: Bad Request
|
135
|
-
headers:
|
136
|
-
Cache-Control:
|
137
|
-
- no-cache
|
138
|
-
Pragma:
|
139
|
-
- no-cache
|
140
|
-
Content-Length:
|
141
|
-
- '179'
|
142
|
-
Content-Type:
|
143
|
-
- text/xml; charset=utf-8
|
144
|
-
Expires:
|
145
|
-
- "-1"
|
146
|
-
Server:
|
147
|
-
- Microsoft-IIS/10.0
|
148
|
-
X-Aspnet-Version:
|
149
|
-
- 4.0.30319
|
150
|
-
X-Frame-Options:
|
151
|
-
- SAMEORIGIN
|
152
|
-
Date:
|
153
|
-
- Tue, 02 Nov 2021 11:37:54 GMT
|
154
|
-
body:
|
155
|
-
encoding: UTF-8
|
156
|
-
string: "<Content><Error><Description>Failed to validate imported 'User':
|
157
|
-
Email 'jim.straw@trestacom.com' is already in use.</Description><Code>400</Code></Error></Content>"
|
158
|
-
recorded_at: Tue, 02 Nov 2021 11:37:54 GMT
|
118
|
+
recorded_at: Thu, 24 Feb 2022 15:04:08 GMT
|
159
119
|
recorded_with: VCR 6.0.0
|
data/lib/ruby/miradore.rb
CHANGED
@@ -13,8 +13,7 @@ module Ruby
|
|
13
13
|
|
14
14
|
def self.url
|
15
15
|
{
|
16
|
-
|
17
|
-
request_v1: 'https://%<subdomain>s.online.miradore.com/API/Device?auth=%<auth>s&select=*,Category.*,InvDevice.*,InvStorage.*,InvOS.*,Enrollment.*,Client.*,User.*,Location.*,Security.*,ReportedLocation.*&filters=%<filter>s&options=%<options>s',
|
16
|
+
v1: 'https://%<subdomain>s.online.miradore.com/API/%<item>s/%<id>s?auth=%<auth>s&select=*,%<attribute>s&filters=%<filter>s&options=%<options>s',
|
18
17
|
v2: 'https://%<subdomain>s.online.miradore.com/API/v2/Device/%<id>s/%<method>s'
|
19
18
|
}
|
20
19
|
end
|
@@ -61,19 +60,16 @@ module Ruby
|
|
61
60
|
@json
|
62
61
|
end
|
63
62
|
|
64
|
-
def api_version
|
65
|
-
superclass == Object ? :request_v1 : :item_v1
|
66
|
-
end
|
67
63
|
|
68
64
|
def http_method_v1(**args)
|
69
|
-
url = Miradore.url[
|
65
|
+
url = Miradore.url[:v1] % args.merge(
|
70
66
|
subdomain: @subdomain || args[:subdomain],
|
71
67
|
auth: args.fetch(:auth, @auth),
|
72
68
|
id: args.fetch(:id, nil),
|
73
69
|
item: self.class.to_s.split('::').last,
|
74
70
|
attribute: args.fetch(:attribute, '*'),
|
75
71
|
filter: args.fetch(:filter, nil),
|
76
|
-
options: args.fetch(:options, nil)
|
72
|
+
options: args.fetch(:options, nil)&.to_query&.sub('&', ',')
|
77
73
|
)
|
78
74
|
self.class.method(args.fetch(:method, :get)).call(url, body: args.fetch(:body, nil)&.to_xml(root: 'Content', skip_types: true))
|
79
75
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-miradore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduard Garcia Castelló
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- fixtures/vcr_cassettes/Get_Device_Location.yml
|
150
150
|
- fixtures/vcr_cassettes/Get__Mobile_Device.yml
|
151
151
|
- fixtures/vcr_cassettes/InvDevice.yml
|
152
|
+
- fixtures/vcr_cassettes/InvDevice_test.yml
|
152
153
|
- fixtures/vcr_cassettes/LockDevice_all.yml
|
153
154
|
- fixtures/vcr_cassettes/add_new_other_device.yml
|
154
155
|
- fixtures/vcr_cassettes/all_criteria.yml
|
@@ -156,7 +157,6 @@ files:
|
|
156
157
|
- fixtures/vcr_cassettes/error_by_serial_number.yml
|
157
158
|
- fixtures/vcr_cassettes/full_list_and_details.yml
|
158
159
|
- fixtures/vcr_cassettes/get_computer_device_to_update.yml
|
159
|
-
- fixtures/vcr_cassettes/get_computer_device_to_update_2.yml
|
160
160
|
- fixtures/vcr_cassettes/get_computer_device_to_update_dell.yml
|
161
161
|
- fixtures/vcr_cassettes/get_location.yml
|
162
162
|
- fixtures/vcr_cassettes/get_user_from_miradore.yml
|
@@ -1,51 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: https://test634.online.miradore.com/API/Device/?auth=&filters=ID%20eq%2037&select=*,*
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Content-Type:
|
11
|
-
- application/json
|
12
|
-
Accept:
|
13
|
-
- application/json
|
14
|
-
Accept-Encoding:
|
15
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
-
User-Agent:
|
17
|
-
- Ruby
|
18
|
-
response:
|
19
|
-
status:
|
20
|
-
code: 200
|
21
|
-
message: OK
|
22
|
-
headers:
|
23
|
-
Cache-Control:
|
24
|
-
- no-cache
|
25
|
-
Pragma:
|
26
|
-
- no-cache
|
27
|
-
Content-Type:
|
28
|
-
- text/xml
|
29
|
-
Expires:
|
30
|
-
- "-1"
|
31
|
-
Vary:
|
32
|
-
- Accept-Encoding
|
33
|
-
Server:
|
34
|
-
- Microsoft-IIS/10.0
|
35
|
-
X-Aspnet-Version:
|
36
|
-
- 4.0.30319
|
37
|
-
X-Frame-Options:
|
38
|
-
- SAMEORIGIN
|
39
|
-
Date:
|
40
|
-
- Tue, 16 Nov 2021 09:03:17 GMT
|
41
|
-
Content-Length:
|
42
|
-
- '547'
|
43
|
-
body:
|
44
|
-
encoding: ASCII-8BIT
|
45
|
-
string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="1"><Device><ID>37</ID><User><ID>2</ID></User><Category><ID>8</ID></Category><Enrollment><ID>49</ID><User><ID>2</ID></User></Enrollment><OnlineStatus>Active</OnlineStatus><LastReported>16.11.2021
|
46
|
-
08:31:26</LastReported><LastReportedDays>0</LastReportedDays><LastReportedHours>1</LastReportedHours><LastReportedMinutes>32</LastReportedMinutes><IPAddress>185.21.34</IPAddress><MACAddress>d4:d6:09:be</MACAddress><Platform>iOS</Platform><OSVersionName>iOS
|
47
|
-
14.4.2</OSVersionName><Client><ID>37</ID></Client><ConfigProfileDeployments
|
48
|
-
/><Status>AutoGenerated</Status><Created>15.11.2021 19:21:35</Created><Modified>16.11.2021
|
49
|
-
09:01:30</Modified><Source>MiradoreOnline</Source></Device></Items></Content>
|
50
|
-
recorded_at: Tue, 16 Nov 2021 09:03:17 GMT
|
51
|
-
recorded_with: VCR 6.0.0
|