Class: UpdateBucketPolicy

Inherits:
Thor
  • Object
show all
Defined in:
lib/cicd/builder/environments-list/mixlib/lib/update_bucket_policy.rb

Overview

Constant Summary collapse

KNOWN =
%w(38.117.159.162/32 70.151.98.131/32 )

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = [], local_options = {}, config = {}) ⇒ UpdateBucketPolicy

Returns a new instance of UpdateBucketPolicy.



312
313
314
# File 'lib/cicd/builder/environments-list/mixlib/lib/update_bucket_policy.rb', line 312

def initialize(args = [], local_options = {}, config = {})
  super(args,local_options,config)
end

Instance Attribute Details

#accountsObject (readonly)

Returns the value of attribute accounts.



49
50
51
# File 'lib/cicd/builder/environments-list/mixlib/lib/update_bucket_policy.rb', line 49

def accounts
  @accounts
end

#clientsObject (readonly)

Returns the value of attribute clients.



49
50
51
# File 'lib/cicd/builder/environments-list/mixlib/lib/update_bucket_policy.rb', line 49

def clients
  @clients
end

#environmentsObject (readonly)

Returns the value of attribute environments.



49
50
51
# File 'lib/cicd/builder/environments-list/mixlib/lib/update_bucket_policy.rb', line 49

def environments
  @environments
end

#loggerObject

Returns the value of attribute logger.



50
51
52
# File 'lib/cicd/builder/environments-list/mixlib/lib/update_bucket_policy.rb', line 50

def logger
  @logger
end

#stacksObject (readonly)

Returns the value of attribute stacks.



49
50
51
# File 'lib/cicd/builder/environments-list/mixlib/lib/update_bucket_policy.rb', line 49

def stacks
  @stacks
end

Instance Method Details

#inspectObject



331
332
333
334
335
336
337
338
339
340
# File 'lib/cicd/builder/environments-list/mixlib/lib/update_bucket_policy.rb', line 331

def inspect()
  prepare_accounts()

  inspect_bucket_policy()

  @policies.each do |pol|
    logger.debug JSON.pretty_generate(pol, { indent: "\t", space: ' '})
  end
  0
end

#readObject



317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/cicd/builder/environments-list/mixlib/lib/update_bucket_policy.rb', line 317

def read()
  prepare_accounts

  read_bucket_policy

  n = 1
  @policies.each do |pol|
    logger.step "#{n+=1}\n"+JSON.pretty_generate(pol, { indent: "\t", space: ' '})
  end

  0
end

#updateObject



343
344
345
346
347
348
349
# File 'lib/cicd/builder/environments-list/mixlib/lib/update_bucket_policy.rb', line 343

def update()
  prepare_accounts()

  update_bucket_policy()

  0
end

#writeObject



352
353
354
355
356
357
358
359
360
361
# File 'lib/cicd/builder/environments-list/mixlib/lib/update_bucket_policy.rb', line 352

def write()
  prepare_accounts
  @options[:inifile] = @options[:bucketini]
  parse_options
  @logger.info options.ai

  write_bucket_policy

  0
end