openstack-router 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa5d02ed5f6c786af51164b99951952ad6ef5fb29ff90a545e0b1f1f808872ed
4
- data.tar.gz: a4d75513c3f3d171a776c2db50c3fbddd4ea4443e004f6765d0862028f2a4109
3
+ metadata.gz: ff6163ba07f33adc553faed4b8da3a88ef16e4358deaf076e9b43f1d93712eb7
4
+ data.tar.gz: f486bfd58299931d24248d7d46ee294005cffd5115f5188853ff8a2435c3555f
5
5
  SHA512:
6
- metadata.gz: 7ad031243d495eaed8611f4fbaa5d8e33a84b11b34f50d7cb4ffd6b6ec0dffcca173adaf044839ff5b6f2431fa4fd811f6df764cf15ea7b04fc1aacc54478d0e
7
- data.tar.gz: fcdce2d3fe25456e788f5bdff5bd09a1be028c81460a47a3b410a3f98676c5f40218ba20d164c50b5e2a51f60eb508e3d42f7d261b003ff6dbe1e1e020565c47
6
+ metadata.gz: bb7eb683c5131e481342f5146c6ee86e91f9ba3fb22110a3b2f26114ec18a793d559df219a25009e6f1e4ccdae8828742335ddf82661ba2f6400150ced194938
7
+ data.tar.gz: 84c5203c72ea459d7ae0ceb5475e6444487db240760128ef55e3b1ac65d93d5e3b0ab10d3a9f634e26bb1e34b72efa408b77596025c71ad35cced5b02364d17d
data/README.md CHANGED
@@ -1,56 +1,59 @@
1
- # Long Command Runner
1
+ # OpenStack Router
2
2
 
3
- [![pipeline status](https://gitlab.com/rol_public/long-command-runner/badges/master/pipeline.svg)](https://gitlab.com/rol_public/long-command-runner/commits/master)
4
- [![Gem Version](https://badge.fury.io/rb/long-command-runner.svg)](https://badge.fury.io/rb/long-command-runner)
5
- [![coverage report](https://gitlab.com/rol_public/long-command-runner/badges/master/coverage.svg)](https://gitlab.com/rol_public/long-command-runner/commits/master)
3
+ [![pipeline status](https://gitlab.com/rol_public/openstack-router/badges/master/pipeline.svg)](https://gitlab.com/rol_public/openstack-router/commits/master)
4
+ [![Gem Version](https://badge.fury.io/rb/openstack-router.svg)](https://badge.fury.io/rb/openstack-router)
5
+ [![coverage report](https://gitlab.com/rol_public/openstack-router/badges/master/coverage.svg)](https://gitlab.com/rol_public/openstack-router/commits/master)
6
6
 
7
- This lib aims to follow a terminal command that is long to execute and monitor
8
- the CPU usage and the progression of the program.
7
+ This lib is an overlay/router of OpenStack components and region.
9
8
 
10
9
  # Current state and goal
11
10
 
11
+ Currently we are not far. So no good explaination for now.
12
+
12
13
  ## Currently (what we have)
13
- - monitoring of the progression of the application through the output of the app
14
- (I don't think that we can do better)
15
- - get the real/user/sys time usage of the application by using the output of the `time` `bash` function.
16
- (This make it incompatible with system that doesn't support ouput redirections and bash itself)
14
+
15
+ TBD
17
16
 
18
17
  ## v1 goal
19
18
 
20
- - Make it pure ruby solution not depending on `bash`
21
- - Realtime mesure of cputime usage
19
+ - Allow to manage multiple regions with one interface
20
+ - Allow to interact simply between regions:
21
+ - create resources where possible (with a round-robin scheme for example)
22
+ - copy images from a region to all the other ...
22
23
 
23
24
  # Install and usage
24
25
 
25
26
  Install on your system:
26
27
 
27
- gem install long-command-runner
28
+ gem install openstack-router
28
29
 
29
30
  Install through bundler:
30
31
 
31
- gem 'long-command-runner', , '~> 0.1'
32
+ gem 'openstack-router', '~> 0.1'
32
33
 
33
34
  To use the library:
34
35
 
35
36
  ```ruby
36
- require 'long_command_runner'
37
-
38
- runner = LCR::Runner.new 'for i in `seq 100`; do echo $i%; sleep 1; done'
39
- runner.launch
40
-
41
- # command now runs
42
-
43
- while runner.running?
44
- STDOUT.write "\rProgram is at: #{runner.progress} % \r"
45
- STDOUT.flush
46
- end
47
- puts 'program ended !'
37
+ require 'openstack_router'
38
+
39
+ cp = OpenStackRouter::Parameter::Connection.new(
40
+ auth_url: 'https://auth.cloud.ovh.net/v2.0/',
41
+ username: 'test_username',
42
+ api_key: 'test_api_key',
43
+ tenant: 'test_tenant',
44
+ project_id: 'test_project_id',
45
+ region: 'SBG3'
46
+ )
47
+ # For now only region connection can be done.
48
+ region = OpenStackRouter::Region.new(@connection_parameters)
49
+ region.images
50
+ region.limits
48
51
  ```
49
52
 
50
53
  # documentation
51
54
 
52
55
  Here some links:
53
56
 
54
- - [The documentation](https://rol-public.gitlab.io/long-command-runner/)
55
- - [The coverage](https://rol-public.gitlab.io/long-command-runner/coverage)
56
- - [The code quality report](https://rol-public.gitlab.io/long-command-runner/rubycritic/overview.html)
57
+ - [The documentation](https://rol-public.gitlab.io/openstack-router/)
58
+ - [The coverage](https://rol-public.gitlab.io/openstack-router/coverage)
59
+ - [The code quality report](https://rol-public.gitlab.io/openstack-router/rubycritic/overview.html)
@@ -23,8 +23,11 @@ module OpenStackRouter
23
23
  attr_reader :project_id
24
24
  attr_reader :region
25
25
 
26
+ # The mandatory options needed to be pass in argument at initialization of that class.
26
27
  MANDATORY_OPTIONS = %i[auth_url username api_key tenant project_id].freeze
28
+ # The options that are not mandatory for this object.
27
29
  OTHER_OPTIONS = %i[region].freeze
30
+ # Constant containing all the available options.
28
31
  ALL_OPTIONS = (MANDATORY_OPTIONS + OTHER_OPTIONS).freeze
29
32
 
30
33
  def initialize(options)
@@ -79,8 +82,8 @@ module OpenStackRouter
79
82
  end
80
83
 
81
84
  def other_options(cfg)
82
- (OTHER_OPTIONS & cfg.keys).each do |key|
83
- send("#{key}=".to_sym, cfg[key])
85
+ cfg.each do |key, value|
86
+ send("#{key}=".to_sym, value) if OTHER_OPTIONS.include?(key)
84
87
  end
85
88
  end
86
89
  end
@@ -58,6 +58,9 @@ module OpenStackRouter
58
58
  # The description of images list request.
59
59
  # You can use the request options with key/value optional argument.
60
60
  # @param [Hash] opts The options to pass to image#images list request.
61
+ #
62
+ # @return [Array] containing
63
+ # @return nil on error
61
64
  def images(opts = {})
62
65
  request_wrapper(@image, :list_images, opts) do |list_images_answer|
63
66
  # 204 is include because the Fog.mock implementation returns 200 | 204 randomly...
@@ -2,5 +2,5 @@
2
2
 
3
3
  module OpenStackRouter
4
4
  # The version number of this library
5
- VERSION = '0.0.1'
5
+ VERSION = '0.0.2'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstack-router
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roland Laurès