Class: AwsAccountUtils::RootAccessKeys
- Defined in:
- lib/aws_account_utils/root_access_keys.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #create(account_email, account_password) ⇒ Object
- #delete(account_email, account_password) ⇒ Object
-
#initialize(logger, browser) ⇒ RootAccessKeys
constructor
A new instance of RootAccessKeys.
Methods inherited from Base
Constructor Details
#initialize(logger, browser) ⇒ RootAccessKeys
Returns a new instance of RootAccessKeys.
8 9 10 11 |
# File 'lib/aws_account_utils/root_access_keys.rb', line 8 def initialize(logger, browser) @logger = logger @browser = browser end |
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
6 7 8 |
# File 'lib/aws_account_utils/root_access_keys.rb', line 6 def browser @browser end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/aws_account_utils/root_access_keys.rb', line 6 def logger @logger end |
Instance Method Details
#create(account_email, account_password) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/aws_account_utils/root_access_keys.rb', line 13 def create(account_email, account_password) logger.debug "Creating root access/secret key" Login.new(logger, browser).execute url, account_email, account_password clear_warning if browser.div(:id => 'modal-content', :text => warning_text) browser.i(:xpath => "id('credaccordion')/div[3]/div[1]/div/div[1]/i").when_present.click browser.(:text => /Create New Access Key/).when_present.click browser.a(:text => /Show Access Key/).when_present.click screenshot(browser, "1") parse_keys browser.text rescue Watir::Wait::TimeoutError, Net::ReadTimeout => e screenshot(browser, "error") raise StandardError, "#{self.class.name} - #{e}" end |
#delete(account_email, account_password) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/aws_account_utils/root_access_keys.rb', line 29 def delete(account_email, account_password) logger.debug "Deleting root access/secret key" Login.new(logger, browser).execute url, account_email, account_password clear_warning if browser.div(:id => 'modal-content', :text => warning_text) browser.i(:xpath => "id('credaccordion')/div[3]/div[1]/div/div[1]/i").when_present.click keys_to_delete? ? delete_all_keys : true rescue Watir::Wait::TimeoutError, Net::ReadTimeout => e screenshot(browser, "error") raise StandardError, "#{self.class.name} - #{e}" end |