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.
- checksums.yaml +4 -4
- data/.codeclimate.yml +41 -0
- data/.rubocop_base.yml +211 -0
- data/.rubocop_cc.yml +2 -0
- data/.travis.yml +1 -1
- data/docs/apib/compliance_policies.apib +214 -0
- data/docs/apib/squisher.rb +21 -13
- data/docs/apib/storages.apib +481 -0
- data/docs/apib/switches.apib +4 -0
- data/lib/xclarity_client.rb +3 -4
- data/lib/xclarity_client/client.rb +37 -343
- data/lib/xclarity_client/connection/connection.rb +3 -3
- data/lib/xclarity_client/endpoints/compliance_policy.rb +19 -0
- data/lib/xclarity_client/endpoints/endpoints.rb +2 -0
- data/lib/xclarity_client/endpoints/node.rb +8 -0
- data/lib/xclarity_client/endpoints/storage.rb +18 -0
- data/lib/xclarity_client/endpoints/switch.rb +3 -0
- data/lib/xclarity_client/mixins/aicc_mixin.rb +10 -0
- data/lib/xclarity_client/mixins/cabinet_mixin.rb +20 -0
- data/lib/xclarity_client/mixins/canister_mixin.rb +20 -0
- data/lib/xclarity_client/mixins/chassi_mixin.rb +20 -0
- data/lib/xclarity_client/mixins/cmm_mixin.rb +20 -0
- data/lib/xclarity_client/mixins/compliance_policy_mixin.rb +38 -0
- data/lib/xclarity_client/mixins/config_pattern_mixin.rb +40 -0
- data/lib/xclarity_client/mixins/config_profile_mixin.rb +51 -0
- data/lib/xclarity_client/mixins/config_target_mixin.rb +16 -0
- data/lib/xclarity_client/mixins/discover_request_mixin.rb +18 -0
- data/lib/xclarity_client/mixins/discovery_mixin.rb +10 -0
- data/lib/xclarity_client/mixins/event_mixin.rb +14 -0
- data/lib/xclarity_client/mixins/fan_mixin.rb +20 -0
- data/lib/xclarity_client/mixins/fan_mux_mixin.rb +20 -0
- data/lib/xclarity_client/mixins/ffdc_mixin.rb +16 -0
- data/lib/xclarity_client/mixins/global_setting_mixin.rb +14 -0
- data/lib/xclarity_client/mixins/host_platform_mixin.rb +18 -0
- data/lib/xclarity_client/mixins/job_mixin.rb +32 -0
- data/lib/xclarity_client/mixins/mixins.rb +38 -0
- data/lib/xclarity_client/mixins/node_mixin.rb +66 -0
- data/lib/xclarity_client/mixins/os_image_mixin.rb +14 -0
- data/lib/xclarity_client/mixins/persisted_result_mixin.rb +10 -0
- data/lib/xclarity_client/mixins/power_supply_mixin.rb +20 -0
- data/lib/xclarity_client/mixins/remote_access_mixin.rb +10 -0
- data/lib/xclarity_client/mixins/remote_file_server_mixin.rb +28 -0
- data/lib/xclarity_client/mixins/scalable_complex_mixin.rb +20 -0
- data/lib/xclarity_client/mixins/storage_mixin.rb +20 -0
- data/lib/xclarity_client/mixins/switch_mixin.rb +30 -0
- data/lib/xclarity_client/mixins/unmanage_request_mixin.rb +18 -0
- data/lib/xclarity_client/mixins/update_repo_mixin.rb +10 -0
- data/lib/xclarity_client/mixins/user_mixin.rb +26 -0
- data/lib/xclarity_client/schemas.rb +184 -189
- data/lib/xclarity_client/services/aicc_management.rb +0 -4
- data/lib/xclarity_client/services/cabinet_management.rb +0 -4
- data/lib/xclarity_client/services/canister_management.rb +0 -4
- data/lib/xclarity_client/services/chassi_management.rb +0 -4
- data/lib/xclarity_client/services/cmm_management.rb +0 -4
- data/lib/xclarity_client/services/compliance_policy_management.rb +52 -0
- data/lib/xclarity_client/services/config_pattern_management.rb +0 -4
- data/lib/xclarity_client/services/config_profile_management.rb +0 -4
- data/lib/xclarity_client/services/config_target_management.rb +0 -4
- data/lib/xclarity_client/services/discover_request_management.rb +0 -4
- data/lib/xclarity_client/services/discovery_management.rb +0 -4
- data/lib/xclarity_client/services/event_management.rb +0 -4
- data/lib/xclarity_client/services/fan_management.rb +0 -4
- data/lib/xclarity_client/services/fan_mux_management.rb +0 -4
- data/lib/xclarity_client/services/ffdc_management.rb +0 -4
- data/lib/xclarity_client/services/job_management.rb +0 -9
- data/lib/xclarity_client/services/mixins/power_action_sender_mixin.rb +59 -0
- data/lib/xclarity_client/services/node_management.rb +3 -26
- data/lib/xclarity_client/services/osimage_management.rb +25 -27
- data/lib/xclarity_client/services/persisted_result_management.rb +0 -6
- data/lib/xclarity_client/services/power_supply_management.rb +0 -4
- data/lib/xclarity_client/services/scalable_complex_management.rb +0 -4
- data/lib/xclarity_client/services/services.rb +6 -4
- data/lib/xclarity_client/services/storage_management.rb +8 -0
- data/lib/xclarity_client/services/switch_management.rb +4 -4
- data/lib/xclarity_client/services/unmanage_request_management.rb +0 -4
- data/lib/xclarity_client/services/update_repo_management.rb +30 -9
- data/lib/xclarity_client/services/user_management.rb +0 -4
- data/lib/xclarity_client/services/xclarity_service.rb +6 -5
- data/lib/xclarity_client/version.rb +1 -1
- data/xclarity_client.gemspec +1 -1
- metadata +45 -5
- 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,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,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
|