applocate 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/lib/applocate/api.rb +20 -2
- data/lib/applocate/version.rb +1 -1
- 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: 392aa32427fc01df5b96187dee2dc2d4a31a6664
|
4
|
+
data.tar.gz: 11dac0e52db1742bb3016e02dd5bf41eaadf457a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7296632d41963d23117054fc2f768cb03b7a77a123ef7353e59b8617d793d263ad9afc43bb2ab4406197207adf796db31cb2d2b693751f8b580ce83d92e1b069
|
7
|
+
data.tar.gz: 3ca2e34f031dcc38f671f2ec46772b287bb6f903b3afd5f04b5707df1cd2626cad9bee703529b2e538609f8c2c01d1e61ab257118a295df224acbb1ba4eb5432
|
data/README.md
CHANGED
@@ -85,6 +85,18 @@ Applocate::API.delete_device(options)
|
|
85
85
|
Applocate::API.profile_list(udid)
|
86
86
|
# returns a list (Array) of install profiles. **excluding any provisioning profiles.**
|
87
87
|
|
88
|
+
# expected params, udid = "ABCD-DCCDDC-12394812389-CDC"
|
89
|
+
Applocate::API.recent_checkins(udid)
|
90
|
+
# returns a list of the checkins for the device for the last two days.
|
91
|
+
|
92
|
+
# expected params, udid = "ABCD-DCCDDC-12394812389-CDC"
|
93
|
+
Applocate::API.recent_commands(udid)
|
94
|
+
# returns a list of commands issued to the device is the last two days.
|
95
|
+
|
96
|
+
# expected params, udid = "ABCD-DCCDDC-12394812389-CDC"
|
97
|
+
Applocate::API.active_commands(udid)
|
98
|
+
# returns a list of the active commands for a device.
|
99
|
+
|
88
100
|
# expected params: udid = "ABCD-DCCDDC-12394812389-CDC", name = "me.example.restrictions" options { ... Apple MDM Restrictions Profile ... }
|
89
101
|
Applocate::API.apply_named_restrictions(udid, name, options)
|
90
102
|
# returns the udid and the status of the command as JSON
|
data/lib/applocate/api.rb
CHANGED
@@ -8,6 +8,24 @@ module Applocate
|
|
8
8
|
headers 'Content-Type' => "application/json"
|
9
9
|
format :plain
|
10
10
|
|
11
|
+
# expected params, udid = "ABCD-DCCDDC-12394812389-CDC"
|
12
|
+
def self.recent_checkins(udid)
|
13
|
+
response = self.get("/api/devices/#{udid}/recent_checkins", { headers: authentication })
|
14
|
+
JSON.parse response.body rescue []
|
15
|
+
end
|
16
|
+
|
17
|
+
# expected params, udid = "ABCD-DCCDDC-12394812389-CDC"
|
18
|
+
def self.recent_commands(udid)
|
19
|
+
response = self.get("/api/devices/#{udid}/recent_commands", { headers: authentication })
|
20
|
+
JSON.parse response.body rescue []
|
21
|
+
end
|
22
|
+
|
23
|
+
# expected params, udid = "ABCD-DCCDDC-12394812389-CDC"
|
24
|
+
def self.active_commands(udid)
|
25
|
+
response = self.get("/api/devices/#{udid}/active_commands", { headers: authentication })
|
26
|
+
JSON.parse response.body rescue []
|
27
|
+
end
|
28
|
+
|
11
29
|
# expected params, udid = "ABCD-DCCDDC-12394812389-CDC"
|
12
30
|
def self.profile_list(udid)
|
13
31
|
response = self.get("/api/devices/#{udid}/profiles", { headers: authentication })
|
@@ -16,7 +34,7 @@ module Applocate
|
|
16
34
|
|
17
35
|
# expected params: udid = "ABCD-DCCDDC-12394812389-CDC", name = "me.example.restrictions" options { ... Apple MDM Restrictions Profile ... }
|
18
36
|
def self.apply_named_restrictions(udid, name, options = {})
|
19
|
-
escaped_name = CGI
|
37
|
+
escaped_name = CGI.escape(name)
|
20
38
|
escaped_name = escaped_name.gsub(/[.]/, '%2E') unless escaped_name.nil?
|
21
39
|
response = self.post("/api/devices/#{udid}/profiles/#{escaped_name}", { body: options.to_json, headers: authentication })
|
22
40
|
JSON.parse response.body rescue {}
|
@@ -24,7 +42,7 @@ module Applocate
|
|
24
42
|
|
25
43
|
# expected params, udid = "ABCD-DCCDDC-12394812389-CDC", name = "me.example.restrictions"
|
26
44
|
def self.remove_named_restrictions(udid, name)
|
27
|
-
escaped_name = CGI
|
45
|
+
escaped_name = CGI.escape(name)
|
28
46
|
escaped_name = escaped_name.gsub(/[.]/, '%2E') unless escaped_name.nil?
|
29
47
|
response = self.delete("/api/devices/#{udid}/profiles/#{escaped_name}", { headers: authentication })
|
30
48
|
JSON.parse response.body rescue {}
|
data/lib/applocate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: applocate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Madsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|