Class: Fog::Sql::AzureRM::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/azurerm/sql.rb,
lib/fog/azurerm/requests/sql/get_database.rb,
lib/fog/azurerm/requests/sql/get_sql_server.rb,
lib/fog/azurerm/requests/sql/list_databases.rb,
lib/fog/azurerm/requests/sql/delete_database.rb,
lib/fog/azurerm/requests/sql/list_sql_servers.rb,
lib/fog/azurerm/requests/sql/delete_sql_server.rb,
lib/fog/azurerm/requests/sql/get_firewall_rule.rb,
lib/fog/azurerm/requests/sql/list_firewall_rules.rb,
lib/fog/azurerm/requests/sql/delete_firewall_rule.rb,
lib/fog/azurerm/requests/sql/check_database_exists.rb,
lib/fog/azurerm/requests/sql/check_sql_server_exists.rb,
lib/fog/azurerm/requests/sql/create_or_update_database.rb,
lib/fog/azurerm/requests/sql/check_firewall_rule_exists.rb,
lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb,
lib/fog/azurerm/requests/sql/create_or_update_firewall_rule.rb

Overview

Mock class for Sql Firewall Rule Request

Instance Method Summary collapse

Constructor Details

#initialize(_options = {}) ⇒ Mock

Returns a new instance of Mock.



61
62
# File 'lib/fog/azurerm/sql.rb', line 61

def initialize(_options = {})
end

Instance Method Details

#check_database_existsObject



15
16
17
# File 'lib/fog/azurerm/requests/sql/check_database_exists.rb', line 15

def check_database_exists(*)
  true
end

#check_firewall_rule_existsObject



15
16
17
# File 'lib/fog/azurerm/requests/sql/check_firewall_rule_exists.rb', line 15

def check_firewall_rule_exists(*)
  true
end

#check_sql_server_existsObject



15
16
17
# File 'lib/fog/azurerm/requests/sql/check_sql_server_exists.rb', line 15

def check_sql_server_exists(*)
  true
end

#create_or_update_databaseObject



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/fog/azurerm/requests/sql/create_or_update_database.rb', line 51

def create_or_update_database(*)
  {
    'location' => '{database-location}',
    'properties' => {
      'createMode' => '{creation-mode}',
      'sourceDatabaseId' => '{source-database-id}',
      'edition' => '{database-edition}',
      'collation' => '{collation-name}',
      'maxSizeBytes' => '{max-database-size}',
      'requestedServiceObjectiveId' => '{requested-service-id}',
      'requestedServiceObjectiveName' => '{requested-service-id}',
      'restorePointInTime' => '{restore-time}',
      'sourceDatabaseDeletionDate' => '{source-deletion-date}',
      'elasticPoolName' => '{elastic-pool-name}'
    }
  }
end

#create_or_update_firewall_ruleObject



31
32
33
34
35
36
37
38
# File 'lib/fog/azurerm/requests/sql/create_or_update_firewall_rule.rb', line 31

def create_or_update_firewall_rule(*)
  {
    'properties' => {
      'startIpAddress' => '{start-ip-address}',
      'endIpAddress' => '{end-ip-address}'
    }
  }
end

#create_or_update_sql_serverObject



40
41
42
43
44
45
46
47
48
49
# File 'lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb', line 40

def create_or_update_sql_server(*)
  {
    'location' => '{server-location}',
    'properties' => {
      'version' => '{server-version}',
      'administratorLogin' => '{admin-name}',
      'administratorLoginPassword' => '{admin-password}'
    }
  }
end

#delete_databaseObject



21
22
23
24
# File 'lib/fog/azurerm/requests/sql/delete_database.rb', line 21

def delete_database(*)
  Fog::Logger.debug 'SQL Database {name} from Resource group {resource_group} deleted successfully.'
  true
end

#delete_firewall_ruleObject



22
23
24
25
# File 'lib/fog/azurerm/requests/sql/delete_firewall_rule.rb', line 22

def delete_firewall_rule(*)
  Fog::Logger.debug 'SQL Firewall Rule {name} from SQL Server {server_name}, Resource group {resource_group} deleted successfully.'
  true
end

#delete_sql_serverObject



22
23
24
25
# File 'lib/fog/azurerm/requests/sql/delete_sql_server.rb', line 22

def delete_sql_server(*)
  Fog::Logger.debug 'SQL Server {name} from Resource group {resource_group} deleted successfully.'
  true
