-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathvolume_template.pp
172 lines (165 loc) · 6.02 KB
/
volume_template.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
################################################################################
# (C) Copyright 2016-2020 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.
################################################################################
# Below request body is for creation for API500 and above. Refer API docs for other versions.
oneview_volume_template{'volume_template_1':
ensure => 'present',
data => {
'name' => 'ONEVIEW_PUPPET_TEST',
'description' => 'Test volume template for puppet',
'rootTemplateUri' => '',
'properties' => {
'name' => {
'title' => 'Volume name',
'description' => 'A volume name between 1 and 100 characters',
'minLength' => 1,
'maxLength' => 100,
'type' => 'string',
'required' => true,
'meta' => {
'locked' => false
}
},
'description' => {
'title' => 'Description',
'default' => '',
'required' => false,
'description' => 'A description for the volume',
'type' => 'string',
'minLength' => 0,
'maxLength' => 2000,
'meta' => {
'locked' => false
}
},
'storagePool' => {
'title' => 'Storage Pool',
'description' => 'A common provisioning group URI reference',
'type' => 'string',
'format' => 'x-uri-reference',
'default' => '',
'required' => true,
'meta' => {
'locked' => false,
'createOnly' => true,
'semanticType' => 'device-storage-pool'
}
},
'snapshotPool' => {
'type' => 'string',
'title' => 'Snapshot Pool',
'description' => 'A URI reference to the common provisioning group used to create snapshots',
'format' => 'x-uri-reference',
'default' => '',
'meta' => {
'locked' => true,
'semanticType' => 'device-snapshot-storage-pool'
}
},
'size' => {
'title' => 'Capacity',
'description' => 'The capacity of the volume in bytes',
'type' => 'integer',
'minimum' => 268435456,
'maximum' => 17592186044416,
'default' => 1073741824,
'required' => true,
'meta' => {
'locked' => false,
'semanticType' => 'capacity'
}
},
'provisioningType' => {
'title' => 'Provisioning Type',
'description' => 'The provisioning type for the volume',
'type' => 'string',
'enum' => [
'Thin',
'Full'
],
'default' => 'Full',
'meta' => {
'locked' => false,
'createOnly' => true
}
},
'isShareable' => {
'title' => 'Is Shareable',
'description' => 'The shareability of the volume',
'type' => 'boolean',
'default' => false,
'meta' => {
'locked' => false
}
}
}
}
}
oneview_volume_template{'volume_template_2':
ensure => 'present',
require => Oneview_volume_template['volume_template_1'],
data => {
name => 'ONEVIEW_PUPPET_TEST',
new_name => 'ONEVIEW_PUPPET_TEST VT1',
description => 'Volume Template after update',
}
}
# This resource accepts a data hash to filter out results or no data hash to display all
oneview_volume_template{'volume_template_3':
ensure => 'found',
require => Oneview_volume_template['volume_template_2'],
data => {
name => 'ONEVIEW_PUPPET_TEST VT1'
}
}
# Method unavailable for api500 and above
# This ensurable accepts a tag query_parameters with type hash, containing the filters to the get
oneview_volume_template{'volume_template_4':
ensure => 'get_connectable_volume_templates',
require => Oneview_volume_template['volume_template_3'],
data => {
name => 'ONEVIEW_PUPPET_TEST VT1',
query_parameters => {
count => '5',
start => '0'
}
}
}
# Method available from api500 and above
oneview_volume_template{'volume_template_5':
ensure => 'get_compatible_systems',
require => Oneview_volume_template['volume_template_3'],
data => {
name => 'ONEVIEW_PUPPET_TEST VT1',
}
}
# Method available from api500 and above
oneview_volume_template{'volume_template_6':
ensure => 'get_reachable_volume_templates',
require => Oneview_volume_template['volume_template_3'],
data => {
name => 'ONEVIEW_PUPPET_TEST VT1',
query_parameters => {
scopeUris => ''
}
}
}
oneview_volume_template{'volume_template_7':
ensure => 'absent',
require => Oneview_volume_template['volume_template_3'],
data => {
name => 'ONEVIEW_PUPPET_TEST VT1',
}
}