Class: Fog::Google::SQL::Mock

Inherits:
Object
  • Object
show all
Includes:
Fog::Google::Shared
Defined in:
lib/fog/google/sql/mock.rb,
lib/fog/google/requests/sql/list_flags.rb,
lib/fog/google/requests/sql/list_tiers.rb,
lib/fog/google/requests/sql/list_users.rb,
lib/fog/google/requests/sql/delete_user.rb,
lib/fog/google/requests/sql/insert_user.rb,
lib/fog/google/requests/sql/update_user.rb,
lib/fog/google/requests/sql/get_instance.rb,
lib/fog/google/requests/sql/get_ssl_cert.rb,
lib/fog/google/requests/sql/get_operation.rb,
lib/fog/google/requests/sql/clone_instance.rb,
lib/fog/google/requests/sql/get_backup_run.rb,
lib/fog/google/requests/sql/list_instances.rb,
lib/fog/google/requests/sql/list_ssl_certs.rb,
lib/fog/google/requests/sql/delete_instance.rb,
lib/fog/google/requests/sql/delete_ssl_cert.rb,
lib/fog/google/requests/sql/export_instance.rb,
lib/fog/google/requests/sql/import_instance.rb,
lib/fog/google/requests/sql/insert_instance.rb,
lib/fog/google/requests/sql/insert_ssl_cert.rb,
lib/fog/google/requests/sql/list_operations.rb,
lib/fog/google/requests/sql/update_instance.rb,
lib/fog/google/requests/sql/list_backup_runs.rb,
lib/fog/google/requests/sql/restart_instance.rb,
lib/fog/google/requests/sql/delete_backup_run.rb,
lib/fog/google/requests/sql/insert_backup_run.rb,
lib/fog/google/requests/sql/restore_instance_backup.rb,
lib/fog/google/requests/sql/reset_instance_ssl_config.rb

Instance Attribute Summary

Attributes included from Fog::Google::Shared

#api_url, #api_version, #project

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Fog::Google::Shared

#apply_client_options, #build_excon_response, #initialize_auth, #initialize_google_client, #request, #shared_initialize

Constructor Details

#initialize(options) ⇒ Mock

Returns a new instance of Mock.



7
8
9
# File 'lib/fog/google/sql/mock.rb', line 7

def initialize(options)
  shared_initialize(options[:google_project], GOOGLE_SQL_API_VERSION, GOOGLE_SQL_BASE_URL)
end

Class Method Details

.dataObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/fog/google/sql/mock.rb', line 11

def self.data
  @data ||= Hash.new do |hash, key|
    hash[key] = {
      :backup_runs => {},
      :instances => {},
      :operations => {},
      :ssl_certs => {}
    }
  end
end

.resetObject



22
23
24
# File 'lib/fog/google/sql/mock.rb', line 22

def self.reset
  @data = nil
end

Instance Method Details

#clone_instance(_instance_id, _destination_name, _log_filename: nil, _log_position: nil) ⇒ Object



33
34
35
36
37
38
# File 'lib/fog/google/requests/sql/clone_instance.rb', line 33

def clone_instance(_instance_id, _destination_name,
                   _log_filename: nil, _log_position: nil)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#dataObject



26
27
28
# File 'lib/fog/google/sql/mock.rb', line 26

def data
  self.class.data[project]
end

#delete_backup_run(_instance_id, _run) ⇒ Object



15
16
17
18
19
# File 'lib/fog/google/requests/sql/delete_backup_run.rb', line 15

def delete_backup_run(_instance_id, _run)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#delete_instance(_instance_id) ⇒ Object



16
17
18
19
20
# File 'lib/fog/google/requests/sql/delete_instance.rb', line 16

def delete_instance(_instance_id)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#delete_ssl_cert(_instance_id, _sha1_fingerprint) ⇒ Object



16
17
18
19
20
# File 'lib/fog/google/requests/sql/delete_ssl_cert.rb', line 16

def delete_ssl_cert(_instance_id, _sha1_fingerprint)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#delete_user(_instance_id, _host, _name) ⇒ Object



16
17
18
19
20
# File 'lib/fog/google/requests/sql/delete_user.rb', line 16

def delete_user(_instance_id, _host, _name)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#export_instance(_instance_id, _uri, _options: {}) ⇒ Object



47
48
49
50
51
# File 'lib/fog/google/requests/sql/export_instance.rb', line 47

def export_instance(_instance_id, _uri, _options: {})
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#get_backup_run(_instance_id, _backup_run_id, _due_time) ⇒ Object



15
16
17
18
19
# File 'lib/fog/google/requests/sql/get_backup_run.rb', line 15