end

#get_databaseObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/fog/azurerm/requests/sql/get_database.rb', line 22

def get_database(*)
  {
    'location' => '{database-location}',
    'properties' => {
      'createMode' => '{creation-mode}',
      'sourceDatabaseId' => '{source-database-id}',
      'edition' => '{database-edition}',
      'collation' => '{collation-name}',
      'maxSizeBytes' => '{max-database-size}',
      'requestedServiceObjectiveId' => '{requested-service-id}',
      'requestedServiceObjectiveName' => '{requested-service-id}',
      'restorePointInTime' => '{restore-time}',
      'sourceDatabaseDeletionDate' => '{source-deletion-date}',
      'elasticPoolName' => '{elastic-pool-name}'
    }
  }
end

#get_firewall_ruleObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fog/azurerm/requests/sql/get_firewall_rule.rb', line 22

def get_firewall_rule(*)
  {
    'id' => '{uri-of-firewall-rule}',
    'name' => '{rule-name}',
    'type' => '{rule-type}',
    'location' => '{server-location}',
    'properties' => {
      'startIpAddress' => '{start-ip-address}',
      'endIpAddress' => '{end-ip-address}'
    }
  }
end

#get_sql_serverObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/fog/azurerm/requests/sql/get_sql_server.rb', line 21

def get_sql_server(*)
  {
    'location' => '{server-location}',
    'properties' => {
      'version' => '{server-version}',
      'administratorLogin' => '{admin-name}',
      'administratorLoginPassword' => '{admin-password}'
    }
  }
end

#list_databasesObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fog/azurerm/requests/sql/list_databases.rb', line 21

def list_databases(*)
  [
    {
      'location' => '{database-location}',
      'properties' => {
        'createMode' => '{creation-mode}',
        'sourceDatabaseId' => '{source-database-id}',
        'edition' => '{database-edition}',
        'collation' => '{collation-name}',
        'maxSizeBytes' => '{max-database-size}',
        'requestedServiceObjectiveId' => '{requested-service-id}',
        'requestedServiceObjectiveName' => '{requested-service-id}',
        'restorePointInTime' => '{restore-time}',
        'sourceDatabaseDeletionDate' => '{source-deletion-date}',
        'elasticPoolName' => '{elastic-pool-name}'
      }
    },
    {
      'location' => '{database-location}',
      'properties' => {
        'createMode' => '{creation-mode}',
        'sourceDatabaseId' => '{source-database-id}',
        'edition' => '{database-edition}',
        'collation' => '{collation-name}',
        'maxSizeBytes' => '{max-database-size}',
        'requestedServiceObjectiveId' => '{requested-service-id}',
        'requestedServiceObjectiveName' => '{requested-service-id}',
        'restorePointInTime' => '{restore-time}',
        'sourceDatabaseDeletionDate' => '{source-deletion-date}',
        'elasticPoolName' => '{elastic-pool-name}'
      }
    }
  ]
end

#list_firewall_rulesObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fog/azurerm/requests/sql/list_firewall_rules.rb', line 22

def list_firewall_rules(*)
  [
    {
      'id' => '{uri-of-firewall-rule}',
      'name' => '{rule-name}',
      'type' => '{rule-type}',
      'location' => '{server-location}',
      'properties' => {
        'startIpAddress' => '{start-ip-address}',
        'endIpAddress' => '{end-ip-address}'
      }
    },
    {
      'id' => '{uri-of-firewall-rule}',
      'name' => '{rule-name}',
      'type' => '{rule-type}',
      'location' => '{server-location}',
      'properties' => {
        'startIpAddress' => '{start-ip-address}',
        'endIpAddress' => '{end-ip-address}'
      }
    }
  ]
end

#list_sql_serversObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/fog/azurerm/requests/sql/list_sql_servers.rb', line 21

def list_sql_servers(*)
  [
    {
      'location' => '{server-location}',
      'properties' => {
        'version' => '{server-version}',
        'administratorLogin' => '{admin-name}',
        'administratorLoginPassword' => '{admin-password}'
      }
    },
    {
      'location' => '{server-location}',
      'properties' => {
        'version' => '{server-version}',
        'administratorLogin' => '{admin-name}',
        'administratorLoginPassword' => '{admin-password}'
      }
    }
  ]
end