marathon-api 2.0.1 → 2.1.0

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: 8b60887f834b4861afd26cac261c219767fbd208
4
- data.tar.gz: b25e03b3dc591c0f3503cb60a3c8c4b528fe032e
3
+ metadata.gz: fbb0e48998c8f3c64b8002009bdba92f13aea4e8
4
+ data.tar.gz: 19ba1b91937a2455bc175da83552c5ce0f2455f3
5
5
  SHA512:
6
- metadata.gz: 66917b9f6d31568d01dcab7c31c083ef4a1d53d4423ddb1435c78cb86b76e2b5e069f630c2a9aa920c1ac1bc9e24746baa5894962e9fded20fd698dafae8ba72
7
- data.tar.gz: 2d20bb4db6d22dd4c1ebf3cfee576b34616fd10547fa48bb69b43ed70b4965a9d6ed2a9b0e83890058752141051bd1af33028a29ccb5274d63c3944177084bfc
6
+ metadata.gz: f41e51ef482f0a041b13efac4b7d47549419dc29ad8f021bc6e6f426da993d3d29ceaddc73263beeb3c7d312156bbba3a55266d61ce57b93eb0b4fcd7495c6be
7
+ data.tar.gz: 2c3497dae1b201f45df830c74fc781824b31ff7514b2de7a870942c4d4f6f15d5b898e2b1fee8cb627bad3805f132df6cfa6577ff7ad00820b7a94f4c1c68315
@@ -1,11 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
3
  - 2.0.0
5
4
  - 2.1.5
6
5
  - 2.2.0
7
6
  - 2.3.0
8
- env:
9
- global:
10
- - CODECLIMATE_REPO_TOKEN=a0f25c19629dd353c43aef0cbbd886a7a4079c2238711fa4f932e1477b818195
7
+ - 2.4.0
11
8
  script: bundle exec rake
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  marathon-api
2
2
  ============
3
3
 
