xclarity_client 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +41 -0
  3. data/.rubocop_base.yml +211 -0
  4. data/.rubocop_cc.yml +2 -0
  5. data/.travis.yml +1 -1
  6. data/docs/apib/compliance_policies.apib +214 -0
  7. data/docs/apib/squisher.rb +21 -13
  8. data/docs/apib/storages.apib +481 -0
  9. data/docs/apib/switches.apib +4 -0
  10. data/lib/xclarity_client.rb +3 -4
  11. data/lib/xclarity_client/client.rb +37 -343
  12. data/lib/xclarity_client/connection/connection.rb +3 -3
  13. data/lib/xclarity_client/endpoints/compliance_policy.rb +19 -0
  14. data/lib/xclarity_client/endpoints/endpoints.rb +2 -0
  15. data/lib/xclarity_client/endpoints/node.rb +8 -0
  16. data/lib/xclarity_client/endpoints/storage.rb +18 -0
  17. data/lib/xclarity_client/endpoints/switch.rb +3 -0
  18. data/lib/xclarity_client/mixins/aicc_mixin.rb +10 -0
  19. data/lib/xclarity_client/mixins/cabinet_mixin.rb +20 -0
  20. data/lib/xclarity_client/mixins/canister_mixin.rb +20 -0
  21. data/lib/xclarity_client/mixins/chassi_mixin.rb +20 -0
  22. data/lib/xclarity_client/mixins/cmm_mixin.rb +20 -0
  23. data/lib/xclarity_client/mixins/compliance_policy_mixin.rb +38 -0
  24. data/lib/xclarity_client/mixins/config_pattern_mixin.rb +40 -0
  25. data/lib/xclarity_client/mixins/config_profile_mixin.rb +51 -0
  26. data/lib/xclarity_client/mixins/config_target_mixin.rb +16 -0
  27. data/lib/xclarity_client/mixins/discover_request_mixin.rb +18 -0
  28. data/lib/xclarity_client/mixins/discovery_mixin.rb +10 -0
  29. data/lib/xclarity_client/mixins/event_mixin.rb +14 -0
  30. data/lib/xclarity_client/mixins/fan_mixin.rb +20 -0
  31. data/lib/xclarity_client/mixins/fan_mux_mixin.rb +20 -0
  32. data/lib/xclarity_client/mixins/ffdc_mixin.rb +16 -0
  33. data/lib/xclarity_client/mixins/global_setting_mixin.rb +14 -0
  34. data/lib/xclarity_client/mixins/host_platform_mixin.rb +18 -0
  35. data/lib/xclarity_client/mixins/job_mixin.rb +32 -0
  36. data/lib/xclarity_client/mixins/mixins.rb +38 -0
  37. data/lib/xclarity_client/mixins/node_mixin.rb +66 -0
  38. data/lib/xclarity_client/mixins/os_image_mixin.rb +14 -0
  39. data/lib/xclarity_client/mixins/persisted_result_mixin.rb +10 -0
  40. data/lib/xclarity_client/mixins/power_supply_mixin.rb +20 -0
  41. data/lib/xclarity_client/mixins/remote_access_mixin.rb +10 -0
  42. data/lib/xclarity_client/mixins/remote_file_server_mixin.rb +28 -0
  43. data/lib/xclarity_client/mixins/scalable_complex_mixin.rb +20 -0
  44. data/lib/xclarity_client/mixins/storage_mixin.rb +20 -0
  45. data/lib/xclarity_client/mixins/switch_mixin.rb +30 -0
  46. data/lib/xclarity_client/mixins/unmanage_request_mixin.rb +18 -0
  47. data/lib/xclarity_client/mixins/update_repo_mixin.rb +10 -0
  48. data/lib/xclarity_client/mixins/user_mixin.rb +26 -0
  49. data/lib/xclarity_client/schemas.rb +184 -189
  50. data/lib/xclarity_client/services/aicc_management.rb +0 -4
  51. data/lib/xclarity_client/services/cabinet_management.rb +0 -4
  52. data/lib/xclarity_client/services/canister_management.rb +0 -4
  53. data/lib/xclarity_client/services/chassi_management.rb +0 -4
  54. data/lib/xclarity_client/services/cmm_management.rb +0 -4
  55. data/lib/xclarity_client/services/compliance_policy_management.rb +52 -0
  56. data/lib/xclarity_client/services/config_pattern_management.rb +0 -4
  57. data/lib/xclarity_client/services/config_profile_management.rb +0 -4
  58. data/lib/xclarity_client/services/config_target_management.rb +0 -4
  59. data/lib/xclarity_client/services/discover_request_management.rb +0 -4
  60. data/lib/xclarity_client/services/discovery_management.rb +0 -4
  61. data/lib/xclarity_client/services/event_management.rb +0 -4
  62. data/lib/xclarity_client/services/fan_management.rb +0 -4
  63. data/lib/xclarity_client/services/fan_mux_management.rb +0 -4
  64. data/lib/xclarity_client/services/ffdc_management.rb +0 -4
  65. data/lib/xclarity_client/services/job_management.rb +0 -9
  66. data/lib/xclarity_client/services/mixins/power_action_sender_mixin.rb +59 -0
  67. data/lib/xclarity_client/services/node_management.rb +3 -26
  68. data/lib/xclarity_client/services/osimage_management.rb +25 -27
  69. data/lib/xclarity_client/services/persisted_result_management.rb +0 -6
  70. data/lib/xclarity_client/services/power_supply_management.rb +0 -4
  71. data/lib/xclarity_client/services/scalable_complex_management.rb +0 -4
  72. data/lib/xclarity_client/services/services.rb +6 -4
  73. data/lib/xclarity_client/services/storage_management.rb +8 -0
  74. data/lib/xclarity_client/services/switch_management.rb +4 -4
  75. data/lib/xclarity_client/services/unmanage_request_management.rb +0 -4
  76. data/lib/xclarity_client/services/update_repo_management.rb +30 -9
  77. data/lib/xclarity_client/services/user_management.rb +0 -4
  78. data/lib/xclarity_client/services/xclarity_service.rb +6 -5
  79. data/lib/xclarity_client/version.rb +1 -1
  80. data/xclarity_client.gemspec +1 -1
  81. metadata +45 -5
  82. data/lib/xclarity_client/xclarity_power_management_mixin.rb +0 -36
