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
|
# File 'lib/puppet/util/hpe3par_api.rb', line 39
def create_cpg(name, domain = nil, growth_increment = nil, growth_increment_unit = nil, growth_limit = nil,
growth_limit_unit = nil, growth_warning = nil, growth_warning_unit = nil, raidtype = nil,
setSize = nil, highavailability = nil, disktype = nil, debug = false)
cl = Hpe3parSdk::Client.new(@rest_url, debug: debug)
begin
ldLayout = Hash.new
diskPatterns = []
if !disktype.nil? && !disktype.empty?
disktype = Hpe3parSdk::CPGDiskType.const_get(disktype)
diskPatterns= [{:diskType => disktype}]
end
ldLayout = {
:RAIDType => raidtype,
:setSize => setSize,
:HA => highavailability,
:diskPatterns => diskPatterns
}
ldLayout = cpg_ldlayout_map(ldLayout)
growth_increment = convert_to_binary_multiple(growth_increment, growth_increment_unit) unless growth_increment.nil?
growth_limit = convert_to_binary_multiple(growth_limit, growth_limit_unit) unless growth_limit.nil?
growth_warning = convert_to_binary_multiple(growth_warning, growth_warning_unit) unless growth_warning.nil?
optional_hash= {
:domain => domain,
:growthIncrementMiB => growth_increment,
:growthLimitMiB => growth_limit,
:usedLDWarningAlertMiB => growth_warning,
:LDLayout => ldLayout
}
cl.login(@url.user, @url.password)
cl.create_cpg(name, optional_hash)
ensure
cl.logout
end
end
|