4
- [![Gem Version](https://badge.fury.io/rb/marathon-api.svg)](http://badge.fury.io/rb/marathon-api) [![travis-ci](https://travis-ci.org/otto-de/marathon-api.png?branch=master)](https://travis-ci.org/otto-de/marathon-api) [![Code Climate](https://codeclimate.com/github/otto-de/marathon-api/badges/gpa.svg)](https://codeclimate.com/github/otto-de/marathon-api) [![Test Coverage](https://codeclimate.com/github/otto-de/marathon-api/badges/coverage.svg)](https://codeclimate.com/github/otto-de/marathon-api)
4
+ [![Gem Version](https://badge.fury.io/rb/marathon-api.svg)](http://badge.fury.io/rb/marathon-api) [![travis-ci](https://travis-ci.org/otto-de/marathon-api.png?branch=master)](https://travis-ci.org/otto-de/marathon-api) [![Code Climate](https://codeclimate.com/github/otto-de/marathon-api/badges/gpa.svg)](https://codeclimate.com/github/otto-de/marathon-api)
5
5
 
6
6
  This gem provides an object oriented interface to the [Marathon Remote API][1]. At the time if this writing, marathon-api is meant to interface with Marathon version 0.10.1.
7
7
 
@@ -2,7 +2,7 @@
2
2
  # See https://mesosphere.github.io/marathon/docs/rest-api.html#apps for full list of API's methods.
3
3
  class Marathon::App < Marathon::Base
4
4
 
5
- ACCESSORS = %w[ id args cmd cpus disk env executor instances mem ports requirePorts
5
+ ACCESSORS = %w[ id args cmd cpus disk env executor fetch instances mem ports requirePorts
6
6
  storeUris tasksHealthy tasksUnhealthy tasksRunning tasksStaged upgradeStrategy
7
7
  deployments uris user version labels ]
8
8
 
@@ -10,7 +10,6 @@ class Marathon::App < Marathon::Base
10
10
  :env => {},
11
11
  :labels => {},
12
12
  :ports => [],
13
- :uris => [],
14
13
  }
15
14
 
16
15
  attr_reader :healthChecks, :constraints, :container, :read_only, :tasks
@@ -151,7 +150,7 @@ class Marathon::App < Marathon::Base
151
150
  end
152
151
 
153
152
  def pretty_uris
154
- uris.map { |e| "URI: #{e}" }.join("\n")
153
+ [ (fetch || []).map { |e| e[:uri] } , uris ].compact.reduce([], :|).map { |e| "URI: #{e}" }.join("\n")
155
154
  end
156
155
 
157
156
  def pretty_constraints
@@ -13,9 +13,6 @@ class Marathon::ContainerVolume < Marathon::Base
13
13
  super(Marathon::Util.merge_keywordized_hash(DEFAULTS, hash), ACCESSORS)
14
14
  Marathon::Util.validate_choice('mode', mode, %w[RW RO])
15
15
  raise Marathon::Error::ArgumentError, 'containerPath must not be nil' unless containerPath
16
- raise Marathon::Error::ArgumentError, 'containerPath must be an absolute path' \
17
- unless Pathname.new(containerPath).absolute?
18
- raise Marathon::Error::ArgumentError, 'hostPath must not be nil' unless hostPath
19
16
  end
20
17
 
21
18
  def to_pretty_s
@@ -13,20 +13,21 @@ class Marathon::HealthCheck < Marathon::Base
13
13
  }
14
14
 
15
15
  ACCESSORS = %w[ command gracePeriodSeconds intervalSeconds maxConsecutiveFailures
16
- path portIndex protocol timeoutSeconds ]
16
+ path portIndex protocol timeoutSeconds ignoreHttp1xx ]
17
17
 
18
18
  # Create a new health check object.
19
19
  # ++hash++: Hash returned by API.
20
20
  def initialize(hash)
21
21
  super(Marathon::Util.merge_keywordized_hash(DEFAULTS, hash), ACCESSORS)
22
- Marathon::Util.validate_choice(:protocol, protocol, %w[HTTP TCP COMMAND])
22
+ Marathon::Util.validate_choice(:protocol, protocol, %w[HTTP TCP COMMAND HTTPS MESOS_HTTP MESOS_HTTPS MESOS_TCP])
23
23
  end
24
24
 
25
25
  def to_s
26
26
  if protocol == 'COMMAND'
27
27
  "Marathon::HealthCheck { :protocol => #{protocol} :command => #{command} }"
28
- elsif protocol == 'HTTP'
29
- "Marathon::HealthCheck { :protocol => #{protocol} :portIndex => #{portIndex} :path => #{path} }"
28
+ elsif %w[HTTP HTTPS MESOS_HTTP MESOS_HTTPS].include? protocol
29
+ "Marathon::HealthCheck { :protocol => #{protocol} :portIndex => #{portIndex} :path => #{path}" +
30
+ (%w[HTTP HTTPS].include? protocol and !ignoreHttp1xx.nil? ? " :ignoreHttp1xx => #{ignoreHttp1xx}" : '') + " }"
30
31
  else
31
32
  "Marathon::HealthCheck { :protocol => #{protocol} :portIndex => #{portIndex} }"
32
33
  end
@@ -1,3 +1,3 @@
1
1
  module Marathon
2
- VERSION = '2.0.1'
2
+ VERSION = '2.1.0'
3
3
  end
@@ -28,5 +28,4 @@ Gem::Specification.new do |gem|
28
28
  gem.add_development_dependency 'pry'
29
29
  gem.add_development_dependency 'cane'
30
30
  gem.add_development_dependency 'simplecov'
31
- gem.add_development_dependency 'codeclimate-test-reporter'
32
31
  end
@@ -12,7 +12,9 @@ describe Marathon::App do
12
12
  },
13
13
  'env' => {'FOO' => 'BAR', 'blubb' => 'blah'},
14
14
  'constraints' => [['hostname', 'UNIQUE']],
15
- 'uris' => ['http://example.com/big.tar'],
15
+ 'fetch' => [
16
+ { 'uri' => 'http://example.com/big.tar' },
17
+ ],
16
18
  'labels' => {'abc' => '123'},
17
19
  'version' => 'foo-version'
18
20
  }, double(Marathon::MarathonInstance)) }