@@ -24,6 +24,7 @@ require 'xclarity_client/endpoints/persisted_result'
24
24
  require 'xclarity_client/endpoints/power_supply'
25
25
  require 'xclarity_client/endpoints/scalable_complex'
26
26
  require 'xclarity_client/endpoints/switch'
27
+ require 'xclarity_client/endpoints/storage'
27
28
  require 'xclarity_client/endpoints/unmanage_request'
28
29
  require 'xclarity_client/endpoints/update_repo'
29
30
  require 'xclarity_client/endpoints/user'
@@ -32,3 +33,4 @@ require 'xclarity_client/endpoints/globalsettings'
32
33
  require 'xclarity_client/endpoints/hostplatform'
33
34
  require 'xclarity_client/endpoints/osimage'
34
35
  require 'xclarity_client/endpoints/remotefileserver'
36
+ require 'xclarity_client/endpoints/compliance_policy'
@@ -2,6 +2,14 @@ module XClarityClient
2
2
  class Node < Endpoints::XclarityEndpoint
3
3
  BASE_URI = '/nodes'.freeze
4
4
  LIST_NAME = 'nodeList'.freeze
5
+ POWER_ACTIONS = %i(
6
+ powerOn
7
+ powerOffSoftGraceful
8
+ powerOff
9
+ powerCycleSoftGrace
10
+ powerCycleSoft
11
+ bootToF1
12
+ ).freeze
5
13
 
