manageiq-api-common 2.0.0 → 2.0.1
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 505d9b26de12a65214f045cba58f0cd0d3f03f24b52e34c9f91c93438107593a
|
4
|
+
data.tar.gz: 93742f14fcc2493740e3b85b42cbcd8f3bc2e06b0b1e35ee3e306dc5eacb6564
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46a55bf1c465a7de8ef16d7245f182dc60b1e14a6a650ac4f882f894889df8fe481e160c76a8701b3882c2abd72656f1bd38d0cdadf1467dff70d4f6e29e9206
|
7
|
+
data.tar.gz: 90ece62ebe786c71c3bc94d20d6bbbacced40abe5168ab9aabf93d628289ab5ef47fd6a982958dd228c7c72fd90dc9dff8fbba4ac8173767d15aa452fc38bbb8
|
@@ -23,11 +23,11 @@ module ManageIQ
|
|
23
23
|
type = determine_string_attribute_type(attribute)
|
24
24
|
send(type, k, v)
|
25
25
|
else
|
26
|
-
errors
|
26
|
+
errors << "unsupported attribute type for: #{k}"
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
raise
|
30
|
+
raise(ManageIQ::API::Common::Filter::Error, errors.join(", ")) unless errors.blank?
|
31
31
|
query
|
32
32
|
end
|
33
33
|
|
@@ -35,18 +35,12 @@ module ManageIQ
|
|
35
35
|
|
36
36
|
attr_accessor :query
|
37
37
|
|
38
|
-
class Error < ArgumentError
|
39
|
-
attr_reader :error_document
|
40
|
-
|
41
|
-
def initialize(attrs)
|
42
|
-
@error_document = attrs[:error_document]
|
43
|
-
end
|
44
|
-
end
|
38
|
+
class Error < ArgumentError; end
|
45
39
|
|
46
40
|
def attribute_for_key(key)
|
47
41
|
attribute = api_doc_definition.properties[key.to_s]
|
48
42
|
return attribute if attribute
|
49
|
-
errors
|
43
|
+
errors << "found unpermitted parameter: #{key}"
|
50
44
|
nil
|
51
45
|
end
|
52
46
|
|
@@ -57,7 +51,7 @@ module ManageIQ
|
|
57
51
|
end
|
58
52
|
|
59
53
|
def errors
|
60
|
-
@errors ||=
|
54
|
+
@errors ||= []
|
61
55
|
end
|
62
56
|
|
63
57
|
def string(k, val)
|
@@ -81,7 +75,7 @@ module ManageIQ
|
|
81
75
|
return if value.nil?
|
82
76
|
send("comparator_#{requested_comparator}", key, value)
|
83
77
|
else
|
84
|
-
errors
|
78
|
+
errors << "unsupported #{type} comparator: #{requested_comparator}"
|
85
79
|
end
|
86
80
|
end
|
87
81
|
|
@@ -100,7 +94,7 @@ module ManageIQ
|
|
100
94
|
|
101
95
|
DateTime.parse(value)
|
102
96
|
rescue ArgumentError
|
103
|
-
errors
|
97
|
+
errors << "invalid timestamp: #{value}"
|
104
98
|
return nil
|
105
99
|
end
|
106
100
|
|
@@ -5,7 +5,7 @@ module ManageIQ
|
|
5
5
|
class Docs
|
6
6
|
class ObjectDefinition < Hash
|
7
7
|
def all_attributes
|
8
|
-
properties.
|
8
|
+
properties.map { |key, val| all_attributes_recursive(key, val) }
|
9
9
|
end
|
10
10
|
|
11
11
|
def read_only_attributes
|
@@ -19,6 +19,18 @@ module ManageIQ
|
|
19
19
|
def properties
|
20
20
|
self["properties"]
|
21
21
|
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def all_attributes_recursive(key, value)
|
26
|
+
if value["properties"]
|
27
|
+
{
|
28
|
+
key => value["properties"].map { |k, v| all_attributes_recursive(k, v) }
|
29
|
+
}
|
30
|
+
else
|
31
|
+
key
|
32
|
+
end
|
33
|
+
end
|
22
34
|
end
|
23
35
|
end
|
24
36
|
end
|
@@ -5,9 +5,9 @@ module ManageIQ
|
|
5
5
|
require 'rbac-api-client'
|
6
6
|
|
7
7
|
class Seed
|
8
|
-
def initialize(seed_file, user_file)
|
8
|
+
def initialize(seed_file, user_file = nil)
|
9
9
|
@acl_data = YAML.load_file(seed_file)
|
10
|
-
@request = create_request(user_file)
|
10
|
+
@request = ManageIQ::API::Common::Request.current || create_request(user_file)
|
11
11
|
end
|
12
12
|
|
13
13
|
def process
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: manageiq-api-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ManageIQ Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: acts_as_tenant
|