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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f8d0229ded440c49c74f1d9c49aeacd576fd4fdf
4
- data.tar.gz: 6f45928c7b0d1062589ac258f1f50bd630d25886
3
+ metadata.gz: 714241cc9417ae4ab27aab39a98b1b1618f154fc
4
+ data.tar.gz: a73d88ab737024ee116444c4927ba503e7c427e0
5
5
  SHA512:
6
- metadata.gz: 05cc0ad9dca0c17e7455f7413ad5627c87f77a1caf7219caebf486c781353e03602276706a42531a81a6d185f622d9cef7702f6f066e5deea7139c6cca267aca
7
- data.tar.gz: 7dd67d6bfd62e8ab7a12e52f3e868970eb15be68873ba56e6a33810586c175bc472e5a4b2654fc9769e36bc190a3139c6cacbcafd5d84060033373c57cbcf28d
6
+ metadata.gz: 40844b7e6df453eb351141f13ca950becdafa967807524c03df999b2cdda2fd8c9ee03b48f92434765a002ee8a761ac1bcf2d47c5b011ac1b791f01024981b4d
7
+ data.tar.gz: 6db55eecaaf8a2d5764df2da2b1b58e7d5d8937445115803efb29274752035f49927dd58a99621726a9d4e92c122272f23ec27295b351f3dcc2a5d3b582b55b3
data/.codeclimate.yml ADDED
@@ -0,0 +1,41 @@
1
+ ---
2
+ exclude_paths:
3
+ - ".git/"
4
+ - "**.gif"
5
+ - "**.html"
6
+ - "**.json"
7
+ - "**.png"
8
+ - "**.svg"
9
+ - "**.xml"
10
+ - "**.yaml"
11
+ - "**.yml"
12
+ - "bin/"
13
+ - "coverage/"
14
+ - "spec/"
15
+ engines:
16
+ brakeman:
17
+ enabled: false
18
+ bundler-audit:
19
+ enabled: false
20
+ csslint:
21
+ enabled: false
22
+ duplication:
23
+ enabled: true
24
+ config:
25
+ concurrency: 1
26
+ languages:
27
+ - ruby
28
+ eslint:
29
+ enabled: false
30
+ fixme:
31
+ enabled: false
32
+ markdownlint:
33
+ enabled: false
34
+ rubocop:
35
+ enabled: true
36
+ config: '.rubocop_cc.yml'
37
+ ratings:
38
+ paths:
39
+ - Gemfile.lock
40
+ - "**.rake"
41
+ - "**.rb"
data/.rubocop_base.yml ADDED
@@ -0,0 +1,211 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.3
3
+ Layout/AlignHash:
4
+ EnforcedHashRocketStyle: table
5
+ EnforcedColonStyle: table
6
+ Layout/ExtraSpacing:
7
+ AutoCorrect: true
8
+ Layout/SpaceBeforeFirstArg:
9
+ Enabled: false
10
+ Layout/SpaceInsideHashLiteralBraces:
11
+ Enabled: true
12
+ Lint/DefEndAlignment:
13
+ AutoCorrect: true
14
+ Lint/EndAlignment:
15
+ AutoCorrect: true
16
+ Metrics/AbcSize:
17
+ Enabled: false
18
+ Metrics/BlockLength:
19
+ Enabled: false
20
+ Metrics/BlockNesting:
21
+ Enabled: false
22
+ Metrics/ClassLength:
23
+ Enabled: true
24
+ Metrics/CyclomaticComplexity:
25
+ Enabled: false
26
+ Metrics/LineLength:
27
+ Enabled: true
28
+ Metrics/MethodLength:
29
+ Enabled: true
30
+ Metrics/ModuleLength:
31
+ Enabled: false
32
+ Metrics/ParameterLists:
33
+ Enabled: true
34
+ Metrics/PerceivedComplexity:
35
+ Enabled: false
36
+ Performance/Casecmp:
37
+ Enabled: true
38
+ Rails:
39
+ Enabled: true
40
+ Rails/FindEach:
41
+ Enabled: false
42
+ Rails/ReadWriteAttribute:
43
+ AutoCorrect: false
44
+ Style/BracesAroundHashParameters:
45
+ EnforcedStyle: context_dependent
46
+ Style/ClassAndModuleChildren:
47
+ Enabled: false
48
+ Style/ClassCheck:
49
+ EnforcedStyle: kind_of?
50
+ Style/CollectionMethods:
51
+ PreferredMethods:
52
+ find: detect
53
+ find_all: select
54
+ map: collect
55
+ reduce: inject
56
+ Style/Documentation:
57
+ Enabled: true
58
+ Style/DoubleNegation:
59
+ Enabled: true
60
+ Style/EmptyMethod:
61
+ Enabled: true
62
+ Style/Encoding:
63
+ Enabled: false
64
+ Style/FormatString:
65
+ EnforcedStyle: percent
66
+ Style/FormatStringToken:
67
+ EnforcedStyle: template
68
+ Style/FrozenStringLiteralComment:
69
+ Enabled: false
70
+ Style/GuardClause:
71
+ Enabled: true
72
+ Style/HashSyntax:
73
+ EnforcedStyle: hash_rockets
74
+ Style/IfUnlessModifier:
75
+ Enabled: true
76
+ Style/MethodCallWithArgsParentheses:
77
+ Exclude:
78
+ - Gemfile
79
+ - spec/**/*
80
+ Enabled: true
81
+ IgnoredMethods:
82
+ # Ruby
83
+ - alias_method
84
+ - attr_accessor
85
+ - attr_reader
86
+ - attr_writer
87
+ - exit
88
+ - extend
89
+ - gem
90
+ - include
91
+ - load
92
+ - module_function
93
+ - pp
94
+ - prepend
95
+ - print
96
+ - private
97
+ - private_class_method
98
+ - private_constant
99
+ - puts
100
+ - raise
101
+ - require
102
+ - sleep
103
+ - throw
104
+ - yield
105
+ # Rails
106
+ - accepts_nested_attributes_for
107
+ - add_column
108
+ - add_index
109
+ - after_action
110
+ - after_commit
111
+ - after_create
112
+ - after_create_commit
113
+ - after_destroy
114
+ - after_destroy
115
+ - after_destroy_commit
116
+ - after_initialize
117
+ - after_save
118
+ - after_save
119
+ - after_update
120
+ - after_update_commit
121
+ - alias_attribute
122
+ - around_destroy
123
+ - autoload
124
+ - before_action
125
+ - before_create
126
+ - before_destroy
127
+ - before_save
128
+ - before_update
129
+ - before_validation
130
+ - belongs_to
131
+ - bigint
132
+ - boolean
133
+ - cattr_accessor
134
+ - cattr_reader
135
+ - cattr_writer
136
+ - change_column
137
+ - class_attribute
138
+ - create_table
139
+ - datetime
140
+ - decimal
141
+ - delegate
142
+ - drop_table
143
+ - has_and_belongs_to_many
144
+ - has_many
145
+ - has_one
146
+ - head
147
+ - identified_by
148
+ - integer
149
+ - mattr_accessor
150
+ - remove_column
151
+ - remove_index
152
+ - rename_column
153
+ - render
154
+ - require_dependency
155
+ - require_relative
156
+ - respond_to
157
+ - scope
158
+ - serialize
159
+ - skip_before_action
160
+ - string
161
+ - text
162
+ - validate
163
+ - validates
164
+ # Rake
165
+ - desc
166
+ - task
167
+ Style/NumericLiterals:
168
+ AutoCorrect: false
169
+ Style/PercentLiteralDelimiters:
170
+ PreferredDelimiters:
171
+ '%i': ()
172
+ '%I': ()
173
+ '%w': ()
174
+ '%W': ()
175
+ Style/PerlBackrefs:
176
+ Enabled: false
177
+ Style/ParallelAssignment:
178
+ Enabled: false
179
+ Style/RedundantReturn:
180
+ AllowMultipleReturnValues: true
181
+ Style/RegexpLiteral:
182
+ Enabled: false
183
+ Style/RescueModifier:
184
+ AutoCorrect: false
185
+ Style/SignalException:
186
+ EnforcedStyle: only_raise
187
+ Style/SingleLineBlockParams:
188
+ Enabled: false
189
+ Style/SingleLineMethods:
190
+ AllowIfMethodIsEmpty: false
191
+ Style/GlobalVars:
192
+ AllowedVariables:
193
+ - $lxca_log
194
+ Style/SpecialGlobalVars:
195
+ AutoCorrect: false
196
+ Style/StringLiterals:
197
+ Enabled: true
198
+ Style/StringLiteralsInInterpolation:
199
+ Enabled: true
200
+ Style/TrailingCommaInArguments:
201
+ Enabled: false
202
+ Style/TrailingCommaInLiteral:
203
+ Enabled: false
204
+ Style/TrailingUnderscoreVariable:
205
+ Enabled: false
206
+ Style/TrivialAccessors:
207
+ AllowPredicates: true
208
+ Style/WhileUntilModifier:
209
+ Enabled: true
210
+ Style/WordArray:
211
+ AutoCorrect: true
data/.rubocop_cc.yml ADDED
@@ -0,0 +1,2 @@
1
+ inherit_from:
2
+ - .rubocop_base.yml
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.2.4
4
+ - 2.3.6
5
5
  before_install: gem install bundler -v 1.11.2