6
14
  attr_accessor :accessState, :activationKeys, :addinCards, :addinCardSlots, :arch, :backedBy, :bladeState, :bladeState_health,
7
15
  :bladeState_string, :bootMode, :bootOrder, :cmmDisplayName, :cmmHealthState, :complexID, :contact, :dataHandle,
@@ -0,0 +1,18 @@
1
+ module XClarityClient
2
+ #
3
+ # This class defines an endpoint for a Storage
4
+ #
5
+ # A Storage is a physical system capable of store a large amount of data with
6
+ # speed, security and high availability
7
+ #
8
+ class Storage < Endpoints::XclarityEndpoint
9
+ BASE_URI = '/storages'.freeze
10
+ LIST_NAME = 'storageList'.freeze
11
+
12
+ attr_accessor :uuid, :name, :type, :accessState, :cmmHealthState,
13
+ :overallHealthState, :driveBays, :enclosureCount,
14
+ :canisterSlots, :productName, :machineType, :model,
15
+ :serialNumber, :contact, :description, :location,
16
+ :room, :rack, :lowestRackUnit, :mgmtProcIPaddress
17
+ end
18
+ end
@@ -2,6 +2,9 @@ module XClarityClient
2
2
  class Switch < Endpoints::XclarityEndpoint
3
3
  BASE_URI = '/switches'.freeze
4
4
  LIST_NAME = 'switchList'.freeze
5
+ POWER_ACTIONS = %i(
6
+ powerCycleSoft
7
+ ).freeze
5
8
 
6
9
  attr_accessor :accessState, :attachedNodes, :backedBy, :cmmDisplayName, :cmmHealthState,
7
10
  :dataHandle, :description, :dnsHostnames, :errorFields, :excludedHealthState,
