Module: PuppetX::CfWeb::Global::App

Includes:
PuppetX::CfWeb::Global
Defined in:
lib/puppet_x/cf_web/global/app.rb

Instance Method Summary collapse

Instance Method Details

#check_global(conf) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/puppet_x/cf_web/global/app.rb', line 9

def check_global(conf)
    slice_name = "#{PuppetX::CfWeb::SLICE_PREFIX}#{conf[:user]}"
    
    not self.cf_system().createSlice({
        :slice_name => slice_name,
        :cpu_weight => conf[:cpu_weight],
        :io_weight => conf[:io_weight],
        :dry_run => true,
    })
end

#create_global(conf) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/puppet_x/cf_web/global/app.rb', line 20

def create_global(conf)
    slice_name = "#{PuppetX::CfWeb::SLICE_PREFIX}#{conf[:user]}"
    
    self.cf_system().createSlice({
        :slice_name => slice_name,
        :cpu_weight => conf[:cpu_weight],
        :io_weight => conf[:io_weight],
    })
    return [slice_name]
end