otc-sdk-ruby 0.1.2 → 0.1.3

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
- SHA1:
3
- metadata.gz: b3e4daf4376f0ce2e70d9cf2209fbcafa1eb8092
4
- data.tar.gz: a7e9d312501a27a489d54eb1ef3fd0ef01ac8e0b
2
+ SHA256:
3
+ metadata.gz: 754a13f68328dd7170f629c524cceb56b8e2c0c99a7f7dfbc64e4be9561c0c31
4
+ data.tar.gz: 4b5c1255d8731123772295a29b1f3f65b0df681f60a36e29e4b90d080c868dde
5
5
  SHA512:
6
- metadata.gz: ec7be92f2a7fccc7f515dc1095ae56fdcc5d8d956e7c6263a281c64da7c13ded9845352671496a164fadd75754e6e5c45b4db661fc46081cd8e64d01f66e44b5
7
- data.tar.gz: fdb833eeb432548008bea9ac4ffb21d962e575506654ee19f6f7055613d14e549695fc134ffa9d19a2be6986ea389d7a177dfcaa3457347e70053a25f9ad6ad9
6
+ metadata.gz: fc6d165625f72ece828430dcb8080bd094745a19ce769498fda519f105c9b37f71efb02f94f6aff7fc51c5356836492912c2c6beded6fd07da4703cbdb934fbe
7
+ data.tar.gz: db16048727a63dc41d275504f7354738bb42eab32022f4d498accf19a07ea686104f5156a0bb8238ad411d768c36e78ced039f056ce208e35e35a5e063617bc4
data/.travis.yml CHANGED
@@ -2,6 +2,9 @@ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
4
  - 2.2.2
5
+ - 2.3.0
6
+ - 2.4.0
7
+ - 2.5.0
5
8
  before_install: gem install bundler -v 1.14.6
6
9
  notifications:
7
10
  email:
data/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2018 Streetspotr GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/lib/otc/asgroup.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "hashie"
2
2
 
3
3
  module Otc
4
- class ASGroup < Hashie::Dash
4
+ class ASGroup < Hashie::Mash
5
5
  class << self
6
6
  def query_all(name: nil)
7
7
  response = Request.get service: "as", path: "/autoscaling-api/v1/#{Configuration.project!}/scaling_group?scaling_group_name=#{name}"
@@ -15,14 +15,6 @@ module Otc
15
15
  end
16
16
  end
17
17
 
18
- [
19
- "networks", "detail", "notifications", "scaling_group_name", "scaling_group_id", "scaling_group_status",
20
- "scaling_configuration_id", "scaling_configuration_name", "current_instance_number", "desire_instance_number",
21
- "min_instance_number", "max_instance_number", "cool_down_time", "lb_listener_id", "lbaas_listeners",
22
- "cloud_location_id", "available_zones", "security_groups", "create_time", "vpc_id", "health_periodic_audit_method",
23
- "health_periodic_audit_time", "instance_terminate_policy", "is_scaling", "delete_publicip"
24
- ].each { |prop| property prop }
25
-
26
18
  def instances
27
19
  @_instances ||= begin
28
20
  response = Request.get service: "as", path: "/autoscaling-api/v1/#{Configuration.project!}/scaling_group_instance/#{self.scaling_group_id}/list"
@@ -1,11 +1,6 @@
1
1
  require "hashie"
2
2
 
3
3
  module Otc
4
- class ASGroupInstance < Hashie::Dash
5
- [
6
- "instance_id", "scaling_group_id", "scaling_group_name", "life_cycle_state", "health_status",
7
- "scaling_configuration_name", "scaling_configuration_id", "create_time", "instance_name",
8
- "protect_from_scaling_down"
9
- ].each { |prop| property prop }
4
+ class ASGroupInstance < Hashie::Mash
10
5
  end
11
6
  end
data/lib/otc/ecs.rb CHANGED
@@ -1,14 +1,11 @@
1
1
  require "hashie"
2
2
 
3
3
  module Otc
4
- class ECS < Hashie::Dash
4
+ class ECS < Hashie::Mash
5
5
  class << self
6
6
  def query_all(name: nil)
7
7
  response = Request.get service: "ecs", path: "/v2/#{Configuration.project!}/servers/detail?name=#{name}"
8
8
  JSON.parse(response.body)["servers"].map do |server|
9
- keys_to_delete = server.keys - ECS::ATTRIBUTES
10
- keys_to_delete.each { |key| server.delete(key) }
11
-
12
9
  ECS.new(server)
13
10
  end
14
11
  end
@@ -18,13 +15,6 @@ module Otc
18
15
  end
19
16
  end
20
17
 
21
- ATTRIBUTES = [
22
- "name", "id", "status", "created", "updated", "flavor", "image", "tenant_id", "key_name",
23
- "user_id", "metadata", "hostId", "addresses", "security_groups", "tags", "links", "progress"
24
- ]
25
-
26
- ATTRIBUTES.each { |prop| property prop }
27
-
28
18
  def public_ip
29
19
  @_public_ip ||= begin
30
20
  private_addresses = self.addresses.values.flatten.map { |val| val["addr"] }
data/lib/otc/eip.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "hashie"
2
2
 
3
3
  module Otc
4
- class EIP < Hashie::Dash
4
+ class EIP < Hashie::Mash
5
5
  class << self
6
6
  def query_all
7
7
  response = Request.get service: "ecs", path: "/v1/#{Configuration.project!}/publicips"
@@ -10,11 +10,5 @@ module Otc
10
10
  end
11
11
  end
12
12
  end
13
-
14
- [
15
- "id", "status", "type", "port_id", "public_ip_address", "private_ip_address",
16
- "tenant_id", "create_time", "bandwidth_id", "bandwidth_share_type", "bandwidth_size",
17
- "profile", "bandwidth_name"
18
- ].each { |prop| property prop }
19
13
  end
20
14
  end
data/lib/otc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Otc
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: otc-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Streetspotr GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-03 00:00:00.000000000 Z
11
+ date: 2018-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -77,6 +77,7 @@ files:
77
77
  - ".rspec"
78
78
  - ".travis.yml"
79
79
  - Gemfile
80
+ - LICENSE
80
81
  - README.md
81
82
  - Rakefile
82
83
  - bin/console
@@ -108,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
109
  version: '0'
109
110
  requirements: []
110
111
  rubyforge_project:
111
- rubygems_version: 2.4.5
112
+ rubygems_version: 2.7.3
112
113
  signing_key:
113
114
  specification_version: 4
114
115
  summary: Ruby SDK which wraps the open telekom cloud API