def get_backup_run(_instance_id, _backup_run_id, _due_time)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#get_instance(_instance_id) ⇒ Object



16
17
18
19
20
# File 'lib/fog/google/requests/sql/get_instance.rb', line 16

def get_instance(_instance_id)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#get_operation(_operation_id) ⇒ Object



16
17
18
19
20
# File 'lib/fog/google/requests/sql/get_operation.rb', line 16

def get_operation(_operation_id)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#get_ssl_cert(_instance_id, _sha1_fingerprint) ⇒ Object



16
17
18
19
20
# File 'lib/fog/google/requests/sql/get_ssl_cert.rb', line 16

def get_ssl_cert(_instance_id, _sha1_fingerprint)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#import_instance(_instance_id, _uri, _options = {}) ⇒ Object



36
37
38
39
40
# File 'lib/fog/google/requests/sql/import_instance.rb', line 36

def import_instance(_instance_id, _uri, _options = {})
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#insert_backup_run(_instance_id, _run) ⇒ Object



20
21
22
23
24
# File 'lib/fog/google/requests/sql/insert_backup_run.rb', line 20

def insert_backup_run(_instance_id, _run)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#insert_instance(_name, _tier, _options = {}) ⇒ Object



20
21
22
23
24
# File 'lib/fog/google/requests/sql/insert_instance.rb', line 20

def insert_instance(_name, _tier, _options = {})
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#insert_ssl_cert(_instance_id, _common_name) ⇒ Object



22
23
24
25
26
# File 'lib/fog/google/requests/sql/insert_ssl_cert.rb', line 22

def insert_ssl_cert(_instance_id, _common_name)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#insert_user(_instance_id, _user) ⇒ Object



17
18
19
20
21
# File 'lib/fog/google/requests/sql/insert_user.rb', line 17

def insert_user(_instance_id, _user)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#list_backup_runs(_instance_id, _backup_configuration_id) ⇒ Object



19
20
21
22
23
# File 'lib/fog/google/requests/sql/list_backup_runs.rb', line 19

def list_backup_runs(_instance_id, _backup_configuration_id)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#list_flagsObject



16
17
18
19
20
# File 'lib/fog/google/requests/sql/list_flags.rb', line 16

def list_flags
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#list_instances(_options: {}) ⇒ Object



19
20
21
22
23
# File 'lib/fog/google/requests/sql/list_instances.rb', line 19

def list_instances(_options: {})
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#list_operations(_instance_id, _options: {}) ⇒ Object



16
17
18
19
20
# File 'lib/fog/google/requests/sql/list_users.rb', line 16

def list_operations(_instance_id)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#list_ssl_certs(_instance_id) ⇒ Object



16
17
18
19
20
# File 'lib/fog/google/requests/sql/list_ssl_certs.rb', line 16

def list_ssl_certs(_instance_id)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#list_tiersObject



16
17
18
19
20
# File 'lib/fog/google/requests/sql/list_tiers.rb', line 16

def list_tiers
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#random_operationObject



34
35
36
# File 'lib/fog/google/sql/mock.rb', line 34

def random_operation
  "operation-#{Fog::Mock.random_numbers(13)}-#{Fog::Mock.random_hex(13)}-#{Fog::Mock.random_hex(8)}"
end

#reset_dataObject



30
31
32
# File 'lib/fog/google/sql/mock.rb', line 30

def reset_data
  self.class.data.delete(project)
end

#reset_instance_ssl_config(_instance_id) ⇒ Object



18
19
20
21
22
# File 'lib/fog/google/requests/sql/reset_instance_ssl_config.rb', line 18

def reset_instance_ssl_config(_instance_id)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#restart_instance(_instance_id) ⇒ Object



16
17
18
19
20
# File 'lib/fog/google/requests/sql/restart_instance.rb', line 16

def restart_instance(_instance_id)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#restore_instance_backup(_instance_id, _backup_run_id) ⇒ Object



23
24
25
26
27
# File 'lib/fog/google/requests/sql/restore_instance_backup.rb', line 23

def restore_instance_backup(_instance_id, _backup_run_id)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#update_instance(_instance_id, _settings_version, _tier, _settings = {}) ⇒ Object



23
24
25
26
27
# File 'lib/fog/google/requests/sql/update_instance.rb', line 23

def update_instance(_instance_id, _settings_version, _tier, _settings = {})
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#update_user(_instance_id, _host, _name, _user) ⇒ Object



19
20
21
22
23
# File 'lib/fog/google/requests/sql/update_user.rb', line 19

def update_user(_instance_id, _host, _name, _user)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end