@@ -0,0 +1,214 @@
1
+ FORMAT: 1A
2
+
3
+ # XClarity compliancePolicies
4
+
5
+ # get details of all policies
6
+
7
+ ## GET /compliancePolicies
8
+ + Response 200
9
+ {
10
+ "policies":[{
11
+ "description":"DEV ONLY",
12
+ "id":"1427930734934",
13
+ "inUse":"true",
14
+ "filterType":"all",
15
+ "lastModified":"2015-04-01 16:25:34",
16
+ "name":"DEFAULT-2015-04-01",
17
+ "updateRule":"",
18
+ "userDefined":"no"
19
+ },
20
+ {"updateRule":"",
21
+ "description":"ddddd",
22
+ "id":"1428397839104",
23
+ "inUse":"false",
24
+ "filterType":"managed",
25
+ "lastModified":"This policy was created by USERID on 2015-04-07 05:10:39",
26
+ "name":"aaaa",
27
+ "updateRule":"",
28
+ "userDefined":"yes"
29
+ }]
30
+ }
31
+ + Response 400
32
+ + Response 401
33
+ + Response 404
34
+ + Response 409
35
+ + Response 500
36
+
37
+ # retrieve the persisted compare result for servers to which a compliance policy is assigned.
38
+
39
+ ## GET /compliancePolicies/persistedResult
40
+ + Response 200
41
+ {
42
+ "all": [{
43
+ "chassis": "FBEF740B178F4EFAA846E7225EE256DC",
44
+ "cmms": [{
45
+ "deviceCompliant": "no",
46
+ "message": [],
47
+ "policyName": "",
48
+ "supported": "true",
49
+ "targetFirmware": [],
50
+ "uuid": "387E51D69EC311E0A4C8E87E4D6C0479"
51
+ }],
52
+ "switches": [{
53
+ "deviceCompliant": "no",
54
+ "message": [],
55
+ "policyName": "DEFAULT-2015-04-25",
56
+ "supported": "true",
57
+ "targetFirmware": [{
58
+ "build": "0802",
59
+ "category": "Switches",
60
+ "compliant": "no",
61
+ "componentID": "1B33D6C57ECB04C14567A897DC604900",
62
+ "componentName": "IO Module 02",
63
+ "date": "2015-04-22",
64
+ "fixid": "lnvgy_fw_scsw_si4093-8.2.1.0_anyos_noarch",
65
+ "level": "higher",
66
+ "packageExistence": "yes",
67
+ "reason": "The installed version is down level than the version defined in compliance policy.",
68
+ "versionList": ["8.2.1.0"]
69
+ }],
70
+ "uuid": "1B33D6C57ECB04C14567A897DC604900"
71
+ }],
72
+ "xITEs": [{
73
+ "deviceCompliant": "no",
74
+ "message": [],
75
+ "policyName": "",
76
+ "supported": "true",
77
+ "targetFirmware": [],
78
+ "uuid": "69BDF8912E5211E4998B40F2E99033F0"
79
+ }],
80
+ "message": []
81
+ },
82
+ {
83
+ "racklist": [{
84
+ "deviceCompliant": "no",
85
+ "message": [],
86
+ "policyName": "",
87
+ "targetFirmware": [],
88
+ "uuid": "C29379AA380E11E39DF3000AF7256714"
89
+ }]
90
+ },
91
+ {
92
+ "rackswitchlist": [{
93
+ "deviceCompliant": "",
94
+ "message": [],
95
+ "policyName": "",
96
+ "targetFirmware": [],
97
+ "uuid": "242CFF20453641238D2B8FEDFB0F056F"
98
+ }]
99
+ },
100
+ {
101
+ "storagelist": [{
102
+ "deviceCompliant": "",
103
+ "message": [],
104
+ "policyName": "",
105
+ "targetFirmware": [],
106
+ "uuid": "208000C0FF25E476"
107
+ }]
108
+ }]
109
+ }
110
+ + Response 400
111
+ + Response 401
112
+ + Response 404
113
+ + Response 409
114
+ + Response 500
115
+
116
+ # determine whether devices are compliant with the assigned compliance policy using the job or task ID that was returned when the compliance policy was assigned
117
+
118
+ ## GET /compliancePolicies/compareResult?jobid=1
119
+ + Response 200
120
+ {
121
+ "jobid": "1",
122
+ "percentage": 100,
123
+ "result": [{
124
+ "endpointCompliant": "no",
125
+ "message": [],
126
+ "status": "finished",
127
+ "targetFirmware": [{
128
+ "build": "0708",
129
+ "category": "Switches",
130
+ "compliant": "no",
131
+ "componentID": "A3F8482B012B32188E68375DD5FF40EE",
132
+ "componentName": "Demo - 00004X4093",
133
+ "date": "2015-02-13",
134
+ "fixid": "fw_scsw_en4093r-7.8.9.0_anyos_noarch",
135
+ "level": "higher",
136
+ "packageExistence": "yes",
137
+ "reason":"The installed version is down level than the version defined in compliance policy.",
138
+ "versionList": ["7.8.9.0"]
139
+ }],
140
+ "taskid": "0",
141
+ "uuid": "A3F8482B012B32188E68375DD5FF40EE"
142
+ }],
143
+ "status": "finished"
144
+ }
145
+ + Response 400
146
+ + Response 401
147
+ + Response 404
148
+ + Response 409
149
+ + Response 500
150
+
151
+ # retrieve information about firmware that is applicable to each managed device.
152
+
153
+ ## GET /compliancePolicies/applicableFirmware
154
+ + Response 200
155
+ {
156
+ "componentTypes": [{
157
+ "applicableFirmware": [{
158
+ "available": [{
159
+ "buildNum": "TCOO15M",
160
+ "buildType": "development",
161
+ "fixid": "lnvgy_fw_imm2_tcoo15m-2.50_anyos_noarch",
162
+ "name": "Integrated Management Module 2 (IMM2) Update",
163
+ "releasedate": "2016-01-09",
164
+ "softwareIDList": ["IMM2-Backup"],
165
+ "version": "2.50",
166
+ "versionList": ["2.50"]
167
+ }],
168
+ "category": "IMM2-Backup",
169
+ "installedVersion": "1.95",
170
+ "name": "IMM2 (Backup)"
171
+ }],
172
+ "machineType": "5463",
173
+ "uuid": "208C0140DF7F11D4AE0FF3F3F3797979"
174
+ }]
175
+ }
176
+ + Response 400
177
+ + Response 401
178
+ + Response 404
179
+ + Response 409
180
+ + Response 500
181
+
182
+ # delete one or more compliance policies.
183
+
184
+ ## DELETE /compliancePolicies
185
+ + Response 200
186
+
187
+ + Response 400
188
+ + Response 401
189
+ + Response 404
190
+ + Response 409
191
+ + Response 500
192
+
193
+ # assign a compliance policy to one or more devices and to return the
194
+ # job ID and task IDs for monitoring the status of the job and tasks.
195
+
196
+ ## POST /compliancePolicies/compareResult
197
+ + Response 200
198
+ {
199
+ "errorDetail": [],
200
+ "errorMessage": "",
201
+ "message": [{
202
+ "tasks": [{
203
+ "taskid": 0,
204
+ "uuid": "A3F8482B012B32188E68375DD5FF40EE"
205
+ }],
206
+ "jobid": 14
207
+ }],
208
+ "status": "success"
209
+ }
210
+ + Response 400
211
+ + Response 401
212
+ + Response 404
213
+ + Response 409
214
+ + Response 500