fog-azure-rm 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +11 -1
- data/README.md +13 -5
- data/fog-azure-rm.gemspec +8 -7
- data/lib/fog/azurerm/application_gateway.rb +2 -0
- data/lib/fog/azurerm/dns.rb +10 -1
- data/lib/fog/azurerm/docs/sql.md +130 -0
- data/lib/fog/azurerm/docs/structure.md +1 -1
- data/lib/fog/azurerm/models/application_gateway/gateway.rb +8 -0
- data/lib/fog/azurerm/models/dns/record_set.rb +34 -27
- data/lib/fog/azurerm/models/dns/zone.rb +27 -13
- data/lib/fog/azurerm/models/network/express_route_circuit_authorization.rb +4 -12
- data/lib/fog/azurerm/models/network/express_route_circuit_authorizations.rb +2 -6
- data/lib/fog/azurerm/models/network/local_network_gateway.rb +5 -13
- data/lib/fog/azurerm/models/network/local_network_gateways.rb +2 -5
- data/lib/fog/azurerm/models/network/virtual_network_gateway_connection.rb +3 -20
- data/lib/fog/azurerm/models/network/virtual_network_gateway_connections.rb +1 -4
- data/lib/fog/azurerm/models/sql/sql_database.rb +89 -0
- data/lib/fog/azurerm/models/sql/sql_databases.rb +29 -0
- data/lib/fog/azurerm/models/sql/sql_server.rb +57 -0
- data/lib/fog/azurerm/models/sql/sql_servers.rb +27 -0
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_end_point.rb +6 -16
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_end_points.rb +6 -11
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +21 -20
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profiles.rb +4 -7
- data/lib/fog/azurerm/network.rb +3 -0
- data/lib/fog/azurerm/requests/application_gateway/start_application_gateway.rb +27 -0
- data/lib/fog/azurerm/requests/application_gateway/stop_application_gateway.rb +27 -0
- data/lib/fog/azurerm/requests/dns/check_for_zone.rb +8 -20
- data/lib/fog/azurerm/requests/dns/create_or_update_record_set.rb +47 -81
- data/lib/fog/azurerm/requests/dns/create_or_update_zone.rb +27 -34
- data/lib/fog/azurerm/requests/dns/delete_record_set.rb +9 -18
- data/lib/fog/azurerm/requests/dns/delete_zone.rb +9 -17
- data/lib/fog/azurerm/requests/dns/get_record_set.rb +11 -20
- data/lib/fog/azurerm/requests/dns/get_records_from_record_set.rb +12 -38
- data/lib/fog/azurerm/requests/dns/get_zone.rb +11 -20
- data/lib/fog/azurerm/requests/dns/list_record_sets.rb +11 -19
- data/lib/fog/azurerm/requests/dns/list_zones.rb +15 -32
- data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit_authorization.rb +4 -2
- data/lib/fog/azurerm/requests/network/create_or_update_local_network_gateway.rb +3 -1
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway_connection.rb +3 -1
- data/lib/fog/azurerm/requests/network/delete_express_route_circuit_authorization.rb +2 -1
- data/lib/fog/azurerm/requests/network/delete_local_network_gateway.rb +2 -1
- data/lib/fog/azurerm/requests/network/delete_virtual_network_gateway_connection.rb +2 -1
- data/lib/fog/azurerm/requests/network/get_express_route_circuit_authorization.rb +2 -1
- data/lib/fog/azurerm/requests/network/get_load_balancer.rb +8 -7
- data/lib/fog/azurerm/requests/network/get_local_network_gateway.rb +2 -1
- data/lib/fog/azurerm/requests/network/get_virtual_network_gateway_connection.rb +2 -1
- data/lib/fog/azurerm/requests/network/list_express_route_circuit_authorizations.rb +2 -1
- data/lib/fog/azurerm/requests/network/list_local_network_gateways.rb +2 -1
- data/lib/fog/azurerm/requests/network/list_virtual_network_gateway_connections.rb +2 -1
- data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +74 -0
- data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +61 -0
- data/lib/fog/azurerm/requests/sql/delete_database.rb +35 -0
- data/lib/fog/azurerm/requests/sql/delete_sql_server.rb +35 -0
- data/lib/fog/azurerm/requests/sql/get_database.rb +48 -0
- data/lib/fog/azurerm/requests/sql/get_sql_server.rb +41 -0
- data/lib/fog/azurerm/requests/sql/list_databases.rb +65 -0
- data/lib/fog/azurerm/requests/sql/list_sql_servers.rb +51 -0
- data/lib/fog/azurerm/requests/traffic_manager/delete_traffic_manager_profile.rb +1 -1
- data/lib/fog/azurerm/sql.rb +49 -0
- data/lib/fog/azurerm/utilities/general.rb +19 -0
- data/lib/fog/azurerm/utilities/logger_messages.yml +19 -0
- data/lib/fog/azurerm/version.rb +1 -1
- data/lib/fog/azurerm.rb +21 -0
- data/test/api_stub/models/dns/record_set.rb +34 -56
- data/test/api_stub/models/dns/zone.rb +17 -35
- data/test/api_stub/models/sql/sql_database.rb +28 -0
- data/test/api_stub/models/sql/sql_server.rb +22 -0
- data/test/api_stub/requests/dns/record_set.rb +13 -43
- data/test/api_stub/requests/dns/zone.rb +21 -36
- data/test/api_stub/requests/network/express_route_circuit_authorization.rb +1 -1
- data/test/api_stub/requests/sql/database.rb +69 -0
- data/test/api_stub/requests/sql/sql_server.rb +45 -0
- data/test/api_stub.rb +10 -0
- data/test/integration/application_gateway.rb +17 -5
- data/test/integration/credentials/azure.yml +4 -4
- data/test/integration/express_route_circuit.rb +1 -1
- data/test/integration/record_set.rb +1 -0
- data/test/integration/resource_tag.rb +14 -3
- data/test/integration/sql_server.rb +111 -0
- data/test/integration/traffic_manager.rb +1 -1
- data/test/integration/zone.rb +1 -0
- data/test/models/application_gateway/test_gateway.rb +25 -3
- data/test/models/application_gateway/test_gateways.rb +2 -2
- data/test/models/compute/test_availability_set.rb +1 -1
- data/test/models/compute/test_availability_sets.rb +2 -2
- data/test/models/compute/test_server.rb +2 -2
- data/test/models/compute/test_servers.rb +2 -2
- data/test/models/compute/test_virtual_machine_extension.rb +2 -2
- data/test/models/compute/test_virtual_machine_extensions.rb +2 -2
- data/test/models/dns/test_record_set.rb +5 -4
- data/test/models/dns/test_record_sets.rb +9 -8
- data/test/models/dns/test_zone.rb +4 -3
- data/test/models/dns/test_zones.rb +4 -3
- data/test/models/network/test_express_route_circuit.rb +2 -2
- data/test/models/network/test_express_route_circuit_authorization.rb +3 -3
- data/test/models/network/test_express_route_circuit_authorizations.rb +3 -3
- data/test/models/network/test_express_route_circuit_peering.rb +2 -2
- data/test/models/network/test_express_route_circuit_peerings.rb +3 -3
- data/test/models/network/test_express_route_circuits.rb +2 -2
- data/test/models/network/test_express_route_service_providers.rb +1 -1
- data/test/models/network/test_load_balancer.rb +2 -2
- data/test/models/network/test_load_balancers.rb +2 -2
- data/test/models/network/test_local_network_gateway.rb +2 -2
- data/test/models/network/test_local_network_gateways.rb +2 -2
- data/test/models/network/test_network_interface.rb +2 -2
- data/test/models/network/test_network_interfaces.rb +2 -2
- data/test/models/network/test_network_security_group.rb +1 -1
- data/test/models/network/test_network_security_groups.rb +2 -2
- data/test/models/network/test_network_security_rule.rb +1 -1
- data/test/models/network/test_network_security_rules.rb +3 -3
- data/test/models/network/test_public_ip.rb +2 -2
- data/test/models/network/test_public_ips.rb +2 -2
- data/test/models/network/test_subnet.rb +2 -2
- data/test/models/network/test_subnets.rb +3 -3
- data/test/models/network/test_virtual_network.rb +2 -2
- data/test/models/network/test_virtual_network_gateway.rb +2 -2
- data/test/models/network/test_virtual_network_gateway_connection.rb +2 -2
- data/test/models/network/test_virtual_network_gateway_connections.rb +2 -2
- data/test/models/network/test_virtual_network_gateways.rb +2 -2
- data/test/models/network/test_virtual_networks.rb +2 -2
- data/test/models/resources/test_deployment.rb +2 -2
- data/test/models/resources/test_deployments.rb +1 -1
- data/test/models/resources/test_resource.rb +1 -1
- data/test/models/resources/test_resource_group.rb +2 -2
- data/test/models/resources/test_resource_groups.rb +1 -1
- data/test/models/resources/test_resources.rb +1 -1
- data/test/models/sql/test_database.rb +68 -0
- data/test/models/sql/test_databases.rb +42 -0
- data/test/models/sql/test_sql_server.rb +56 -0
- data/test/models/sql/test_sql_servers.rb +41 -0
- data/test/models/storage/test_data_disk.rb +1 -1
- data/test/models/storage/test_directories.rb +1 -1
- data/test/models/storage/test_directory.rb +1 -1
- data/test/models/storage/test_file.rb +1 -1
- data/test/models/storage/test_files.rb +1 -1
- data/test/models/storage/test_storage_account.rb +1 -1
- data/test/models/storage/test_storage_accounts.rb +2 -2
- data/test/models/traffic_manager/test_traffic_manager_end_point.rb +2 -2
- data/test/models/traffic_manager/test_traffic_manager_end_points.rb +3 -3
- data/test/models/traffic_manager/test_traffic_manager_profile.rb +2 -2
- data/test/models/traffic_manager/test_traffic_manager_profiles.rb +2 -2
- data/test/requests/application_gateway/test_start_application_gateway.rb +25 -0
- data/test/requests/application_gateway/test_stop_application_gateway.rb +25 -0
- data/test/requests/dns/test_check_for_zone.rb +8 -36
- data/test/requests/dns/test_create_record_set.rb +19 -18
- data/test/requests/dns/test_create_zone.rb +14 -13
- data/test/requests/dns/test_delete_record_set.rb +8 -19
- data/test/requests/dns/test_delete_zone.rb +8 -19
- data/test/requests/dns/test_get_record_set.rb +8 -30
- data/test/requests/dns/test_get_records_from_record_set.rb +15 -28
- data/test/requests/dns/test_get_zone.rb +11 -22
- data/test/requests/dns/test_list_record_sets.rb +10 -11
- data/test/requests/dns/test_list_zones.rb +9 -23
- data/test/requests/network/{test_create_or_update_local_network_gateway.rb → test_create_local_network_gateway.rb} +2 -2
- data/test/requests/network/test_create_virtual_network_gateway_connection.rb +2 -2
- data/test/requests/sql/test_create_or_update_database.rb +28 -0
- data/test/requests/sql/test_create_or_update_sql_server.rb +28 -0
- data/test/requests/sql/test_delete_database.rb +34 -0
- data/test/requests/sql/test_delete_sql_server.rb +34 -0
- data/test/requests/sql/test_get_database.rb +35 -0
- data/test/requests/sql/test_get_sql_server.rb +35 -0
- data/test/requests/sql/test_list_databases.rb +35 -0
- data/test/requests/sql/test_list_sql_servers.rb +35 -0
- data/test/smoke_tests/compute/test_resource_group_smoke.rb +27 -0
- data/test/test_helper.rb +27 -0
- metadata +68 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d368c1c1b51e0a2ce92cc1791b88c7fc41c05ecc
|
4
|
+
data.tar.gz: 9d50a7b320080bc990a6e2e54cef9c5144c9e7c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b397f190098b56507d6cfae71f290c298282ef4de15e122ee59d38dcb3b3fae6759646824e91a25c78640237b18bb9f7bd61315f3a962c11c4f384653e1b8f36
|
7
|
+
data.tar.gz: 4503e9320364fa79d212cc5872052a5f72c32f4b96ad7cdfdaaf9260c47a524305c19bc5d2a87281c41cb6d01d7308459dd7fd4713969e22db51d7f37803ee32
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,14 @@
|
|
1
|
-
## 0.0.
|
1
|
+
## 0.0.9
|
2
|
+
|
3
|
+
**Added:**
|
4
|
+
- Azure SQL Service - Added support for SQL Server, SQL Databases and Data warehouse.
|
5
|
+
|
6
|
+
**Changed:**
|
7
|
+
- DNS Service - DNS Service moved from API calls to Azure latest SDK.
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
## 0.0.8
|
2
12
|
|
3
13
|
**Added:**
|
4
14
|
- Compute Service - Added support to create virtual machine from a custom image.
|
data/README.md
CHANGED
@@ -47,24 +47,32 @@ After creating the service principal, you should have three pieces of informatio
|
|
47
47
|
|
48
48
|
### Compute
|
49
49
|
|
50
|
-
Fog-AzureRM for compute includes
|
50
|
+
Fog-AzureRM for compute includes implementation of Virtual Machines and Availability Sets. Readme for the usage of [Compute](https://github.com/fog/fog-azure-rm/blob/master/lib/fog/azurerm/docs/compute.md) module.
|
51
51
|
|
52
52
|
### Resources
|
53
53
|
|
54
|
-
Fog-AzureRM for resources includes
|
54
|
+
Fog-AzureRM for resources includes implementation of Resource Groups. Readme for the usage of [Resources](https://github.com/fog/fog-azure-rm/blob/master/lib/fog/azurerm/docs/resources.md) module.
|
55
55
|
|
56
56
|
### DNS
|
57
57
|
|
58
|
-
Fog-AzureRM for dns includes
|
58
|
+
Fog-AzureRM for dns includes implementation of Record sets and Zones. Readme for the usage of [DNS](https://github.com/fog/fog-azure-rm/blob/master/lib/fog/azurerm/docs/dns.md) module.
|
59
59
|
|
60
60
|
### Network
|
61
61
|
|
62
|
-
Fog-AzureRM for network includes
|
62
|
+
Fog-AzureRM for network includes implementation of Network Interfaces, Public IPs, Subnets and Virtual Networks. Readme for the usage of [Network](https://github.com/fog/fog-azure-rm/blob/master/lib/fog/azurerm/docs/network.md) module.
|
63
63
|
|
64
64
|
### Storage
|
65
65
|
|
66
|
-
Fog-AzureRM for storage includes
|
66
|
+
Fog-AzureRM for storage includes implementation of Storage Accounts. Readme for the usage of [Storage](https://github.com/fog/fog-azure-rm/blob/master/lib/fog/azurerm/docs/storage.md) module.
|
67
67
|
|
68
|
+
### Traffic Manager
|
69
|
+
|
70
|
+
Fog-AzureRM for Traffic Manager includes implementation of Traffic Manager Profile and Traffic Manager End-points. Readme for the usage of [Traffic Manager](https://github.com/fog/fog-azure-rm/blob/master/lib/fog/azurerm/docs/traffic_manager.md) module.
|
71
|
+
|
72
|
+
### SQL
|
73
|
+
|
74
|
+
Fog-AzureRM for SQL includes implementation of SQL Server, SQL Databases and Data Warehouse. Readme for the usage of [Azure SQL](https://github.com/fog/fog-azure-rm/blob/master/lib/fog/azurerm/docs/sql.md) module.
|
75
|
+
|
68
76
|
## Supported Services
|
69
77
|
|
70
78
|
Use following command for the complete list of services, Fog provides for Azure Resource Manager.
|
data/fog-azure-rm.gemspec
CHANGED
@@ -22,12 +22,13 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency 'minitest', '~> 5.8.4'
|
23
23
|
spec.add_development_dependency 'simplecov', '~> 0.11.2'
|
24
24
|
spec.add_development_dependency 'codeclimate-test-reporter'
|
25
|
-
spec.add_dependency 'fog-core', '~> 1.
|
25
|
+
spec.add_dependency 'fog-core', '~> 1.43.0'
|
26
26
|
spec.add_dependency 'rest-client', '~> 2.0.0'
|
27
|
-
spec.add_dependency 'azure_mgmt_compute', '~> 0.
|
28
|
-
spec.add_dependency 'azure_mgmt_resources', '~> 0.
|
29
|
-
spec.add_dependency 'azure_mgmt_storage', '~> 0.
|
30
|
-
spec.add_dependency 'azure_mgmt_network', '~> 0.
|
31
|
-
spec.add_dependency '
|
32
|
-
spec.add_dependency '
|
27
|
+
spec.add_dependency 'azure_mgmt_compute', '~> 0.6.0'
|
28
|
+
spec.add_dependency 'azure_mgmt_resources', '~> 0.6.0'
|
29
|
+
spec.add_dependency 'azure_mgmt_storage', '~> 0.6.0'
|
30
|
+
spec.add_dependency 'azure_mgmt_network', '~> 0.6.0'
|
31
|
+
spec.add_dependency 'azure_mgmt_dns', '~> 0.6.0'
|
32
|
+
spec.add_dependency 'azure_mgmt_traffic_manager', '~> 0.6.0'
|
33
|
+
spec.add_dependency 'azure-storage', '~> 0.11.1.preview'
|
33
34
|
end
|
@@ -14,6 +14,8 @@ module Fog
|
|
14
14
|
request :get_application_gateway
|
15
15
|
request :update_subnet_id_in_gateway_ip_configuration
|
16
16
|
request :update_sku_attributes
|
17
|
+
request :start_application_gateway
|
18
|
+
request :stop_application_gateway
|
17
19
|
|
18
20
|
model_path 'fog/azurerm/models/application_gateway'
|
19
21
|
model :gateway
|
data/lib/fog/azurerm/dns.rb
CHANGED
@@ -34,10 +34,19 @@ module Fog
|
|
34
34
|
# This class provides the actual implemention for service calls.
|
35
35
|
class Real
|
36
36
|
def initialize(options)
|
37
|
+
begin
|
38
|
+
require 'azure_mgmt_dns'
|
39
|
+
rescue LoadError => e
|
40
|
+
retry if require('rubygems')
|
41
|
+
raise e.message
|
42
|
+
end
|
43
|
+
|
44
|
+
credentials = Fog::Credentials::AzureRM.get_credentials(options[:tenant_id], options[:client_id], options[:client_secret])
|
45
|
+
@dns_client = ::Azure::ARM::Dns::DnsManagementClient.new(credentials)
|
46
|
+
@dns_client.subscription_id = options[:subscription_id]
|
37
47
|
@tenant_id = options[:tenant_id]
|
38
48
|
@client_id = options[:client_id]
|
39
49
|
@client_secret = options[:client_secret]
|
40
|
-
@subscription_id = options[:subscription_id]
|
41
50
|
@resources = Fog::Resources::AzureRM.new(
|
42
51
|
tenant_id: options[:tenant_id],
|
43
52
|
client_id: options[:client_id],
|
@@ -0,0 +1,130 @@
|
|
1
|
+
#Azure SQL
|
2
|
+
|
3
|
+
This document explains how to get started using Azure SQL Services with Fog.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
First of all, you need to require the Fog library by executing:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
require 'fog/azurerm'
|
11
|
+
```
|
12
|
+
|
13
|
+
## Create Connection
|
14
|
+
|
15
|
+
Next, create a connection to the SQL Service:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
azure_sql_service = Fog::Sql::AzureRM.new(
|
19
|
+
tenant_id: '<Tenantid>', # Tenant id of Azure Active Directory Application
|
20
|
+
client_id: '<Clientid>', # Client id of Azure Active Directory Application
|
21
|
+
client_secret: '<ClientSecret>', # Client Secret of Azure Active Directory Application
|
22
|
+
subscription_id: '<Subscriptionid>' # Subscription id of an Azure Account
|
23
|
+
)
|
24
|
+
```
|
25
|
+
|
26
|
+
The {server-name} and {database-name} value must be set using all lowercase ANSI letters , hyphen, and the numbers 1 through 9. Do not use a hyphen as the leading or trailing character.
|
27
|
+
|
28
|
+
|
29
|
+
## Create SQL Server
|
30
|
+
|
31
|
+
Create a new Server
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
azure_sql_service.sql_servers.create(
|
35
|
+
name: '<Unique Server Name>',
|
36
|
+
resource_group: '<Resource Group Name>',
|
37
|
+
location: 'East US',
|
38
|
+
version: '2.0', # Specifies the version of the Azure server. The acceptable value are: '2.0' or '12.0'
|
39
|
+
administrator_login: 'testserveradmin', # Specifies the name of the SQL administrator.
|
40
|
+
administrator_login_password: 'svr@admin123' # Specifies the password of the SQL administrator.
|
41
|
+
)
|
42
|
+
```
|
43
|
+
For more information, see link: https://msdn.microsoft.com/en-us/library/azure/mt297738.aspx
|
44
|
+
|
45
|
+
## List SQL Servers
|
46
|
+
Get a list of servers in given resource group
|
47
|
+
```ruby
|
48
|
+
servers = azure_sql_service.sql_servers(resource_group: '<Resource Group Name>')
|
49
|
+
servers.each do |server|
|
50
|
+
puts "Listing : #{server.name}"
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
54
|
+
## Retrieve a single SQL Server
|
55
|
+
|
56
|
+
Get a single record of SQL Server
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
server = azure_sql_service.sql_servers
|
60
|
+
.get('<Resource Group Name>', '<Server Name>')
|
61
|
+
puts "Server Name: #{server.name}"
|
62
|
+
```
|
63
|
+
|
64
|
+
## Destroy a SQL Server
|
65
|
+
|
66
|
+
Get SQL Server object from the get method(described above) and destroy that Server.
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
server.destroy
|
70
|
+
```
|
71
|
+
|
72
|
+
## Create SQL Database
|
73
|
+
|
74
|
+
Creates a new Sql Database
|
75
|
+
|
76
|
+
In parameter {create_mode}: 'Copy', 'NonReadableSecondary', and 'OnlineSecondary' are not supported by SQL Data Warehouse.
|
77
|
+
|
78
|
+
If parameter {edition} is set to DataWarehouse, the acceptable values for parameter {requested_service_objective_name} are: ['DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1500', 'DW2000', 'DW3000', 'DW6000']
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
azure_sql_service.sql_databases.create(
|
82
|
+
resource_group: '<Resource Group Name>',
|
83
|
+
location: 'East US',
|
84
|
+
server_name: '<Server Name>',
|
85
|
+
name: '<Database Name>',
|
86
|
+
create_mode: '<Create Mode>', # Optional. Specifies the type of database to create. The default value is Default. The acceptable values are: [Copy, Default, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, PointInTimeRestore, Restore]
|
87
|
+
edition: '<Edition>', # Conditional. Specifies the edition of the database. If createMode is set to Default, then this value must be specified. The acceptable value are: [Basic, Standard, Premium, DataWarehouse]
|
88
|
+
source_database_id: '<URI>', # Conditional. Specifies the URI of the source database. If createMode is not set to Default, then this value must be specified.
|
89
|
+
collation: '<Collation>', # Conditional. Specifies the name of the collation. If createMode is set to Default, then this value must be specified.
|
90
|
+
max_size_bytes: '<Size>', # Conditional. Specifies the maximum size to which the database may grow. If createMode is set to Default, then this value must be specified.
|
91
|
+
requested_service_objective_name: '<Name>' , # Conditional. Specifies the requested service level of the database. If requestedServiceObjectiveId is specified, then this value must not be specified. The acceptable value are: [Basic, S0, S1, S2, S3, P1, P2, P4, P6, P11, ElasticPool]
|
92
|
+
restore_point_in_time: '<String>', # Conditional. Specifies the point in time for the restore. If createMode is set to PointInTimeRestore, then this value must be specified.
|
93
|
+
source_database_deletion_date: '<Date>', # Conditional. Specifies the deletion date of the source database. If createMode is set to Restore, then this value must be specified
|
94
|
+
elastic_pool_name: '<Pool Name>', # Conditional. Specifies the name of the elastic database pool. If requestedServiceObjectiveId or requestedServiceObjectiveName is set to ElasticPool, then this value must be specified.
|
95
|
+
requested_service_objective_id: '<GUID>' # Conditional. Specifies the identifier of the requested service level. If requestedServiceObjectiveName is specified, then this value must not be specified.
|
96
|
+
)
|
97
|
+
```
|
98
|
+
For more information see link: https://msdn.microsoft.com/en-us/library/azure/mt163685.aspx
|
99
|
+
|
100
|
+
## List SQL Databases
|
101
|
+
Get a list of databases in given resource group
|
102
|
+
|
103
|
+
```ruby
|
104
|
+
databases = azure_sql_service.sql_databases(resource_group: '<Resource Group Name>', server_name: '<Server Name>')
|
105
|
+
databases.each do |database|
|
106
|
+
puts "Listing : #{database.name}"
|
107
|
+
end
|
108
|
+
```
|
109
|
+
|
110
|
+
## Retrieve a single SQL Database
|
111
|
+
|
112
|
+
Get a single record of SQL Database
|
113
|
+
|
114
|
+
```ruby
|
115
|
+
database = azure_sql_service.sql_databases
|
116
|
+
.get('<Resource Group Name>', '<Server Name>', '<Database Name>')
|
117
|
+
puts "Database Name: #{database.name}"
|
118
|
+
```
|
119
|
+
|
120
|
+
## Destroy a SQL Database
|
121
|
+
|
122
|
+
Get SQL Database object from the get method(described above) and destroy that Database.
|
123
|
+
|
124
|
+
```ruby
|
125
|
+
database.destroy
|
126
|
+
```
|
127
|
+
|
128
|
+
|
129
|
+
## Support and Feedback
|
130
|
+
Your feedback is appreciated! If you have specific issues with the fog ARM, you should file an issue via Github.
|
@@ -601,6 +601,14 @@ module Fog
|
|
601
601
|
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
602
602
|
end
|
603
603
|
|
604
|
+
def start
|
605
|
+
service.start_application_gateway(resource_group, name)
|
606
|
+
end
|
607
|
+
|
608
|
+
def stop
|
609
|
+
service.stop_application_gateway(resource_group, name)
|
610
|
+
end
|
611
|
+
|
604
612
|
def destroy
|
605
613
|
service.delete_application_gateway(resource_group, name)
|
606
614
|
end
|
@@ -7,50 +7,41 @@ module Fog
|
|
7
7
|
attribute :id
|
8
8
|
identity :name
|
9
9
|
attribute :resource_group
|
10
|
-
attribute :location
|
11
10
|
attribute :zone_name
|
12
11
|
attribute :records
|
13
12
|
attribute :type
|
14
13
|
attribute :ttl
|
15
|
-
attribute :fqdn
|
16
14
|
attribute :cname_record
|
17
|
-
attribute :
|
15
|
+
attribute :a_records
|
18
16
|
|
19
17
|
def self.parse(recordset)
|
20
18
|
hash = {}
|
21
|
-
hash['id'] = recordset
|
22
|
-
hash['name'] = recordset
|
23
|
-
hash['resource_group'] = recordset
|
24
|
-
hash['
|
25
|
-
hash['
|
26
|
-
|
27
|
-
type = recordset['type'].split('/')[2]
|
19
|
+
hash['id'] = recordset.id
|
20
|
+
hash['name'] = recordset.name
|
21
|
+
hash['resource_group'] = get_resource_group_from_id(recordset.id)
|
22
|
+
hash['zone_name'] = get_record_set_from_id(recordset.id)
|
23
|
+
hash['type'] = recordset.type
|
24
|
+
type = get_type_from_recordset_type(recordset.type)
|
28
25
|
hash['records'] = []
|
29
26
|
if type == 'A'
|
30
|
-
record_entries = recordset
|
27
|
+
record_entries = recordset.arecords
|
31
28
|
record_entries.each do |record|
|
32
|
-
hash['records'] << record
|
29
|
+
hash['records'] << record.ipv4address
|
33
30
|
end
|
34
31
|
end
|
35
32
|
if type == 'CNAME'
|
36
|
-
record_entries = recordset
|
33
|
+
record_entries = recordset.cname_record
|
37
34
|
hash['records'] << record_entries
|
38
35
|
end
|
39
|
-
hash['
|
40
|
-
hash['cname_record'] = recordset
|
41
|
-
hash['ttl'] = recordset
|
42
|
-
hash['fqdn'] = recordset['properties']['fqdn']
|
36
|
+
hash['a_records'] = recordset.arecords if type == 'A'
|
37
|
+
hash['cname_record'] = recordset.cname_record if type == 'CNAME'
|
38
|
+
hash['ttl'] = recordset.ttl
|
43
39
|
hash
|
44
40
|
end
|
45
41
|
|
46
42
|
def save
|
47
|
-
requires :name
|
48
|
-
|
49
|
-
requires :zone_name
|
50
|
-
requires :records
|
51
|
-
requires :type
|
52
|
-
requires :ttl
|
53
|
-
record_set = service.create_or_update_record_set(resource_group, name, zone_name, records, type, ttl)
|
43
|
+
requires :name, :resource_group, :zone_name, :records, :type, :ttl
|
44
|
+
record_set = service.create_or_update_record_set(record_set_params, type)
|
54
45
|
merge_attributes(Fog::DNS::AzureRM::RecordSet.parse(record_set))
|
55
46
|
end
|
56
47
|
|
@@ -63,21 +54,37 @@ module Fog
|
|
63
54
|
end
|
64
55
|
|
65
56
|
def update_ttl(ttl)
|
66
|
-
|
57
|
+
params = record_set_params
|
58
|
+
params[:ttl] = ttl
|
59
|
+
record_set = service.create_or_update_record_set(params, get_record_type(type))
|
67
60
|
merge_attributes(Fog::DNS::AzureRM::RecordSet.parse(record_set))
|
68
61
|
end
|
69
62
|
|
70
63
|
def add_a_type_record(record)
|
71
64
|
records << record
|
72
|
-
record_set = service.create_or_update_record_set(
|
65
|
+
record_set = service.create_or_update_record_set(record_set_params, get_record_type(type))
|
73
66
|
merge_attributes(Fog::DNS::AzureRM::RecordSet.parse(record_set))
|
74
67
|
end
|
75
68
|
|
76
69
|
def remove_a_type_record(record)
|
77
70
|
records.delete(record)
|
78
|
-
record_set = service.create_or_update_record_set(
|
71
|
+
record_set = service.create_or_update_record_set(record_set_params, get_record_type(type))
|
79
72
|
merge_attributes(Fog::DNS::AzureRM::RecordSet.parse(record_set))
|
80
73
|
end
|
74
|
+
|
75
|
+
private
|
76
|
+
|
77
|
+
def record_set_params
|
78
|
+
{
|
79
|
+
name: name,
|
80
|
+
resource_group: resource_group,
|
81
|
+
zone_name: zone_name,
|
82
|
+
records: records,
|
83
|
+
ttl: ttl,
|
84
|
+
cname_record: cname_record,
|
85
|
+
a_records: a_records
|
86
|
+
}
|
87
|
+
end
|
81
88
|
end
|
82
89
|
end
|
83
90
|
end
|
@@ -12,32 +12,46 @@ module Fog
|
|
12
12
|
attribute :tags
|
13
13
|
attribute :etag
|
14
14
|
attribute :number_of_record_sets
|
15
|
-
attribute :
|
15
|
+
attribute :max_number_of_record_sets
|
16
16
|
|
17
17
|
def self.parse(zone)
|
18
18
|
hash = {}
|
19
|
-
hash['id'] = zone
|
20
|
-
hash['name'] = zone
|
21
|
-
hash['resource_group'] = zone
|
22
|
-
hash['location'] = zone
|
23
|
-
hash['type'] = zone
|
24
|
-
hash['tags'] = zone
|
25
|
-
hash['etag'] = zone
|
26
|
-
hash['number_of_record_sets'] = zone
|
27
|
-
hash['
|
19
|
+
hash['id'] = zone.id
|
20
|
+
hash['name'] = zone.name
|
21
|
+
hash['resource_group'] = get_resource_group_from_id(zone.id)
|
22
|
+
hash['location'] = zone.location
|
23
|
+
hash['type'] = zone.type
|
24
|
+
hash['tags'] = zone.tags
|
25
|
+
hash['etag'] = zone.etag
|
26
|
+
hash['number_of_record_sets'] = zone.number_of_record_sets
|
27
|
+
hash['max_number_of_record_sets'] = zone.max_number_of_record_sets
|
28
28
|
hash
|
29
29
|
end
|
30
30
|
|
31
31
|
def save
|
32
|
-
requires :name
|
33
|
-
|
34
|
-
zone = service.create_or_update_zone(resource_group, name)
|
32
|
+
requires :name, :resource_group, :location
|
33
|
+
zone = service.create_or_update_zone(zone_params)
|
35
34
|
merge_attributes(Fog::DNS::AzureRM::Zone.parse(zone))
|
36
35
|
end
|
37
36
|
|
38
37
|
def destroy
|
39
38
|
service.delete_zone(resource_group, name)
|
40
39
|
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def zone_params
|
44
|
+
{
|
45
|
+
name: name,
|
46
|
+
resource_group: resource_group,
|
47
|
+
location: location,
|
48
|
+
type: type,
|
49
|
+
tags: tags,
|
50
|
+
number_of_record_sets: number_of_record_sets,
|
51
|
+
max_number_of_record_sets: max_number_of_record_sets,
|
52
|
+
etag: etag
|
53
|
+
}
|
54
|
+
end
|
41
55
|
end
|
42
56
|
end
|
43
57
|
end
|
@@ -8,29 +8,21 @@ module Fog
|
|
8
8
|
attribute :resource_group
|
9
9
|
attribute :authorization_name
|
10
10
|
attribute :authorization_key
|
11
|
-
attribute :
|
11
|
+
attribute :authorization_use_status
|
12
12
|
attribute :provisioning_state
|
13
13
|
attribute :etag
|
14
14
|
attribute :circuit_name
|
15
15
|
|
16
16
|
def self.parse(circuit_authorization)
|
17
|
-
circuit_auth_hash =
|
18
|
-
circuit_auth_hash['id'] = circuit_authorization.id
|
17
|
+
circuit_auth_hash = get_hash_from_object(circuit_authorization)
|
19
18
|
circuit_auth_hash['resource_group'] = get_resource_group_from_id(circuit_authorization.id)
|
20
19
|
circuit_auth_hash['circuit_name'] = get_circuit_name_from_id(circuit_authorization.id)
|
21
|
-
circuit_auth_hash['authorization_key'] = circuit_authorization.authorization_key
|
22
|
-
circuit_auth_hash['authorization_status'] = circuit_authorization.authorization_use_status
|
23
|
-
circuit_auth_hash['provisioning_state'] = circuit_authorization.provisioning_state
|
24
|
-
circuit_auth_hash['name'] = circuit_authorization.name
|
25
|
-
circuit_auth_hash['etag'] = circuit_authorization.etag
|
26
|
-
|
27
20
|
circuit_auth_hash
|
28
21
|
end
|
29
22
|
|
30
23
|
def save
|
31
24
|
requires :name, :resource_group, :circuit_name
|
32
|
-
|
33
|
-
circuit_authorization = service.create_or_update_express_route_circuit_authorization(circuit_authorization_parameters)
|
25
|
+
circuit_authorization = service.create_or_update_express_route_circuit_authorization(express_route_circuit_authorization_params)
|
34
26
|
merge_attributes(ExpressRouteCircuitAuthorization.parse(circuit_authorization))
|
35
27
|
end
|
36
28
|
|
@@ -47,7 +39,7 @@ module Fog
|
|
47
39
|
circuit_name: circuit_name,
|
48
40
|
authorization_name: authorization_name,
|
49
41
|
authorization_key: authorization_key,
|
50
|
-
|
42
|
+
authorization_use_status: authorization_use_status,
|
51
43
|
provisioning_state: provisioning_state,
|
52
44
|
etag: etag
|
53
45
|
}
|
@@ -11,12 +11,8 @@ module Fog
|
|
11
11
|
attribute :circuit_name
|
12
12
|
|
13
13
|
def all
|
14
|
-
requires :resource_group
|
15
|
-
|
16
|
-
circuit_authorizations = []
|
17
|
-
service.list_express_route_circuit_authorizations(resource_group, circuit_name).each do |circuit_authorization|
|
18
|
-
circuit_authorizations << ExpressRouteCircuitAuthorization.parse(circuit_authorization)
|
19
|
-
end
|
14
|
+
requires :resource_group, :circuit_name
|
15
|
+
circuit_authorizations = service.list_express_route_circuit_authorizations(resource_group, circuit_name).map { |circuit_authorization| ExpressRouteCircuitAuthorization.parse(circuit_authorization) }
|
20
16
|
load(circuit_authorizations)
|
21
17
|
end
|
22
18
|
|
@@ -17,30 +17,22 @@ module Fog
|
|
17
17
|
attribute :provisioning_state
|
18
18
|
|
19
19
|
def self.parse(local_network_gateway)
|
20
|
-
local_network_gateway_hash =
|
21
|
-
local_network_gateway_hash['id'] = local_network_gateway.id
|
22
|
-
local_network_gateway_hash['name'] = local_network_gateway.name
|
23
|
-
local_network_gateway_hash['location'] = local_network_gateway.location
|
24
|
-
local_network_gateway_hash['type'] = local_network_gateway.type
|
25
|
-
local_network_gateway_hash['resource_group'] = get_resource_group_from_id(local_network_gateway.id)
|
26
|
-
local_network_gateway_hash['tags'] = local_network_gateway.tags
|
27
|
-
local_network_address_space = local_network_gateway.local_network_address_space
|
28
|
-
local_network_gateway_hash['local_network_address_space_prefixes'] = local_network_address_space.address_prefixes unless local_network_address_space.nil?
|
29
|
-
local_network_gateway_hash['gateway_ip_address'] = local_network_gateway.gateway_ip_address
|
20
|
+
local_network_gateway_hash = get_hash_from_object(local_network_gateway)
|
30
21
|
bgp_settings = local_network_gateway.bgp_settings
|
31
22
|
unless bgp_settings.nil?
|
32
23
|
local_network_gateway_hash['asn'] = bgp_settings.asn
|
33
24
|
local_network_gateway_hash['bgp_peering_address'] = bgp_settings.bgp_peering_address
|
34
25
|
local_network_gateway_hash['peer_weight'] = bgp_settings.peer_weight
|
35
26
|
end
|
36
|
-
|
27
|
+
local_network_address_space = local_network_gateway.local_network_address_space
|
28
|
+
local_network_gateway_hash['local_network_address_space_prefixes'] = local_network_address_space.address_prefixes unless local_network_address_space.nil?
|
29
|
+
local_network_gateway_hash['resource_group'] = get_resource_group_from_id(local_network_gateway.id)
|
37
30
|
local_network_gateway_hash
|
38
31
|
end
|
39
32
|
|
40
33
|
def save
|
41
34
|
requires :name, :location, :resource_group, :local_network_address_space_prefixes, :gateway_ip_address, :asn, :bgp_peering_address, :peer_weight
|
42
|
-
|
43
|
-
local_network_gateway = service.create_or_update_local_network_gateway(local_network_gateway_params)
|
35
|
+
local_network_gateway = service.create_or_update_local_network_gateway(local_network_gateway_parameters)
|
44
36
|
merge_attributes(LocalNetworkGateway.parse(local_network_gateway))
|
45
37
|
end
|
46
38
|
|
@@ -6,15 +6,12 @@ module Fog
|
|
6
6
|
class AzureRM
|
7
7
|
# LocalNetworkGateways collection class for Network Service
|
8
8
|
class LocalNetworkGateways < Fog::Collection
|
9
|
-
model
|
9
|
+
model LocalNetworkGateway
|
10
10
|
attribute :resource_group
|
11
11
|
|
12
12
|
def all
|
13
13
|
requires :resource_group
|
14
|
-
local_network_gateways =
|
15
|
-
service.list_local_network_gateways(resource_group).each do |gateway|
|
16
|
-
local_network_gateways << LocalNetworkGateway.parse(gateway)
|
17
|
-
end
|
14
|
+
local_network_gateways = service.list_local_network_gateways(resource_group).map { |gateway| LocalNetworkGateway.parse(gateway) }
|
18
15
|
load(local_network_gateways)
|
19
16
|
end
|
20
17
|
|
@@ -24,12 +24,7 @@ module Fog
|
|
24
24
|
attribute :provisioning_state
|
25
25
|
|
26
26
|
def self.parse(gateway_connection)
|
27
|
-
connection =
|
28
|
-
connection['id'] = gateway_connection.id
|
29
|
-
connection['name'] = gateway_connection.name
|
30
|
-
connection['location'] = gateway_connection.location
|
31
|
-
connection['resource_group'] = get_resource_group_from_id(gateway_connection.id)
|
32
|
-
connection['tags'] = gateway_connection.tags
|
27
|
+
connection = get_hash_from_object(gateway_connection)
|
33
28
|
|
34
29
|
unless gateway_connection.virtual_network_gateway1.nil?
|
35
30
|
gateway1 = VirtualNetworkGateway.new
|
@@ -40,25 +35,13 @@ module Fog
|
|
40
35
|
gateway2 = VirtualNetworkGateway.new
|
41
36
|
connection['virtual_network_gateway2'] = gateway2.merge_attributes(VirtualNetworkGateway.parse(gateway_connection.virtual_network_gateway2))
|
42
37
|
end
|
43
|
-
|
44
|
-
connection['connection_type'] = gateway_connection.connection_type
|
45
|
-
connection['connection_status'] = gateway_connection.connection_status
|
46
|
-
connection['authorization_key'] = gateway_connection.authorization_key
|
47
|
-
connection['routing_weight'] = gateway_connection.routing_weight
|
48
|
-
connection['shared_key'] = gateway_connection.shared_key
|
49
|
-
connection['egress_bytes_transferred'] = gateway_connection.egress_bytes_transferred
|
50
|
-
connection['ingress_bytes_transferred'] = gateway_connection.ingress_bytes_transferred
|
51
|
-
connection['peer'] = gateway_connection.peer
|
52
|
-
connection['enable_bgp'] = gateway_connection.enable_bgp
|
53
|
-
connection['provisioning_state'] = gateway_connection.provisioning_state
|
54
|
-
|
38
|
+
connection['resource_group'] = get_resource_group_from_id(gateway_connection.id)
|
55
39
|
connection
|
56
40
|
end
|
57
41
|
|
58
42
|
def save
|
59
43
|
requires :name, :location, :resource_group, :connection_type
|
60
|
-
|
61
|
-
gateway_connection = service.create_or_update_virtual_network_gateway_connection(gateway_connection_params)
|
44
|
+
gateway_connection = service.create_or_update_virtual_network_gateway_connection(gateway_connection_parameters)
|
62
45
|
merge_attributes(VirtualNetworkGatewayConnection.parse(gateway_connection))
|
63
46
|
end
|
64
47
|
|
@@ -11,10 +11,7 @@ module Fog
|
|
11
11
|
|
12
12
|
def all
|
13
13
|
requires :resource_group
|
14
|
-
gateway_connections =
|
15
|
-
service.list_virtual_network_gateway_connections(resource_group).each do |connection|
|
16
|
-
gateway_connections << VirtualNetworkGatewayConnection.parse(connection)
|
17
|
-
end
|
14
|
+
gateway_connections = service.list_virtual_network_gateway_connections(resource_group).map { |connection| VirtualNetworkGatewayConnection.parse(connection) }
|
18
15
|
load(gateway_connections)
|
19
16
|
end
|
20
17
|
|