@@ -0,0 +1,10 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes AiccManagement features
4
+ #
5
+ module Mixins::AiccMixin
6
+ def discover_aicc(opts = {})
7
+ AiccManagement.new(@config).fetch_all(opts)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,20 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes CabinetManagement features
4
+ #
5
+ module Mixins::CabinetMixin
6
+ def discover_cabinet(opts = {})
7
+ CabinetManagement.new(@config).fetch_all(opts)
8
+ end
9
+
10
+ def fetch_cabinet(uuids = nil,
11
+ include_attributes = nil,
12
+ exclude_attributes = nil)
13
+ CabinetManagement.new(@config).get_object(
14
+ uuids,
15
+ include_attributes,
16
+ exclude_attributes
17
+ )
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes CanisterManagement features
4
+ #
5
+ module Mixins::CanisterMixin
6
+ def discover_canisters(opts = {})
7
+ CanisterManagement.new(@config).fetch_all(opts)
8
+ end
9
+
10
+ def fetch_canisters(uuids = nil,
11
+ include_attributes = nil,
12
+ exclude_attributes = nil)
13
+ CanisterManagement.new(@config).get_object(
14
+ uuids,
15
+ include_attributes,
16
+ exclude_attributes
17
+ )
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes ChassiManagement features
4
+ #
5
+ module Mixins::ChassiMixin
6
+ def discover_chassis(opts = {})
7
+ ChassiManagement.new(@config).fetch_all(opts)
8
+ end
9
+
10
+ def fetch_chassis(uuids = nil,
11
+ include_attributes = nil,
12
+ exclude_attributes = nil)
13
+ ChassiManagement.new(@config).get_object(
14
+ uuids,
15
+ include_attributes,
16
+ exclude_attributes
17
+ )
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes CmmManagement features
4
+ #
5
+ module Mixins::CmmMixin
6
+ def discover_cmms(opts = {})
7
+ CmmManagement.new(@config).fetch_all(opts)
8
+ end
9
+
10
+ def fetch_cmms(uuids = nil,
11
+ include_attributes = nil,
12
+ exclude_attributes = nil)
13
+ CmmManagement.new(@config).get_object(
14
+ uuids,
15
+ include_attributes,
16
+ exclude_attributes
17
+ )
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,38 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes CompliancePolicyManagement features
4
+ #
5
+ module Mixins::CompliancePolicyMixin
6
+ def discover_update_policy(opts = {})
7
+ CompliancePolicyManagement.new(@config).fetch_all(opts)
8
+ end
9
+
10
+ def discover_application_firmware
11
+ CompliancePolicyManagement.new(@config).get_applicable_firmware
12
+ end
13
+
14
+ def discover_persisted_compare_results(opts = {})
15
+ CompliancePolicyManagement.new(@config).get_persisted_compare_results(
16
+ opts
17
+ )
18
+ end
19
+
20
+ def discover_compare_results(opts = {})
21
+ CompliancePolicyManagement.new(@config).get_compare_results(
22
+ opts
23
+ )
24
+ end
25
+
26
+ def assign_compliance_policy(opts = {}, keep = nil, auto_assign = nil)
27
+ CompliancePolicyManagement.new(@config).assign_compliance_policy(
28
+ opts, keep, auto_assign
29
+ )
30
+ end
31
+
32
+ def delete_compliance_policy(policy_name, remove_package = nil)
33
+ CompliancePolicyManagement.new(@config).delete_compliance_policy(
34
+ policy_name, remove_package
35
+ )
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,40 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes ConfigPatternManagement features
4
+ #
5
+ module Mixins::ConfigPatternMixin
6
+ def fetch_config_pattern(ids = nil,
7
+ include_attributes = nil,
8
+ exclude_attributes = nil)
9
+ ConfigPatternManagement.new(@config).get_object_with_id(
10
+ ids,
11
+ include_attributes,
12
+ exclude_attributes
13
+ )
14
+ end
15
+
16
+ def discover_config_pattern
17
+ ConfigPatternManagement.new(@config).fetch_all
18
+ end
19
+
20
+ def export_config_pattern(id = '')
21
+ ConfigPatternManagement.new(@config).export(id)
22
+ end
23
+
24
+ def deploy_config_pattern(id = '',
25
+ endpoints = nil,
26
+ restart = '',
27
+ etype = '')
28
+ ConfigPatternManagement.new(@config).deploy_config_pattern(
29
+ id,
30
+ endpoints,
31
+ restart,
32
+ etype
33
+ )
34
+ end
35
+
36
+ def import_config_pattern(config_pattern = {})
37
+ ConfigPatternManagement.new(@config).import_config_pattern(config_pattern)
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,51 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes ConfigProfileManagement features
4
+ #
5
+ module Mixins::ConfigProfileMixin
6
+ def fetch_config_profile(ids = nil,
7
+ include_attributes = nil,
8
+ exclude_attributes = nil)
9
+ ConfigProfileManagement.new(@config).get_object_with_id(
10
+ ids,
11
+ include_attributes,
12
+ exclude_attributes
13
+ )
14
+ end
15
+
16
+ def discover_config_profile
17
+ ConfigProfileManagement.new(@config).fetch_all
18
+ end
19
+
20
+ def rename_config_profile(id = '', name = '')
21
+ ConfigProfileManagement.new(@config).rename_config_profile(
22
+ id,
23
+ name
24
+ )
25
+ end
26
+
27
+ def activate_config_profile(id = '', endpoint_uuid = '', restart = '')
28
+ ConfigProfileManagement.new(@config).activate_config_profile(
29
+ id,
30
+ endpoint_uuid,
31
+ restart
32
+ )
33
+ end
34
+
35
+ def unassign_config_profile(id = '',
36
+ power_down = '',
37
+ reset_imm = '',
38
+ force = '')
39
+ ConfigProfileManagement.new(@config).unassign_config_profile(
40
+ id,
41
+ power_down,
42
+ reset_imm,
43
+ force
44
+ )
45
+ end
46
+
47
+ def delete_config_profile(id = '')
48
+ ConfigProfileManagement.new(@config).delete_config_profile(id)
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,16 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes ConfigTargetManagement features
4
+ #
5
+ module Mixins::ConfigTargetMixin
6
+ def fetch_config_target(ids = nil,
7
+ include_attributes = nil,
8
+ exclude_attributes = nil)
9
+ ConfigTargetManagement.new(@config).get_object_with_id(
10
+ ids,
11
+ include_attributes,
12
+ exclude_attributes
13
+ )
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes DiscoverRequestManagement features
4
+ #
5
+ module Mixins::DiscoverRequestMixin
6
+ def monitor_discover_request(job_id)
7
+ DiscoverRequestManagement.new(@config).monitor_discover_request(
8
+ job_id
9
+ )
10
+ end
11
+
12
+ def discover_manageable_devices(ip_addresses)
13
+ DiscoverRequestManagement.new(@config).discover_manageable_devices(
14
+ ip_addresses
15
+ )
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,10 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes DiscoveryManagement features
4
+ #
5
+ module Mixins::DiscoverMixin
6
+ def discover_devices_by_slp
7
+ DiscoveryManagement.new(@config).fetch_all
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes EventManagement features
4
+ #
5
+ module Mixins::EventMixin
6
+ def discover_events
7
+ EventManagement.new(@config).fetch_all
8
+ end
9
+
10
+ def fetch_events(opts = {})
11
+ EventManagement.new(@config).get_object_with_opts(opts, Event)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,20 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes FanManagement features
4
+ #
5
+ module Mixins::FanMixin
6
+ def fetch_fans(uuids = nil,
7
+ include_attributes = nil,
8
+ exclude_attributes = nil)
9
+ FanManagement.new(@config).get_object(
10
+ uuids,
11
+ include_attributes,
12
+ exclude_attributes
13
+ )
14
+ end
15
+
16
+ def discover_fans(opts = {})
17
+ FanManagement.new(@config).fetch_all(opts)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes FanMuxManagement features
4
+ #
5
+ module Mixins::FanMuxMixin
6
+ def discover_fan_muxes(opts = {})
7
+ FanMuxManagement.new(@config).fetch_all(opts)
8
+ end
9
+
10
+ def fetch_fan_muxes(uuids = nil,
11
+ include_attributes = nil,
12
+ exclude_attributes = nil)
13
+ FanMuxManagement.new(@config).get_object(
14
+ uuids,
15
+ include_attributes,
16
+ exclude_attributes
17
+ )
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,16 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes FfdcManagement features
4
+ #
5
+ module Mixins::FfdcMixin
6
+ def fetch_ffdc(uuids = nil,
7
+ include_attributes = nil,
8
+ exclude_attributes = nil)
9
+ FfdcManagement.new(@config).get_object(
10
+ uuids,
11
+ include_attributes,
12
+ exclude_attributes
13
+ )
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes GlobalSettingManagement features
4
+ #
5
+ module Mixins::GlobalSettingMixin
6
+ def get_globalsettings
7
+ GlobalSettingManagement.new(@config).population
8
+ end
9
+
10
+ def set_globalsettings(opts = {})
11
+ GlobalSettingManagement.new(@config).set_globalsettings(opts)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ module XClarityClient
2
+ #
3
+ # Exposes HostPlatformManagement features
4
+ #
5
+ module Mixins::HostPlatformMixin
6
+ def get_hostplatforms
7
+ HostPlatformManagement.new(@config).population
8
+ end
9
+
10
+ def get_osimage_deployment_status(uuid = '')
11
+ HostPlatformManagement.new(@config).get_osimage_deployment_status(uuid)
12
+ end
13
+
14
+ def deploy_osimage(opts = [])
15
+ HostPlatformManagement.new(@config).deploy_osimage(opts)
16
+ end
17
+ end
18
+ end