Class: Fog::Sql::AzureRM::Mock
- Inherits:
-
Object
- Object
- Fog::Sql::AzureRM::Mock
- 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
- #check_database_exists ⇒ Object
- #check_firewall_rule_exists ⇒ Object
- #check_sql_server_exists ⇒ Object
- #create_or_update_database ⇒ Object
- #create_or_update_firewall_rule ⇒ Object
- #create_or_update_sql_server ⇒ Object
- #delete_database ⇒ Object
- #delete_firewall_rule ⇒ Object
- #delete_sql_server ⇒ Object
- #get_database ⇒ Object
- #get_firewall_rule ⇒ Object
- #get_sql_server ⇒ Object
-
#initialize(_options = {}) ⇒ Mock
constructor
A new instance of Mock.
- #list_databases ⇒ Object
- #list_firewall_rules ⇒ Object
- #list_sql_servers ⇒ Object
Constructor Details
#initialize(_options = {}) ⇒ Mock
Returns a new instance of Mock.
61 62 |
# File 'lib/fog/azurerm/sql.rb', line 61 def initialize( = {}) end |
Instance Method Details
#check_database_exists ⇒ Object
15 16 17 |
# File 'lib/fog/azurerm/requests/sql/check_database_exists.rb', line 15 def check_database_exists(*) true end |
#check_firewall_rule_exists ⇒ Object
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_exists ⇒ Object
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_database ⇒ Object
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_rule ⇒ Object
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_server ⇒ Object
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_database ⇒ Object
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_rule ⇒ Object
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_server ⇒ Object
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_database ⇒ Object
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_rule ⇒ Object
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_server ⇒ Object
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_databases ⇒ Object
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_rules ⇒ Object
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_servers ⇒ Object
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 |