redfish_client 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +19 -0
- data/.simplecov +3 -0
- data/.travis.yml +13 -0
- data/.yardopts +3 -0
- data/Gemfile +6 -0
- data/README.md +52 -0
- data/Rakefile +6 -0
- data/bin/console +10 -0
- data/bin/setup +8 -0
- data/lib/redfish_client.rb +21 -0
- data/lib/redfish_client/connector.rb +97 -0
- data/lib/redfish_client/resource.rb +195 -0
- data/lib/redfish_client/root.rb +55 -0
- data/lib/redfish_client/version.rb +5 -0
- data/redfish_client.gemspec +41 -0
- metadata +174 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ef675df00d6ecec6a42816c288047a68a9cf85f6
|
4
|
+
data.tar.gz: 0a6d6dc6e5c8af0b70857f7fcf8d49ddfde0c2c8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6c44c7d4045c017703ce35a137bbb8de69ce9e77bc18459b9fc333829d9b612f294ff05bce990895de7fadf92ab68019000ec62ec8491459b50baef4520f9cfd
|
7
|
+
data.tar.gz: 780cabd5d73abcb4a146e13ccd0ad548e07716fa0e499ea8014574b61638667fe533ab566f12944ef1b862c97e6c85ad97de6631e8512be42712ea88350843be
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- redfish_client.gemspec
|
4
|
+
- Gemfile
|
5
|
+
- Rakefile
|
6
|
+
- bin/**
|
7
|
+
|
8
|
+
Style/StringLiterals:
|
9
|
+
EnforcedStyle: double_quotes
|
10
|
+
|
11
|
+
Style/Documentation:
|
12
|
+
Enabled: false
|
13
|
+
|
14
|
+
Style/BracesAroundHashParameters:
|
15
|
+
EnforcedStyle: context_dependent
|
16
|
+
|
17
|
+
Metrics/BlockLength:
|
18
|
+
Exclude:
|
19
|
+
- spec/**/*.rb
|
data/.simplecov
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
sudo: false
|
2
|
+
language: ruby
|
3
|
+
cache: bundler
|
4
|
+
rvm:
|
5
|
+
- 2.4.3
|
6
|
+
deploy:
|
7
|
+
provider: rubygems
|
8
|
+
api_key:
|
9
|
+
secure: NdOd7EA9XQZNbnkzLFNXeJcOoaTi93uuwzjADS+fxFJ2HYGJs/T+gi98f742Oj4j187lBQjwICkdduGQjVn3BA/8YZD7sOkdywDSELupTjJmugf/hks6MiKJ0fex5GmHwspjZ7P+9iLPXGcaYWbGamWlSDL+Z/79s4bi8b5sBVwJ01YnIJvFn32/I5vPFwbwUzvH0n3HAjYHZ/kpZ122Zp/DhSpGam2azWF0Tynu7RNMsQrGamAH0mC1DzAscSD6VTyMcSMkD6XUr3GX7w7yvVO0qo7e6EcjrsJKMRC8/s2C/SWQ4pRDAldhQpd4C7/QSaHE0mmQcEYi2qsBmrbFb7cAfRmS5BKn8LSv7YPVH0VFl3fwYAycwqA068TZ68t99YPw7uVcJpDOWBODCQWA1wgV1tXHop7CJOcQW4MoXzyaRbbpF+6lyxXEgTz8Me8zEucMsHWzS9dI1E5x/bWl3TgEM9n+/G6BAcBj/mZv/dxC6H7kWp0ubKw0bRsdET/YmG53vxISaFbnLxNhsHzeE2mFeF+JL7a1amlC4aTiSBnxDgRzDdnoo42Hu8SUg/mp0xLjyoTME1w1zaB+GvmWCdrpkLQL2kNDgQUvBfOp+Zqfb37tKgc15zb7v2sru5acixkSG9UVElleDW8K4R1QcqXwLxCYccCi/ExVR1zSvSM=
|
10
|
+
gem: redfish_client
|
11
|
+
on:
|
12
|
+
tags: true
|
13
|
+
repo: xlab-si/redfish_client
|
data/.yardopts
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Redfish Ruby Client
|
2
|
+
|
3
|
+
This repository contains source code for redfish_client gem that can be used
|
4
|
+
to connect to Redfish services.
|
5
|
+
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem "redfish_client"
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install redfish_client
|
20
|
+
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
Minimal program that uses this gem would look something like this:
|
25
|
+
|
26
|
+
require "redfish_client"
|
27
|
+
|
28
|
+
root = RedfishClient.new("https://localhost:8000",
|
29
|
+
prefix: "/redfish/v1",
|
30
|
+
verify: false)
|
31
|
+
puts root
|
32
|
+
root.login("username", "password")
|
33
|
+
puts root.Systems
|
34
|
+
root.logout
|
35
|
+
|
36
|
+
|
37
|
+
## Development
|
38
|
+
|
39
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then,
|
40
|
+
run `rake spec` to run the tests. You can also run `bin/console` for an
|
41
|
+
interactive prompt that will allow you to experiment.
|
42
|
+
|
43
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
44
|
+
To release a new version, update the version number in `version.rb`, and then
|
45
|
+
run `bundle exec rake release`, which will create a git tag for the version,
|
46
|
+
push git commits and tags, and push the `.gem` file to
|
47
|
+
[rubygems.org](https://rubygems.org).
|
48
|
+
|
49
|
+
|
50
|
+
## Contributing
|
51
|
+
|
52
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/redfish_client.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "redfish_client"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
require "pry"
|
10
|
+
Pry.start
|
data/bin/setup
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "redfish_client/connector"
|
4
|
+
require "redfish_client/null_logger"
|
5
|
+
require "redfish_client/root"
|
6
|
+
require "redfish_client/version"
|
7
|
+
|
8
|
+
module RedfishClient
|
9
|
+
def self.logger
|
10
|
+
@logger ||= NullLogger.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.logger=(logger)
|
14
|
+
@logger = logger
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.new(url, prefix: "/redfish/v1", verify: true)
|
18
|
+
con = Connector.new(url, verify)
|
19
|
+
Root.new(con, oid: prefix)
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "excon"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module RedfishClient
|
7
|
+
# Connector serves as a low-level wrapper around HTTP calls that are used
|
8
|
+
# to retrieve data from the service API. It abstracts away implementation
|
9
|
+
# details such as sending the proper headers in request, which do not
|
10
|
+
# change between resource fetches.
|
11
|
+
#
|
12
|
+
# Library users should treat this class as an implementation detail and
|
13
|
+
# use higer-level {RedfishClient::Resource} instead.
|
14
|
+
class Connector
|
15
|
+
# Default headers, as required by Redfish spec
|
16
|
+
# https://redfish.dmtf.org/schemas/DSP0266_1.4.0.html#request-headers
|
17
|
+
DEFAULT_HEADERS = {
|
18
|
+
"Accept" => "application/json",
|
19
|
+
"OData-Version" => "4.0"
|
20
|
+
}.freeze
|
21
|
+
|
22
|
+
# Create new connector.
|
23
|
+
#
|
24
|
+
# @param url [String] base url of the Redfish service
|
25
|
+
# @param verify [Boolean] verify SSL certificate of the service
|
26
|
+
def initialize(url, verify = true)
|
27
|
+
@url = url
|
28
|
+
@verify = verify
|
29
|
+
@headers = DEFAULT_HEADERS.dup
|
30
|
+
@connection = create_connection
|
31
|
+
end
|
32
|
+
|
33
|
+
# Add HTTP headers to the requests made by the connector.
|
34
|
+
#
|
35
|
+
# @param headers [Hash<String, String>] headers to be added
|
36
|
+
def add_headers(headers)
|
37
|
+
@headers.merge!(headers)
|
38
|
+
@connection = create_connection
|
39
|
+
end
|
40
|
+
|
41
|
+
# Remove HTTP headers from requests made by the connector.
|
42
|
+
#
|
43
|
+
# Headers that are not currently set are silently ignored and no error is
|
44
|
+
# raised.
|
45
|
+
#
|
46
|
+
# @param headers [List<String>] headers to remove
|
47
|
+
def remove_headers(headers)
|
48
|
+
headers.each { |h| @headers.delete(h) }
|
49
|
+
@connection = create_connection
|
50
|
+
end
|
51
|
+
|
52
|
+
# Issue GET request to service.
|
53
|
+
#
|
54
|
+
# @param path [String] path to the resource, relative to the base url
|
55
|
+
# @return [Excon::Response] response object
|
56
|
+
def get(path)
|
57
|
+
@connection.get(path: path)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Issue POST requests to the service.
|
61
|
+
#
|
62
|
+
# @param path [String] path to the resource, relative to the base
|
63
|
+
# @param body [String] data to be sent over the socket
|
64
|
+
# @return [Excon::Response] response object
|
65
|
+
def post(path, body = nil)
|
66
|
+
params = { path: path }
|
67
|
+
params[:body] = body if body
|
68
|
+
@connection.post(params)
|
69
|
+
end
|
70
|
+
|
71
|
+
# Issue PATCH requests to the service.
|
72
|
+
#
|
73
|
+
# @param path [String] path to the resource, relative to the base
|
74
|
+
# @param body [String] data to be sent over the socket
|
75
|
+
# @return [Excon::Response] response object
|
76
|
+
def patch(path, body = nil)
|
77
|
+
params = { path: path }
|
78
|
+
params[:body] = body if body
|
79
|
+
@connection.patch(params)
|
80
|
+
end
|
81
|
+
|
82
|
+
|
83
|
+
# Issue DELETE requests to the service.
|
84
|
+
#
|
85
|
+
# @param path [String] path to the resource, relative to the base
|
86
|
+
# @return [Excon::Response] response object
|
87
|
+
def delete(path)
|
88
|
+
@connection.delete(path: path)
|
89
|
+
end
|
90
|
+
|
91
|
+
private
|
92
|
+
|
93
|
+
def create_connection
|
94
|
+
Excon.new(@url, headers: @headers, ssl_verify_peer: @verify)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,195 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module RedfishClient
|
6
|
+
# Resource is basic building block of Redfish client and serves as a
|
7
|
+
# container for the data that is retrieved from the Redfish service.
|
8
|
+
#
|
9
|
+
# When we interact with the Redfish service, resource will wrap the data
|
10
|
+
# retrieved from the service API and offer us dot-notation accessors for
|
11
|
+
# values stored.
|
12
|
+
#
|
13
|
+
# Resource will also load any sub-resource on demand when we access it.
|
14
|
+
# For example, if we have a root Redfish resource stored in `root`,
|
15
|
+
# accessing `root.SessionService` will automatically fetch the appropriate
|
16
|
+
# resource from the API.
|
17
|
+
#
|
18
|
+
# In order to reduce the amount of requests being sent to the service,
|
19
|
+
# resource also caches responses for later reuse. If we would like to get
|
20
|
+
# fresh values from the service, {#reset} call will flush the cache,
|
21
|
+
# causing next access to retrieve fresh data.
|
22
|
+
class Resource
|
23
|
+
# NoODataId error is raised when operation would need OpenData id of the
|
24
|
+
# resource to accomplish the task a hand.
|
25
|
+
class NoODataId < StandardError; end
|
26
|
+
|
27
|
+
# Create new resource.
|
28
|
+
#
|
29
|
+
# Resource can be created either by passing in OpenData identifier or
|
30
|
+
# supplying the content (hash). In the first case, connector will be used
|
31
|
+
# to fetch the resource data. In the second case, resource only wraps the
|
32
|
+
# passed-in hash and does no fetching.
|
33
|
+
#
|
34
|
+
# @param connector [RedfishClient::Connector] connector that will be used
|
35
|
+
# to fetch the resources
|
36
|
+
# @param oid [String] OpenData id of the resource
|
37
|
+
# @param content [Hash]
|
38
|
+
def initialize(connector, oid: nil, content: nil)
|
39
|
+
if oid
|
40
|
+
resp = connector.get(oid)
|
41
|
+
@content = JSON.parse(resp.data[:body])
|
42
|
+
@content["@odata.id"] = oid
|
43
|
+
@headers = resp.data[:headers]
|
44
|
+
else
|
45
|
+
@content = content
|
46
|
+
end
|
47
|
+
|
48
|
+
@cache = {}
|
49
|
+
@connector = connector
|
50
|
+
end
|
51
|
+
|
52
|
+
# Access resource content.
|
53
|
+
#
|
54
|
+
# This function offers a way of accessing resource data in the same way
|
55
|
+
# that hash exposes its content.
|
56
|
+
#
|
57
|
+
# In addition to accessing values associated with keys, this function can
|
58
|
+
# also be used to access members of collection by directly indexing into
|
59
|
+
# Members array. This means that `res["Members"][3]` can be shortened into
|
60
|
+
# `res[3]`.
|
61
|
+
#
|
62
|
+
# Accessing non-existent or indexing non-collection resource key will
|
63
|
+
# raise `KeyError`. Accessing invalid index will raise `IndexError`.
|
64
|
+
#
|
65
|
+
# @param attr [String, Integer] key or index for accessing data
|
66
|
+
# @return associated value
|
67
|
+
def [](attr)
|
68
|
+
if attr.is_a?(Integer)
|
69
|
+
raise(KeyError, "Not a collection.") unless key?("Members")
|
70
|
+
cache("Members").fetch(attr)
|
71
|
+
else
|
72
|
+
cache(attr)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# Test if resource contains required key.
|
77
|
+
#
|
78
|
+
# @param name [String, Symbol] key name to test
|
79
|
+
# @return [Boolean] inclusion test result
|
80
|
+
def key?(name)
|
81
|
+
@content.key?(name.to_s)
|
82
|
+
end
|
83
|
+
|
84
|
+
# Convenience access for resource data.
|
85
|
+
#
|
86
|
+
# Calling `resource.Value` is exactly the same as `resource["Value"]`. The
|
87
|
+
# only difference is that accessing non-existent field will raise
|
88
|
+
# NoMethodError instead of KeyError as `[]` method does.
|
89
|
+
def method_missing(symbol, *args, &block)
|
90
|
+
name = symbol.to_s
|
91
|
+
key?(name) ? self[name] : super
|
92
|
+
end
|
93
|
+
|
94
|
+
def respond_to_missing?(symbol, include_private = false)
|
95
|
+
key?(symbol.to_s) || super
|
96
|
+
end
|
97
|
+
|
98
|
+
# Clear the cached sub-resources. Next sub-resource access will repopulate
|
99
|
+
# the cache.
|
100
|
+
def reset
|
101
|
+
@cache = {}
|
102
|
+
end
|
103
|
+
|
104
|
+
# Access raw JSON data that resource wraps.
|
105
|
+
#
|
106
|
+
# @return [Hash] wrapped data
|
107
|
+
def raw
|
108
|
+
@content
|
109
|
+
end
|
110
|
+
|
111
|
+
# Pretty-print the wrapped content.
|
112
|
+
#
|
113
|
+
# @return [String] JSON-serialized raw data
|
114
|
+
def to_s
|
115
|
+
JSON.pretty_generate(@content)
|
116
|
+
end
|
117
|
+
|
118
|
+
# Issue a POST requests to the selected endpoint.
|
119
|
+
#
|
120
|
+
# By default, POST request will be sent to the path, stored in `@odata.id`
|
121
|
+
# field. Source field can be changed by specifying the `field` parameter
|
122
|
+
# when calling this function. Specifying the `path` argument will bypass
|
123
|
+
# the field lookup altogether and POST directly to the requested path.
|
124
|
+
#
|
125
|
+
# In order to avoid having to manually serialize data to JSON, this
|
126
|
+
# function call takes Hash as a payload and encodes it before sending it
|
127
|
+
# to the endpoint.
|
128
|
+
#
|
129
|
+
# If the resource has no lookup field, {NoODataId} error will be raised,
|
130
|
+
# since posting to non-networked resources makes no sense and probably
|
131
|
+
# indicates bug in library consumer.
|
132
|
+
#
|
133
|
+
# @param field [String, Symbol] path lookup field
|
134
|
+
# @param path [String] path to post to
|
135
|
+
# @param payload [Hash<String, >] data to send
|
136
|
+
# @return [Excon::Response] response
|
137
|
+
# @raise [NoODataId] resource has no OpenData id
|
138
|
+
def post(field: "@odata.id", path: nil, payload: nil)
|
139
|
+
@connector.post(get_path(field, path), payload ? payload.to_json : "")
|
140
|
+
end
|
141
|
+
|
142
|
+
# Issue a PATCH requests to the selected endpoint.
|
143
|
+
#
|
144
|
+
# Works exactly the same as the {post} method, but issued a PATCH request
|
145
|
+
# to the server.
|
146
|
+
#
|
147
|
+
# @param field [String, Symbol] path lookup field
|
148
|
+
# @param path [String] path to patch
|
149
|
+
# @param payload [Hash<String, >] data to send
|
150
|
+
# @return [Excon::Response] response
|
151
|
+
# @raise [NoODataId] resource has no OpenData id
|
152
|
+
def patch(field: "@odata.id", path: nil, payload: nil)
|
153
|
+
@connector.patch(get_path(field, path), payload ? payload.to_json : "")
|
154
|
+
end
|
155
|
+
|
156
|
+
# Issue a DELETE requests to the endpoint of the resource.
|
157
|
+
#
|
158
|
+
# If the resource has no `@odata.id` field, {NoODataId} error will be
|
159
|
+
# raised, since deleting non-networked resources makes no sense and
|
160
|
+
# probably indicates bug in library consumer.
|
161
|
+
#
|
162
|
+
# @return [Excon::Response] response
|
163
|
+
# @raise [NoODataId] resource has no OpenData id
|
164
|
+
def delete
|
165
|
+
@connector.delete(get_path("@odata.id", nil))
|
166
|
+
end
|
167
|
+
|
168
|
+
private
|
169
|
+
|
170
|
+
def get_path(field, path)
|
171
|
+
raise NoODataId if path.nil? and !key?(field)
|
172
|
+
path || @content[field]
|
173
|
+
end
|
174
|
+
|
175
|
+
def cache(name)
|
176
|
+
@cache[name] ||= build_resource(@content.fetch(name))
|
177
|
+
end
|
178
|
+
|
179
|
+
def build_resource(data)
|
180
|
+
case data
|
181
|
+
when Hash then build_hash_resource(data)
|
182
|
+
when Array then data.collect { |d| build_resource(d) }
|
183
|
+
else data
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
def build_hash_resource(data)
|
188
|
+
if data.key?("@odata.id")
|
189
|
+
Resource.new(@connector, oid: data["@odata.id"])
|
190
|
+
else
|
191
|
+
Resource.new(@connector, content: data)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "redfish_client/resource"
|
4
|
+
|
5
|
+
module RedfishClient
|
6
|
+
# Root resource represents toplevel entry point into Redfish service data.
|
7
|
+
# Its main purpose is to provide authentication support for the API.
|
8
|
+
class Root < Resource
|
9
|
+
# AuthError is raised if the user session cannot be created.
|
10
|
+
class AuthError < StandardError; end
|
11
|
+
|
12
|
+
# Token authentication header.
|
13
|
+
AUTH_HEADER = "X-Auth-Token"
|
14
|
+
|
15
|
+
# Authenticate against the service.
|
16
|
+
#
|
17
|
+
# Calling this method will try to create new session on the service using
|
18
|
+
# provided credentials. If the session creation fails, {AuthError} will be
|
19
|
+
# raised.
|
20
|
+
#
|
21
|
+
# @param username [String] username
|
22
|
+
# @param password [String] password
|
23
|
+
# @raise [AuthError] if user session could not be created
|
24
|
+
def login(username, password)
|
25
|
+
r = self.Links.Sessions.post(
|
26
|
+
payload: { "UserName" => username, "Password" => password }
|
27
|
+
)
|
28
|
+
raise AuthError unless r.status == 201
|
29
|
+
|
30
|
+
logout
|
31
|
+
rdata = r.data
|
32
|
+
@connector.add_headers(AUTH_HEADER => rdata[:headers][AUTH_HEADER])
|
33
|
+
@session = Resource.new(@connector, content: JSON.parse(rdata[:body]))
|
34
|
+
end
|
35
|
+
|
36
|
+
# Sign out of the service.
|
37
|
+
#
|
38
|
+
# If the session could not be deleted, {AuthError} will be raised.
|
39
|
+
def logout
|
40
|
+
return unless @session
|
41
|
+
r = @session.delete
|
42
|
+
raise AuthError unless r.status == 204
|
43
|
+
@session = nil
|
44
|
+
@connector.remove_headers([AUTH_HEADER])
|
45
|
+
end
|
46
|
+
|
47
|
+
# Find Redfish service object by OData ID field.
|
48
|
+
#
|
49
|
+
# @param oid [String] Odata id of the resource
|
50
|
+
# @return [Resource] new resource
|
51
|
+
def find(oid)
|
52
|
+
Resource.new(@connector, oid: oid)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "redfish_client/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "redfish_client"
|
8
|
+
spec.version = RedfishClient::VERSION
|
9
|
+
spec.authors = ["Tadej Borovšak"]
|
10
|
+
spec.email = ["tadej.borovsak@xlab.si"]
|
11
|
+
|
12
|
+
spec.summary = "Simple Redfish client library"
|
13
|
+
spec.homepage = "https://github.com/xlab-si/redfish_client"
|
14
|
+
spec.license = "Apache-2.0"
|
15
|
+
|
16
|
+
if spec.respond_to?(:metadata)
|
17
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
18
|
+
else
|
19
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
20
|
+
"public gem pushes."
|
21
|
+
end
|
22
|
+
|
23
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
24
|
+
f.match(%r{^(test|spec|features)/})
|
25
|
+
end
|
26
|
+
spec.bindir = "exe"
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
|
30
|
+
spec.required_ruby_version = "~> 2.1"
|
31
|
+
|
32
|
+
spec.add_runtime_dependency "excon", "~> 0.60"
|
33
|
+
|
34
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
35
|
+
spec.add_development_dependency "rake", ">= 11.0"
|
36
|
+
spec.add_development_dependency "rspec", ">= 3.7"
|
37
|
+
spec.add_development_dependency "simplecov"
|
38
|
+
spec.add_development_dependency "yard"
|
39
|
+
spec.add_development_dependency "rubocop"
|
40
|
+
spec.add_development_dependency "pry"
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: redfish_client
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tadej Borovšak
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-04-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: excon
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.60'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.60'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.16'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.16'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '11.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '11.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.7'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.7'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: yard
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description:
|
126
|
+
email:
|
127
|
+
- tadej.borovsak@xlab.si
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- ".gitignore"
|
133
|
+
- ".rspec"
|
134
|
+
- ".rubocop.yml"
|
135
|
+
- ".simplecov"
|
136
|
+
- ".travis.yml"
|
137
|
+
- ".yardopts"
|
138
|
+
- Gemfile
|
139
|
+
- README.md
|
140
|
+
- Rakefile
|
141
|
+
- bin/console
|
142
|
+
- bin/setup
|
143
|
+
- lib/redfish_client.rb
|
144
|
+
- lib/redfish_client/connector.rb
|
145
|
+
- lib/redfish_client/resource.rb
|
146
|
+
- lib/redfish_client/root.rb
|
147
|
+
- lib/redfish_client/version.rb
|
148
|
+
- redfish_client.gemspec
|
149
|
+
homepage: https://github.com/xlab-si/redfish_client
|
150
|
+
licenses:
|
151
|
+
- Apache-2.0
|
152
|
+
metadata:
|
153
|
+
allowed_push_host: https://rubygems.org
|
154
|
+
post_install_message:
|
155
|
+
rdoc_options: []
|
156
|
+
require_paths:
|
157
|
+
- lib
|
158
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - "~>"
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '2.1'
|
163
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
168
|
+
requirements: []
|
169
|
+
rubyforge_project:
|
170
|
+
rubygems_version: 2.6.14
|
171
|
+
signing_key:
|
172
|
+
specification_version: 4
|
173
|
+
summary: Simple Redfish client library
|
174
|
+
test_files: []
|