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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 373f2fc5d1767ae8c47db70515f86a4bdebef52b
4
- data.tar.gz: 6f06a5cb63e6a92d7ddc8b5d156fff6b5762e515
3
+ metadata.gz: b12986c29a9d36e9a01e27d69bd589f92b168365
4
+ data.tar.gz: 06dd50cb3c55664132fd0e7657a076d8ef221706
5
5
  SHA512:
6
- metadata.gz: e77d18925ee2de60d29895d403a22ce5bb342ed7ed972c1ecec4d06081c215e96cda6bcb52aa4db89a8f83703d8d18842c6ef9daf53c9e582c19a83339366a30
7
- data.tar.gz: 35216f7360eb17ca50627c9bec9923fb54f99a073efb66368f19d5381e607df74b51b776f42a06d53571b9f3321688dca6886b53b85639c802709a90ecd7b1d8
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, :primaryProfileID, :forScalableNode, :forScalablePrimaryNode, :deviceId, :deviceType, :managementPatternPresent, :rackID, :templateID
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, :failSNs,
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)
@@ -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, :uuid
9
+ :messageParameters, :startTime, :messageID, :messageBundle, :endTime, :id, :isCancelable, :rebootPersistent,
10
+ :uuid, :hidden
10
11
 
11
12
  def initialize(attributes)
12
13
  build_resource(attributes)
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module XClarityClient
2
- VERSION = "0.5.8"
2
+ VERSION = "0.5.9"
3
3
  end
@@ -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 = {resource::LIST_NAME => body} if body.is_a? Array
18
- body = {resource::LIST_NAME => [body]} unless body.has_key? resource::LIST_NAME
19
- body[resource::LIST_NAME].map do |resource_params|
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.8
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: 2017-11-21 00:00:00.000000000 Z
12
+ date: 2018-01-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler