openstack-router 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -29
- data/lib/openstack-router/parameter/connection.rb +5 -2
- data/lib/openstack-router/region.rb +3 -0
- data/lib/openstack-router/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff6163ba07f33adc553faed4b8da3a88ef16e4358deaf076e9b43f1d93712eb7
|
4
|
+
data.tar.gz: f486bfd58299931d24248d7d46ee294005cffd5115f5188853ff8a2435c3555f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb7eb683c5131e481342f5146c6ee86e91f9ba3fb22110a3b2f26114ec18a793d559df219a25009e6f1e4ccdae8828742335ddf82661ba2f6400150ced194938
|
7
|
+
data.tar.gz: 84c5203c72ea459d7ae0ceb5475e6444487db240760128ef55e3b1ac65d93d5e3b0ab10d3a9f634e26bb1e34b72efa408b77596025c71ad35cced5b02364d17d
|
data/README.md
CHANGED
@@ -1,56 +1,59 @@
|
|
1
|
-
#
|
1
|
+
# OpenStack Router
|
2
2
|
|
3
|
-
[![pipeline status](https://gitlab.com/rol_public/
|
4
|
-
[![Gem Version](https://badge.fury.io/rb/
|
5
|
-
[![coverage report](https://gitlab.com/rol_public/
|
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
|
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
|
-
|
14
|
-
|
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
|
-
-
|
21
|
-
-
|
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
|
28
|
+
gem install openstack-router
|
28
29
|
|
29
30
|
Install through bundler:
|
30
31
|
|
31
|
-
gem '
|
32
|
+
gem 'openstack-router', '~> 0.1'
|
32
33
|
|
33
34
|
To use the library:
|
34
35
|
|
35
36
|
```ruby
|
36
|
-
require '
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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/
|
55
|
-
- [The coverage](https://rol-public.gitlab.io/
|
56
|
-
- [The code quality report](https://rol-public.gitlab.io/
|
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
|
-
|
83
|
-
send("#{key}=".to_sym,
|
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...
|