optica-client 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2707b665c02b7e9fab50ed54997fcd7f6deaba82
4
- data.tar.gz: 6a1e0236dd17a745341c62fb12723a325ad89a78
3
+ metadata.gz: e231b226e1fd51fcf8a57d0e03c644e006a352a8
4
+ data.tar.gz: 36c245aaffdd8dfbe13bffdf24a8c9d717f24b56
5
5
  SHA512:
6
- metadata.gz: f1011f391dd4695e3ebd5bc5833697d34e785d93b3510ff13fcd35c936731a4c9800b9a76cd4a2d7512620f2fbd8c2d9cedfe56a7bec06353b1fab1c69d5d759
7
- data.tar.gz: 5be5f02624481514824262fd12fbde9d21287623996ee43d1f94d8526a60d0f3bb0f43653e516ed5e44bd90469203f367124f3f7e8314f73a0bb5f716d855522
6
+ metadata.gz: 7395337003e0e80229826b0a9aef7a036faca0df9dbb773c6006e655ef574f2493e4508b3ac702ef98377b0a5e359a1ed9de848e189592c34b38d3167d2b06d1
7
+ data.tar.gz: f6cd27ba9404d9d858d118196c9b42978aec4328265b36e76b58cdd5023ea0e552e7fe91e873dad08b12f0b8b3afedcb5551f7b499a59d7debc04da54885d365
data/README.md CHANGED
@@ -20,8 +20,8 @@ You'll want to configure the command-line client to use your Optica instance:
20
20
  ```text
21
21
  Usage: optical [options] [FIELD=FILTER] [FIELD2=FILTER2...]
22
22
 
23
- Fetch host information from Optica, and cache it for 15 minutes. Output the
24
- fetched information as single-line JSON hashes, suitable for furhter processing with `jq`.
23
+ Fetch host information from Optica, and cache it for 15 minutes.
24
+ Output the fetched information as a JSON stream, suitable for processing with `jq`.
25
25
 
26
26
  FIELD: any optica field; see your optica host for availible fields
27
27
  FILTER: either a bare string, like "optica", or a regex string, like "/^(o|O)ptica?/"
@@ -30,10 +30,23 @@ Options:
30
30
  -s, --select a,b,c Retrieve the given fields, in addition to the defaults
31
31
  -a, --all Retrieve all fields (default is just role,id,hostname)
32
32
  -v, --verbose Print debug information to STDERR
33
- -p, --pretty[=true] Pretty-print JSON (default true when STDOUT is a TTY)
33
+ -p, --pretty[=false] Pretty-print JSON (default true when STDOUT is a TTY)
34
34
  -r, --refresh Delete cache before performing request.
35
35
  -h, --host URI Optica host (default "https://optica.d.musta.ch")
36
36
  -H, --set-default-host URI Set the default optica host
37
+
38
+ Examples:
39
+ Retrieve all nodes with a role starting with "example-":
40
+ optical role=/^example-/
41
+
42
+ Retrieve all the nodes registered to a test optica instance:
43
+ optical -h https://optica-test.example.com
44
+
45
+ Retrieve all data about my nodes:
46
+ optical --all launched_by=`whoami`
47
+
48
+ SSH into the first matched node:
49
+ ssh $(optical role=example branch=jake-test | head -n 1 | jq -r .hostname)
37
50
  ```
38
51
 
39
52
  ## Development
@@ -53,8 +53,8 @@ module Optica
53
53
 
54
54
  o.separator ''
55
55
  o.separator <<-EOS
56
- Fetch host information from Optica, and cache it for 15 minutes. Output the
57
- fetched information as single-line JSON hashes, suitable for furhter processing with `jq`.
56
+ Fetch host information from Optica, and cache it for 15 minutes.
57
+ Output the fetched information as a JSON stream, suitable for processing with `jq`.
58
58
 
59
59
  FIELD: any optica field; see your optica host for availible fields
60
60
  FILTER: either a bare string, like "optica", or a regex string, like "/^(o|O)ptica?/"
@@ -120,6 +120,21 @@ module Optica
120
120
  log "set default host to #{h}"
121
121
  end
122
122
 
123
+ o.separator ''
124
+ o.separator 'Examples:'
125
+ o.separator <<-EOS
126
+ Retrieve all nodes with a role starting with "example-":
127
+ optical role=/^example-/
128
+
129
+ Retrieve all the nodes registered to a test optica instance:
130
+ optical -h https://optica-test.example.com
131
+
132
+ Retrieve all data about my nodes:
133
+ optical --all launched_by=`whoami`
134
+
135
+ SSH into the first matched node:
136
+ ssh $(optical role=example branch=jake-test | head -n 1 | jq -r .hostname)
137
+ EOS
123
138
  end
124
139
  end
125
140
 
@@ -1,5 +1,5 @@
1
1
  module Optica
2
2
  module Client
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optica-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Teton-Landis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-17 00:00:00.000000000 Z
11
+ date: 2017-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: filecache