Module: Hpe3parSdk
- Defined in:
- lib/Hpe3parSdk/util.rb,
lib/Hpe3parSdk.rb,
lib/Hpe3parSdk/ssh.rb,
lib/Hpe3parSdk/http.rb,
lib/Hpe3parSdk/client.rb,
lib/Hpe3parSdk/models.rb,
lib/Hpe3parSdk/version.rb,
lib/Hpe3parSdk/constants.rb,
lib/Hpe3parSdk/multi_log.rb,
lib/Hpe3parSdk/exceptions.rb,
lib/Hpe3parSdk/tcl_parser.rb,
lib/Hpe3parSdk/cpg_manager.rb,
lib/Hpe3parSdk/qos_manager.rb,
lib/Hpe3parSdk/host_manager.rb,
lib/Hpe3parSdk/port_manager.rb,
lib/Hpe3parSdk/task_manager.rb,
lib/Hpe3parSdk/vlun_manager.rb,
lib/Hpe3parSdk/wsapi_version.rb,
lib/Hpe3parSdk/volume_manager.rb,
lib/Hpe3parSdk/host_set_manager.rb,
lib/Hpe3parSdk/volume_set_manager.rb,
lib/Hpe3parSdk/flash_cache_manager.rb
Overview
© Copyright 2016-2017 Hewlett Packard Enterprise Development LP
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Defined Under Namespace
Classes: Agent, CPG, CPGChunkletPosPref, CPGDetailedState, CPGDiskType, CPGHA, CPGManager, CPGRAIDType, CPGState, CapEfficiency, ChapOperationMode, Client, ConnectionError, CustomFormatter, CustomHTTPFormatter, Descriptors, DiskPattern, FCPath, FlashCache, FlashCacheManager, FlashCachePolicy, GrowthParams, HPE3PARException, HTTPBadGateway, HTTPBadRequest, HTTPConflict, HTTPError, HTTPExpectationFailed, HTTPForbidden, HTTPGatewayTimeout, HTTPGone, HTTPInternalServerError, HTTPJSONRestClient, HTTPLengthRequired, HTTPMethodNotAllowed, HTTPNotAcceptable, HTTPNotFound, HTTPNotImplemented, HTTPPreconditionFailed, HTTPProxyAuthRequired, HTTPRequestEntityTooLarge, HTTPRequestTimeout, HTTPRequestURITooLong, HTTPRequestedRangeNotSatisfiable, HTTPServiceUnavailable, HTTPTeaPot, HTTPUnauthorized, HTTPUnsupportedMediaType, HTTPVersionNotSupported, Host, HostEditOperation, HostManager, HostPersona, HostSet, HostSetManager, ISCSIPortInfo, LDLayout, LDLayoutCapacity, MultiLog, Policy, Port, PortConnType, PortFailOverState, PortLinkState, PortManager, PortMode, PortPos, PortProtocol, PrivateSpace, QOSManager, QoSRule, QoSpriorityEnumeration, QoStargetType, QoStargetTypeConstants, QosZeroNoneOperation, RaidTypeSetSizeMap, RequestException, SCSIPath, SSH, SSLCertFailed, SetCustomAction, Space, TCL_Parser, Task, TaskAction, TaskManager, TaskPriority, TaskStatus, TaskType, Timeout, TooManyRedirects, URLRequired, UnsupportedVersion, Usage, Util, VLUN, VLUNfailedPathPol, VirtualVolume, VlunManager, VlunMultipathing, VlunType, VolumeCompressionState, VolumeConversionOperation, VolumeCopyType, VolumeCustomAction, VolumeDeduplicationState, VolumeDetailedState, VolumeHostDIF, VolumeManager, VolumeProvisioningType, VolumeSet, VolumeSetManager, VolumeTuneOperation, WSAPIVersion, WSAPIVersionSupport
Constant Summary collapse
- VERSION =
'1.0.0'.freeze
- @@code_map =
Hash.new('HPE3PARException')
Class Attribute Summary collapse
-
.logger ⇒ Object
Returns the value of attribute logger.
Instance Attribute Summary collapse
-
#code_map ⇒ Object
Returns the value of attribute code_map.
Class Method Summary collapse
Class Attribute Details
.logger ⇒ Object
Returns the value of attribute logger.
15 16 17 |
# File 'lib/Hpe3parSdk/multi_log.rb', line 15 def logger @logger end |
Instance Attribute Details
#code_map ⇒ Object
Returns the value of attribute code_map.
454 455 456 |
# File 'lib/Hpe3parSdk/exceptions.rb', line 454 def code_map @code_map end |
Class Method Details
.exception_from_response(response, body) ⇒ Object
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 |
# File 'lib/Hpe3parSdk/exceptions.rb', line 473 def self.exception_from_response(response, body) # Return an instance of an ClientException or subclass # based on a Python Requests response. # # Usage:: # # resp, body = http.request(...) # if resp.status != 200: # raise exception_from_response(resp, body) cls = @@code_map[response.code] code = nil msg = nil ref = nil if response.code >= 400 if !body.nil? and body.key?('message') body['desc'] = body['message'] end end code = body['code'] msg = body['desc'] if body.key?('ref') ref = body['ref'] end return Hpe3parSdk.const_get(cls).new(code, msg, ref, response.code) end |