xclarity_client 0.5.8 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xclarity_client/chassi.rb +4 -3
- data/lib/xclarity_client/config_profile.rb +4 -2
- data/lib/xclarity_client/event.rb +4 -3
- data/lib/xclarity_client/job.rb +2 -1
- data/lib/xclarity_client/node.rb +2 -1
- data/lib/xclarity_client/scalable_complex.rb +1 -2
- data/lib/xclarity_client/switch.rb +5 -1
- data/lib/xclarity_client/version.rb +1 -1
- data/lib/xclarity_client/xclarity_management_mixin.rb +43 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b12986c29a9d36e9a01e27d69bd589f92b168365
|
4
|
+
data.tar.gz: 06dd50cb3c55664132fd0e7657a076d8ef221706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d69fdfe58498d950b115f296194cdb0104d6836d8dfd00b9159c0df8b7365bfd79341151d931d1c1e024f246e76774507d61ecec52bd9deb6a3a627a3daabb8
|
7
|
+
data.tar.gz: 64181dca18c9c11a224cf2784e694f96d890fe93205dd1db37ba372f4286a6675fc48d5cb91051e72017cbbf4d1628695b043e63075b3e69a4625d0e3d985b62
|
@@ -11,14 +11,15 @@ module XClarityClient
|
|
11
11
|
:energyPolicies, :errorFields, :excludedHealthState, :fanMuxes,
|
12
12
|
:fanMuxSlots, :fans, :fanSlots, :fruNumber, :height, :hostname,
|
13
13
|
:ipAddresses, :isConnectionTrusted, :ledCardSlots, :leds,
|
14
|
-
:location, :machineType, :managementPorts, :managerName,
|
14
|
+
:location, :machineType, :managementPorts, :managerName,
|
15
15
|
:managerUuid, :manufacturer, :manufacturerId, :mgmtProcIPaddress,
|
16
|
-
:mmSlots, :model, :name, :nist, :nodes, :overallHealthState,
|
16
|
+
:mmSlots, :model, :name, :nist, :nodes, :overallHealthState,
|
17
17
|
:partNumber, :passThroughModules, :password, :posID,
|
18
18
|
:powerAllocation, :powerSupplies, :powerSupplySlots, :productId,
|
19
19
|
:productName, :recoveryPassword, :SecurityPolicy, :serialNumber,
|
20
20
|
:status, :switches, :switchSlots, :tlsVersion, :type, :uri,
|
21
|
-
:userDescription, :username, :uuid, :vpdID
|
21
|
+
:userDescription, :username, :uuid, :vpdID, :FQDN, :parent, :encapsulation,
|
22
|
+
:securityDescriptor, :powerCappingPolicy
|
22
23
|
|
23
24
|
def initialize(attributes)
|
24
25
|
build_resource(attributes)
|
@@ -7,8 +7,10 @@ module XClarityClient
|
|
7
7
|
|
8
8
|
attr_accessor :identifier, :items, :label, :profileName, :serverName, :uuid, :chassisName, :bayId,
|
9
9
|
:subBayId, :profileStatus, :templateName, :templateId, :type, :id, :externalId, :managementPatternPresent,
|
10
|
-
:addressPresent, :rackId, :unit, :ID, :name, :displayName, :displayId, :endPointType, :endPointId,
|
11
|
-
:profilePath, :forScalableSecondaryNode, :secondaryProfileIDs, :serverTemplateId, :commands, :dynamicProperties,
|
10
|
+
:addressPresent, :rackId, :unit, :ID, :name, :displayName, :displayId, :endPointType, :endPointId,
|
11
|
+
:profilePath, :forScalableSecondaryNode, :secondaryProfileIDs, :serverTemplateId, :commands, :dynamicProperties,
|
12
|
+
:primaryProfileID, :forScalableNode, :forScalablePrimaryNode, :deviceId, :deviceType, :managementPatternPresent,
|
13
|
+
:rackID, :templateID, :complianceStatus
|
12
14
|
|
13
15
|
def initialize(attributes)
|
14
16
|
build_resource(attributes)
|
@@ -6,13 +6,14 @@ module XClarityClient
|
|
6
6
|
LIST_NAME = 'eventList'.freeze
|
7
7
|
|
8
8
|
attr_accessor :action, :args, :bayText, :chassisText, :cn, :commonEventID, :componentID,
|
9
|
-
:eventClass, :eventDate, :eventID, :eventSourceText, :failFRUs,
|
10
|
-
:flags, :fruSerialNumberText, :localLogID, :localLogSequence, :location,
|
9
|
+
:componentIdentifierText, :eventClass, :eventDate, :eventID, :eventSourceText, :failFRUs,
|
10
|
+
:failSNs, :flags, :fruSerialNumberText, :localLogID, :localLogSequence, :location,
|
11
11
|
:msg, :msgID, :mtm, :originatorUUID, :parameters, :senderUUID, :serialnum,
|
12
12
|
:service, :serviceabilityText, :severity, :severityText, :sourceID,
|
13
13
|
:sourceLogID, :sourceLogSequence, :systemFruNumberText, :systemName,
|
14
14
|
:systemSerialNumberText, :systemText, :systemTypeModelText, :systemTypeText,
|
15
|
-
:timeStamp, :typeText, :userid, :userIDIndex
|
15
|
+
:timeStamp, :typeText, :userid, :userIDIndex, :descriptionArgs, :userActionArgs, :failFRUNames,
|
16
|
+
:failFRUUUIDs, :failFRUPartNumbers
|
16
17
|
|
17
18
|
def initialize(attributes)
|
18
19
|
build_resource(attributes)
|
data/lib/xclarity_client/job.rb
CHANGED
@@ -6,7 +6,8 @@ module XClarityClient
|
|
6
6
|
LIST_NAME = 'jobsList'.freeze
|
7
7
|
|
8
8
|
attr_accessor :status, :cancelledBy, :createdBy, :category, :typeId, :messageDisplay, :cancelURI,
|
9
|
-
:messageParameters, :startTime, :messageID, :messageBundle, :endTime, :id, :isCancelable, :
|
9
|
+
:messageParameters, :startTime, :messageID, :messageBundle, :endTime, :id, :isCancelable, :rebootPersistent,
|
10
|
+
:uuid, :hidden
|
10
11
|
|
11
12
|
def initialize(attributes)
|
12
13
|
build_resource(attributes)
|
data/lib/xclarity_client/node.rb
CHANGED
@@ -16,7 +16,8 @@ module XClarityClient
|
|
16
16
|
:parentComplexID, :parentPartitionUUID, :partitionEnabled, :partitionID, :partNumber, :password, :pciCapabilities, :pciDevices, :physicalID, :ports,
|
17
17
|
:posID, :powerAllocation, :powerCappingPolicy, :powerStatus, :powerSupplies, :processors, :processorSlots, :productId, :productName, :raidSettings,
|
18
18
|
:recoveryPassword, :secureBootMode, :serialNumber, :server_type, :slots, :status, :subSlots, :subType, :thinkServerFru, :tlsVersion, :type, :uri,
|
19
|
-
:userDescription, :username, :uuid, :vnicMode, :vpdID
|
19
|
+
:userDescription, :username, :uuid, :vnicMode, :vpdID, :securityDescriptor, :primary, :logicalID, :FeaturesOnDemand,
|
20
|
+
:canisterSlots, :canisters, :userDefinedName, :management_processor_type
|
20
21
|
|
21
22
|
def initialize(attributes)
|
22
23
|
build_resource(attributes)
|
@@ -3,12 +3,11 @@ module XClarityClient
|
|
3
3
|
include XClarityClient::Resource
|
4
4
|
|
5
5
|
BASE_URI = '/scalableComplex'.freeze
|
6
|
-
LIST_NAME = 'complex'.freeze
|
6
|
+
LIST_NAME = ['complex', 'complexList'].map { |name| name.freeze }.freeze
|
7
7
|
|
8
8
|
attr_accessor :complexID, :location, :nodeCount, :orphanNodes,
|
9
9
|
:partition, :partitionCount, :uuid
|
10
10
|
|
11
|
-
|
12
11
|
def initialize(attributes)
|
13
12
|
build_resource(attributes)
|
14
13
|
end
|
@@ -11,7 +11,11 @@ module XClarityClient
|
|
11
11
|
:ipv6Addresses, :leds, :macAddresses, :machineType, :manufacturer, :manufacturerId,
|
12
12
|
:model, :name, :overallHealthState, :parent, :partNumber, :posID, :powerAllocation,
|
13
13
|
:powerState, :productId, :productName, :protectedMode, :serialNumber, :slots,
|
14
|
-
:stackMode, :type, :uri, :userDescription, :uuid, :vpdID
|
14
|
+
:stackMode, :type, :uri, :userDescription, :uuid, :vpdID, :ntpPushEnabled,
|
15
|
+
:ntpPushFrequency, :location, :height, :memoryUtilization, :mgmtProcIPaddress,
|
16
|
+
:temperatureSensors, :entitleSerialNumber, :manufacturingDate, :panicDump,
|
17
|
+
:powerSupply, :stackRole, :fans, :contact, :sysObjectID, :savePending, :resetReason,
|
18
|
+
:applyPending, :OS, :cpuUtilization, :ports, :upTime
|
15
19
|
|
16
20
|
def initialize(attributes)
|
17
21
|
build_resource(attributes)
|
@@ -6,7 +6,7 @@ module XClarityClient
|
|
6
6
|
response = connection(resource::BASE_URI, opts)
|
7
7
|
|
8
8
|
$lxca_log.info "XclarityClient::ManagementMixin get_all_resources", "Response received from #{resource::BASE_URI}"
|
9
|
-
|
9
|
+
|
10
10
|
return [] unless response.success?
|
11
11
|
|
12
12
|
body = JSON.parse(response.body)
|
@@ -14,9 +14,9 @@ module XClarityClient
|
|
14
14
|
body = body['response']
|
15
15
|
end
|
16
16
|
|
17
|
-
body =
|
18
|
-
|
19
|
-
body[
|
17
|
+
list_name, body = add_listname_on_body(resource, body)
|
18
|
+
|
19
|
+
body[list_name].map do |resource_params|
|
20
20
|
resource.new resource_params
|
21
21
|
end
|
22
22
|
end
|
@@ -147,5 +147,44 @@ module XClarityClient
|
|
147
147
|
resource.new resource_params
|
148
148
|
end
|
149
149
|
end
|
150
|
+
|
151
|
+
private
|
152
|
+
|
153
|
+
# Process the response body to make sure that its contains the list name defined on resource
|
154
|
+
# Returns the list name present on body and the body itself
|
155
|
+
def add_listname_on_body(resource, body)
|
156
|
+
body.kind_of?(Array) ? process_body_as_array(resource, body) : process_body_as_hash(resource, body)
|
157
|
+
end
|
158
|
+
|
159
|
+
# Return any listname described on resource
|
160
|
+
def any_listname_of(resource)
|
161
|
+
if resource::LIST_NAME.kind_of?(Array)
|
162
|
+
resource::LIST_NAME.first # If is an array, any listname can be use
|
163
|
+
else
|
164
|
+
resource::LIST_NAME # If is not an array, just return the listname of resource
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
# Returns the body value assigned to the list name defined on resource
|
169
|
+
def process_body_as_array(resource, body)
|
170
|
+
list_name = any_listname_of(resource)
|
171
|
+
|
172
|
+
return list_name, { list_name => body } # assign the list name to the body
|
173
|
+
end
|
174
|
+
|
175
|
+
# Discover what list name defined on resource is present on body
|
176
|
+
# If none of then is find assume that the body is a single resource
|
177
|
+
# and add it value into array and assing to any list name
|
178
|
+
def process_body_as_hash(resource, body)
|
179
|
+
result = body
|
180
|
+
|
181
|
+
if resource::LIST_NAME.kind_of? Array # search which list name is present on body
|
182
|
+
list_name = resource::LIST_NAME.find { |name| body.keys.include?(name) && body[name].kind_of?(Array) }
|
183
|
+
else
|
184
|
+
list_name = any_listname_of(resource)
|
185
|
+
end
|
186
|
+
result = {list_name => [body]} unless body.has_key? list_name # for the cases where body represents a single resource
|
187
|
+
return list_name, result
|
188
|
+
end
|
150
189
|
end
|
151
190
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xclarity_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manasa Rao
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-01-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|