xclarity_client 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/apib/aicc.apib +125 -106
- data/docs/apib/discover_request.apib +40 -0
- data/docs/apib/discovery.apib +181 -0
- data/lib/xclarity_client.rb +6 -1
- data/lib/xclarity_client/aicc.rb +15 -0
- data/lib/xclarity_client/aicc_management.rb +16 -0
- data/lib/xclarity_client/client.rb +17 -0
- data/lib/xclarity_client/discover_request.rb +15 -0
- data/lib/xclarity_client/discover_request_management.rb +32 -0
- data/lib/xclarity_client/discovery.rb +15 -0
- data/lib/xclarity_client/discovery_management.rb +17 -0
- data/lib/xclarity_client/version.rb +1 -1
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 373f2fc5d1767ae8c47db70515f86a4bdebef52b
|
4
|
+
data.tar.gz: 6f06a5cb63e6a92d7ddc8b5d156fff6b5762e515
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e77d18925ee2de60d29895d403a22ce5bb342ed7ed972c1ecec4d06081c215e96cda6bcb52aa4db89a8f83703d8d18842c6ef9daf53c9e582c19a83339366a30
|
7
|
+
data.tar.gz: 35216f7360eb17ca50627c9bec9923fb54f99a073efb66368f19d5381e607df74b51b776f42a06d53571b9f3321688dca6886b53b85639c802709a90ecd7b1d8
|
data/docs/apib/aicc.apib
CHANGED
@@ -6,119 +6,138 @@ FORMAT: 1A
|
|
6
6
|
|
7
7
|
+ Response 200 (application/json)
|
8
8
|
|
9
|
-
|
10
|
-
"appliance":
|
11
|
-
"build":
|
12
|
-
"date":
|
13
|
-
"name":
|
14
|
-
"runlevel":
|
15
|
-
"status":
|
16
|
-
"uuid":
|
17
|
-
"version":
|
9
|
+
{
|
10
|
+
"appliance":{
|
11
|
+
"build":"110",
|
12
|
+
"date":"2015-09-15_10-25-16",
|
13
|
+
"name":"LXCA - 10.240.61.98",
|
14
|
+
"runlevel":3,
|
15
|
+
"status":"Normal",
|
16
|
+
"uuid":"bef3e2c3-a689-4734-aa79-2a21f21e8b97",
|
17
|
+
"version":"1.1.0"
|
18
18
|
},
|
19
|
-
"appliance_states":
|
20
|
-
|
21
|
-
|
19
|
+
"appliance_states":[
|
20
|
+
{
|
21
|
+
"description":"Halt the appliance",
|
22
|
+
"runlevel":0
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"description":"Reboot the appliance",
|
26
|
+
"runlevel":6
|
27
|
+
}
|
28
|
+
],
|
29
|
+
"date":{
|
30
|
+
"date_time":"September 18, 2015 8:45:54 AM EST",
|
31
|
+
"parts":{
|
32
|
+
"yyyy":2015,
|
33
|
+
"mm":9,
|
34
|
+
"dd":18,
|
35
|
+
"hours":8,
|
36
|
+
"mins":45,
|
37
|
+
"secs":54
|
38
|
+
},
|
39
|
+
"timezone":"Eastern Standard Time",
|
40
|
+
"timezones":[
|
41
|
+
{
|
42
|
+
"daylight_saves":0,
|
43
|
+
"display_name":"GMT-12:00",
|
44
|
+
"id":"Etc/GMT+12",
|
45
|
+
"offset":-43200000,
|
46
|
+
"uses_daylight":false,
|
47
|
+
"utc_offset_raw":-43200000,
|
48
|
+
"utc_offset_w_dst":-43200000
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"daylight_saves":0,
|
52
|
+
"display_name":"Eastern Standard Time",
|
53
|
+
"id":"America/Grand_Turk",
|
54
|
+
"offset":-14400000,
|
55
|
+
"uses_daylight":false,
|
56
|
+
"utc_offset_raw":-18000000,
|
57
|
+
"utc_offset_w_dst":-14400000
|
58
|
+
}
|
59
|
+
],
|
60
|
+
"timezone_id":"America/Cayman",
|
61
|
+
"uses_daylight":true,
|
62
|
+
"utc_offset":-18000000,
|
63
|
+
"utc_offset_raw":-18000000,
|
64
|
+
"utc_offset_w_dst":-18000000
|
22
65
|
},
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
66
|
+
"network_interfaces":[
|
67
|
+
{
|
68
|
+
"id":"eth0",
|
69
|
+
"ip_addresses":[
|
70
|
+
{
|
71
|
+
"assign_method":"static",
|
72
|
+
"ip":"fe80:0:0:0:200:ff:fe00:10%2",
|
73
|
+
"ip_linklocal":"true",
|
74
|
+
"prefix_length":64,
|
75
|
+
"version":6
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"assign_method":"static",
|
79
|
+
"ip":"10.240.61.98",
|
80
|
+
"ip_linklocal":"false",
|
81
|
+
"prefix_length":22,
|
82
|
+
"version":4
|
83
|
+
}
|
84
|
+
],
|
85
|
+
"mac_address":"00:00:00:00:00:10",
|
86
|
+
"role":[
|
87
|
+
"management",
|
88
|
+
"osdeployment"
|
89
|
+
]
|
90
|
+
}
|
91
|
+
],
|
92
|
+
"ntp":{
|
93
|
+
"servers":[
|
94
|
+
{
|
95
|
+
"authenticated":false,
|
96
|
+
"server":"us.pool.ntp.org",
|
97
|
+
"version":1,
|
98
|
+
"v3_key":"",
|
99
|
+
"v3_key_index":0,
|
100
|
+
"v3_key_type":""
|
101
|
+
}
|
102
|
+
]
|
103
|
+
},
|
104
|
+
"services":[
|
105
|
+
{
|
106
|
+
"id":"core",
|
107
|
+
"initd":"xhmc-core",
|
108
|
+
"pid":52706,
|
109
|
+
"state":0
|
36
110
|
},
|
37
|
-
|
38
|
-
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
111
|
+
{
|
112
|
+
"id":"watchdog",
|
113
|
+
"initd":"sympl-watchdog",
|
114
|
+
"pid":52517,
|
115
|
+
"state":0
|
116
|
+
}
|
117
|
+
],
|
118
|
+
"service_states":[
|
119
|
+
{
|
120
|
+
"description":"Service is running",
|
121
|
+
"state":0
|
46
122
|
},
|
47
123
|
{
|
48
|
-
"
|
49
|
-
"
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
"
|
55
|
-
|
56
|
-
|
57
|
-
"uses_daylight": true,
|
58
|
-
"utc_offset": -18000000,
|
59
|
-
"utc_offset_raw": -18000000,
|
60
|
-
"utc_offset_w_dst": -18000000
|
61
|
-
}
|
62
|
-
"network_interfaces": [{
|
63
|
-
"id": "eth0",
|
64
|
-
"ip_addresses": [{
|
65
|
-
"assign_method": "static",
|
66
|
-
"ip": "fe80:0:0:0:200:ff:fe00:10%2",
|
67
|
-
"ip_linklocal": "true",
|
68
|
-
"prefix_length": 64,
|
69
|
-
"version": 6
|
124
|
+
"description":"Special purpose state used to trigger restart through REST",
|
125
|
+
"state":191
|
126
|
+
}
|
127
|
+
],
|
128
|
+
"subscriptions":[
|
129
|
+
{
|
130
|
+
"id":1,
|
131
|
+
"monitor_uri":"/aicc",
|
132
|
+
"uri":"/ntpNotification"
|
70
133
|
},
|
71
134
|
{
|
72
|
-
"
|
73
|
-
"
|
74
|
-
"
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
"mac_address": "00:00:00:00:00:10",
|
79
|
-
"role": ["management", "osdeployment"]
|
80
|
-
}],
|
81
|
-
"ntp": {
|
82
|
-
"servers": [{
|
83
|
-
"authenticated": false,
|
84
|
-
"server": "us.pool.ntp.org",
|
85
|
-
"version": 1,
|
86
|
-
"v3_key": "",
|
87
|
-
"v3_key_index": 0,
|
88
|
-
"v3_key_type": ""
|
89
|
-
}]
|
90
|
-
},
|
91
|
-
"services": [{
|
92
|
-
"id": "core",
|
93
|
-
"initd": "xhmc-core",
|
94
|
-
"pid": 52706,
|
95
|
-
"state": 0
|
96
|
-
},
|
97
|
-
{
|
98
|
-
"id": "watchdog",
|
99
|
-
"initd": "sympl-watchdog",
|
100
|
-
"pid": 52517,
|
101
|
-
"state": 0
|
102
|
-
}],
|
103
|
-
"service_states": [{
|
104
|
-
"description": "Service is running",
|
105
|
-
"state": 0
|
106
|
-
},
|
107
|
-
{
|
108
|
-
"description": "Special purpose state used to trigger restart through REST",
|
109
|
-
"state": 191
|
110
|
-
}],
|
111
|
-
"subscriptions": [{
|
112
|
-
"id": 1,
|
113
|
-
"monitor_uri": "/aicc",
|
114
|
-
"uri": "/ntpNotification"
|
115
|
-
},
|
116
|
-
{
|
117
|
-
"id": 3,
|
118
|
-
"monitor_uri": "",
|
119
|
-
"uri": "/osdeployment/rest/internal/event/aicc"
|
120
|
-
}],
|
121
|
-
}
|
135
|
+
"id":3,
|
136
|
+
"monitor_uri":"",
|
137
|
+
"uri":"/osdeployment/rest/internal/event/aicc"
|
138
|
+
}
|
139
|
+
]
|
140
|
+
}
|
122
141
|
|
123
142
|
# PUT /aicc
|
124
143
|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
FORMAT: 1A
|
2
|
+
|
3
|
+
# XClarity discoverRequest
|
4
|
+
|
5
|
+
# Discovery request with job id 215 [/discoverRequest/jobs/215]
|
6
|
+
|
7
|
+
## Retrieve [GET]
|
8
|
+
+ Response 200
|
9
|
+
[{
|
10
|
+
"result": 100,
|
11
|
+
"storageList": [],
|
12
|
+
"rackswitchList": [],
|
13
|
+
"serverList": [],
|
14
|
+
"xhmcList": [],
|
15
|
+
"progress": 100.0,
|
16
|
+
"chassisList": []
|
17
|
+
}]
|
18
|
+
|
19
|
+
+ Response 401
|
20
|
+
+ Response 404
|
21
|
+
+ Response 409
|
22
|
+
+ Response 500
|
23
|
+
|
24
|
+
# Post a discovery request [/discoverRequest]
|
25
|
+
|
26
|
+
## Monitor [POST]
|
27
|
+
+ Request (application/json)
|
28
|
+
[
|
29
|
+
{
|
30
|
+
"ipAddresses" : [""]
|
31
|
+
}
|
32
|
+
]
|
33
|
+
+ Response 200
|
34
|
+
|
35
|
+
+ Response 400
|
36
|
+
+ Response 401
|
37
|
+
+ Response 404
|
38
|
+
+ Response 409
|
39
|
+
+ Response 500
|
40
|
+
|
@@ -0,0 +1,181 @@
|
|
1
|
+
FORMAT: 1A
|
2
|
+
|
3
|
+
# XClarity SLP discovery
|
4
|
+
|
5
|
+
# GET /discovery
|
6
|
+
|
7
|
+
+ Response 200 (application/json)
|
8
|
+
{
|
9
|
+
"lastUpdateElapsedTime": 77662963,
|
10
|
+
"storageList": [],
|
11
|
+
"discoveryInProgress": false,
|
12
|
+
"rackswitchList": [],
|
13
|
+
"xhmcList": [],
|
14
|
+
"chassisList": [],
|
15
|
+
"nodeList": [{
|
16
|
+
"securityDescriptor": {
|
17
|
+
"managedAuthSupported": true,
|
18
|
+
"uri": "nodes/909145e6dc9411e4a97b6eae8b4bd9a3",
|
19
|
+
"roleGroups": ["lxc-supervisor", "lxc-recovery", "lxc-operator", "lxc-sysrdr", "lxc-os-admin", "lxc-security-admin", "lxc-hw-manager", "lxc-admin", "lxc-fw-admin", "lxc-hw-admin", "lxc-sysmgr"],
|
20
|
+
"managedAuthEnabled": true
|
21
|
+
},
|
22
|
+
"serialNumber": "23EF191",
|
23
|
+
"displayName": "SN#23EF191",
|
24
|
+
"enclosure-form-factor": "rack-tower",
|
25
|
+
"managementPorts": [{
|
26
|
+
"protocol": "cimxml-http",
|
27
|
+
"port": 5988,
|
28
|
+
"enabled": true
|
29
|
+
}, {
|
30
|
+
"protocol": "cimxml-https",
|
31
|
+
"port": 5989,
|
32
|
+
"enabled": true
|
33
|
+
}, {
|
34
|
+
"protocol": "http",
|
35
|
+
"port": 80,
|
36
|
+
"enabled": true
|
37
|
+
}, {
|
38
|
+
"protocol": "https",
|
39
|
+
"port": 443,
|
40
|
+
"enabled": true
|
41
|
+
}, {
|
42
|
+
"protocol": "snmpv1",
|
43
|
+
"port": 161,
|
44
|
+
"enabled": true
|
45
|
+
}, {
|
46
|
+
"protocol": "snmpv3",
|
47
|
+
"port": 161,
|
48
|
+
"enabled": true
|
49
|
+
}, {
|
50
|
+
"protocol": "ssh",
|
51
|
+
"port": 22,
|
52
|
+
"enabled": true
|
53
|
+
}, {
|
54
|
+
"protocol": "telnet",
|
55
|
+
"port": 23,
|
56
|
+
"enabled": true
|
57
|
+
}, {
|
58
|
+
"protocol": "rem-pres",
|
59
|
+
"port": 3900,
|
60
|
+
"enabled": true
|
61
|
+
}, {
|
62
|
+
"protocol": "rmcp",
|
63
|
+
"port": 623,
|
64
|
+
"enabled": true
|
65
|
+
}],
|
66
|
+
"type": "Rack-Tower Server",
|
67
|
+
"server-type": "Rack-Tower Server",
|
68
|
+
"uuid": "909145e6dc9411e4a97b6eae8b4bd9a3",
|
69
|
+
"password": null,
|
70
|
+
"hostname": "IMM2-6cae8b4bd9a1",
|
71
|
+
"management-processor-type": "integrated-management-module2",
|
72
|
+
"fruNumber": "00FN856 ",
|
73
|
+
"recoveryPassword": null,
|
74
|
+
"name": "SN#23EF191",
|
75
|
+
"subType": "",
|
76
|
+
"model": "AC2",
|
77
|
+
"ipAddresses": ["10.240.28.246", "fd55:faaf:e1ab:20fb:6eae:8bff:fe4b:d9a1", "fe80::6eae:8bff:fe4b:d9a1"],
|
78
|
+
"firmware": [{
|
79
|
+
"date": "2015/03/23",
|
80
|
+
"build": "TCOO51X",
|
81
|
+
"version": "9.00"
|
82
|
+
}, {
|
83
|
+
"date": "2015/03/26",
|
84
|
+
"build": "A9E121UUS",
|
85
|
+
"version": "1.00"
|
86
|
+
}],
|
87
|
+
"machineType": "6241",
|
88
|
+
"username": null,
|
89
|
+
"status": {
|
90
|
+
"name": "UNMANAGED",
|
91
|
+
"message": "Unmanaged",
|
92
|
+
"manageable": true
|
93
|
+
}
|
94
|
+
}, {
|
95
|
+
"securityDescriptor": {
|
96
|
+
"managedAuthSupported": true,
|
97
|
+
"uri": "nodes/ef362cf0fb4511e397ab40f2e9af01d0",
|
98
|
+
"roleGroups": ["lxc-supervisor", "lxc-recovery", "lxc-operator", "lxc-sysrdr", "lxc-os-admin", "lxc-security-admin", "lxc-hw-manager", "lxc-admin", "lxc-fw-admin", "lxc-hw-admin", "lxc-sysmgr"],
|
99
|
+
"managedAuthEnabled": true
|
100
|
+
},
|
101
|
+
"serialNumber": "06BNEBV",
|
102
|
+
"displayName": "XinYi_28.135",
|
103
|
+
"enclosure-form-factor": "rack-tower",
|
104
|
+
"managementPorts": [{
|
105
|
+
"protocol": "cimxml-http",
|
106
|
+
"port": 5988,
|
107
|
+
"enabled": true
|
108
|
+
}, {
|
109
|
+
"protocol": "cimxml-https",
|
110
|
+
"port": 5989,
|
111
|
+
"enabled": true
|
112
|
+
}, {
|
113
|
+
"protocol": "http",
|
114
|
+
"port": 80,
|
115
|
+
"enabled": true
|
116
|
+
}, {
|
117
|
+
"protocol": "https",
|
118
|
+
"port": 443,
|
119
|
+
"enabled": true
|
120
|
+
}, {
|
121
|
+
"protocol": "snmpv1",
|
122
|
+
"port": 161,
|
123
|
+
"enabled": true
|
124
|
+
}, {
|
125
|
+
"protocol": "snmpv3",
|
126
|
+
"port": 161,
|
127
|
+
"enabled": true
|
128
|
+
}, {
|
129
|
+
"protocol": "ssh",
|
130
|
+
"port": 22,
|
131
|
+
"enabled": true
|
132
|
+
}, {
|
133
|
+
"protocol": "telnet",
|
134
|
+
"port": 23,
|
135
|
+
"enabled": true
|
136
|
+
}, {
|
137
|
+
"protocol": "rem-pres",
|
138
|
+
"port": 3900,
|
139
|
+
"enabled": true
|
140
|
+
}, {
|
141
|
+
"protocol": "rmcp",
|
142
|
+
"port": 623,
|
143
|
+
"enabled": true
|
144
|
+
}],
|
145
|
+
"type": "Rack-Tower Server",
|
146
|
+
"server-type": "Rack-Tower Server",
|
147
|
+
"uuid": "ef362cf0fb4511e397ab40f2e9af01d0",
|
148
|
+
"password": null,
|
149
|
+
"hostname": "IMM2-40f2e9af01d5",
|
150
|
+
"management-processor-type": "integrated-management-module2",
|
151
|
+
"fruNumber": "XXXXXXX ",
|
152
|
+
"recoveryPassword": null,
|
153
|
+
"name": "XinYi_28.135",
|
154
|
+
"subType": "",
|
155
|
+
"model": "AC1",
|
156
|
+
"ipAddresses": ["10.240.28.135", "fd55:faaf:e1ab:20fb:42f2:e9ff:feaf:1d5", "fe80::42f2:e9ff:feaf:1d5"],
|
157
|
+
"firmware": [{
|
158
|
+
"date": "2015/05/07",
|
159
|
+
"build": "TCOO09H",
|
160
|
+
"version": "1.72"
|
161
|
+
}, {
|
162
|
+
"date": "2015/04/17",
|
163
|
+
"build": "TCE105KUS",
|
164
|
+
"version": "1.10"
|
165
|
+
}],
|
166
|
+
"machineType": "5462",
|
167
|
+
"username": null,
|
168
|
+
"status": {
|
169
|
+
"name": "UNMANAGED",
|
170
|
+
"message": "Unmanaged",
|
171
|
+
"manageable": true
|
172
|
+
}
|
173
|
+
}]
|
174
|
+
}
|
175
|
+
|
176
|
+
+ Response 400
|
177
|
+
+ Response 401
|
178
|
+
+ Response 404
|
179
|
+
+ Response 409
|
180
|
+
+ Response 500
|
181
|
+
|
data/lib/xclarity_client.rb
CHANGED
@@ -12,6 +12,8 @@ require 'xclarity_client/xclarity_management_mixin'
|
|
12
12
|
require 'xclarity_client/xclarity_power_management_mixin'
|
13
13
|
require 'xclarity_client/xclarity_credentials_validator'
|
14
14
|
require 'xclarity_client/virtual_appliance_management'
|
15
|
+
require 'xclarity_client/aicc'
|
16
|
+
require 'xclarity_client/aicc_management'
|
15
17
|
require 'xclarity_client/node'
|
16
18
|
require 'xclarity_client/node_management'
|
17
19
|
require 'xclarity_client/chassi'
|
@@ -55,4 +57,7 @@ require 'xclarity_client/error/connection_failed'
|
|
55
57
|
require 'xclarity_client/error/connection_failed_unknown'
|
56
58
|
require 'xclarity_client/error/connection_refused'
|
57
59
|
require 'xclarity_client/error/hostname_unknown'
|
58
|
-
|
60
|
+
require 'xclarity_client/discover_request'
|
61
|
+
require 'xclarity_client/discover_request_management'
|
62
|
+
require 'xclarity_client/discovery'
|
63
|
+
require 'xclarity_client/discovery_management'
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# XClarityClient module/namespace
|
2
|
+
module XClarityClient
|
3
|
+
# Aicc Management class
|
4
|
+
class AiccManagement < XClarityBase
|
5
|
+
include XClarityClient::ManagementMixin
|
6
|
+
|
7
|
+
def initialize(conf)
|
8
|
+
super(conf, Aicc::BASE_URI)
|
9
|
+
end
|
10
|
+
|
11
|
+
def population(opts = {})
|
12
|
+
get_all_resources(Aicc, opts)
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
@@ -10,6 +10,10 @@ module XClarityClient
|
|
10
10
|
NodeManagement.new(@connection).population opts
|
11
11
|
end
|
12
12
|
|
13
|
+
def discover_aicc(opts = {})
|
14
|
+
AiccManagement.new(@connection).population opts
|
15
|
+
end
|
16
|
+
|
13
17
|
def discover_scalableComplexes(opts = {})
|
14
18
|
ScalableComplexManagement.new(@connection).population opts
|
15
19
|
end
|
@@ -278,5 +282,18 @@ module XClarityClient
|
|
278
282
|
def validate_configuration
|
279
283
|
XClarityCredentialsValidator.new(@connection).validate
|
280
284
|
end
|
285
|
+
|
286
|
+
def discover_manageable_devices(ip_addresses)
|
287
|
+
DiscoverRequestManagement.new(@connection).discover_manageable_devices(ip_addresses)
|
288
|
+
end
|
289
|
+
|
290
|
+
def discover_devices_by_slp
|
291
|
+
DiscoveryManagement.new(@connection).population
|
292
|
+
end
|
293
|
+
|
294
|
+
def monitor_discover_request(job_id)
|
295
|
+
DiscoverRequestManagement.new(@connection).monitor_discover_request(job_id)
|
296
|
+
end
|
297
|
+
|
281
298
|
end
|
282
299
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module XClarityClient
|
2
|
+
class DiscoverRequest
|
3
|
+
include XClarityClient::Resource
|
4
|
+
|
5
|
+
BASE_URI = '/discoverRequest'.freeze
|
6
|
+
LIST_NAME = 'deviceList'.freeze
|
7
|
+
|
8
|
+
attr_accessor :result, :rackswitchList, :serverList, :xhmcList, :progress, :chassisList, :cmmDisplayName, :cmms, :displayName, :fruNumber, :hostname, :ipAddresses, :machineType, :managementPorts, :model, :name, :password, :recoveryPassword, :serialNumber, :status, :type, :username, :uuid, :enablePassword, :firmware, :os, :subType
|
9
|
+
|
10
|
+
def initialize(attributes)
|
11
|
+
build_resource(attributes)
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module XClarityClient
|
4
|
+
class DiscoverRequestManagement < XClarityBase
|
5
|
+
|
6
|
+
include XClarityClient::ManagementMixin
|
7
|
+
|
8
|
+
def initialize(conf)
|
9
|
+
super(conf, DiscoverRequest::BASE_URI)
|
10
|
+
end
|
11
|
+
|
12
|
+
def discover_manageable_devices(ip_addresses)
|
13
|
+
post_req = JSON.generate([ipAddresses: ip_addresses])
|
14
|
+
response = do_post(DiscoverRequest::BASE_URI, post_req)
|
15
|
+
response
|
16
|
+
end
|
17
|
+
|
18
|
+
def monitor_discover_request(job_id)
|
19
|
+
response = connection(DiscoverRequest::BASE_URI + "/jobs/" + job_id)
|
20
|
+
return [] unless response.success?
|
21
|
+
|
22
|
+
body = JSON.parse(response.body)
|
23
|
+
|
24
|
+
body = {DiscoverRequest::LIST_NAME => body} if body.is_a? Array
|
25
|
+
body = {DiscoverRequest::LIST_NAME => [body]} unless body.has_key? DiscoverRequest::LIST_NAME
|
26
|
+
body[DiscoverRequest::LIST_NAME].map do |resource_params|
|
27
|
+
DiscoverRequest.new resource_params
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module XClarityClient
|
2
|
+
class Discovery
|
3
|
+
include XClarityClient::Resource
|
4
|
+
|
5
|
+
BASE_URI = '/discovery'.freeze
|
6
|
+
LIST_NAME = 'deviceList'.freeze
|
7
|
+
|
8
|
+
attr_accessor :lastUpdateElapsedTime, :storageList, :discoveryInProgress, :rackswitchList, :xhmcList, :chassisList, :nodeList, :securityDescriptor, :serialNumber, :displayName, :managementPorts, :type, :uuid, :password, :hostname, :fruNumber, :recoveryPassword, :name, :subType, :model, :ipAddresses, :firmware, :machineType, :username, :status, :cmmDisplayName, :cmms, :enablePassword, :wwnn, :software
|
9
|
+
|
10
|
+
def initialize(attributes)
|
11
|
+
build_resource(attributes)
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module XClarityClient
|
4
|
+
class DiscoveryManagement < XClarityBase
|
5
|
+
|
6
|
+
include XClarityClient::ManagementMixin
|
7
|
+
|
8
|
+
def initialize(conf)
|
9
|
+
super(conf, Discovery::BASE_URI)
|
10
|
+
end
|
11
|
+
|
12
|
+
def population()
|
13
|
+
get_all_resources(Discovery)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
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.
|
4
|
+
version: 0.5.8
|
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-
|
12
|
+
date: 2017-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -164,6 +164,8 @@ files:
|
|
164
164
|
- docs/apib/config_pattern.apib
|
165
165
|
- docs/apib/config_profile.apib
|
166
166
|
- docs/apib/config_target.apib
|
167
|
+
- docs/apib/discover_request.apib
|
168
|
+
- docs/apib/discovery.apib
|
167
169
|
- docs/apib/event.apib
|
168
170
|
- docs/apib/fan.apib
|
169
171
|
- docs/apib/fan_mux.apib
|
@@ -181,6 +183,8 @@ files:
|
|
181
183
|
- example/simple.rb
|
182
184
|
- lib/utils/logger.rb
|
183
185
|
- lib/xclarity_client.rb
|
186
|
+
- lib/xclarity_client/aicc.rb
|
187
|
+
- lib/xclarity_client/aicc_management.rb
|
184
188
|
- lib/xclarity_client/cabinet.rb
|
185
189
|
- lib/xclarity_client/cabinet_management.rb
|
186
190
|
- lib/xclarity_client/canister.rb
|
@@ -198,6 +202,10 @@ files:
|
|
198
202
|
- lib/xclarity_client/config_target_management.rb
|
199
203
|
- lib/xclarity_client/configuration.rb
|
200
204
|
- lib/xclarity_client/discover.rb
|
205
|
+
- lib/xclarity_client/discover_request.rb
|
206
|
+
- lib/xclarity_client/discover_request_management.rb
|
207
|
+
- lib/xclarity_client/discovery.rb
|
208
|
+
- lib/xclarity_client/discovery_management.rb
|
201
209
|
- lib/xclarity_client/error/authentication_error.rb
|
202
210
|
- lib/xclarity_client/error/connection_failed.rb
|
203
211
|
- lib/xclarity_client/error/connection_failed_unknown.rb
|