-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathpower_device.pp
144 lines (133 loc) · 3.56 KB
/
power_device.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
################################################################################
# (C) 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
#
# http://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.
################################################################################
# The uID and power state operations (commented-out blocks at the bottom)
# are not supported by all Power Device models
# In case you want to set power connections, you can either specify the Power Connection URI or simply its name/type as follows:
oneview_power_device{'Power Device Add':
ensure => 'present',
data =>
{
name => 'Power Device',
ratedCapacity => '40'
# powerConnections =>
# [
# {
# name => 'Ethernet 1',
# type => 'EthernetNetwork'
# },
# {
# connectionUri => '/rest/...'
# }
# ]
}
}
oneview_power_device{'Power Device Remove':
ensure => 'absent',
require => Oneview_power_device['Power Device Add'],
data =>
{
name => 'Power Device'
}
}
oneview_power_device{'Power Device Discover':
ensure => 'discover',
data =>
{
hostname => '172.18.8.11',
username => 'dcs',
password => 'dcs'
}
}
# # Optional filters
oneview_power_device{'Power Device Found':
ensure => 'found',
require => Oneview_power_device['Power Device Discover']
# data =>
# {
# name => '172.18.8.11, PDU 1'
# }
}
oneview_power_device{'Power Device Refresh':
ensure => 'set_refresh_state',
require => Oneview_power_device['Power Device Found'],
data =>
{
name => '172.18.8.11, PDU 1',
refreshOptions =>
{
refreshState => 'RefreshPending',
username => 'dcs',
password => 'dcs'
}
}
}
# Optional filters
oneview_power_device{'Power Device Get Utilization':
ensure => 'get_utilization',
require => Oneview_power_device['Power Device Refresh'],
data =>
{
name => '172.18.8.11, PDU 1',
queryParameters =>
{
fields => ['AveragePower']
# startDate => '2016-07-31T15:10:00.000Z',
# endDate => '2016-07-31T15:10:00.000Z'
}
}
}
oneview_power_device{'Power Device Edit':
ensure => 'present',
require => Oneview_power_device['Power Device Get Utilization'],
data =>
{
name => '172.18.8.11, PDU 1',
new_name => 'Power Device'
}
}
# Caution: more than one matching Power Device can be deleted at once
oneview_power_device{'Power Device Remove Discovered':
ensure => 'absent',
require => Oneview_power_device['Power Device Edit'],
data =>
{
name => 'Power Device'
}
}
# oneview_power_device{'Power Device Set Power State':
# ensure => 'set_power_state',
# data =>
# {
# name => '172.18.8.11, PDU 1',
# powerState => 'On'
# }
# }
# oneview_power_device{'Power Device Get UID State':
# ensure => 'get_uid_state',
# data =>
# {
# name => '172.18.8.11, PDU 1'
# }
# }
#
# oneview_power_device{'Power Device Set UID State':
# ensure => 'set_uid_state',
# data =>
# {
# name => '172.18.8.11, PDU 1',
# uidState => 'On'
# }
# }