wavefront-cli 2.10.0 → 2.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +8 -1
- data/lib/wavefront-cli/commands/proxy.rb +2 -1
- data/lib/wavefront-cli/display/proxy.rb +4 -0
- data/lib/wavefront-cli/proxy.rb +12 -0
- data/lib/wavefront-cli/version.rb +1 -1
- data/spec/spec_helper.rb +19 -4
- data/spec/wavefront-cli/proxy_spec.rb +2 -1
- data/wavefront-cli.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc20c9708088b0919282067c07688154bed7f7a2b2b37697eda633c6a9ffa95f
|
4
|
+
data.tar.gz: fb2c599eba984f008ba7d750b651ccef0b5cf49732e0a427ba50edcb8af4fff8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73a3bc9afce21f9b6f3cdac570483f5155b3ba7b3b6b3f84ac3acebe83aeb927c28f1bc00a416a225b64ec8ff8bac42f16c2aef348a88c06a90c83a872383e31
|
7
|
+
data.tar.gz: 6ef1736948858597ae347aa1cbf9c3d71c4855b317076209fbd7e0a9cca216514df74a31663f2096b735b63693322244a06744e2e8d54b5ecaef68946d88f02e
|
data/HISTORY.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## 2.
|
3
|
+
## 2.11.0 (24/10/2018)
|
4
|
+
* Add `proxy versions` subcommand. Lists proxies and their versions,
|
5
|
+
newest to oldest.
|
6
|
+
|
7
|
+
## 2.10.1 (22/10/2018)
|
8
|
+
* Fix bug seen when listing events with `-s` AND `-L`.
|
9
|
+
|
10
|
+
## 2.10.0 (22/10/2018)
|
4
11
|
* Most `list` subcommands accept `-a / --all`, and will show all
|
5
12
|
objects of the given type, with no pagination. (Exceptions are
|
6
13
|
`user`, which never paginated because the API doesn't, and
|
@@ -13,7 +13,8 @@ class WavefrontCommandProxy < WavefrontCommandBase
|
|
13
13
|
"delete #{CMN} <id>",
|
14
14
|
"undelete #{CMN} <id>",
|
15
15
|
"rename #{CMN} <id> <name>",
|
16
|
-
"search #{CMN} [-al] [-f format] [-o offset] [-L limit] <condition>..."
|
16
|
+
"search #{CMN} [-al] [-f format] [-o offset] [-L limit] <condition>...",
|
17
|
+
"versions #{CMN}"]
|
17
18
|
end
|
18
19
|
|
19
20
|
def _options
|
data/lib/wavefront-cli/proxy.rb
CHANGED
@@ -5,11 +5,23 @@ module WavefrontCli
|
|
5
5
|
# CLI coverage for the v2 'proxy' API.
|
6
6
|
#
|
7
7
|
class Proxy < WavefrontCli::Base
|
8
|
+
def no_api_response
|
9
|
+
%w[do_versions]
|
10
|
+
end
|
11
|
+
|
8
12
|
def do_rename
|
9
13
|
wf_string?(options[:'<name>'])
|
10
14
|
wf.rename(options[:'<id>'], options[:'<name>'])
|
11
15
|
end
|
12
16
|
|
17
|
+
def do_versions
|
18
|
+
raw = wf.list(0, :all).response.items.map do |i|
|
19
|
+
{ id: i.id, version: i.version, name: i.name }
|
20
|
+
end
|
21
|
+
|
22
|
+
raw.sort_by { |p| Gem::Version.new(p[:version]) }.reverse
|
23
|
+
end
|
24
|
+
|
13
25
|
def extra_validation
|
14
26
|
return unless options[:'<name>']
|
15
27
|
begin
|
@@ -1 +1 @@
|
|
1
|
-
WF_CLI_VERSION = '2.
|
1
|
+
WF_CLI_VERSION = '2.11.0'.freeze
|
data/spec/spec_helper.rb
CHANGED
@@ -47,9 +47,24 @@ def permutations
|
|
47
47
|
e: ENDPOINT }]]
|
48
48
|
end
|
49
49
|
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
50
|
+
# Object returned by cmd_to_call. Has just enough methods to satisy
|
51
|
+
# the SDK
|
52
|
+
#
|
53
|
+
class DummyResponse
|
54
|
+
def more_items?
|
55
|
+
false
|
56
|
+
end
|
57
|
+
|
58
|
+
def response
|
59
|
+
Map.new(items: [])
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
CANNED_RESPONSE = DummyResponse.new
|
64
|
+
|
65
|
+
# Match a command to the final API call it should produce, applying
|
66
|
+
# options in as many combinations as possible, and ensuring the
|
67
|
+
# requisite display methods are called.
|
53
68
|
#
|
54
69
|
# @param cmd [String] command line args to supply to the Wavefront
|
55
70
|
# command
|
@@ -89,7 +104,7 @@ def cmd_to_call(word, args, call, sdk_class = nil)
|
|
89
104
|
require "wavefront-sdk/#{sdk_class.name.split('::').last.downcase}"
|
90
105
|
Spy.on_instance_method(
|
91
106
|
Object.const_get('Wavefront::ApiCaller'), :respond
|
92
|
-
).and_return(
|
107
|
+
).and_return(CANNED_RESPONSE)
|
93
108
|
|
94
109
|
d = Spy.on_instance_method(sdk_class, :display)
|
95
110
|
WavefrontCliController.new(cmd.split)
|
@@ -8,10 +8,11 @@ require_relative '../spec_helper'
|
|
8
8
|
require_relative "../../lib/wavefront-cli/#{word}"
|
9
9
|
|
10
10
|
describe "#{word} command" do
|
11
|
-
missing_creds(word, ['list', "describe #{id}", "delete #{id}",
|
11
|
+
missing_creds(word, ['list', 'versions', "describe #{id}", "delete #{id}",
|
12
12
|
"undelete #{id}", "rename #{id} newname"])
|
13
13
|
list_tests(word)
|
14
14
|
cmd_to_call(word, "describe #{id}", path: "/api/v2/#{word}/#{id}")
|
15
|
+
cmd_to_call(word, 'versions', path: "/api/v2/#{word}?limit=999&offset=0")
|
15
16
|
cmd_to_call(word, "rename #{id} newname",
|
16
17
|
method: :put,
|
17
18
|
path: "/api/v2/#{word}/#{id}",
|
data/wavefront-cli.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
|
|
23
23
|
gem.require_paths = %w[lib]
|
24
24
|
|
25
25
|
gem.add_runtime_dependency 'docopt', '~> 0.6.0'
|
26
|
-
gem.add_runtime_dependency 'wavefront-sdk', '~> 2.0', '>= 2.0.
|
26
|
+
gem.add_runtime_dependency 'wavefront-sdk', '~> 2.0', '>= 2.0.3'
|
27
27
|
|
28
28
|
gem.add_development_dependency 'bundler', '~> 1.3'
|
29
29
|
gem.add_development_dependency 'minitest', '~> 5.11', '>= 5.11.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wavefront-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Fisher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docopt
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '2.0'
|
34
34
|
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 2.0.
|
36
|
+
version: 2.0.3
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '2.0'
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 2.0.
|
46
|
+
version: 2.0.3
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|