@@ -43,7 +45,7 @@ describe Marathon::App do
43
45
  subject { described_class.new({'id' => '/app/foo'}, double(Marathon::MarathonInstance)) }
44
46
 
45
47
  let(:expected_string) do
46
- '{"env":{},"labels":{},"ports":[],"uris":[],"id":"/app/foo"}'
48
+ '{"env":{},"labels":{},"ports":[],"id":"/app/foo"}'
47
49
  end
48
50
 
49
51
  its(:to_json) { should == expected_string }
@@ -153,7 +155,7 @@ describe Marathon::App do
153
155
  expect(@subject).to receive(:check_read_only)
154
156
  expect(@apps).to receive(:change).with(
155
157
  '/app/foo',
156
- {:env => {}, :labels => {}, :ports => [], :uris => [], :id => "/app/foo"},
158
+ {:env => {}, :labels => {}, :ports => [], :id => "/app/foo"},
157
159
  false
158
160
  )
159
161
  @subject.start!
@@ -163,7 +165,7 @@ describe Marathon::App do
163
165
  expect(@apps).to receive(:change)
164
166
  .with(
165
167
  '/app/foo',
166
- {:env => {}, :labels => {}, :ports => [], :uris => [], :id => "/app/foo"},
168
+ {:env => {}, :labels => {}, :ports => [], :id => "/app/foo"},
167
169
  false
168
170
  )
169
171
  @subject.start!
@@ -19,8 +19,6 @@ describe Marathon::ContainerVolume do
19
19
  it 'should fail with invalid path' do
20
20
  expect { subject.new(:hostPath => '/') }
21
21
  .to raise_error(Marathon::Error::ArgumentError, /containerPath .* not be nil/)
22
- expect { subject.new(:containerPath => '/') }
23
- .to raise_error(Marathon::Error::ArgumentError, /hostPath .* not be nil/)
24
22
  end
25
23
  end
26
24
 
@@ -6,16 +6,12 @@ require 'simplecov'
6
6
  require 'vcr'
7
7
  require 'webmock'
8
8
  require 'marathon'
9
- require 'codeclimate-test-reporter'
10
9
 
11
10
  %w[MARATHON_URL MARATHON_USER MARATHON_PASSWORD].each do |key|
12
11
  ENV.delete(key)
13
12
  end
14
13
 
15
- CodeClimate::TestReporter.start
16
-
17
14
  VCR.configure do |c|
18
- c.ignore_hosts 'codeclimate.com'
19
15
  c.allow_http_connections_when_no_cassette = false
20
16
  c.cassette_library_dir = "fixtures/vcr"
21
17
  c.hook_into :webmock
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marathon-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Bechstein
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-22 00:00:00.000000000 Z
11
+ date: 2017-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -164,20 +164,6 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: codeclimate-test-reporter
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
167
  description: A simple REST client for the Marathon Remote API
182
168
  email:
183
169
  - felix.bechstein@otto.de
@@ -305,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
291
  version: '0'
306
292
  requirements: []
307
293
  rubyforge_project:
308
- rubygems_version: 2.4.3
294
+ rubygems_version: 2.4.8
309
295
  signing_key:
310
296
  specification_version: 4
311
297
  summary: A simple REST client for the Marathon Remote API
@@ -332,4 +318,3 @@ test_files:
332
318
  - spec/marathon/task_spec.rb
333
319
  - spec/marathon/util_spec.rb
334
320
  - spec/spec_helper.rb
335
- has_rdoc: