fog-azure-rm 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +17 -0
- data/.gitignore +6 -0
- data/.hound.yml +2 -0
- data/.rubocop.yml +36 -0
- data/.travis.yml +14 -0
- data/CHANGELOG.md +28 -0
- data/CONTRIBUTING.md +2 -0
- data/CONTRIBUTORS.md +2 -0
- data/Gemfile +3 -0
- data/fog-azure-rm.gemspec +34 -0
- data/lib/fog/azurerm.rb +1 -0
- data/lib/fog/azurerm/compute.rb +0 -1
- data/lib/fog/azurerm/config.rb +4 -0
- data/lib/fog/azurerm/credentials.rb +10 -3
- data/lib/fog/azurerm/docs/compute.md +172 -0
- data/lib/fog/azurerm/docs/dns.md +112 -0
- data/lib/fog/azurerm/docs/network.md +794 -0
- data/lib/fog/azurerm/docs/resources.md +155 -0
- data/lib/fog/azurerm/docs/storage.md +222 -0
- data/lib/fog/azurerm/docs/structure.md +53 -0
- data/lib/fog/azurerm/models/compute/server.rb +3 -2
- data/lib/fog/azurerm/models/network/frontend_ip_configuration.rb +5 -1
- data/lib/fog/azurerm/models/network/network_interface.rb +49 -4
- data/lib/fog/azurerm/models/network/network_interfaces.rb +4 -2
- data/lib/fog/azurerm/models/network/network_security_group.rb +27 -4
- data/lib/fog/azurerm/models/network/network_security_groups.rb +4 -2
- data/lib/fog/azurerm/models/network/network_security_rule.rb +1 -1
- data/lib/fog/azurerm/models/network/subnet.rb +26 -6
- data/lib/fog/azurerm/models/network/subnets.rb +4 -2
- data/lib/fog/azurerm/models/network/virtual_network.rb +72 -10
- data/lib/fog/azurerm/models/network/virtual_networks.rb +4 -2
- data/lib/fog/azurerm/models/resources/azure_resource.rb +25 -0
- data/lib/fog/azurerm/models/resources/azure_resources.rb +31 -0
- data/lib/fog/azurerm/models/resources/dependency.rb +27 -0
- data/lib/fog/azurerm/models/resources/deployment.rb +65 -0
- data/lib/fog/azurerm/models/resources/deployments.rb +27 -0
- data/lib/fog/azurerm/models/resources/provider.rb +27 -0
- data/lib/fog/azurerm/models/resources/provider_resource_type.rb +22 -0
- data/lib/fog/azurerm/models/storage/blob.rb +13 -0
- data/lib/fog/azurerm/models/storage/blobs.rb +22 -0
- data/lib/fog/azurerm/models/storage/container.rb +65 -0
- data/lib/fog/azurerm/models/storage/containers.rb +44 -0
- data/lib/fog/azurerm/models/storage/data_disk.rb +26 -0
- data/lib/fog/azurerm/models/storage/storage_account.rb +4 -0
- data/lib/fog/azurerm/network.rb +21 -3
- data/lib/fog/azurerm/requests/network/add_address_prefixes_in_virtual_network.rb +68 -0
- data/lib/fog/azurerm/requests/network/add_dns_servers_in_virtual_network.rb +74 -0
- data/lib/fog/azurerm/requests/network/add_security_rules.rb +152 -0
- data/lib/fog/azurerm/requests/network/add_subnets_in_virtual_network.rb +69 -0
- data/lib/fog/azurerm/requests/network/attach_network_security_group_to_subnet.rb +59 -0
- data/lib/fog/azurerm/requests/network/attach_resource_to_nic.rb +88 -0
- data/lib/fog/azurerm/requests/network/attach_route_table_to_subnet.rb +59 -0
- data/lib/fog/azurerm/requests/network/create_load_balancer.rb +4 -4
- data/lib/fog/azurerm/requests/network/{create_network_interface.rb → create_or_update_network_interface.rb} +14 -13
- data/lib/fog/azurerm/requests/network/{create_network_security_group.rb → create_or_update_network_security_group.rb} +17 -35
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb +116 -0
- data/lib/fog/azurerm/requests/network/create_subnet.rb +28 -14
- data/lib/fog/azurerm/requests/network/detach_network_security_group_from_subnet.rb +53 -0
- data/lib/fog/azurerm/requests/network/detach_resource_from_nic.rb +80 -0
- data/lib/fog/azurerm/requests/network/detach_route_table_from_subnet.rb +53 -0
- data/lib/fog/azurerm/requests/network/get_network_interface.rb +60 -0
- data/lib/fog/azurerm/requests/network/get_network_security_group.rb +161 -0
- data/lib/fog/azurerm/requests/network/get_subnet.rb +36 -0
- data/lib/fog/azurerm/requests/network/get_virtual_network.rb +64 -0
- data/lib/fog/azurerm/requests/network/remove_address_prefixes_from_virtual_network.rb +67 -0
- data/lib/fog/azurerm/requests/network/remove_dns_servers_from_virtual_network.rb +67 -0
- data/lib/fog/azurerm/requests/network/remove_security_rule.rb +155 -0
- data/lib/fog/azurerm/requests/network/remove_subnets_from_virtual_network.rb +57 -0
- data/lib/fog/azurerm/requests/resources/create_deployment.rb +90 -0
- data/lib/fog/azurerm/requests/resources/delete_deployment.rb +28 -0
- data/lib/fog/azurerm/requests/resources/delete_resource_tag.rb +48 -0
- data/lib/fog/azurerm/requests/resources/list_deployments.rb +75 -0
- data/lib/fog/azurerm/requests/resources/list_tagged_resources.rb +46 -0
- data/lib/fog/azurerm/requests/resources/tag_resource.rb +46 -0
- data/lib/fog/azurerm/requests/storage/create_container.rb +37 -0
- data/lib/fog/azurerm/requests/storage/delete_container.rb +26 -0
- data/lib/fog/azurerm/requests/storage/delete_disk.rb +36 -0
- data/lib/fog/azurerm/requests/storage/get_blob_metadata.rb +30 -0
- data/lib/fog/azurerm/requests/storage/get_container_access_control_list.rb +29 -0
- data/lib/fog/azurerm/requests/storage/get_container_metadata.rb +31 -0
- data/lib/fog/azurerm/requests/storage/get_container_properties.rb +36 -0
- data/lib/fog/azurerm/requests/storage/get_storage_access_keys.rb +31 -0
- data/lib/fog/azurerm/requests/storage/list_containers.rb +49 -0
- data/lib/fog/azurerm/requests/storage/list_storage_account_for_rg.rb +0 -1
- data/lib/fog/azurerm/requests/storage/set_blob_metadata.rb +26 -0
- data/lib/fog/azurerm/requests/storage/set_container_metadata.rb +26 -0
- data/lib/fog/azurerm/resources.rb +13 -0
- data/lib/fog/azurerm/storage.rb +46 -6
- data/lib/fog/azurerm/utilities/general.rb +18 -0
- data/lib/fog/azurerm/version.rb +1 -1
- data/rakefile +21 -0
- data/test/api_stub.rb +44 -0
- data/test/api_stub/models/compute/availability_set.rb +21 -0
- data/test/api_stub/models/compute/server.rb +191 -0
- data/test/api_stub/models/dns/record_set.rb +59 -0
- data/test/api_stub/models/dns/zone.rb +47 -0
- data/test/api_stub/models/network/application_gateway.rb +135 -0
- data/test/api_stub/models/network/load_balancer.rb +132 -0
- data/test/api_stub/models/network/network_interface.rb +71 -0
- data/test/api_stub/models/network/network_security_group.rb +94 -0
- data/test/api_stub/models/network/public_ip.rb +35 -0
- data/test/api_stub/models/network/subnet.rb +35 -0
- data/test/api_stub/models/network/traffic_manager_end_point.rb +26 -0
- data/test/api_stub/models/network/traffic_manager_profile.rb +74 -0
- data/test/api_stub/models/network/virtual_network.rb +61 -0
- data/test/api_stub/models/resources/deployment.rb +110 -0
- data/test/api_stub/models/resources/resource.rb +40 -0
- data/test/api_stub/models/resources/resource_group.rb +38 -0
- data/test/api_stub/models/storage/blob.rb +17 -0
- data/test/api_stub/models/storage/container.rb +92 -0
- data/test/api_stub/models/storage/data_disk.rb +30 -0
- data/test/api_stub/models/storage/storageaccount.rb +29 -0
- data/test/api_stub/requests/compute/availability_set.rb +46 -0
- data/test/api_stub/requests/compute/virtual_machine.rb +654 -0
- data/test/api_stub/requests/dns/record_set.rb +105 -0
- data/test/api_stub/requests/dns/zone.rb +67 -0
- data/test/api_stub/requests/network/application_gateway.rb +433 -0
- data/test/api_stub/requests/network/load_balancer.rb +366 -0
- data/test/api_stub/requests/network/network_interface.rb +268 -0
- data/test/api_stub/requests/network/network_security_group.rb +240 -0
- data/test/api_stub/requests/network/public_ip.rb +73 -0
- data/test/api_stub/requests/network/subnet.rb +73 -0
- data/test/api_stub/requests/network/traffic_manager_endpoint.rb +25 -0
- data/test/api_stub/requests/network/traffic_manager_profile.rb +140 -0
- data/test/api_stub/requests/network/virtual_network.rb +127 -0
- data/test/api_stub/requests/resources/deployment.rb +23 -0
- data/test/api_stub/requests/resources/resource.rb +47 -0
- data/test/api_stub/requests/resources/resource_group.rb +53 -0
- data/test/api_stub/requests/storage/blob.rb +24 -0
- data/test/api_stub/requests/storage/container.rb +95 -0
- data/test/api_stub/requests/storage/storageaccount.rb +112 -0
- data/test/integration/README.md +14 -0
- data/test/integration/application_gateway.rb +129 -0
- data/test/integration/availability_set.rb +56 -0
- data/test/integration/container.rb +81 -0
- data/test/integration/credentials/azure.yml +4 -0
- data/test/integration/external_load_balancer.rb +119 -0
- data/test/integration/internal_load_balancer.rb +126 -0
- data/test/integration/network_interface.rb +135 -0
- data/test/integration/network_security_group.rb +104 -0
- data/test/integration/public_ip.rb +63 -0
- data/test/integration/record_set.rb +88 -0
- data/test/integration/server.rb +139 -0
- data/test/integration/storage_account.rb +62 -0
- data/test/integration/subnet.rb +91 -0
- data/test/integration/traffic_manager.rb +81 -0
- data/test/integration/virtual_network.rb +124 -0
- data/test/integration/zone.rb +64 -0
- data/test/models/compute/test_availability_set.rb +53 -0
- data/test/models/compute/test_availability_sets.rb +41 -0
- data/test/models/compute/test_server.rb +143 -0
- data/test/models/compute/test_servers.rb +49 -0
- data/test/models/dns/test_record_set.rb +59 -0
- data/test/models/dns/test_record_sets.rb +51 -0
- data/test/models/dns/test_zone.rb +49 -0
- data/test/models/dns/test_zones.rb +49 -0
- data/test/models/network/test_application_gateway.rb +62 -0
- data/test/models/network/test_application_gateways.rb +42 -0
- data/test/models/network/test_load_balancer.rb +56 -0
- data/test/models/network/test_load_balancers.rb +42 -0
- data/test/models/network/test_network_interface.rb +106 -0
- data/test/models/network/test_network_interfaces.rb +41 -0
- data/test/models/network/test_network_security_group.rb +88 -0
- data/test/models/network/test_network_security_groups.rb +40 -0
- data/test/models/network/test_network_security_rule.rb +30 -0
- data/test/models/network/test_public_ip.rb +58 -0
- data/test/models/network/test_public_ips.rb +55 -0
- data/test/models/network/test_subnet.rb +84 -0
- data/test/models/network/test_subnets.rb +42 -0
- data/test/models/network/test_traffic_manager_end_point.rb +53 -0
- data/test/models/network/test_traffic_manager_end_points.rb +42 -0
- data/test/models/network/test_traffic_manager_profile.rb +54 -0
- data/test/models/network/test_traffic_manager_profiles.rb +41 -0
- data/test/models/network/test_virtual_network.rb +112 -0
- data/test/models/network/test_virtual_networks.rb +54 -0
- data/test/models/resources/test_deployment.rb +54 -0
- data/test/models/resources/test_deployments.rb +37 -0
- data/test/models/resources/test_resource.rb +22 -0
- data/test/models/resources/test_resource_group.rb +43 -0
- data/test/models/resources/test_resource_groups.rb +37 -0
- data/test/models/resources/test_resources.rb +38 -0
- data/test/models/storage/test_blobs.rb +32 -0
- data/test/models/storage/test_container.rb +67 -0
- data/test/models/storage/test_containers.rb +56 -0
- data/test/models/storage/test_data_disk.rb +29 -0
- data/test/models/storage/test_storage_account.rb +62 -0
- data/test/models/storage/test_storage_accounts.rb +65 -0
- data/test/requests/compute/test_attach_data_disk_to_vm.rb +175 -0
- data/test/requests/compute/test_create_availability_set.rb +30 -0
- data/test/requests/compute/test_create_virtual_machine.rb +50 -0
- data/test/requests/compute/test_deallocate_virtual_machine.rb +29 -0
- data/test/requests/compute/test_delete_availability_set.rb +29 -0
- data/test/requests/compute/test_delete_virtual_machine.rb +29 -0
- data/test/requests/compute/test_detach_data_disk_from_vm.rb +53 -0
- data/test/requests/compute/test_generalize_virtual_machine.rb +29 -0
- data/test/requests/compute/test_get_virtual_machine.rb +31 -0
- data/test/requests/compute/test_get_vm_status.rb +31 -0
- data/test/requests/compute/test_list_availability_sets.rb +30 -0
- data/test/requests/compute/test_list_available_sizes_for_virtual_machine.rb +31 -0
- data/test/requests/compute/test_list_virtual_machines.rb +30 -0
- data/test/requests/compute/test_power_off_virtual_machine.rb +29 -0
- data/test/requests/compute/test_redeploy_virtual_machine.rb +29 -0
- data/test/requests/compute/test_restart_virtual_machine.rb +29 -0
- data/test/requests/compute/test_start_virtual_machine.rb +29 -0
- data/test/requests/dns/test_check_for_zone.rb +52 -0
- data/test/requests/dns/test_create_record_set.rb +45 -0
- data/test/requests/dns/test_create_zone.rb +36 -0
- data/test/requests/dns/test_delete_record_set.rb +35 -0
- data/test/requests/dns/test_delete_zone.rb +35 -0
- data/test/requests/dns/test_get_records_from_record_set.rb +55 -0
- data/test/requests/dns/test_list_record_sets.rb +36 -0
- data/test/requests/dns/test_list_zones.rb +40 -0
- data/test/requests/network/test_add_address_prefixes_in_virtual_network.rb +45 -0
- data/test/requests/network/test_add_dns_servers_in_virtual_network.rb +45 -0
- data/test/requests/network/test_add_security_rules.rb +63 -0
- data/test/requests/network/test_add_subnets_in_virtual_network.rb +45 -0
- data/test/requests/network/test_attach_network_security_group_to_subnet.rb +33 -0
- data/test/requests/network/test_attach_resource_to_nic.rb +65 -0
- data/test/requests/network/test_attach_route_table_to_subnet.rb +33 -0
- data/test/requests/network/test_check_for_public_ip.rb +38 -0
- data/test/requests/network/test_check_for_virtual_network.rb +38 -0
- data/test/requests/network/test_create_application_gateway.rb +61 -0
- data/test/requests/network/test_create_load_balancer.rb +56 -0
- data/test/requests/network/test_create_network_interface.rb +54 -0
- data/test/requests/network/test_create_network_security_group.rb +45 -0
- data/test/requests/network/test_create_or_update_virtual_network.rb +63 -0
- data/test/requests/network/test_create_public_ip.rb +44 -0
- data/test/requests/network/test_create_subnet.rb +44 -0
- data/test/requests/network/test_create_traffic_manager_endpoint.rb +32 -0
- data/test/requests/network/test_create_traffic_manager_profile.rb +32 -0
- data/test/requests/network/test_delete_application_gateway.rb +30 -0
- data/test/requests/network/test_delete_load_balancer.rb +30 -0
- data/test/requests/network/test_delete_network_interface.rb +30 -0
- data/test/requests/network/test_delete_network_security_group.rb +32 -0
- data/test/requests/network/test_delete_public_ip.rb +30 -0
- data/test/requests/network/test_delete_subnet.rb +30 -0
- data/test/requests/network/test_delete_traffic_manager_endpoint.rb +28 -0
- data/test/requests/network/test_delete_traffic_manager_profile.rb +28 -0
- data/test/requests/network/test_delete_virtual_network.rb +30 -0
- data/test/requests/network/test_detach_network_security_group_from_subnet.rb +33 -0
- data/test/requests/network/test_detach_resource_from_nic.rb +60 -0
- data/test/requests/network/test_detach_route_table_from_subnet.rb +33 -0
- data/test/requests/network/test_get_network_interface.rb +31 -0
- data/test/requests/network/test_get_network_security_group.rb +33 -0
- data/test/requests/network/test_get_subnet.rb +33 -0
- data/test/requests/network/test_get_traffic_manager_profile.rb +29 -0
- data/test/requests/network/test_list_application_gateways.rb +31 -0
- data/test/requests/network/test_list_load_balancers.rb +31 -0
- data/test/requests/network/test_list_network_interfaces.rb +31 -0
- data/test/requests/network/test_list_network_security_groups.rb +33 -0
- data/test/requests/network/test_list_public_ips.rb +31 -0
- data/test/requests/network/test_list_subnets.rb +31 -0
- data/test/requests/network/test_list_traffic_manager_profiles.rb +29 -0
- data/test/requests/network/test_list_virtual_networks.rb +31 -0
- data/test/requests/network/test_remove_address_prefixes_from_virtual_network.rb +45 -0
- data/test/requests/network/test_remove_dns_servers_from_virtual_network.rb +45 -0
- data/test/requests/network/test_remove_security_rule.rb +49 -0
- data/test/requests/network/test_remove_subnets_from_virtual_network.rb +45 -0
- data/test/requests/resources/test_create_deployment.rb +49 -0
- data/test/requests/resources/test_create_resource_group.rb +31 -0
- data/test/requests/resources/test_delete_deployment.rb +31 -0
- data/test/requests/resources/test_delete_resource_group.rb +30 -0
- data/test/requests/resources/test_delete_resource_tag.rb +51 -0
- data/test/requests/resources/test_list_deployments.rb +32 -0
- data/test/requests/resources/test_list_resource_groups.rb +31 -0
- data/test/requests/resources/test_list_tagged_resources.rb +31 -0
- data/test/requests/resources/test_tag_resource.rb +51 -0
- data/test/requests/storage/test_check_storage_account_name_availability.rb +59 -0
- data/test/requests/storage/test_create_container.rb +31 -0
- data/test/requests/storage/test_create_storage_account.rb +56 -0
- data/test/requests/storage/test_delete_container.rb +30 -0
- data/test/requests/storage/test_delete_storage_account.rb +34 -0
- data/test/requests/storage/test_get_blob_metadata.rb +18 -0
- data/test/requests/storage/test_get_container_access_control_list.rb +31 -0
- data/test/requests/storage/test_get_container_metadata.rb +18 -0
- data/test/requests/storage/test_get_container_properties.rb +31 -0
- data/test/requests/storage/test_get_storage_access_keys.rb +31 -0
- data/test/requests/storage/test_list_containers.rb +23 -0
- data/test/requests/storage/test_list_storage_accounts.rb +47 -0
- data/test/requests/storage/test_list_storage_accounts_for_rg.rb +51 -0
- data/test/requests/storage/test_set_blob_metadata.rb +17 -0
- data/test/requests/storage/test_set_container_metadata.rb +17 -0
- data/test/test_credentials.rb +39 -0
- data/test/test_helper.rb +428 -0
- metadata +273 -14
- data/lib/fog/azurerm/models/compute/data_disk.rb +0 -26
- data/lib/fog/azurerm/requests/network/create_virtual_network.rb +0 -115
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e1533bcbd71b04e12dacfd7833aafb1883ffeb7
|
4
|
+
data.tar.gz: 563922c138a209f6567d3cf014e7036be24fbf4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8a8cd51ec379e4923629435949b4fafa30931229689d4095b280413f8cde7ca092323f0b2fce510844a019cde95d810c6c780508b3d5e5538cba052203b69a1
|
7
|
+
data.tar.gz: 00ddbbe007b7a89a9f8db4c9f4c06f9b9f5e1536b15d79c2d3c85ebd193547ac434bd7d34ffa83434d5d1839aaf5ed9d10316d1061cf5cdf84521c464b2c6eb2
|
data/.codeclimate.yml
ADDED
data/.gitignore
ADDED
data/.hound.yml
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Custom Enforced Rubocop Styles
|
2
|
+
|
3
|
+
LineLength:
|
4
|
+
Enabled: false
|
5
|
+
MethodLength:
|
6
|
+
Enabled: false
|
7
|
+
ClassLength:
|
8
|
+
Enabled: false
|
9
|
+
SignalException:
|
10
|
+
Enabled: false
|
11
|
+
RaiseArgs:
|
12
|
+
Enabled: false
|
13
|
+
ParameterLists:
|
14
|
+
Enabled: false
|
15
|
+
AbcSize:
|
16
|
+
Enabled: false
|
17
|
+
RedundantBegin:
|
18
|
+
Enabled: false
|
19
|
+
PerceivedComplexity:
|
20
|
+
Enabled: false
|
21
|
+
CyclomaticComplexity:
|
22
|
+
Enabled: false
|
23
|
+
RescueException:
|
24
|
+
Enabled: false
|
25
|
+
NestedParenthesizedCalls:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
# Custom Enforced Hound Ruby Styles
|
29
|
+
|
30
|
+
CollectionMethods:
|
31
|
+
PreferredMethods:
|
32
|
+
detect: find
|
33
|
+
StringLiterals:
|
34
|
+
EnforcedStyle: single_quotes
|
35
|
+
SignalException:
|
36
|
+
EnforcedStyle: only_raise
|
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
## 0.0.4
|
2
|
+
|
3
|
+
**Added:**
|
4
|
+
- Storage Service - Added Support Azure container operations
|
5
|
+
- Storage Service - Added blob container metadata support
|
6
|
+
- Storage Service - Added support for Get Storage Access keys for Storage Account
|
7
|
+
- Network Service - Added support for updation methods for Virtual Network
|
8
|
+
- Network Service - Added support for updation methods for Network Security Group
|
9
|
+
- Network Service - Added support for updation methods for Subnet
|
10
|
+
- Network Service - Added Support for Internal Load Balancer
|
11
|
+
- Resources Service - Added Azure Resource Manager Template feature
|
12
|
+
- Resources Service - Added tag azure resources support
|
13
|
+
- Tests - Added Integration test scripts for all services
|
14
|
+
- Documentation - Added Readme for integration tests
|
15
|
+
- Documentation - Added fog structure information
|
16
|
+
- Code Climate - Added Ratings
|
17
|
+
|
18
|
+
**Changed:**
|
19
|
+
- Compute Service - Moved Data Disk model to Storage service
|
20
|
+
- Network Service - Improved Subnet and Virtual Network module
|
21
|
+
- Storage Service - Code standardization
|
22
|
+
- Documentation - Changed delete_data_disk request name to delete_disk
|
23
|
+
- Code Climate - Disabled similar and identical code check
|
24
|
+
|
25
|
+
**Fixed:**
|
26
|
+
- Resolved bugs in server.rb integration file
|
27
|
+
|
28
|
+
|
1
29
|
## 0.0.3
|
2
30
|
|
3
31
|
**Added:**
|
data/CONTRIBUTING.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
New contributors are always welcome, when it doubt please ask questions. We strive to be an open and welcoming community. Please be nice to one another.
|
4
4
|
|
5
|
+
For structure information of fog click [here](https://github.com/fog/fog-azure-rm/blob/master/lib/fog/azurerm/docs/structure.md)
|
6
|
+
|
5
7
|
### Coding
|
6
8
|
|
7
9
|
* Pick a task:
|
data/CONTRIBUTORS.md
CHANGED
data/Gemfile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'fog/azurerm/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'fog-azure-rm'
|
7
|
+
spec.version = Fog::AzureRM::VERSION
|
8
|
+
spec.authors = ['Shaffan Chaudhry', 'Samawia Moin', 'Adnan Khalil', 'Zeeshan Arshad', 'Haider Ali']
|
9
|
+
spec.summary = "Module for the 'fog' gem to support Azure Resource Manager cloud services."
|
10
|
+
spec.description = "This library can be used as a module for 'fog' or as standalone provider
|
11
|
+
to use the Azure Resource Manager cloud services in applications.."
|
12
|
+
spec.files = `git ls-files`.split("\n")
|
13
|
+
spec.test_files = `git ls-files -- {spec,tests}/*`.split("\n")
|
14
|
+
spec.require_paths = %w[lib]
|
15
|
+
spec.license = 'MIT'
|
16
|
+
spec.homepage = 'https://github.com/fog/fog-azure-rm'
|
17
|
+
spec.rdoc_options = %w[--charset=UTF-8]
|
18
|
+
spec.extra_rdoc_files = %w[README.md]
|
19
|
+
spec.required_ruby_version = '>= 2.0.0'
|
20
|
+
spec.post_install_message = 'Thanks for installing!'
|
21
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
22
|
+
spec.add_development_dependency 'minitest', '~> 5.8.4'
|
23
|
+
spec.add_development_dependency 'simplecov', '~> 0.11.2'
|
24
|
+
spec.add_development_dependency 'codeclimate-test-reporter'
|
25
|
+
spec.add_dependency 'fog-core', '~> 1.27'
|
26
|
+
spec.add_dependency 'fog-json', '~> 1.0'
|
27
|
+
spec.add_dependency 'fog-xml', '~> 0.1'
|
28
|
+
spec.add_dependency 'rest-client', '~> 1.8'
|
29
|
+
spec.add_dependency 'azure_mgmt_compute', '~> 0.2.1'
|
30
|
+
spec.add_dependency 'azure_mgmt_resources', '~> 0.2.1'
|
31
|
+
spec.add_dependency 'azure_mgmt_storage', '~> 0.2.1'
|
32
|
+
spec.add_dependency 'azure_mgmt_network', '~> 0.2.1'
|
33
|
+
spec.add_dependency 'azure-storage', '~> 0.10.2.preview'
|
34
|
+
end
|
data/lib/fog/azurerm.rb
CHANGED
data/lib/fog/azurerm/compute.rb
CHANGED
data/lib/fog/azurerm/config.rb
CHANGED
@@ -3,7 +3,7 @@ module Fog
|
|
3
3
|
# This class is managing credentials token
|
4
4
|
class AzureRM
|
5
5
|
def self.get_credentials(tenant_id, client_id, client_secret)
|
6
|
-
if @credentials.nil? ||
|
6
|
+
if @credentials.nil? || new_management_credential?(tenant_id, client_id, client_secret)
|
7
7
|
get_new_credentials(tenant_id, client_id, client_secret)
|
8
8
|
else
|
9
9
|
@credentials
|
@@ -19,19 +19,26 @@ module Fog
|
|
19
19
|
@tenant_id = tenant_id
|
20
20
|
@client_id = client_id
|
21
21
|
@client_secret = client_secret
|
22
|
+
return if @tenant_id.nil? || @client_id.nil? || @client_secret.nil?
|
22
23
|
@token_provider = MsRestAzure::ApplicationTokenProvider.new(@tenant_id, @client_id, @client_secret)
|
23
24
|
@credentials = MsRest::TokenCredentials.new(@token_provider)
|
24
25
|
@credentials
|
25
26
|
end
|
26
27
|
|
27
|
-
def self.
|
28
|
+
def self.new_management_credential?(tenant_id, client_id, client_secret)
|
28
29
|
@tenant_id != tenant_id ||
|
29
30
|
@client_id != client_id ||
|
30
31
|
@client_secret != client_secret
|
31
32
|
end
|
32
33
|
|
34
|
+
def self.new_account_credential?(options = {})
|
35
|
+
@account_name != options[:azure_storage_account_name] ||
|
36
|
+
@account_key != options[:azure_storage_access_key] ||
|
37
|
+
@connection_string != options[:azure_storage_connection_string]
|
38
|
+
end
|
39
|
+
|
33
40
|
private_class_method :get_new_credentials
|
34
|
-
private_class_method :
|
41
|
+
private_class_method :new_management_credential?
|
35
42
|
end
|
36
43
|
end
|
37
44
|
end
|
@@ -0,0 +1,172 @@
|
|
1
|
+
# Compute
|
2
|
+
|
3
|
+
This document explains how to get started using Azure Compute Service with Fog. With this gem you can create/update/list/delete availability sets and virtual machines.
|
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 Compute Service:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
azure_compute_service = Fog::Compute.new(
|
19
|
+
provider: 'AzureRM',
|
20
|
+
tenant_id: '<Tenantid>', # Tenant id of Azure Active Directory Application
|
21
|
+
client_id: '<Clientid>', # Client id of Azure Active Directory Application
|
22
|
+
client_secret: '<ClientSecret>', # Client Secret of Azure Active Directory Application
|
23
|
+
subscription_id: '<Subscriptionid>' # Subscription id of an Azure Account
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
27
|
+
## Create Server
|
28
|
+
|
29
|
+
Create a new linux server
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
azure_compute_service.servers.create(
|
33
|
+
name: '<VM Name>',
|
34
|
+
location: 'West US',
|
35
|
+
resource_group: '<Resource Group Name>',
|
36
|
+
vm_size: 'Basic_A0',
|
37
|
+
storage_account_name: '<Storage Account Name>',
|
38
|
+
username: '<Username for VM>',
|
39
|
+
password: '<Password for VM>',
|
40
|
+
disable_password_authentication: false,
|
41
|
+
network_interface_card_id: '/subscriptions/{Subscription-Id}/resourceGroups/{Resource-Group-Name}/providers/Microsoft.Network/networkInterfaces/{Network-Interface-Id}',
|
42
|
+
publisher: 'Canonical',
|
43
|
+
offer: 'UbuntuServer',
|
44
|
+
sku: '14.04.2-LTS',
|
45
|
+
version: 'latest',
|
46
|
+
platform: 'Linux'
|
47
|
+
)
|
48
|
+
```
|
49
|
+
Create a new windows server
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
azure_compute_service.servers.create(
|
53
|
+
name: '<VM Name>',
|
54
|
+
location: 'West US',
|
55
|
+
resource_group: '<Resource Group Name>',
|
56
|
+
vm_size: 'Basic_A0',
|
57
|
+
storage_account_name: '<Storage Account Name>',
|
58
|
+
username: '<Username for VM>',
|
59
|
+
password: '<Password for VM>',
|
60
|
+
disable_password_authentication: false,
|
61
|
+
network_interface_card_id: '/subscriptions/{Subscription-Id}/resourceGroups/{Resource-Group-Name}/providers/Microsoft.Network/networkInterfaces/{Network-Interface-Id}',
|
62
|
+
publisher: 'MicrosoftWindowsServerEssentials',
|
63
|
+
offer: 'WindowsServerEssentials',
|
64
|
+
sku: 'WindowsServerEssentials',
|
65
|
+
version: 'latest',
|
66
|
+
platform: 'Windows'
|
67
|
+
)
|
68
|
+
```
|
69
|
+
|
70
|
+
## List Servers
|
71
|
+
|
72
|
+
List servers in a resource group
|
73
|
+
|
74
|
+
```ruby
|
75
|
+
servers = azure_compute_service.servers(resource_group: '<Resource Group name>')
|
76
|
+
servers.each do |server|
|
77
|
+
puts "#{server.name}"
|
78
|
+
puts "#{server.location}"
|
79
|
+
end
|
80
|
+
```
|
81
|
+
|
82
|
+
## Retrieve a single Server
|
83
|
+
|
84
|
+
Get a single record of Server
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
server = azure_compute_service
|
88
|
+
.servers(resource_group: '<Resource Group name>')
|
89
|
+
.get('Server name>')
|
90
|
+
puts "#{server.name}"
|
91
|
+
```
|
92
|
+
|
93
|
+
## Attach a Data Disk to Server
|
94
|
+
|
95
|
+
Get the server object and attach a Data Disk to it.
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
server.attach_data_disk('<Disk Name>', <Size in GB>, '<Storage Account Name>)
|
99
|
+
```
|
100
|
+
|
101
|
+
## Detach a Data Disk from Server
|
102
|
+
|
103
|
+
Get the server object and detach a Data Disk from it.
|
104
|
+
|
105
|
+
```ruby
|
106
|
+
server.detach_data_disk('<Disk Name>')
|
107
|
+
```
|
108
|
+
|
109
|
+
## Get a Server's status
|
110
|
+
|
111
|
+
Check the status of a Server
|
112
|
+
|
113
|
+
```ruby
|
114
|
+
status = azure_compute_service
|
115
|
+
.servers(resource_group: '<Resource Group name>')
|
116
|
+
.get('<Server name>')
|
117
|
+
.vm_status
|
118
|
+
puts status
|
119
|
+
```
|
120
|
+
|
121
|
+
## Destroy a single Server
|
122
|
+
|
123
|
+
Get a server object from the get method(described above) and then destroy that server.
|
124
|
+
|
125
|
+
```ruby
|
126
|
+
server.destroy
|
127
|
+
```
|
128
|
+
|
129
|
+
## Create Availability Set
|
130
|
+
|
131
|
+
Create a new availability set
|
132
|
+
|
133
|
+
```ruby
|
134
|
+
azure_compute_service.availability_sets.create(
|
135
|
+
name: '<Availability Set name>',
|
136
|
+
location: 'West US',
|
137
|
+
resource_group: '<Resource Group name>'
|
138
|
+
)
|
139
|
+
```
|
140
|
+
## List Availability Sets
|
141
|
+
|
142
|
+
List availability sets in a resource group
|
143
|
+
|
144
|
+
```ruby
|
145
|
+
availability_sets = azure_compute_service.availability_sets(resource_group: '<Resource Group name>')
|
146
|
+
availability_sets.each do |availability_set|
|
147
|
+
puts "#{availability_set.name}"
|
148
|
+
puts "#{availability_set.location}"
|
149
|
+
end
|
150
|
+
```
|
151
|
+
|
152
|
+
## Retrieve a single Availability Set
|
153
|
+
|
154
|
+
Get a single record of Availability Set
|
155
|
+
|
156
|
+
```ruby
|
157
|
+
availability_set = azure_compute_service
|
158
|
+
.availability_sets(resource_group: '<Resource Group name>')
|
159
|
+
.get('<Resource Group name>','<Availability Set name>')
|
160
|
+
puts "#{availability_set.name}"
|
161
|
+
```
|
162
|
+
|
163
|
+
## Destroy a single Availability Set
|
164
|
+
|
165
|
+
Get an availability set object from the get method and then destroy that availability set.
|
166
|
+
|
167
|
+
```ruby
|
168
|
+
availability_set.destroy
|
169
|
+
```
|
170
|
+
|
171
|
+
## Support and Feedback
|
172
|
+
Your feedback is appreciated! If you have specific issues with the fog ARM, you should file an issue via Github.
|
@@ -0,0 +1,112 @@
|
|
1
|
+
#DNS
|
2
|
+
|
3
|
+
This document explains how to get started using Azure DNS Service 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 DNS Service:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
azure_dns_service = Fog::DNS::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
|
+
## Create Zone
|
26
|
+
|
27
|
+
Create a new Zone
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
azure_dns_service.zones.create(
|
31
|
+
name: '<Zone name>',
|
32
|
+
resource_group: '<Resource Group name>'
|
33
|
+
)
|
34
|
+
```
|
35
|
+
## List Zones
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
azure_dns_service.zones.each do |zone|
|
39
|
+
puts "#{zone.name}"
|
40
|
+
puts "#{zone.resource_group}"
|
41
|
+
end
|
42
|
+
```
|
43
|
+
|
44
|
+
## Retrieve a single Zone
|
45
|
+
|
46
|
+
Get a single record of Zone
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
zone = azure_dns_service
|
50
|
+
.zones
|
51
|
+
.get('<Zone name>', '<Resource Group name>')
|
52
|
+
puts "#{zone.name}"
|
53
|
+
```
|
54
|
+
|
55
|
+
## Destroy a single Zone
|
56
|
+
|
57
|
+
Get Zone object from the get method(described above) and then destroy that Zone.
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
zone.destroy
|
61
|
+
```
|
62
|
+
|
63
|
+
## Create Record Set
|
64
|
+
|
65
|
+
Create a new Record Set
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
azure_dns_service.record_sets.create(
|
69
|
+
name: '<Record Set name>',
|
70
|
+
resource_group: '<Resource Group name>',
|
71
|
+
zone_name: '<Zone Name>',
|
72
|
+
records: <String array of Records>,
|
73
|
+
type: '<Record Type(A/CNAME)>',
|
74
|
+
ttl: <Time to live(Integer)>
|
75
|
+
)
|
76
|
+
```
|
77
|
+
## List Record Sets
|
78
|
+
|
79
|
+
```ruby
|
80
|
+
azure_dns_service.record_sets(
|
81
|
+
resource_group: '<Resource Group Name>',
|
82
|
+
zone_name: '<Zone Name>'
|
83
|
+
).each do |record_set|
|
84
|
+
puts "#{record_set.name}"
|
85
|
+
puts "#{record_set.resource_group}"
|
86
|
+
end
|
87
|
+
```
|
88
|
+
|
89
|
+
## Retrieve a single Record Set
|
90
|
+
|
91
|
+
Get a single record of Record Set
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
record_set = azure_dns_service
|
95
|
+
.record_sets(
|
96
|
+
resource_group: '<Resource Group Name>',
|
97
|
+
zone_name: '<Zone Name>'
|
98
|
+
)
|
99
|
+
.get('<Record Set name>', '<Record Type>')
|
100
|
+
puts "#{record_set.name}"
|
101
|
+
```
|
102
|
+
|
103
|
+
## Destroy a single Record Set
|
104
|
+
|
105
|
+
Get Record Set object from the get method(described above) and then destroy that Record Set.
|
106
|
+
|
107
|
+
```ruby
|
108
|
+
record_set.destroy
|
109
|
+
```
|
110
|
+
|
111
|
+
## Support and Feedback
|
112
|
+
Your feedback is appreciated! If you have specific issues with the fog ARM, you should file an issue via Github.
|