fog-azure-rm 0.1.1 → 0.1.2
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 -17
- data/.gitignore +6 -6
- data/.hound.yml +2 -2
- data/.rubocop.yml +37 -37
- data/.travis.yml +33 -33
- data/CHANGELOG.md +197 -178
- data/CONTRIBUTING.md +40 -40
- data/CONTRIBUTORS.md +8 -8
- data/Gemfile +3 -3
- data/LICENSE.md +20 -20
- data/README.md +97 -97
- data/fog-azure-rm.gemspec +36 -36
- data/lib/fog/azurerm.rb +68 -68
- data/lib/fog/azurerm/application_gateway.rb +67 -67
- data/lib/fog/azurerm/compute.rb +74 -74
- data/lib/fog/azurerm/config.rb +52 -55
- data/lib/fog/azurerm/credentials.rb +40 -44
- data/lib/fog/azurerm/dns.rb +60 -60
- data/lib/fog/azurerm/docs/application_gateway.md +209 -209
- data/lib/fog/azurerm/docs/compute.md +231 -231
- data/lib/fog/azurerm/docs/dns.md +134 -134
- data/lib/fog/azurerm/docs/network.md +1040 -1040
- data/lib/fog/azurerm/docs/resources.md +155 -155
- data/lib/fog/azurerm/docs/sql.md +169 -169
- data/lib/fog/azurerm/docs/storage.md +450 -447
- data/lib/fog/azurerm/docs/structure.md +53 -53
- data/lib/fog/azurerm/docs/traffic_manager.md +141 -141
- data/lib/fog/azurerm/models/application_gateway/backend_address_pool.rb +22 -22
- data/lib/fog/azurerm/models/application_gateway/backend_http_setting.rb +26 -26
- data/lib/fog/azurerm/models/application_gateway/frontend_ip_configuration.rb +22 -22
- data/lib/fog/azurerm/models/application_gateway/frontend_port.rb +18 -18
- data/lib/fog/azurerm/models/application_gateway/gateway.rb +617 -617
- data/lib/fog/azurerm/models/application_gateway/gateways.rb +26 -26
- data/lib/fog/azurerm/models/application_gateway/http_listener.rb +28 -28
- data/lib/fog/azurerm/models/application_gateway/ip_configuration.rb +23 -23
- data/lib/fog/azurerm/models/application_gateway/probe.rb +28 -28
- data/lib/fog/azurerm/models/application_gateway/request_routing_rule.rb +25 -25
- data/lib/fog/azurerm/models/application_gateway/ssl_certificate.rb +22 -22
- data/lib/fog/azurerm/models/application_gateway/url_path_map.rb +28 -28
- data/lib/fog/azurerm/models/compute/availability_set.rb +43 -43
- data/lib/fog/azurerm/models/compute/availability_sets.rb +31 -31
- data/lib/fog/azurerm/models/compute/server.rb +157 -157
- data/lib/fog/azurerm/models/compute/servers.rb +27 -27
- data/lib/fog/azurerm/models/compute/virtual_machine_extension.rb +76 -76
- data/lib/fog/azurerm/models/compute/virtual_machine_extensions.rb +27 -27
- data/lib/fog/azurerm/models/dns/record_set.rb +91 -91
- data/lib/fog/azurerm/models/dns/record_sets.rb +30 -30
- data/lib/fog/azurerm/models/dns/zone.rb +58 -58
- data/lib/fog/azurerm/models/dns/zones.rb +29 -29
- data/lib/fog/azurerm/models/network/express_route_circuit.rb +86 -86
- data/lib/fog/azurerm/models/network/express_route_circuit_authorization.rb +50 -50
- data/lib/fog/azurerm/models/network/express_route_circuit_authorizations.rb +24 -24
- data/lib/fog/azurerm/models/network/express_route_circuit_peering.rb +91 -91
- data/lib/fog/azurerm/models/network/express_route_circuit_peerings.rb +27 -27
- data/lib/fog/azurerm/models/network/express_route_circuits.rb +26 -26
- data/lib/fog/azurerm/models/network/express_route_service_provider.rb +29 -29
- data/lib/fog/azurerm/models/network/express_route_service_providers.rb +18 -18
- data/lib/fog/azurerm/models/network/local_network_gateway.rb +60 -60
- data/lib/fog/azurerm/models/network/local_network_gateways.rb +23 -23
- data/lib/fog/azurerm/models/network/network_interface.rb +119 -119
- data/lib/fog/azurerm/models/network/network_interfaces.rb +26 -26
- data/lib/fog/azurerm/models/network/network_security_group.rb +112 -112
- data/lib/fog/azurerm/models/network/network_security_groups.rb +26 -26
- data/lib/fog/azurerm/models/network/network_security_rule.rb +66 -66
- data/lib/fog/azurerm/models/network/network_security_rules.rb +27 -27
- data/lib/fog/azurerm/models/network/path_rule.rb +30 -30
- data/lib/fog/azurerm/models/network/public_ip.rb +68 -68
- data/lib/fog/azurerm/models/network/public_ips.rb +37 -37
- data/lib/fog/azurerm/models/network/subnet.rb +66 -66
- data/lib/fog/azurerm/models/network/subnets.rb +27 -27
- data/lib/fog/azurerm/models/network/virtual_network.rb +107 -107
- data/lib/fog/azurerm/models/network/virtual_network_gateway.rb +137 -137
- data/lib/fog/azurerm/models/network/virtual_network_gateway_connection.rb +76 -76
- data/lib/fog/azurerm/models/network/virtual_network_gateway_connections.rb +23 -23
- data/lib/fog/azurerm/models/network/virtual_network_gateways.rb +26 -26
- data/lib/fog/azurerm/models/network/virtual_networks.rb +38 -38
- data/lib/fog/azurerm/models/network/vpn_client_configuration.rb +34 -34
- data/lib/fog/azurerm/models/network/vpn_client_revoked_certificates.rb +22 -22
- data/lib/fog/azurerm/models/network/vpn_client_root_certificates.rb +22 -22
- data/lib/fog/azurerm/models/resources/dependency.rb +27 -27
- data/lib/fog/azurerm/models/resources/deployment.rb +65 -65
- data/lib/fog/azurerm/models/resources/deployments.rb +26 -26
- data/lib/fog/azurerm/models/resources/provider.rb +27 -27
- data/lib/fog/azurerm/models/resources/provider_resource_type.rb +22 -22
- data/lib/fog/azurerm/models/resources/resource_group.rb +32 -32
- data/lib/fog/azurerm/models/resources/resource_groups.rb +25 -25
- data/lib/fog/azurerm/models/sql/firewall_rule.rb +60 -52
- data/lib/fog/azurerm/models/sql/firewall_rules.rb +28 -28
- data/lib/fog/azurerm/models/sql/sql_database.rb +84 -93
- data/lib/fog/azurerm/models/sql/sql_databases.rb +28 -28
- data/lib/fog/azurerm/models/sql/sql_server.rb +62 -57
- data/lib/fog/azurerm/models/sql/sql_servers.rb +27 -27
- data/lib/fog/azurerm/models/storage/data_disk.rb +27 -27
- data/lib/fog/azurerm/models/storage/directories.rb +66 -66
- data/lib/fog/azurerm/models/storage/directory.rb +151 -151
- data/lib/fog/azurerm/models/storage/file.rb +263 -263
- data/lib/fog/azurerm/models/storage/files.rb +183 -183
- data/lib/fog/azurerm/models/storage/recovery_vault.rb +50 -50
- data/lib/fog/azurerm/models/storage/recovery_vaults.rb +27 -27
- data/lib/fog/azurerm/models/storage/storage_account.rb +89 -89
- data/lib/fog/azurerm/models/storage/storage_accounts.rb +39 -39
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_end_point.rb +82 -82
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_end_points.rb +26 -26
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +86 -86
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profiles.rb +23 -23
- data/lib/fog/azurerm/network.rb +160 -160
- data/lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb +295 -295
- data/lib/fog/azurerm/requests/application_gateway/delete_application_gateway.rb +26 -26
- data/lib/fog/azurerm/requests/application_gateway/get_application_gateway.rb +159 -159
- data/lib/fog/azurerm/requests/application_gateway/list_application_gateways.rb +29 -29
- data/lib/fog/azurerm/requests/application_gateway/start_application_gateway.rb +27 -27
- data/lib/fog/azurerm/requests/application_gateway/stop_application_gateway.rb +27 -27
- data/lib/fog/azurerm/requests/application_gateway/update_sku_attributes.rb +28 -28
- data/lib/fog/azurerm/requests/application_gateway/update_subnet_id_in_gateway_ip_configuration.rb +29 -29
- data/lib/fog/azurerm/requests/compute/attach_data_disk_to_vm.rb +160 -160
- data/lib/fog/azurerm/requests/compute/create_availability_set.rb +48 -48
- data/lib/fog/azurerm/requests/compute/create_or_update_vm_extension.rb +63 -63
- data/lib/fog/azurerm/requests/compute/create_virtual_machine.rb +234 -234
- data/lib/fog/azurerm/requests/compute/deallocate_virtual_machine.rb +27 -27
- data/lib/fog/azurerm/requests/compute/delete_availability_set.rb +27 -27
- data/lib/fog/azurerm/requests/compute/delete_virtual_machine.rb +27 -27
- data/lib/fog/azurerm/requests/compute/delete_vm_extension.rb +28 -28
- data/lib/fog/azurerm/requests/compute/detach_data_disk_from_vm.rb +95 -95
- data/lib/fog/azurerm/requests/compute/generalize_virtual_machine.rb +27 -27
- data/lib/fog/azurerm/requests/compute/get_availability_set.rb +32 -32
- data/lib/fog/azurerm/requests/compute/get_virtual_machine.rb +82 -82
- data/lib/fog/azurerm/requests/compute/get_vm_extension.rb +46 -46
- data/lib/fog/azurerm/requests/compute/list_availability_sets.rb +40 -40
- data/lib/fog/azurerm/requests/compute/list_available_sizes_for_virtual_machine.rb +56 -56
- data/lib/fog/azurerm/requests/compute/list_virtual_machines.rb +69 -69
- data/lib/fog/azurerm/requests/compute/power_off_virtual_machine.rb +27 -27
- data/lib/fog/azurerm/requests/compute/redeploy_virtual_machine.rb +27 -27
- data/lib/fog/azurerm/requests/compute/restart_virtual_machine.rb +27 -27
- data/lib/fog/azurerm/requests/compute/start_virtual_machine.rb +27 -27
- data/lib/fog/azurerm/requests/dns/check_for_zone.rb +27 -27
- data/lib/fog/azurerm/requests/dns/create_or_update_record_set.rb +71 -71
- data/lib/fog/azurerm/requests/dns/create_or_update_zone.rb +57 -57
- data/lib/fog/azurerm/requests/dns/delete_record_set.rb +28 -28
- data/lib/fog/azurerm/requests/dns/delete_zone.rb +28 -28
- data/lib/fog/azurerm/requests/dns/get_record_set.rb +47 -47
- data/lib/fog/azurerm/requests/dns/get_records_from_record_set.rb +32 -32
- data/lib/fog/azurerm/requests/dns/get_zone.rb +41 -41
- data/lib/fog/azurerm/requests/dns/list_record_sets.rb +63 -63
- data/lib/fog/azurerm/requests/dns/list_zones.rb +72 -72
- data/lib/fog/azurerm/requests/network/add_address_prefixes_in_virtual_network.rb +68 -68
- data/lib/fog/azurerm/requests/network/add_dns_servers_in_virtual_network.rb +76 -76
- data/lib/fog/azurerm/requests/network/add_subnets_in_virtual_network.rb +71 -71
- data/lib/fog/azurerm/requests/network/attach_network_security_group_to_subnet.rb +57 -57
- data/lib/fog/azurerm/requests/network/attach_route_table_to_subnet.rb +57 -57
- data/lib/fog/azurerm/requests/network/check_for_public_ip.rb +26 -26
- data/lib/fog/azurerm/requests/network/check_for_virtual_network.rb +28 -28
- data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit.rb +111 -111
- data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit_authorization.rb +51 -51
- data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit_peering.rb +79 -79
- data/lib/fog/azurerm/requests/network/create_or_update_local_network_gateway.rb +80 -80
- data/lib/fog/azurerm/requests/network/create_or_update_network_interface.rb +94 -94
- data/lib/fog/azurerm/requests/network/create_or_update_network_security_group.rb +177 -177
- data/lib/fog/azurerm/requests/network/create_or_update_network_security_rule.rb +59 -59
- data/lib/fog/azurerm/requests/network/create_or_update_public_ip.rb +59 -59
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb +110 -110
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway.rb +159 -159
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway_connection.rb +83 -83
- data/lib/fog/azurerm/requests/network/create_subnet.rb +54 -54
- data/lib/fog/azurerm/requests/network/delete_express_route_circuit.rb +28 -28
- data/lib/fog/azurerm/requests/network/delete_express_route_circuit_authorization.rb +29 -29
- data/lib/fog/azurerm/requests/network/delete_express_route_circuit_peering.rb +28 -28
- data/lib/fog/azurerm/requests/network/delete_local_network_gateway.rb +29 -29
- data/lib/fog/azurerm/requests/network/delete_network_interface.rb +28 -28
- data/lib/fog/azurerm/requests/network/delete_network_security_group.rb +30 -30
- data/lib/fog/azurerm/requests/network/delete_network_security_rule.rb +30 -30
- data/lib/fog/azurerm/requests/network/delete_public_ip.rb +27 -27
- data/lib/fog/azurerm/requests/network/delete_subnet.rb +28 -28
- data/lib/fog/azurerm/requests/network/delete_virtual_network.rb +28 -28
- data/lib/fog/azurerm/requests/network/delete_virtual_network_gateway.rb +28 -28
- data/lib/fog/azurerm/requests/network/delete_virtual_network_gateway_connection.rb +29 -29
- data/lib/fog/azurerm/requests/network/detach_network_security_group_from_subnet.rb +51 -51
- data/lib/fog/azurerm/requests/network/detach_route_table_from_subnet.rb +51 -51
- data/lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb +23 -23
- data/lib/fog/azurerm/requests/network/get_connection_shared_key.rb +25 -25
- data/lib/fog/azurerm/requests/network/get_express_route_circuit.rb +51 -51
- data/lib/fog/azurerm/requests/network/get_express_route_circuit_authorization.rb +35 -35
- data/lib/fog/azurerm/requests/network/get_express_route_circuit_peering.rb +48 -48
- data/lib/fog/azurerm/requests/network/get_load_balancer.rb +170 -170
- data/lib/fog/azurerm/requests/network/get_local_network_gateway.rb +47 -47
- data/lib/fog/azurerm/requests/network/get_network_security_rule.rb +47 -47
- data/lib/fog/azurerm/requests/network/get_public_ip.rb +41 -41
- data/lib/fog/azurerm/requests/network/get_subnet.rb +37 -37
- data/lib/fog/azurerm/requests/network/get_virtual_network.rb +62 -62
- data/lib/fog/azurerm/requests/network/get_virtual_network_gateway.rb +45 -45
- data/lib/fog/azurerm/requests/network/get_virtual_network_gateway_connection.rb +47 -47
- data/lib/fog/azurerm/requests/network/list_express_route_circuit_authorizations.rb +37 -37
- data/lib/fog/azurerm/requests/network/list_express_route_circuit_peerings.rb +44 -44
- data/lib/fog/azurerm/requests/network/list_express_route_circuits.rb +53 -53
- data/lib/fog/azurerm/requests/network/list_express_route_service_providers.rb +37 -37
- data/lib/fog/azurerm/requests/network/list_local_network_gateways.rb +50 -50
- data/lib/fog/azurerm/requests/network/list_network_interfaces.rb +67 -67
- data/lib/fog/azurerm/requests/network/list_network_security_groups.rb +169 -169
- data/lib/fog/azurerm/requests/network/list_network_security_rules.rb +51 -51
- data/lib/fog/azurerm/requests/network/list_public_ips.rb +46 -46
- data/lib/fog/azurerm/requests/network/list_subnets.rb +55 -55
- data/lib/fog/azurerm/requests/network/list_virtual_network_gateway_connections.rb +50 -50
- data/lib/fog/azurerm/requests/network/list_virtual_network_gateways.rb +43 -43
- data/lib/fog/azurerm/requests/network/list_virtual_networks.rb +74 -74
- data/lib/fog/azurerm/requests/network/remove_address_prefixes_from_virtual_network.rb +69 -69
- data/lib/fog/azurerm/requests/network/remove_dns_servers_from_virtual_network.rb +69 -69
- data/lib/fog/azurerm/requests/network/remove_subnets_from_virtual_network.rb +59 -59
- data/lib/fog/azurerm/requests/network/reset_connection_shared_key.rb +36 -36
- data/lib/fog/azurerm/requests/network/set_connection_shared_key.rb +36 -36
- data/lib/fog/azurerm/requests/resources/create_deployment.rb +97 -97
- data/lib/fog/azurerm/requests/resources/create_resource_group.rb +39 -39
- data/lib/fog/azurerm/requests/resources/delete_deployment.rb +28 -28
- data/lib/fog/azurerm/requests/resources/delete_resource_group.rb +28 -28
- data/lib/fog/azurerm/requests/resources/get_deployment.rb +81 -81
- data/lib/fog/azurerm/requests/resources/get_resource_group.rb +47 -47
- data/lib/fog/azurerm/requests/resources/list_deployments.rb +77 -77
- data/lib/fog/azurerm/requests/resources/list_resource_groups.rb +51 -51
- data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +74 -74
- data/lib/fog/azurerm/requests/sql/create_or_update_firewall_rule.rb +56 -56
- data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +60 -60
- data/lib/fog/azurerm/requests/sql/delete_database.rb +35 -35
- data/lib/fog/azurerm/requests/sql/delete_firewall_rule.rb +36 -36
- data/lib/fog/azurerm/requests/sql/delete_sql_server.rb +35 -35
- data/lib/fog/azurerm/requests/sql/get_database.rb +48 -48
- data/lib/fog/azurerm/requests/sql/get_firewall_rule.rb +43 -43
- data/lib/fog/azurerm/requests/sql/get_sql_server.rb +41 -41
- data/lib/fog/azurerm/requests/sql/list_databases.rb +65 -65
- data/lib/fog/azurerm/requests/sql/list_firewall_rules.rb +55 -55
- data/lib/fog/azurerm/requests/sql/list_sql_servers.rb +51 -51
- data/lib/fog/azurerm/requests/storage/acquire_blob_lease.rb +32 -32
- data/lib/fog/azurerm/requests/storage/acquire_container_lease.rb +32 -32
- data/lib/fog/azurerm/requests/storage/check_storage_account_name_availability.rb +33 -33
- data/lib/fog/azurerm/requests/storage/commit_blob_blocks.rb +30 -30
- data/lib/fog/azurerm/requests/storage/compare_container_blobs.rb +148 -148
- data/lib/fog/azurerm/requests/storage/copy_blob.rb +30 -30
- data/lib/fog/azurerm/requests/storage/copy_blob_from_uri.rb +30 -30
- data/lib/fog/azurerm/requests/storage/create_block_blob.rb +108 -108
- data/lib/fog/azurerm/requests/storage/create_container.rb +40 -40
- data/lib/fog/azurerm/requests/storage/create_disk.rb +62 -62
- data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +54 -54
- data/lib/fog/azurerm/requests/storage/create_page_blob.rb +31 -31
- data/lib/fog/azurerm/requests/storage/create_storage_account.rb +64 -64
- data/lib/fog/azurerm/requests/storage/delete_blob.rb +32 -32
- data/lib/fog/azurerm/requests/storage/delete_container.rb +31 -31
- data/lib/fog/azurerm/requests/storage/delete_disk.rb +36 -36
- data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +35 -35
- data/lib/fog/azurerm/requests/storage/delete_storage_account.rb +27 -27
- data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +60 -60
- data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +61 -61
- data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +56 -56
- data/lib/fog/azurerm/requests/storage/get_backup_container.rb +53 -53
- data/lib/fog/azurerm/requests/storage/get_backup_item.rb +58 -58
- data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +53 -53
- data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +64 -64
- data/lib/fog/azurerm/requests/storage/get_blob.rb +163 -163
- data/lib/fog/azurerm/requests/storage/get_blob_http_url.rb +39 -39
- data/lib/fog/azurerm/requests/storage/get_blob_https_url.rb +39 -39
- data/lib/fog/azurerm/requests/storage/get_blob_properties.rb +55 -55
- data/lib/fog/azurerm/requests/storage/get_blob_url.rb +28 -28
- data/lib/fog/azurerm/requests/storage/get_container_acl.rb +30 -30
- data/lib/fog/azurerm/requests/storage/get_container_properties.rb +41 -41
- data/lib/fog/azurerm/requests/storage/get_container_url.rb +34 -34
- data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +49 -49
- data/lib/fog/azurerm/requests/storage/get_storage_access_keys.rb +32 -32
- data/lib/fog/azurerm/requests/storage/get_storage_account.rb +36 -36
- data/lib/fog/azurerm/requests/storage/list_blobs.rb +168 -168
- data/lib/fog/azurerm/requests/storage/list_containers.rb +73 -73
- data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +48 -48
- data/lib/fog/azurerm/requests/storage/list_storage_account_for_rg.rb +49 -49
- data/lib/fog/azurerm/requests/storage/list_storage_accounts.rb +49 -49
- data/lib/fog/azurerm/requests/storage/multipart_save_block_blob.rb +110 -110
- data/lib/fog/azurerm/requests/storage/put_blob_block.rb +30 -30
- data/lib/fog/azurerm/requests/storage/put_blob_metadata.rb +31 -31
- data/lib/fog/azurerm/requests/storage/put_blob_pages.rb +30 -30
- data/lib/fog/azurerm/requests/storage/put_blob_properties.rb +31 -31
- data/lib/fog/azurerm/requests/storage/put_container_acl.rb +31 -31
- data/lib/fog/azurerm/requests/storage/put_container_metadata.rb +31 -31
- data/lib/fog/azurerm/requests/storage/release_blob_lease.rb +30 -30
- data/lib/fog/azurerm/requests/storage/release_container_lease.rb +30 -30
- data/lib/fog/azurerm/requests/storage/save_page_blob.rb +111 -111
- data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +36 -36
- data/lib/fog/azurerm/requests/storage/start_backup.rb +54 -54
- data/lib/fog/azurerm/requests/storage/update_storage_account.rb +59 -59
- data/lib/fog/azurerm/requests/storage/wait_blob_copy_operation_to_finish.rb +56 -56
- data/lib/fog/azurerm/requests/traffic_manager/create_or_update_traffic_manager_endpoint.rb +54 -54
- data/lib/fog/azurerm/requests/traffic_manager/create_or_update_traffic_manager_profile.rb +107 -107
- data/lib/fog/azurerm/requests/traffic_manager/delete_traffic_manager_endpoint.rb +28 -28
- data/lib/fog/azurerm/requests/traffic_manager/delete_traffic_manager_profile.rb +26 -26
- data/lib/fog/azurerm/requests/traffic_manager/get_traffic_manager_endpoint.rb +39 -39
- data/lib/fog/azurerm/requests/traffic_manager/get_traffic_manager_profile.rb +80 -80
- data/lib/fog/azurerm/requests/traffic_manager/list_traffic_manager_profiles.rb +82 -82
- data/lib/fog/azurerm/resources.rb +63 -63
- data/lib/fog/azurerm/sql.rb +58 -58
- data/lib/fog/azurerm/storage.rb +151 -145
- data/lib/fog/azurerm/traffic_manager.rb +55 -55
- data/lib/fog/azurerm/utilities/general.rb +165 -150
- data/lib/fog/azurerm/utilities/logger_messages.yml +18 -18
- data/lib/fog/azurerm/version.rb +5 -5
- data/rake-script.sh +10 -10
- data/rakefile +28 -28
- data/test/api_stub.rb +118 -118
- data/test/api_stub/models/application_gateway/gateway.rb +165 -165
- data/test/api_stub/models/compute/availability_set.rb +50 -50
- data/test/api_stub/models/compute/server.rb +190 -190
- data/test/api_stub/models/compute/virtual_machine_extension.rb +31 -31
- data/test/api_stub/models/dns/record_set.rb +57 -57
- data/test/api_stub/models/dns/zone.rb +29 -29
- data/test/api_stub/models/network/express_route_circuit.rb +47 -47
- data/test/api_stub/models/network/express_route_circuit_authorization.rb +22 -22
- data/test/api_stub/models/network/express_route_circuit_peering.rb +33 -33
- data/test/api_stub/models/network/express_route_service_provider.rb +29 -29
- data/test/api_stub/models/network/local_network_gateway.rb +31 -31
- data/test/api_stub/models/network/network_interface.rb +72 -72
- data/test/api_stub/models/network/network_security_group.rb +95 -95
- data/test/api_stub/models/network/network_security_rule.rb +30 -30
- data/test/api_stub/models/network/public_ip.rb +36 -36
- data/test/api_stub/models/network/subnet.rb +36 -36
- data/test/api_stub/models/network/virtual_network.rb +62 -62
- data/test/api_stub/models/network/virtual_network_gateway.rb +26 -26
- data/test/api_stub/models/network/virtual_network_gateway_connection.rb +31 -31
- data/test/api_stub/models/resources/deployment.rb +116 -116
- data/test/api_stub/models/resources/resource_group.rb +24 -24
- data/test/api_stub/models/sql/sql_database.rb +28 -28
- data/test/api_stub/models/sql/sql_firewall_rule.rb +22 -22
- data/test/api_stub/models/sql/sql_server.rb +22 -22
- data/test/api_stub/models/storage/directory.rb +178 -178
- data/test/api_stub/models/storage/file.rb +181 -181
- data/test/api_stub/models/storage/recovery_vault.rb +23 -23
- data/test/api_stub/models/storage/storageaccount.rb +22 -22
- data/test/api_stub/models/traffic_manager/traffic_manager_end_point.rb +27 -27
- data/test/api_stub/models/traffic_manager/traffic_manager_profile.rb +75 -75
- data/test/api_stub/requests/application_gateway/gateway.rb +461 -461
- data/test/api_stub/requests/compute/availability_set.rb +57 -57
- data/test/api_stub/requests/compute/virtual_machine.rb +943 -943
- data/test/api_stub/requests/compute/virtual_machine_extension.rb +46 -46
- data/test/api_stub/requests/dns/record_set.rb +75 -75
- data/test/api_stub/requests/dns/zone.rb +52 -52
- data/test/api_stub/requests/network/express_route_circuit.rb +100 -100
- data/test/api_stub/requests/network/express_route_circuit_authorization.rb +31 -31
- data/test/api_stub/requests/network/express_route_circuit_peering.rb +62 -62
- data/test/api_stub/requests/network/express_route_service_provider.rb +30 -30
- data/test/api_stub/requests/network/local_network_gateway.rb +62 -62
- data/test/api_stub/requests/network/network_interface.rb +264 -264
- data/test/api_stub/requests/network/network_security_group.rb +225 -225
- data/test/api_stub/requests/network/network_security_rule.rb +72 -72
- data/test/api_stub/requests/network/public_ip.rb +71 -71
- data/test/api_stub/requests/network/subnet.rb +71 -71
- data/test/api_stub/requests/network/virtual_network.rb +125 -125
- data/test/api_stub/requests/network/virtual_network_gateway.rb +49 -49
- data/test/api_stub/requests/network/virtual_network_gateway_connection.rb +68 -68
- data/test/api_stub/requests/resources/deployment.rb +68 -68
- data/test/api_stub/requests/resources/resource_group.rb +51 -51
- data/test/api_stub/requests/sql/database.rb +69 -69
- data/test/api_stub/requests/sql/firewall_rule.rb +46 -46
- data/test/api_stub/requests/sql/sql_server.rb +45 -45
- data/test/api_stub/requests/storage/directory.rb +89 -89
- data/test/api_stub/requests/storage/file.rb +243 -234
- data/test/api_stub/requests/storage/recovery_vault.rb +189 -189
- data/test/api_stub/requests/storage/storageaccount.rb +126 -126
- data/test/api_stub/requests/traffic_manager/traffic_manager_endpoint.rb +41 -41
- data/test/api_stub/requests/traffic_manager/traffic_manager_profile.rb +155 -155
- data/test/integration/README.md +14 -14
- data/test/integration/Virtual_network_gateway_connection.rb +219 -219
- data/test/integration/application_gateway.rb +245 -245
- data/test/integration/availability_set.rb +79 -79
- data/test/integration/blob.rb +303 -329
- data/test/integration/container.rb +153 -134
- data/test/integration/credentials/azure.yml +5 -4
- data/test/integration/data_disk.rb +90 -88
- data/test/integration/deployment.rb +71 -71
- data/test/integration/express_route_circuit.rb +123 -123
- data/test/integration/external_load_balancer.rb +137 -137
- data/test/integration/local_network_gateway.rb +83 -83
- data/test/integration/network_interface.rb +147 -147
- data/test/integration/network_security_group.rb +125 -125
- data/test/integration/network_security_rule.rb +94 -94
- data/test/integration/public_ip.rb +78 -78
- data/test/integration/record_set.rb +118 -119
- data/test/integration/resource_group.rb +51 -51
- data/test/integration/resource_tag.rb +84 -84
- data/test/integration/server.rb +219 -219
- data/test/integration/server_custom_image.rb +127 -127
- data/test/integration/sql_server.rb +155 -159
- data/test/integration/storage_account.rb +117 -110
- data/test/integration/subnet.rb +115 -115
- data/test/integration/traffic_manager.rb +114 -114
- data/test/integration/virtual_machine_extension.rb +157 -157
- data/test/integration/virtual_network.rb +153 -153
- data/test/integration/virtual_network_gateway.rb +118 -115
- data/test/integration/virtual_network_gateway_connection_to_express_route.rb +123 -123
- data/test/integration/zone.rb +73 -73
- data/test/models/application_gateway/test_gateway.rb +134 -134
- data/test/models/application_gateway/test_gateways.rb +42 -42
- data/test/models/compute/test_availability_set.rb +54 -54
- data/test/models/compute/test_availability_sets.rb +42 -42
- data/test/models/compute/test_server.rb +144 -144
- data/test/models/compute/test_servers.rb +42 -42
- data/test/models/compute/test_virtual_machine_extension.rb +61 -61
- data/test/models/compute/test_virtual_machine_extensions.rb +36 -36
- data/test/models/dns/test_record_set.rb +86 -86
- data/test/models/dns/test_record_sets.rb +53 -53
- data/test/models/dns/test_zone.rb +50 -50
- data/test/models/dns/test_zones.rb +51 -51
- data/test/models/network/test_express_route_circuit.rb +52 -52
- data/test/models/network/test_express_route_circuit_authorization.rb +50 -50
- data/test/models/network/test_express_route_circuit_authorizations.rb +43 -43
- data/test/models/network/test_express_route_circuit_peering.rb +53 -53
- data/test/models/network/test_express_route_circuit_peerings.rb +43 -43
- data/test/models/network/test_express_route_circuits.rb +42 -42
- data/test/models/network/test_express_route_service_providers.rb +30 -30
- data/test/models/network/test_local_network_gateway.rb +53 -53
- data/test/models/network/test_local_network_gateways.rb +42 -42
- data/test/models/network/test_network_interface.rb +96 -96
- data/test/models/network/test_network_interfaces.rb +42 -42
- data/test/models/network/test_network_security_group.rb +86 -86
- data/test/models/network/test_network_security_groups.rb +41 -41
- data/test/models/network/test_network_security_rule.rb +44 -44
- data/test/models/network/test_network_security_rules.rb +42 -42
- data/test/models/network/test_public_ip.rb +61 -61
- data/test/models/network/test_public_ips.rb +55 -55
- data/test/models/network/test_subnet.rb +83 -83
- data/test/models/network/test_subnets.rb +43 -43
- data/test/models/network/test_virtual_network.rb +106 -106
- data/test/models/network/test_virtual_network_gateway.rb +62 -62
- data/test/models/network/test_virtual_network_gateway_connection.rb +59 -59
- data/test/models/network/test_virtual_network_gateway_connections.rb +42 -42
- data/test/models/network/test_virtual_network_gateways.rb +42 -42
- data/test/models/network/test_virtual_networks.rb +55 -55
- data/test/models/resources/test_deployment.rb +55 -55
- data/test/models/resources/test_deployments.rb +38 -38
- data/test/models/resources/test_resource_group.rb +44 -44
- data/test/models/resources/test_resource_groups.rb +38 -38
- data/test/models/sql/test_database.rb +68 -68
- data/test/models/sql/test_databases.rb +42 -42
- data/test/models/sql/test_firewall_rule.rb +54 -54
- data/test/models/sql/test_firewall_rules.rb +41 -41
- data/test/models/sql/test_sql_server.rb +56 -56
- data/test/models/sql/test_sql_servers.rb +41 -41
- data/test/models/storage/test_data_disk.rb +23 -23
- data/test/models/storage/test_directories.rb +61 -61
- data/test/models/storage/test_directory.rb +178 -178
- data/test/models/storage/test_file.rb +294 -294
- data/test/models/storage/test_files.rb +234 -234
- data/test/models/storage/test_recovery_vault.rb +61 -61
- data/test/models/storage/test_recovery_vaults.rb +47 -47
- data/test/models/storage/test_storage_account.rb +88 -88
- data/test/models/storage/test_storage_accounts.rb +65 -65
- data/test/models/traffic_manager/test_traffic_manager_end_point.rb +54 -54
- data/test/models/traffic_manager/test_traffic_manager_end_points.rb +43 -43
- data/test/models/traffic_manager/test_traffic_manager_profile.rb +62 -62
- data/test/models/traffic_manager/test_traffic_manager_profiles.rb +42 -42
- data/test/requests/application_gateway/test_create_or_update_application_gateway.rb +35 -35
- data/test/requests/application_gateway/test_delete_application_gateway.rb +23 -23
- data/test/requests/application_gateway/test_get_application_gateway.rb +24 -24
- data/test/requests/application_gateway/test_list_application_gateways.rb +24 -24
- data/test/requests/application_gateway/test_start_application_gateway.rb +25 -25
- data/test/requests/application_gateway/test_stop_application_gateway.rb +25 -25
- data/test/requests/compute/test_attach_data_disk_to_vm.rb +90 -90
- data/test/requests/compute/test_create_availability_set.rb +28 -28
- data/test/requests/compute/test_create_virtual_machine.rb +63 -63
- data/test/requests/compute/test_create_vm_extension.rb +35 -35
- data/test/requests/compute/test_deallocate_virtual_machine.rb +23 -23
- data/test/requests/compute/test_delete_availability_set.rb +23 -23
- data/test/requests/compute/test_delete_virtual_machine.rb +23 -23
- data/test/requests/compute/test_detach_data_disk_from_vm.rb +32 -32
- data/test/requests/compute/test_generalize_virtual_machine.rb +23 -23
- data/test/requests/compute/test_get_availability_set.rb +24 -24
- data/test/requests/compute/test_get_virtual_machine.rb +24 -24
- data/test/requests/compute/test_get_vm_extension.rb +26 -26
- data/test/requests/compute/test_list_availability_sets.rb +24 -24
- data/test/requests/compute/test_list_available_sizes_for_virtual_machine.rb +24 -24
- data/test/requests/compute/test_list_virtual_machines.rb +24 -24
- data/test/requests/compute/test_power_off_virtual_machine.rb +23 -23
- data/test/requests/compute/test_redeploy_virtual_machine.rb +23 -23
- data/test/requests/compute/test_restart_virtual_machine.rb +23 -23
- data/test/requests/compute/test_start_virtual_machine.rb +23 -23
- data/test/requests/compute/test_update_vm_extension.rb +35 -35
- data/test/requests/dns/test_check_for_zone.rb +24 -24
- data/test/requests/dns/test_create_record_set.rb +46 -46
- data/test/requests/dns/test_create_zone.rb +37 -37
- data/test/requests/dns/test_delete_record_set.rb +24 -24
- data/test/requests/dns/test_delete_zone.rb +24 -24
- data/test/requests/dns/test_get_record_set.rb +24 -24
- data/test/requests/dns/test_get_records_from_record_set.rb +42 -42
- data/test/requests/dns/test_get_zone.rb +35 -35
- data/test/requests/network/test_add_address_prefixes_in_virtual_network.rb +29 -29
- data/test/requests/network/test_add_dns_servers_in_virtual_network.rb +29 -29
- data/test/requests/network/test_add_subnets_in_virtual_network.rb +29 -29
- data/test/requests/network/test_attach_network_security_group_to_subnet.rb +26 -26
- data/test/requests/network/test_attach_route_table_to_subnet.rb +26 -26
- data/test/requests/network/test_check_for_public_ip.rb +30 -30
- data/test/requests/network/test_check_for_virtual_network.rb +30 -30
- data/test/requests/network/test_create_express_route_circuit.rb +39 -39
- data/test/requests/network/test_create_express_route_circuit_authorization.rb +35 -35
- data/test/requests/network/test_create_express_route_circuit_peering.rb +37 -37
- data/test/requests/network/test_create_local_network_gateway.rb +36 -36
- data/test/requests/network/test_create_network_interface.rb +42 -42
- data/test/requests/network/test_create_or_update_network_security_group.rb +38 -38
- data/test/requests/network/test_create_or_update_network_security_rule.rb +28 -28
- data/test/requests/network/test_create_or_update_virtual_network.rb +55 -55
- data/test/requests/network/test_create_public_ip.rb +35 -35
- data/test/requests/network/test_create_subnet.rb +35 -35
- data/test/requests/network/test_create_virtual_network_gateway.rb +37 -37
- data/test/requests/network/test_create_virtual_network_gateway_connection.rb +36 -36
- data/test/requests/network/test_delete_express_route_circuit.rb +24 -24
- data/test/requests/network/test_delete_express_route_circuit_authorization.rb +23 -23
- data/test/requests/network/test_delete_express_route_circuit_peering.rb +24 -24
- data/test/requests/network/test_delete_local_network_gateway.rb +23 -23
- data/test/requests/network/test_delete_network_interface.rb +24 -24
- data/test/requests/network/test_delete_network_security_group.rb +25 -25
- data/test/requests/network/test_delete_network_security_rule.rb +25 -25
- data/test/requests/network/test_delete_public_ip.rb +24 -24
- data/test/requests/network/test_delete_subnet.rb +24 -24
- data/test/requests/network/test_delete_virtual_network.rb +24 -24
- data/test/requests/network/test_delete_virtual_network_gateway.rb +24 -24
- data/test/requests/network/test_delete_virtual_network_gateway_connection.rb +23 -23
- data/test/requests/network/test_detach_network_security_group_from_subnet.rb +26 -26
- data/test/requests/network/test_detach_route_table_from_subnet.rb +26 -26
- data/test/requests/network/test_get_available_ipaddresses_count.rb +18 -18
- data/test/requests/network/test_get_connection_shared_key.rb +24 -24
- data/test/requests/network/test_get_express_route_circuit.rb +24 -24
- data/test/requests/network/test_get_express_route_circuit_authorization.rb +24 -24
- data/test/requests/network/test_get_express_route_circuit_peering.rb +24 -24
- data/test/requests/network/test_get_load_balancer.rb +24 -24
- data/test/requests/network/test_get_local_network_gateway.rb +24 -24
- data/test/requests/network/test_get_network_security_rule.rb +26 -26
- data/test/requests/network/test_get_public_ip.rb +26 -26
- data/test/requests/network/test_get_subnet.rb +26 -26
- data/test/requests/network/test_get_virtual_network.rb +26 -26
- data/test/requests/network/test_get_virtual_network_gateway.rb +24 -24
- data/test/requests/network/test_get_virtual_network_gateway_connection.rb +24 -24
- data/test/requests/network/test_list_express_route_circuit_authorizations.rb +24 -24
- data/test/requests/network/test_list_express_route_circuit_peerings.rb +24 -24
- data/test/requests/network/test_list_express_route_circuits.rb +26 -26
- data/test/requests/network/test_list_express_route_service_providers.rb +24 -24
- data/test/requests/network/test_list_local_network_gateways.rb +24 -24
- data/test/requests/network/test_list_network_interfaces.rb +24 -24
- data/test/requests/network/test_list_network_security_groups.rb +26 -26
- data/test/requests/network/test_list_network_security_rules.rb +26 -26
- data/test/requests/network/test_list_public_ips.rb +24 -24
- data/test/requests/network/test_list_subnets.rb +24 -24
- data/test/requests/network/test_list_virtual_network_gateway_connections.rb +24 -24
- data/test/requests/network/test_list_virtual_network_gateways.rb +24 -24
- data/test/requests/network/test_list_virtual_networks.rb +24 -24
- data/test/requests/network/test_remove_address_prefixes_from_virtual_network.rb +29 -29
- data/test/requests/network/test_remove_dns_servers_from_virtual_network.rb +29 -29
- data/test/requests/network/test_remove_subnets_from_virtual_network.rb +29 -29
- data/test/requests/network/test_reset_connection_shared_key.rb +23 -23
- data/test/requests/network/test_set_connection_shared_key.rb +23 -23
- data/test/requests/network/test_update_public_ip.rb +34 -34
- data/test/requests/resources/test_create_deployment.rb +32 -32
- data/test/requests/resources/test_create_resource_group.rb +24 -24
- data/test/requests/resources/test_delete_deployment.rb +25 -25
- data/test/requests/resources/test_delete_resource_group.rb +24 -24
- data/test/requests/resources/test_get_deployment.rb +24 -24
- data/test/requests/resources/test_get_resource_group.rb +24 -24
- data/test/requests/resources/test_list_deployments.rb +25 -25
- data/test/requests/resources/test_list_resource_groups.rb +24 -24
- data/test/requests/sql/test_create_or_update_database.rb +28 -28
- data/test/requests/sql/test_create_or_update_firewall_rule.rb +27 -27
- data/test/requests/sql/test_create_or_update_sql_server.rb +28 -28
- data/test/requests/sql/test_delete_database.rb +34 -34
- data/test/requests/sql/test_delete_firewall_rule.rb +34 -34
- data/test/requests/sql/test_delete_sql_server.rb +34 -34
- data/test/requests/sql/test_get_database.rb +35 -35
- data/test/requests/sql/test_get_firewall_rule.rb +35 -35
- data/test/requests/sql/test_get_sql_server.rb +35 -35
- data/test/requests/sql/test_list_databases.rb +35 -35
- data/test/requests/sql/test_list_firewall_rules.rb +35 -35
- data/test/requests/sql/test_list_sql_servers.rb +35 -35
- data/test/requests/storage/test_acquire_blob_lease.rb +36 -36
- data/test/requests/storage/test_acquire_container_lease.rb +36 -36
- data/test/requests/storage/test_check_storage_account_name_availability.rb +44 -44
- data/test/requests/storage/test_commit_blob_blocks.rb +34 -34
- data/test/requests/storage/test_compare_container_blobs.rb +36 -36
- data/test/requests/storage/test_copy_blob.rb +36 -36
- data/test/requests/storage/test_copy_blob_from_uri.rb +36 -36
- data/test/requests/storage/test_create_block_blob.rb +80 -80
- data/test/requests/storage/test_create_container.rb +36 -36
- data/test/requests/storage/test_create_disk.rb +70 -70
- data/test/requests/storage/test_create_page_blob.rb +34 -34
- data/test/requests/storage/test_create_recovery_vault.rb +35 -35
- data/test/requests/storage/test_create_storage_account.rb +34 -34
- data/test/requests/storage/test_delete_blob.rb +42 -42
- data/test/requests/storage/test_delete_container.rb +42 -42
- data/test/requests/storage/test_delete_disk.rb +30 -30
- data/test/requests/storage/test_delete_recovery_vault.rb +34 -34
- data/test/requests/storage/test_delete_storage_account.rb +28 -28
- data/test/requests/storage/test_disable_backup_protection.rb +52 -52
- data/test/requests/storage/test_enable_backup_protection.rb +66 -66
- data/test/requests/storage/test_get_all_backup_jobs.rb +35 -35
- data/test/requests/storage/test_get_backup_container.rb +35 -35
- data/test/requests/storage/test_get_backup_item.rb +35 -35
- data/test/requests/storage/test_get_backup_job_for_vm.rb +26 -26
- data/test/requests/storage/test_get_backup_protection_policy.rb +35 -35
- data/test/requests/storage/test_get_blob.rb +141 -141
- data/test/requests/storage/test_get_blob_http_url.rb +30 -30
- data/test/requests/storage/test_get_blob_https_url.rb +30 -30
- data/test/requests/storage/test_get_blob_properties.rb +45 -45
- data/test/requests/storage/test_get_blob_url.rb +75 -33
- data/test/requests/storage/test_get_container_acl.rb +37 -37
- data/test/requests/storage/test_get_container_properties.rb +45 -45
- data/test/requests/storage/test_get_container_url.rb +33 -33
- data/test/requests/storage/test_get_recovery_vault.rb +35 -35
- data/test/requests/storage/test_get_storage_access_keys.rb +24 -24
- data/test/requests/storage/test_get_storage_account.rb +25 -25
- data/test/requests/storage/test_list_blobs.rb +77 -77
- data/test/requests/storage/test_list_containers.rb +54 -54
- data/test/requests/storage/test_list_recovery_vault.rb +35 -35
- data/test/requests/storage/test_list_storage_accounts.rb +37 -37
- data/test/requests/storage/test_list_storage_accounts_for_rg.rb +37 -37
- data/test/requests/storage/test_multipart_save_block_blob.rb +105 -105
- data/test/requests/storage/test_put_blob_block.rb +34 -34
- data/test/requests/storage/test_put_blob_metadata.rb +36 -36
- data/test/requests/storage/test_put_blob_pages.rb +34 -34
- data/test/requests/storage/test_put_blob_properties.rb +39 -39
- data/test/requests/storage/test_put_container_acl.rb +34 -34
- data/test/requests/storage/test_put_container_metadata.rb +36 -36
- data/test/requests/storage/test_release_blob_lease.rb +34 -34
- data/test/requests/storage/test_release_container_lease.rb +34 -34
- data/test/requests/storage/test_save_page_blob.rb +115 -115
- data/test/requests/storage/test_set_recovery_vault_context.rb +34 -34
- data/test/requests/storage/test_start_backup.rb +55 -55
- data/test/requests/storage/test_update_storage_account.rb +34 -34
- data/test/requests/storage/test_wait_blob_copy_operation_to_finish.rb +148 -148
- data/test/requests/traffic_manager/test_create_traffic_manager_endpoint.rb +25 -25
- data/test/requests/traffic_manager/test_create_traffic_manager_profile.rb +25 -25
- data/test/requests/traffic_manager/test_delete_traffic_manager_endpoint.rb +23 -23
- data/test/requests/traffic_manager/test_delete_traffic_manager_profile.rb +23 -23
- data/test/requests/traffic_manager/test_get_traffic_manager_endpoint.rb +24 -24
- data/test/requests/traffic_manager/test_get_traffic_manager_profile.rb +24 -24
- data/test/requests/traffic_manager/test_list_traffic_manager_profiles.rb +24 -24
- data/test/requests/traffic_manager/test_update_traffic_manager_endpoint.rb +27 -27
- data/test/requests/traffic_manager/test_update_traffic_manager_profile.rb +27 -27
- data/test/smoke_tests/compute/test_resource_group_smoke.rb +37 -37
- data/test/test_credentials.rb +63 -39
- data/test/test_helper.rb +768 -768
- metadata +16 -18
- data/test/requests/dns/test_list_record_sets.rb +0 -35
- data/test/requests/dns/test_list_zones.rb +0 -26
data/lib/fog/azurerm/docs/dns.md
CHANGED
@@ -1,134 +1,134 @@
|
|
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('<Resource Group name>', '<Zone 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
|
-
|
78
|
-
## List Record Sets
|
79
|
-
|
80
|
-
```ruby
|
81
|
-
azure_dns_service.record_sets(
|
82
|
-
resource_group: '<Resource Group Name>',
|
83
|
-
zone_name: '<Zone Name>'
|
84
|
-
).each do |record_set|
|
85
|
-
puts "#{record_set.name}"
|
86
|
-
puts "#{record_set.resource_group}"
|
87
|
-
end
|
88
|
-
```
|
89
|
-
|
90
|
-
## Retrieve a single Record Set
|
91
|
-
|
92
|
-
Get a single record of Record Set
|
93
|
-
|
94
|
-
```ruby
|
95
|
-
record_set = azure_dns_service
|
96
|
-
.record_sets
|
97
|
-
.get('<Resource Group Name>', '<Record Set name>', '<Zone Name>', '<Record Type>')
|
98
|
-
puts "#{record_set.name}"
|
99
|
-
```
|
100
|
-
|
101
|
-
## Update TTL
|
102
|
-
|
103
|
-
Get an object of record set and then update TTL
|
104
|
-
|
105
|
-
```ruby
|
106
|
-
record_set.update_ttl(
|
107
|
-
ttl: '<Time to live(Integer)>,
|
108
|
-
)
|
109
|
-
```
|
110
|
-
|
111
|
-
## Add/Remove Record set in Existing Record sets
|
112
|
-
|
113
|
-
Add a record by giving the value of record set in the form of string.
|
114
|
-
|
115
|
-
```ruby
|
116
|
-
record_set.add_a_type_record('<Record>')
|
117
|
-
```
|
118
|
-
|
119
|
-
Remove record from existing records by giving its value in the form of string.
|
120
|
-
|
121
|
-
```ruby
|
122
|
-
record_set.remove_a_type_record('<Record>')
|
123
|
-
```
|
124
|
-
|
125
|
-
## Destroy a single Record Set
|
126
|
-
|
127
|
-
Get Record Set object from the get method(described above) and then destroy that Record Set.
|
128
|
-
|
129
|
-
```ruby
|
130
|
-
record_set.destroy
|
131
|
-
```
|
132
|
-
|
133
|
-
## Support and Feedback
|
134
|
-
Your feedback is appreciated! If you have specific issues with the fog ARM, you should file an issue via Github.
|
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('<Resource Group name>', '<Zone 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
|
+
|
78
|
+
## List Record Sets
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
azure_dns_service.record_sets(
|
82
|
+
resource_group: '<Resource Group Name>',
|
83
|
+
zone_name: '<Zone Name>'
|
84
|
+
).each do |record_set|
|
85
|
+
puts "#{record_set.name}"
|
86
|
+
puts "#{record_set.resource_group}"
|
87
|
+
end
|
88
|
+
```
|
89
|
+
|
90
|
+
## Retrieve a single Record Set
|
91
|
+
|
92
|
+
Get a single record of Record Set
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
record_set = azure_dns_service
|
96
|
+
.record_sets
|
97
|
+
.get('<Resource Group Name>', '<Record Set name>', '<Zone Name>', '<Record Type>')
|
98
|
+
puts "#{record_set.name}"
|
99
|
+
```
|
100
|
+
|
101
|
+
## Update TTL
|
102
|
+
|
103
|
+
Get an object of record set and then update TTL
|
104
|
+
|
105
|
+
```ruby
|
106
|
+
record_set.update_ttl(
|
107
|
+
ttl: '<Time to live(Integer)>,
|
108
|
+
)
|
109
|
+
```
|
110
|
+
|
111
|
+
## Add/Remove Record set in Existing Record sets
|
112
|
+
|
113
|
+
Add a record by giving the value of record set in the form of string.
|
114
|
+
|
115
|
+
```ruby
|
116
|
+
record_set.add_a_type_record('<Record>')
|
117
|
+
```
|
118
|
+
|
119
|
+
Remove record from existing records by giving its value in the form of string.
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
record_set.remove_a_type_record('<Record>')
|
123
|
+
```
|
124
|
+
|
125
|
+
## Destroy a single Record Set
|
126
|
+
|
127
|
+
Get Record Set object from the get method(described above) and then destroy that Record Set.
|
128
|
+
|
129
|
+
```ruby
|
130
|
+
record_set.destroy
|
131
|
+
```
|
132
|
+
|
133
|
+
## Support and Feedback
|
134
|
+
Your feedback is appreciated! If you have specific issues with the fog ARM, you should file an issue via Github.
|
@@ -1,1040 +1,1040 @@
|
|
1
|
-
# Network
|
2
|
-
|
3
|
-
This document explains how to get started using Azure Network Service with Fog. With this gem you can create/update/list/delete virtual networks, subnets, public IPs and network interfaces.
|
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
|
-
## Create Connection
|
13
|
-
|
14
|
-
Next, create a connection to the Network Service:
|
15
|
-
|
16
|
-
```ruby
|
17
|
-
azure_network_service = Fog::Network::AzureRM.new(
|
18
|
-
tenant_id: '<Tenantid>', # Tenant id of Azure Active Directory Application
|
19
|
-
client_id: '<Clientid>', # Client id of Azure Active Directory Application
|
20
|
-
client_secret: '<ClientSecret>', # Client Secret of Azure Active Directory Application
|
21
|
-
subscription_id: '<Subscriptionid>' # Subscription id of an Azure Account
|
22
|
-
)
|
23
|
-
```
|
24
|
-
## Create Virtual Network
|
25
|
-
|
26
|
-
Create a new virtual network
|
27
|
-
|
28
|
-
Optional parameters for Virtual Network: subnets, dns_servers & address_prefixes
|
29
|
-
Optional parameters for Subnet: network_security_group_id, route_table_id & address_prefix
|
30
|
-
|
31
|
-
```ruby
|
32
|
-
vnet = azure_network_service.virtual_networks.create(
|
33
|
-
name: '<Virtual Network Name>',
|
34
|
-
location: 'westus',
|
35
|
-
resource_group: '<Resource Group Name>',
|
36
|
-
subnets: [{
|
37
|
-
name: '<Subnet Name>',
|
38
|
-
address_prefix: '10.1.0.0/24',
|
39
|
-
network_security_group_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/networkSecurityGroups/<Network Security Group Name>',
|
40
|
-
route_table_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/routeTables/<Route Table Name>'
|
41
|
-
}],
|
42
|
-
dns_servers: ['10.1.0.0','10.2.0.0'],
|
43
|
-
address_prefixes: ['10.1.0.0/16','10.2.0.0/16']
|
44
|
-
)
|
45
|
-
```
|
46
|
-
|
47
|
-
## Check for Virtual Network
|
48
|
-
|
49
|
-
Checks if the Virtual Network already exists or not.
|
50
|
-
|
51
|
-
```ruby
|
52
|
-
azure_network_service.virtual_networks.check_if_exists('<Virtual Network name>', '<Resource Group name>')
|
53
|
-
```
|
54
|
-
|
55
|
-
## List Virtual Networks
|
56
|
-
|
57
|
-
List all virtual networks in a subscription
|
58
|
-
|
59
|
-
```ruby
|
60
|
-
vnets = azure_network_service.virtual_networks(resource_group: '<Resource Group Name>')
|
61
|
-
vnets.each do |vnet|
|
62
|
-
puts "#{vnet.name}"
|
63
|
-
puts "#{vnet.location}"
|
64
|
-
end
|
65
|
-
```
|
66
|
-
|
67
|
-
## Retrieve a single Virtual Network
|
68
|
-
|
69
|
-
Get a single record of virtual network
|
70
|
-
|
71
|
-
```ruby
|
72
|
-
vnet = azure_network_service.virtual_networks.get('<Resource Group Name>', '<Virtual Network name>')
|
73
|
-
puts "#{vnet.name}"
|
74
|
-
```
|
75
|
-
|
76
|
-
## Add/Remove DNS Servers to/from Virtual Network
|
77
|
-
|
78
|
-
Add/Remove DNS Servers to/from Virtual Network
|
79
|
-
|
80
|
-
```ruby
|
81
|
-
vnet.add_dns_servers(['10.3.0.0','10.4.0.0'])
|
82
|
-
vnet.remove_dns_servers(['10.3.0.0','10.4.0.0'])
|
83
|
-
```
|
84
|
-
|
85
|
-
## Add/Remove Address Prefixes to/from Virtual Network
|
86
|
-
|
87
|
-
Add/Remove Address Prefixes to/from Virtual Network
|
88
|
-
|
89
|
-
```ruby
|
90
|
-
vnet.add_address_prefixes(['10.2.0.0/16', '10.3.0.0/16'])
|
91
|
-
vnet.remove_address_prefixes(['10.2.0.0/16'])
|
92
|
-
```
|
93
|
-
|
94
|
-
## Add/Remove Subnets to/from Virtual Network
|
95
|
-
|
96
|
-
Add/Remove Subnets to/from Virtual Network
|
97
|
-
|
98
|
-
```ruby
|
99
|
-
vnet.add_subnets([{
|
100
|
-
name: 'test-subnet',
|
101
|
-
address_prefix: '10.3.0.0/24'
|
102
|
-
}])
|
103
|
-
|
104
|
-
vnet.remove_subnets(['test-subnet'])
|
105
|
-
```
|
106
|
-
|
107
|
-
## Update Virtual Network
|
108
|
-
|
109
|
-
Update Virtual Network
|
110
|
-
|
111
|
-
```ruby
|
112
|
-
vnet.update({
|
113
|
-
subnets:[{
|
114
|
-
name: 'fog-subnet',
|
115
|
-
address_prefix: '10.3.0.0/16'
|
116
|
-
}],
|
117
|
-
dns_servers: ['10.3.0.0','10.4.0.0']
|
118
|
-
})
|
119
|
-
```
|
120
|
-
|
121
|
-
## Destroy a single virtual network
|
122
|
-
|
123
|
-
Get virtual network object from the get method and then destroy that virtual network.
|
124
|
-
|
125
|
-
```ruby
|
126
|
-
vnet.destroy
|
127
|
-
```
|
128
|
-
|
129
|
-
## Create Subnet
|
130
|
-
|
131
|
-
Create a new Subnet
|
132
|
-
|
133
|
-
Optional parameters: network_security_group_id, route_table_id & address_prefix
|
134
|
-
|
135
|
-
```ruby
|
136
|
-
subnet = azure_network_service.subnets.create(
|
137
|
-
name: '<Subnet Name>',
|
138
|
-
resource_group: '<Resource Group Name>',
|
139
|
-
virtual_network_name: '<Virtual Network Name>',
|
140
|
-
address_prefix: '10.0.0.0/24',
|
141
|
-
network_security_group_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/networkSecurityGroups/<Network Security Group Name>',
|
142
|
-
route_table_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/routeTables/<Route Table Name>'
|
143
|
-
)
|
144
|
-
```
|
145
|
-
|
146
|
-
## List Subnets
|
147
|
-
|
148
|
-
List subnets in a resource group and a virtual network
|
149
|
-
|
150
|
-
```ruby
|
151
|
-
subnets = azure_network_service.subnets(resource_group: '<Resource Group name>', virtual_network_name: '<Virtual Network name>')
|
152
|
-
subnets.each do |subnet|
|
153
|
-
puts "#{subnet.name}"
|
154
|
-
end
|
155
|
-
```
|
156
|
-
|
157
|
-
## Retrieve a single Subnet
|
158
|
-
|
159
|
-
Get a single record of Subnet
|
160
|
-
|
161
|
-
```ruby
|
162
|
-
subnet = azure_network_service
|
163
|
-
.subnets
|
164
|
-
.get('<Resource Group name>', '<Virtual Network name>', '<Subnet name>')
|
165
|
-
puts "#{subnet.name}"
|
166
|
-
```
|
167
|
-
|
168
|
-
## Attach Network Security Group to Subnet
|
169
|
-
|
170
|
-
Attach Network Security Group to Subnet
|
171
|
-
|
172
|
-
```ruby
|
173
|
-
subnet = azure_network_service.attach_network_security_group('/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/networkSecurityGroups/<Network Security Group Name>')
|
174
|
-
puts "#{subnet.network_security_group_id}"
|
175
|
-
```
|
176
|
-
|
177
|
-
## Detach Network Security Group from Subnet
|
178
|
-
|
179
|
-
Detach Network Security Group from Subnet
|
180
|
-
|
181
|
-
```ruby
|
182
|
-
subnet = azure_network_service.detach_network_security_group
|
183
|
-
puts "#{subnet.network_security_group_id}"
|
184
|
-
```
|
185
|
-
|
186
|
-
## Attach Route Table to Subnet
|
187
|
-
|
188
|
-
Attach Route Table to Subnet
|
189
|
-
|
190
|
-
```ruby
|
191
|
-
subnet = azure_network_service.attach_route_table('/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/routeTables/<Route Table Name>')
|
192
|
-
puts "#{subnet.route_table_id}"
|
193
|
-
```
|
194
|
-
|
195
|
-
## Detach Route Table from Subnet
|
196
|
-
|
197
|
-
Detach Route Table from Subnet
|
198
|
-
|
199
|
-
```ruby
|
200
|
-
subnet = azure_network_service.detach_route_table
|
201
|
-
puts "#{subnet.route_table_id}"
|
202
|
-
```
|
203
|
-
|
204
|
-
## List Number of Available IP Addresses in Subnet
|
205
|
-
|
206
|
-
The parameter is a boolean which checks if the Virtual Network the Subnet belongs to is attached to an Express Route Circuit or not
|
207
|
-
|
208
|
-
```ruby
|
209
|
-
puts "#{subnet.get_available_ipaddresses_count(false)}"
|
210
|
-
```
|
211
|
-
|
212
|
-
## Destroy a single Subnet
|
213
|
-
|
214
|
-
Get a subnet object from the get method and then destroy that subnet.
|
215
|
-
|
216
|
-
```ruby
|
217
|
-
subnet.destroy
|
218
|
-
```
|
219
|
-
|
220
|
-
## Create Network Interface Card
|
221
|
-
|
222
|
-
Create a new network interface. Skip public_ip_address_id parameter to create network interface without PublicIP. The parameter, private_ip_allocation_method can be Dynamic or Static.
|
223
|
-
|
224
|
-
```ruby
|
225
|
-
nic = azure_network_service.network_interfaces.create(
|
226
|
-
name: '<Network Interface name>',
|
227
|
-
resource_group: '<Resource Group name>',
|
228
|
-
location: 'eastus',
|
229
|
-
subnet_id: '/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/virtualNetworks/<Virtual Network name>/subnets/<Subnet name>',
|
230
|
-
public_ip_address_id: '/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/publicIPAddresses/<Public IP name>',
|
231
|
-
ip_configuration_name: '<Ip Configuration Name>',
|
232
|
-
private_ip_allocation_method: 'Dynamic'
|
233
|
-
)
|
234
|
-
```
|
235
|
-
|
236
|
-
## List Network Interface Cards
|
237
|
-
|
238
|
-
List network interfaces in a resource group
|
239
|
-
|
240
|
-
```ruby
|
241
|
-
nics = azure_network_service.network_interfaces(resource_group: '<Resource Group name>')
|
242
|
-
nics.each do |nic|
|
243
|
-
puts "#{nic.name}"
|
244
|
-
end
|
245
|
-
```
|
246
|
-
|
247
|
-
## Retrieve a single Network Interface Card
|
248
|
-
|
249
|
-
Get a single record of Network Interface
|
250
|
-
|
251
|
-
```ruby
|
252
|
-
nic = azure_network_service
|
253
|
-
.network_interfaces
|
254
|
-
.get('<Resource Group name>', '<Network Interface name>')
|
255
|
-
puts "#{nic.name}"
|
256
|
-
```
|
257
|
-
|
258
|
-
## Update Network Interface Card
|
259
|
-
|
260
|
-
You can update network interface by passing only updated attributes, in the form of hash.
|
261
|
-
For example,
|
262
|
-
```ruby
|
263
|
-
nic.update(private_ip_allocation_method: 'Static', private_ip_address: '10.0.0.0')
|
264
|
-
```
|
265
|
-
## Attach/Detach resources to Network Interface Card
|
266
|
-
|
267
|
-
Attach Subnet, Public-IP or Network-Security-Group as following
|
268
|
-
```ruby
|
269
|
-
subnet_id = "<NEW-SUBNET-ID>"
|
270
|
-
nic.attach_subnet(subnet_id)
|
271
|
-
|
272
|
-
public_ip_id = "<NEW-PUBLIC_IP-ID>"
|
273
|
-
nic.attach_public_ip(public_ip_id)
|
274
|
-
|
275
|
-
nsg_id = "<NEW-NSG-ID>"
|
276
|
-
nic.attach_network_security_group(nsg_id)
|
277
|
-
|
278
|
-
```
|
279
|
-
Detach Public-IP or Network-Security-Group as following
|
280
|
-
|
281
|
-
```ruby
|
282
|
-
nic.detach_public_ip
|
283
|
-
|
284
|
-
nic.detach_network_security_group
|
285
|
-
|
286
|
-
```
|
287
|
-
`Note: You can't detach subnet from Network Interface.`
|
288
|
-
|
289
|
-
## Destroy a single Network Interface Card
|
290
|
-
|
291
|
-
Get a network interface object from the get method and then destroy that network interface.
|
292
|
-
|
293
|
-
```ruby
|
294
|
-
nic.destroy
|
295
|
-
```
|
296
|
-
|
297
|
-
## Create Public IP
|
298
|
-
|
299
|
-
Create a new public IP. The parameter, type can be Dynamic or Static.
|
300
|
-
|
301
|
-
```ruby
|
302
|
-
pubip = azure_network_service.public_ips.create(
|
303
|
-
name: '<Public IP name>',
|
304
|
-
resource_group: '<Resource Group name>',
|
305
|
-
location: 'westus',
|
306
|
-
public_ip_allocation_method: 'Static'
|
307
|
-
)
|
308
|
-
```
|
309
|
-
|
310
|
-
## Check for Public IP
|
311
|
-
|
312
|
-
Checks if the Public IP already exists or not.
|
313
|
-
|
314
|
-
```ruby
|
315
|
-
azure_network_service.public_ips.check_if_exists('<Public IP name>', '<Resource Group name>')
|
316
|
-
```
|
317
|
-
|
318
|
-
## List Public IPs
|
319
|
-
|
320
|
-
List network interfaces in a resource group
|
321
|
-
|
322
|
-
```ruby
|
323
|
-
pubips = azure_network_service.public_ips(resource_group: '<Resource Group name>')
|
324
|
-
pubips.each do |pubip|
|
325
|
-
puts "#{pubip.name}"
|
326
|
-
end
|
327
|
-
```
|
328
|
-
|
329
|
-
## Retrieve a single Public Ip
|
330
|
-
|
331
|
-
Get a single record of Public Ip
|
332
|
-
|
333
|
-
```ruby
|
334
|
-
pubip = azure_network_service
|
335
|
-
.public_ips
|
336
|
-
.get('<Resource Group name>', '<Public IP name>')
|
337
|
-
puts "#{pubip.name}"
|
338
|
-
```
|
339
|
-
|
340
|
-
## Update Public Ip
|
341
|
-
|
342
|
-
Get a Public IP object from the get method and then update that public IP. You can update the Public IP by passing the modifiable attributes in the form of a hash.
|
343
|
-
|
344
|
-
```ruby
|
345
|
-
pubip.update(
|
346
|
-
public_ip_allocation_method: '<IP Allocation Method>',
|
347
|
-
idle_timeout_in_minutes: '<Idle Timeout In Minutes>',
|
348
|
-
domain_name_label: '<Domain Name Label>'
|
349
|
-
)
|
350
|
-
```
|
351
|
-
|
352
|
-
## Destroy a single Public Ip
|
353
|
-
|
354
|
-
Get a Public IP object from the get method and then destroy that public IP.
|
355
|
-
|
356
|
-
```ruby
|
357
|
-
pubip.destroy
|
358
|
-
```
|
359
|
-
|
360
|
-
## Create Network Security Group
|
361
|
-
|
362
|
-
Network security group requires a resource group to create.
|
363
|
-
|
364
|
-
```ruby
|
365
|
-
azure_network_service.network_security_groups.create(
|
366
|
-
name: '<Network Security Group name>',
|
367
|
-
resource_group: '<Resource Group name>',
|
368
|
-
location: 'eastus',
|
369
|
-
security_rules: [{
|
370
|
-
name: '<Security Rule name>',
|
371
|
-
protocol: 'tcp',
|
372
|
-
source_port_range: '22',
|
373
|
-
destination_port_range: '22',
|
374
|
-
source_address_prefix: '0.0.0.0/0',
|
375
|
-
destination_address_prefix: '0.0.0.0/0',
|
376
|
-
access: 'Allow',
|
377
|
-
priority: '100',
|
378
|
-
direction: 'Inbound'
|
379
|
-
}]
|
380
|
-
)
|
381
|
-
```
|
382
|
-
|
383
|
-
## List Network Security Groups
|
384
|
-
|
385
|
-
List all the network security groups in a resource group
|
386
|
-
|
387
|
-
```ruby
|
388
|
-
network_security_groups = azure_network_service.network_security_groups(resource_group: '<Resource Group name>')
|
389
|
-
network_security_groups.each do |nsg|
|
390
|
-
puts "#{nsg.name}"
|
391
|
-
end
|
392
|
-
```
|
393
|
-
|
394
|
-
## Retrieve a single Network Security Group
|
395
|
-
|
396
|
-
Get a single record of Network Security Group
|
397
|
-
|
398
|
-
```ruby
|
399
|
-
nsg = azure_network_service
|
400
|
-
.network_security_groups
|
401
|
-
.get('<Resource Group Name>','<Network Security Group name>')
|
402
|
-
puts "#{nsg.name}"
|
403
|
-
```
|
404
|
-
|
405
|
-
## Update Security Rules
|
406
|
-
|
407
|
-
You can update security rules by passing the modified attributes in the form of hash.
|
408
|
-
|
409
|
-
```ruby
|
410
|
-
nsg.update_security_rules(
|
411
|
-
security_rules:
|
412
|
-
[
|
413
|
-
{
|
414
|
-
name: '<Security Rule name>',
|
415
|
-
protocol: 'tcp',
|
416
|
-
source_port_range: '*',
|
417
|
-
destination_port_range: '*',
|
418
|
-
source_address_prefix: '0.0.0.0/0',
|
419
|
-
destination_address_prefix: '0.0.0.0/0',
|
420
|
-
access: 'Allow',
|
421
|
-
priority: '100',
|
422
|
-
direction: 'Inbound'
|
423
|
-
}
|
424
|
-
]
|
425
|
-
)
|
426
|
-
```
|
427
|
-
`Note: You can't modify Name of a security rule.`
|
428
|
-
|
429
|
-
## Add and Remove Security Rules in a Network Security Group
|
430
|
-
|
431
|
-
Add array of security rules in the form of hash.
|
432
|
-
|
433
|
-
```ruby
|
434
|
-
nsg.add_security_rules(
|
435
|
-
[
|
436
|
-
{
|
437
|
-
name: '<Security Rule name>',
|
438
|
-
protocol: 'tcp',
|
439
|
-
source_port_range: '3389',
|
440
|
-
destination_port_range: '3389',
|
441
|
-
source_address_prefix: '0.0.0.0/0',
|
442
|
-
destination_address_prefix: '0.0.0.0/0',
|
443
|
-
access: 'Allow',
|
444
|
-
priority: '102',
|
445
|
-
direction: 'Inbound'
|
446
|
-
}
|
447
|
-
]
|
448
|
-
)
|
449
|
-
```
|
450
|
-
|
451
|
-
Delete security rule by providing its name.
|
452
|
-
|
453
|
-
```ruby
|
454
|
-
nsg.remove_security_rule('<Security Rule name>')
|
455
|
-
```
|
456
|
-
|
457
|
-
## Destroy a Network Security Group
|
458
|
-
|
459
|
-
Get a network security group object from the get method and then destroy that network security group.
|
460
|
-
|
461
|
-
```ruby
|
462
|
-
nsg.destroy
|
463
|
-
```
|
464
|
-
|
465
|
-
## Create Network Security Rule
|
466
|
-
|
467
|
-
Network security rule requires a resource group and network security group to create.
|
468
|
-
|
469
|
-
```ruby
|
470
|
-
azure_network_service.network_security_rules.create(
|
471
|
-
name: '<Security Rule name>',
|
472
|
-
resource_group: '<Resource Group name>',
|
473
|
-
protocol: 'tcp',
|
474
|
-
network_security_group_name: '<Network Security Group name>',
|
475
|
-
source_port_range: '22',
|
476
|
-
destination_port_range: '22',
|
477
|
-
source_address_prefix: '0.0.0.0/0',
|
478
|
-
destination_address_prefix: '0.0.0.0/0',
|
479
|
-
access: 'Allow',
|
480
|
-
priority: '100',
|
481
|
-
direction: 'Inbound'
|
482
|
-
)
|
483
|
-
```
|
484
|
-
|
485
|
-
## List Network Security Rules
|
486
|
-
|
487
|
-
List all the network security rules in a resource group and network security group
|
488
|
-
|
489
|
-
```ruby
|
490
|
-
network_security_rules = azure_network_service.network_security_rules(resource_group: '<Resource Group name>',
|
491
|
-
network_security_group_name: '<Network Security Group name>')
|
492
|
-
network_security_rules.each do |network_security_rule|
|
493
|
-
puts network_security_rule.name
|
494
|
-
end
|
495
|
-
```
|
496
|
-
|
497
|
-
## Retrieve a single Network Security Rule
|
498
|
-
|
499
|
-
Get a single record of Network Security Rule
|
500
|
-
|
501
|
-
```ruby
|
502
|
-
network_security_rule = azure_network_service
|
503
|
-
.network_security_rules
|
504
|
-
.get(<Resource Group Name>','<Network Security Group name>', '<Security Rule name>')
|
505
|
-
puts "#{network_security_rule.name}"
|
506
|
-
```
|
507
|
-
|
508
|
-
## Destroy a Network Security Rule
|
509
|
-
|
510
|
-
Get a network security rule object from the get method and then destroy that network security rule.
|
511
|
-
|
512
|
-
```ruby
|
513
|
-
network_security_rule.destroy
|
514
|
-
```
|
515
|
-
|
516
|
-
## Create External Load Balancer
|
517
|
-
|
518
|
-
Create a new load balancer.
|
519
|
-
|
520
|
-
```ruby
|
521
|
-
lb = azure_network_service.load_balancers.create(
|
522
|
-
name: '<Load Balancer name>',
|
523
|
-
resource_group: '<Resource Group name>',
|
524
|
-
location: 'westus',
|
525
|
-
|
526
|
-
frontend_ip_configurations:
|
527
|
-
[
|
528
|
-
{
|
529
|
-
name: 'fic',
|
530
|
-
private_ipallocation_method: 'Dynamic',
|
531
|
-
public_ipaddress_id: '/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/publicIPAddresses/<Public-IP-Name>'
|
532
|
-
}
|
533
|
-
],
|
534
|
-
backend_address_pool_names:
|
535
|
-
[
|
536
|
-
'pool1'
|
537
|
-
],
|
538
|
-
load_balancing_rules:
|
539
|
-
[
|
540
|
-
{
|
541
|
-
name: 'lb_rule_1',
|
542
|
-
frontend_ip_configuration_id: '/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load Balancer name>/frontendIPConfigurations/fic',
|
543
|
-
backend_address_pool_id: '/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load Balancer name>/backendAddressPools/pool1',
|
544
|
-
protocol: 'Tcp',
|
545
|
-
frontend_port: '80',
|
546
|
-
backend_port: '8080',
|
547
|
-
enable_floating_ip: false,
|
548
|
-
idle_timeout_in_minutes: 4,
|
549
|
-
load_distribution: "Default"
|
550
|
-
}
|
551
|
-
],
|
552
|
-
inbound_nat_rules:
|
553
|
-
[
|
554
|
-
{
|
555
|
-
name: 'RDP-Traffic',
|
556
|
-
frontend_ip_configuration_id: '/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load Balancer name>/frontendIPConfigurations/fic',
|
557
|
-
protocol: 'Tcp',
|
558
|
-
frontend_port: 3389,
|
559
|
-
backend_port: 3389
|
560
|
-
}
|
561
|
-
]
|
562
|
-
)
|
563
|
-
```
|
564
|
-
|
565
|
-
## Create Internal Load Balancer
|
566
|
-
|
567
|
-
```ruby
|
568
|
-
|
569
|
-
lb = azure_network_service.load_balancers.create(
|
570
|
-
name: '<Load Balancer name>',
|
571
|
-
resource_group: '<Resource Group name>',
|
572
|
-
location: 'westus',
|
573
|
-
frontend_ip_configurations:
|
574
|
-
[
|
575
|
-
{
|
576
|
-
name: 'LB-Frontend',
|
577
|
-
private_ipallocation_method: 'Static',
|
578
|
-
private_ipaddress: '10.1.2.5',
|
579
|
-
subnet_id: subnet.id
|
580
|
-
}
|
581
|
-
],
|
582
|
-
backend_address_pool_names:
|
583
|
-
[
|
584
|
-
'LB-backend'
|
585
|
-
],
|
586
|
-
load_balancing_rules:
|
587
|
-
[
|
588
|
-
{
|
589
|
-
name: 'HTTP',
|
590
|
-
frontend_ip_configuration_id: "/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load-Balancer-Name>/frontendIPConfigurations/LB-Frontend",
|
591
|
-
backend_address_pool_id: "/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load-Balancer-Name>/backendAddressPools/LB-backend",
|
592
|
-
probe_id: "/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers<Load-Balancer-Name>lb/probes/HealthProbe",
|
593
|
-
protocol: 'Tcp',
|
594
|
-
frontend_port: '80',
|
595
|
-
backend_port: '80'
|
596
|
-
}
|
597
|
-
],
|
598
|
-
inbound_nat_rules:
|
599
|
-
[
|
600
|
-
{
|
601
|
-
name: 'RDP1',
|
602
|
-
frontend_ip_configuration_id: "/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load-Balancer-Name>/frontendIPConfigurations/LB-Frontend",
|
603
|
-
protocol: 'Tcp',
|
604
|
-
frontend_port: 3441,
|
605
|
-
backend_port: 3389
|
606
|
-
},
|
607
|
-
{
|
608
|
-
name: 'RDP2',
|
609
|
-
frontend_ip_configuration_id: "/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load-Balancer-Name>/frontendIPConfigurations/LB-Frontend",
|
610
|
-
protocol: 'Tcp',
|
611
|
-
frontend_port: 3442,
|
612
|
-
backend_port: 3389
|
613
|
-
}
|
614
|
-
],
|
615
|
-
probes:
|
616
|
-
[
|
617
|
-
{
|
618
|
-
name: 'HealthProbe',
|
619
|
-
protocol: 'http',
|
620
|
-
request_path: 'HealthProbe.aspx',
|
621
|
-
port: '80',
|
622
|
-
interval_in_seconds: 15,
|
623
|
-
number_of_probes: 2
|
624
|
-
}
|
625
|
-
]
|
626
|
-
)
|
627
|
-
```
|
628
|
-
|
629
|
-
## List Load Balancers
|
630
|
-
|
631
|
-
List all load balancers in a resource group
|
632
|
-
|
633
|
-
```ruby
|
634
|
-
lbs = azure_network_service.load_balancers(resource_group: '<Resource Group name>')
|
635
|
-
lbs.each do |lb|
|
636
|
-
puts "#{lb.name}"
|
637
|
-
end
|
638
|
-
```
|
639
|
-
|
640
|
-
## Retrieve a single Load Balancer
|
641
|
-
|
642
|
-
Get a single record of Load Balancer
|
643
|
-
|
644
|
-
```ruby
|
645
|
-
lb = azure_network_service
|
646
|
-
.load_balancers
|
647
|
-
.get('<Resource Group name>', '<Load Balancer name>')
|
648
|
-
puts "#{lb.name}"
|
649
|
-
```
|
650
|
-
|
651
|
-
## Destroy a Load Balancer
|
652
|
-
|
653
|
-
Get a load balancer object from the get method and then destroy that load balancer.
|
654
|
-
|
655
|
-
```ruby
|
656
|
-
lb.destroy
|
657
|
-
```
|
658
|
-
|
659
|
-
## Create Virtual Network Gateway
|
660
|
-
|
661
|
-
Create a new Virtual Network Gateway.
|
662
|
-
|
663
|
-
```ruby
|
664
|
-
network_gateway = network.virtual_network_gateways.create(
|
665
|
-
name: '<Virtual Network Gateway Name>',
|
666
|
-
location: 'eastus',
|
667
|
-
tags: {
|
668
|
-
key1: 'value1',
|
669
|
-
key2: 'value2'
|
670
|
-
},
|
671
|
-
ip_configurations: [
|
672
|
-
{
|
673
|
-
name: 'default',
|
674
|
-
private_ipallocation_method: 'Dynamic',
|
675
|
-
public_ipaddress_id: '/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Network/publicIPAddresses/{public_ip_name}',
|
676
|
-
subnet_id: '/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Network/virtualNetworks/{virtual_network_name}/subnets/{subnet_name}',
|
677
|
-
private_ipaddress: nil
|
678
|
-
}
|
679
|
-
],
|
680
|
-
resource_group: 'learn_fog',
|
681
|
-
sku_name: 'Standard',
|
682
|
-
sku_tier: 'Standard',
|
683
|
-
sku_capacity: 2,
|
684
|
-
gateway_type: 'ExpressRoute',
|
685
|
-
enable_bgp: true,
|
686
|
-
gateway_size: nil,
|
687
|
-
asn: 100,
|
688
|
-
bgp_peering_address: nil,
|
689
|
-
peer_weight: 3,
|
690
|
-
vpn_type: 'RouteBased',
|
691
|
-
vpn_client_address_pool: [],
|
692
|
-
gateway_default_site: '/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Network/localNetworkGateways/{local_network_gateway_name}',
|
693
|
-
default_sites: [],
|
694
|
-
vpn_client_configuration: {
|
695
|
-
address_pool: ['192.168.0.4', '192.168.0.5'],
|
696
|
-
root_certificates: [
|
697
|
-
{
|
698
|
-
name: 'root',
|
699
|
-
public_cert_data: 'certificate data'
|
700
|
-
}
|
701
|
-
],
|
702
|
-
revoked_certificates: [
|
703
|
-
{
|
704
|
-
name: 'revoked',
|
705
|
-
thumbprint: 'thumb print detail'
|
706
|
-
}
|
707
|
-
]
|
708
|
-
}
|
709
|
-
)
|
710
|
-
```
|
711
|
-
|
712
|
-
## List Virtual Network Gateways
|
713
|
-
|
714
|
-
List all virtual network gateways in a resource group
|
715
|
-
|
716
|
-
```ruby
|
717
|
-
network_gateways = network.virtual_network_gateways(resource_group: '<Resource Group Name>')
|
718
|
-
network_gateways.each do |gateway|
|
719
|
-
puts "#{gateway.name}"
|
720
|
-
end
|
721
|
-
```
|
722
|
-
|
723
|
-
## Retrieve single Virtual Network Gateway
|
724
|
-
|
725
|
-
Get single record of Virtual Network Gateway
|
726
|
-
|
727
|
-
```ruby
|
728
|
-
network_gateway = network.virtual_network_gateways.get('<Resource Group Name>', '<Virtual Network Gateway Name>')
|
729
|
-
puts "#{network_gateway.name}"
|
730
|
-
```
|
731
|
-
|
732
|
-
## Destroy single Virtual Network Gateway
|
733
|
-
|
734
|
-
Get a virtual network gateway object from the get method and then destroy that virtual network gateway.
|
735
|
-
|
736
|
-
```ruby
|
737
|
-
network_gateway.destroy
|
738
|
-
```
|
739
|
-
|
740
|
-
## Create Local Network Gateway
|
741
|
-
|
742
|
-
Create a new Local Network Gateway.
|
743
|
-
|
744
|
-
```ruby
|
745
|
-
local_network_gateway = network.local_network_gateways.create(
|
746
|
-
name: "<Local Network Gateway Name>",
|
747
|
-
location: "eastus",
|
748
|
-
tags: {
|
749
|
-
key1: "value1",
|
750
|
-
key2: "value2"
|
751
|
-
},
|
752
|
-
resource_group: "<Resource Group Name>",
|
753
|
-
gateway_ip_address: '192.168.1.1',
|
754
|
-
local_network_address_space_prefixes: [],
|
755
|
-
asn: 100,
|
756
|
-
bgp_peering_address: '192.168.1.2',
|
757
|
-
peer_weight: 3
|
758
|
-
)
|
759
|
-
```
|
760
|
-
|
761
|
-
## List Local Network Gateways
|
762
|
-
|
763
|
-
List all local network gateways in a resource group
|
764
|
-
|
765
|
-
```ruby
|
766
|
-
local_network_gateways = network.local_network_gateways(resource_group: '<Resource Group Name>')
|
767
|
-
local_network_gateways.each do |gateway|
|
768
|
-
puts "#{gateway.name}"
|
769
|
-
end
|
770
|
-
```
|
771
|
-
|
772
|
-
## Retrieve single Local Network Gateway
|
773
|
-
|
774
|
-
Get single record of Local Network Gateway
|
775
|
-
|
776
|
-
```ruby
|
777
|
-
local_network_gateway = network.local_network_gateways.get('<Resource Group Name>', '<Local Network Gateway Name>')
|
778
|
-
puts "#{local_network_gateway.name}"
|
779
|
-
```
|
780
|
-
|
781
|
-
## Destroy single Local Network Gateway
|
782
|
-
|
783
|
-
Get a local network gateway object from the get method and then destroy that local network gateway.
|
784
|
-
|
785
|
-
```ruby
|
786
|
-
local_network_gateway.destroy
|
787
|
-
```
|
788
|
-
|
789
|
-
## Express Route
|
790
|
-
|
791
|
-
Microsoft Azure ExpressRoute lets you extend your on-premises networks into the Microsoft cloud over a dedicated private connection facilitated by a connectivity provider.
|
792
|
-
For more details about express route [click here](https://azure.microsoft.com/en-us/documentation/articles/expressroute-introduction/).
|
793
|
-
|
794
|
-
# Express Route Circuit
|
795
|
-
|
796
|
-
The Circuit represents the entity created by customer to register with an express route service provider with intent to connect to Microsoft.
|
797
|
-
|
798
|
-
## Create an Express Route Circuit
|
799
|
-
|
800
|
-
Create a new Express Route Circuit.
|
801
|
-
|
802
|
-
```ruby
|
803
|
-
circuit = network.express_route_circuits.create(
|
804
|
-
"name": "<Circuit Name>",
|
805
|
-
"location": "eastus",
|
806
|
-
"resource_group": "<Resource Group Name>",
|
807
|
-
"tags": {
|
808
|
-
"key1": 'value1',
|
809
|
-
"key2": 'value2'
|
810
|
-
},
|
811
|
-
"sku_name": "Standard_MeteredData",
|
812
|
-
"sku_tier": "Standard",
|
813
|
-
"sku_family": "MeteredData",
|
814
|
-
"service_provider_name": "Telenor",
|
815
|
-
"peering_location": "London",
|
816
|
-
"bandwidth_in_mbps": 100,
|
817
|
-
"peerings": [
|
818
|
-
{
|
819
|
-
"name": "AzurePublicPeering",
|
820
|
-
"peering_type": "AzurePublicPeering",
|
821
|
-
"peer_asn": 100,
|
822
|
-
"primary_peer_address_prefix": "192.168.1.0/30",
|
823
|
-
"secondary_peer_address_prefix": "192.168.2.0/30",
|
824
|
-
"vlan_id": 200
|
825
|
-
}
|
826
|
-
]
|
827
|
-
)
|
828
|
-
```
|
829
|
-
|
830
|
-
## List Express Route Circuits
|
831
|
-
|
832
|
-
List all express route circuits in a resource group
|
833
|
-
|
834
|
-
```ruby
|
835
|
-
circuits = network.express_route_circuits(resource_group: '<Resource Group Name>')
|
836
|
-
circuits.each do |circuit|
|
837
|
-
puts "#{circuit.name}"
|
838
|
-
end
|
839
|
-
```
|
840
|
-
|
841
|
-
## Retrieve a single Express Route Circuit
|
842
|
-
|
843
|
-
Get a single record of Express Route Circuit
|
844
|
-
|
845
|
-
```ruby
|
846
|
-
circuit = network.express_route_circuits.get("<Resource Group Name>", "<Circuit Name>")
|
847
|
-
puts "#{circuit.name}"
|
848
|
-
```
|
849
|
-
|
850
|
-
## Destroy a single Express Route Circuit
|
851
|
-
|
852
|
-
Get an express route circuit object from the get method and then destroy that express route circuit.
|
853
|
-
|
854
|
-
```ruby
|
855
|
-
circuit.destroy
|
856
|
-
```
|
857
|
-
# Express Route Authorization
|
858
|
-
|
859
|
-
Authorization is part of Express Route circuit.
|
860
|
-
|
861
|
-
## Create an Express Route Circuit Authorization
|
862
|
-
|
863
|
-
Create a new Express Route Circuit Authorization. Parameter 'authorization_status' can be 'Available' or 'InUse'.
|
864
|
-
|
865
|
-
```ruby
|
866
|
-
authorization = network.express_route_circuit_authorizations.create(
|
867
|
-
"resource_group": "<Resourse Group Name>",
|
868
|
-
"name": "<Resource-Unique-Name>",
|
869
|
-
"circuit_name": "<Circuit Name>",
|
870
|
-
"authorization_status": "Available",
|
871
|
-
"authorization_name": "<Authorization-Name>",
|
872
|
-
)
|
873
|
-
```
|
874
|
-
|
875
|
-
## List Express Route Circuit Authorizations
|
876
|
-
|
877
|
-
List all express route circuit authorizations in a resource group.
|
878
|
-
|
879
|
-
```ruby
|
880
|
-
authorizations = network.express_route_circuit_authorizations(resource_group: '<Resource Group Name>', circuit_name: '<Circuit Name>')
|
881
|
-
authorizations.each do |authorization|
|
882
|
-
puts "#{authorization.name}"
|
883
|
-
end
|
884
|
-
```
|
885
|
-
|
886
|
-
## Retrieve single Express Route Circuit Authorization
|
887
|
-
|
888
|
-
Get a single record of Express Route Circuit Authorization.
|
889
|
-
|
890
|
-
```ruby
|
891
|
-
authorization = network.express_route_circuit_authorizations.get("<Resource Group Name>", "Circuit Name", "Authorization Name")
|
892
|
-
puts "#{authorization.name}"
|
893
|
-
```
|
894
|
-
|
895
|
-
## Destroy single Express Route Circuit Authorization
|
896
|
-
|
897
|
-
Get an express route circuit authorization object from the get method and then destroy that express route circuit authorization.
|
898
|
-
|
899
|
-
```ruby
|
900
|
-
authorization.destroy
|
901
|
-
```
|
902
|
-
|
903
|
-
|
904
|
-
# Express Route Peering
|
905
|
-
|
906
|
-
BGP Peering is part of Express Route circuit and defines the type of connectivity needed with Microsoft.
|
907
|
-
|
908
|
-
## Create an Express Route Circuit Peering
|
909
|
-
|
910
|
-
Create a new Express Route Circuit Peering.
|
911
|
-
|
912
|
-
```ruby
|
913
|
-
peering = network.express_route_circuit_peerings.create(
|
914
|
-
"name": "AzurePrivatePeering",
|
915
|
-
"circuit_name": "<Circuit Name>",
|
916
|
-
"resource_group": "<Resourse Group Name>",
|
917
|
-
"peering_type": "AzurePrivatePeering",
|
918
|
-
"peer_asn": 100,
|
919
|
-
"primary_peer_address_prefix": "192.168.3.0/30",
|
920
|
-
"secondary_peer_address_prefix": "192.168.4.0/30",
|
921
|
-
"vlan_id": 200
|
922
|
-
)
|
923
|
-
```
|
924
|
-
|
925
|
-
## List Express Route Circuit Peerings
|
926
|
-
|
927
|
-
List all express route circuit peerings in a resource group
|
928
|
-
|
929
|
-
```ruby
|
930
|
-
peerings = network.express_route_circuit_peerings(resource_group: '<Resource Group Name>', circuit_name: '<Circuit Name>')
|
931
|
-
peerings.each do |peering|
|
932
|
-
puts "#{peering.name}"
|
933
|
-
end
|
934
|
-
```
|
935
|
-
|
936
|
-
## Retrieve single Express Route Circuit Peering
|
937
|
-
|
938
|
-
Get a single record of Express Route Circuit Peering
|
939
|
-
|
940
|
-
```ruby
|
941
|
-
peering = network.express_route_circuit_peerings.get("<Resource Group Name>", "<Peering Name>", "Circuit Name")
|
942
|
-
puts "#{peering.peering_type}"
|
943
|
-
```
|
944
|
-
|
945
|
-
## Destroy single Express Route Circuit Peering
|
946
|
-
|
947
|
-
Get an express route circuit peering object from the get method and then destroy that express route circuit peering.
|
948
|
-
|
949
|
-
```ruby
|
950
|
-
peering.destroy
|
951
|
-
```
|
952
|
-
|
953
|
-
# Express Route Service Provider
|
954
|
-
|
955
|
-
Express Route Service Providers are telcos and exchange providers who are approved in the system to provide Express Route connectivity.
|
956
|
-
|
957
|
-
## List Express Route Service Providers
|
958
|
-
|
959
|
-
List all express route service providers
|
960
|
-
|
961
|
-
```ruby
|
962
|
-
service_providers = network.express_route_service_providers
|
963
|
-
puts service_providers
|
964
|
-
```
|
965
|
-
|
966
|
-
## Create Virtual Network Gateway Connection
|
967
|
-
|
968
|
-
Create a new Virtual Network Gateway Connection.
|
969
|
-
|
970
|
-
```ruby
|
971
|
-
gateway_connection = network.virtual_network_gateway_connections.create(
|
972
|
-
name: '<Virtual Network Gateway Connection Name>',
|
973
|
-
location: 'eastus',
|
974
|
-
tags: {
|
975
|
-
key1: 'value1',
|
976
|
-
key2: 'value2'
|
977
|
-
},
|
978
|
-
resource_group: '<Resource Group Name>',
|
979
|
-
virtual_network_gateway1: {
|
980
|
-
name: 'firstgateway',
|
981
|
-
resource_group: '<Resource Group Name>'
|
982
|
-
},
|
983
|
-
virtual_network_gateway2: {
|
984
|
-
name: 'secondgateway',
|
985
|
-
resource_group: '<Resource Group Name>'
|
986
|
-
}
|
987
|
-
connection_type: 'VNet-to-VNet'
|
988
|
-
)
|
989
|
-
```
|
990
|
-
|
991
|
-
## List Virtual Network Gateway Connections
|
992
|
-
|
993
|
-
List all virtual network gateway connections in a resource group
|
994
|
-
|
995
|
-
```ruby
|
996
|
-
gateway_connections = network.virtual_network_gateway_connections(resource_group: '<Resource Group Name>')
|
997
|
-
gateway_connections.each do |connection|
|
998
|
-
puts "#{connection.name}"
|
999
|
-
end
|
1000
|
-
```
|
1001
|
-
|
1002
|
-
## Retrieve single Virtual Network Gateway Connection
|
1003
|
-
|
1004
|
-
Get single record of Virtual Network Gateway Connection
|
1005
|
-
|
1006
|
-
```ruby
|
1007
|
-
gateway_connection = network.virtual_network_gateway_connections.get('<Resource Group Name>', '<Virtual Network Gateway Connection Name>')
|
1008
|
-
puts "#{gateway_connection.name}"
|
1009
|
-
```
|
1010
|
-
|
1011
|
-
## Destroy single Virtual Network Gateway Connection
|
1012
|
-
|
1013
|
-
Get a virtual network gateway connection object from the get method and then destroy that virtual network gateway connection.
|
1014
|
-
|
1015
|
-
```ruby
|
1016
|
-
gateway_connection.destroy
|
1017
|
-
```
|
1018
|
-
|
1019
|
-
## Get the shared key for a connection
|
1020
|
-
|
1021
|
-
```ruby
|
1022
|
-
shared_key = network.get_connection_shared_key('<Resource Group Name>', '<Virtual Network Gateway Connection Name>')
|
1023
|
-
puts gateway_connection
|
1024
|
-
```
|
1025
|
-
|
1026
|
-
## Set the shared key for a connection
|
1027
|
-
|
1028
|
-
```ruby
|
1029
|
-
network.set_connection_shared_key('<Resource Group Name>', '<Virtual Network Gateway Connection Name>', 'Value')
|
1030
|
-
```
|
1031
|
-
|
1032
|
-
## Reset the shared key for a connection
|
1033
|
-
|
1034
|
-
```ruby
|
1035
|
-
network.reset_connection_shared_key('<Resource Group Name>', '<Virtual Network Gateway Connection Name>', <Key Length in Integer>)
|
1036
|
-
```
|
1037
|
-
|
1038
|
-
|
1039
|
-
## Support and Feedback
|
1040
|
-
Your feedback is highly appreciated! If you have specific issues with the fog ARM, you should file an issue via Github.
|
1
|
+
# Network
|
2
|
+
|
3
|
+
This document explains how to get started using Azure Network Service with Fog. With this gem you can create/update/list/delete virtual networks, subnets, public IPs and network interfaces.
|
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
|
+
## Create Connection
|
13
|
+
|
14
|
+
Next, create a connection to the Network Service:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
azure_network_service = Fog::Network::AzureRM.new(
|
18
|
+
tenant_id: '<Tenantid>', # Tenant id of Azure Active Directory Application
|
19
|
+
client_id: '<Clientid>', # Client id of Azure Active Directory Application
|
20
|
+
client_secret: '<ClientSecret>', # Client Secret of Azure Active Directory Application
|
21
|
+
subscription_id: '<Subscriptionid>' # Subscription id of an Azure Account
|
22
|
+
)
|
23
|
+
```
|
24
|
+
## Create Virtual Network
|
25
|
+
|
26
|
+
Create a new virtual network
|
27
|
+
|
28
|
+
Optional parameters for Virtual Network: subnets, dns_servers & address_prefixes
|
29
|
+
Optional parameters for Subnet: network_security_group_id, route_table_id & address_prefix
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
vnet = azure_network_service.virtual_networks.create(
|
33
|
+
name: '<Virtual Network Name>',
|
34
|
+
location: 'westus',
|
35
|
+
resource_group: '<Resource Group Name>',
|
36
|
+
subnets: [{
|
37
|
+
name: '<Subnet Name>',
|
38
|
+
address_prefix: '10.1.0.0/24',
|
39
|
+
network_security_group_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/networkSecurityGroups/<Network Security Group Name>',
|
40
|
+
route_table_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/routeTables/<Route Table Name>'
|
41
|
+
}],
|
42
|
+
dns_servers: ['10.1.0.0','10.2.0.0'],
|
43
|
+
address_prefixes: ['10.1.0.0/16','10.2.0.0/16']
|
44
|
+
)
|
45
|
+
```
|
46
|
+
|
47
|
+
## Check for Virtual Network
|
48
|
+
|
49
|
+
Checks if the Virtual Network already exists or not.
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
azure_network_service.virtual_networks.check_if_exists('<Virtual Network name>', '<Resource Group name>')
|
53
|
+
```
|
54
|
+
|
55
|
+
## List Virtual Networks
|
56
|
+
|
57
|
+
List all virtual networks in a subscription
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
vnets = azure_network_service.virtual_networks(resource_group: '<Resource Group Name>')
|
61
|
+
vnets.each do |vnet|
|
62
|
+
puts "#{vnet.name}"
|
63
|
+
puts "#{vnet.location}"
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
67
|
+
## Retrieve a single Virtual Network
|
68
|
+
|
69
|
+
Get a single record of virtual network
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
vnet = azure_network_service.virtual_networks.get('<Resource Group Name>', '<Virtual Network name>')
|
73
|
+
puts "#{vnet.name}"
|
74
|
+
```
|
75
|
+
|
76
|
+
## Add/Remove DNS Servers to/from Virtual Network
|
77
|
+
|
78
|
+
Add/Remove DNS Servers to/from Virtual Network
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
vnet.add_dns_servers(['10.3.0.0','10.4.0.0'])
|
82
|
+
vnet.remove_dns_servers(['10.3.0.0','10.4.0.0'])
|
83
|
+
```
|
84
|
+
|
85
|
+
## Add/Remove Address Prefixes to/from Virtual Network
|
86
|
+
|
87
|
+
Add/Remove Address Prefixes to/from Virtual Network
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
vnet.add_address_prefixes(['10.2.0.0/16', '10.3.0.0/16'])
|
91
|
+
vnet.remove_address_prefixes(['10.2.0.0/16'])
|
92
|
+
```
|
93
|
+
|
94
|
+
## Add/Remove Subnets to/from Virtual Network
|
95
|
+
|
96
|
+
Add/Remove Subnets to/from Virtual Network
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
vnet.add_subnets([{
|
100
|
+
name: 'test-subnet',
|
101
|
+
address_prefix: '10.3.0.0/24'
|
102
|
+
}])
|
103
|
+
|
104
|
+
vnet.remove_subnets(['test-subnet'])
|
105
|
+
```
|
106
|
+
|
107
|
+
## Update Virtual Network
|
108
|
+
|
109
|
+
Update Virtual Network
|
110
|
+
|
111
|
+
```ruby
|
112
|
+
vnet.update({
|
113
|
+
subnets:[{
|
114
|
+
name: 'fog-subnet',
|
115
|
+
address_prefix: '10.3.0.0/16'
|
116
|
+
}],
|
117
|
+
dns_servers: ['10.3.0.0','10.4.0.0']
|
118
|
+
})
|
119
|
+
```
|
120
|
+
|
121
|
+
## Destroy a single virtual network
|
122
|
+
|
123
|
+
Get virtual network object from the get method and then destroy that virtual network.
|
124
|
+
|
125
|
+
```ruby
|
126
|
+
vnet.destroy
|
127
|
+
```
|
128
|
+
|
129
|
+
## Create Subnet
|
130
|
+
|
131
|
+
Create a new Subnet
|
132
|
+
|
133
|
+
Optional parameters: network_security_group_id, route_table_id & address_prefix
|
134
|
+
|
135
|
+
```ruby
|
136
|
+
subnet = azure_network_service.subnets.create(
|
137
|
+
name: '<Subnet Name>',
|
138
|
+
resource_group: '<Resource Group Name>',
|
139
|
+
virtual_network_name: '<Virtual Network Name>',
|
140
|
+
address_prefix: '10.0.0.0/24',
|
141
|
+
network_security_group_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/networkSecurityGroups/<Network Security Group Name>',
|
142
|
+
route_table_id: '/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/routeTables/<Route Table Name>'
|
143
|
+
)
|
144
|
+
```
|
145
|
+
|
146
|
+
## List Subnets
|
147
|
+
|
148
|
+
List subnets in a resource group and a virtual network
|
149
|
+
|
150
|
+
```ruby
|
151
|
+
subnets = azure_network_service.subnets(resource_group: '<Resource Group name>', virtual_network_name: '<Virtual Network name>')
|
152
|
+
subnets.each do |subnet|
|
153
|
+
puts "#{subnet.name}"
|
154
|
+
end
|
155
|
+
```
|
156
|
+
|
157
|
+
## Retrieve a single Subnet
|
158
|
+
|
159
|
+
Get a single record of Subnet
|
160
|
+
|
161
|
+
```ruby
|
162
|
+
subnet = azure_network_service
|
163
|
+
.subnets
|
164
|
+
.get('<Resource Group name>', '<Virtual Network name>', '<Subnet name>')
|
165
|
+
puts "#{subnet.name}"
|
166
|
+
```
|
167
|
+
|
168
|
+
## Attach Network Security Group to Subnet
|
169
|
+
|
170
|
+
Attach Network Security Group to Subnet
|
171
|
+
|
172
|
+
```ruby
|
173
|
+
subnet = azure_network_service.attach_network_security_group('/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/networkSecurityGroups/<Network Security Group Name>')
|
174
|
+
puts "#{subnet.network_security_group_id}"
|
175
|
+
```
|
176
|
+
|
177
|
+
## Detach Network Security Group from Subnet
|
178
|
+
|
179
|
+
Detach Network Security Group from Subnet
|
180
|
+
|
181
|
+
```ruby
|
182
|
+
subnet = azure_network_service.detach_network_security_group
|
183
|
+
puts "#{subnet.network_security_group_id}"
|
184
|
+
```
|
185
|
+
|
186
|
+
## Attach Route Table to Subnet
|
187
|
+
|
188
|
+
Attach Route Table to Subnet
|
189
|
+
|
190
|
+
```ruby
|
191
|
+
subnet = azure_network_service.attach_route_table('/subscriptions/<Subscription Id>/resourceGroups/<Resource Group Name>/providers/Microsoft.Network/routeTables/<Route Table Name>')
|
192
|
+
puts "#{subnet.route_table_id}"
|
193
|
+
```
|
194
|
+
|
195
|
+
## Detach Route Table from Subnet
|
196
|
+
|
197
|
+
Detach Route Table from Subnet
|
198
|
+
|
199
|
+
```ruby
|
200
|
+
subnet = azure_network_service.detach_route_table
|
201
|
+
puts "#{subnet.route_table_id}"
|
202
|
+
```
|
203
|
+
|
204
|
+
## List Number of Available IP Addresses in Subnet
|
205
|
+
|
206
|
+
The parameter is a boolean which checks if the Virtual Network the Subnet belongs to is attached to an Express Route Circuit or not
|
207
|
+
|
208
|
+
```ruby
|
209
|
+
puts "#{subnet.get_available_ipaddresses_count(false)}"
|
210
|
+
```
|
211
|
+
|
212
|
+
## Destroy a single Subnet
|
213
|
+
|
214
|
+
Get a subnet object from the get method and then destroy that subnet.
|
215
|
+
|
216
|
+
```ruby
|
217
|
+
subnet.destroy
|
218
|
+
```
|
219
|
+
|
220
|
+
## Create Network Interface Card
|
221
|
+
|
222
|
+
Create a new network interface. Skip public_ip_address_id parameter to create network interface without PublicIP. The parameter, private_ip_allocation_method can be Dynamic or Static.
|
223
|
+
|
224
|
+
```ruby
|
225
|
+
nic = azure_network_service.network_interfaces.create(
|
226
|
+
name: '<Network Interface name>',
|
227
|
+
resource_group: '<Resource Group name>',
|
228
|
+
location: 'eastus',
|
229
|
+
subnet_id: '/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/virtualNetworks/<Virtual Network name>/subnets/<Subnet name>',
|
230
|
+
public_ip_address_id: '/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/publicIPAddresses/<Public IP name>',
|
231
|
+
ip_configuration_name: '<Ip Configuration Name>',
|
232
|
+
private_ip_allocation_method: 'Dynamic'
|
233
|
+
)
|
234
|
+
```
|
235
|
+
|
236
|
+
## List Network Interface Cards
|
237
|
+
|
238
|
+
List network interfaces in a resource group
|
239
|
+
|
240
|
+
```ruby
|
241
|
+
nics = azure_network_service.network_interfaces(resource_group: '<Resource Group name>')
|
242
|
+
nics.each do |nic|
|
243
|
+
puts "#{nic.name}"
|
244
|
+
end
|
245
|
+
```
|
246
|
+
|
247
|
+
## Retrieve a single Network Interface Card
|
248
|
+
|
249
|
+
Get a single record of Network Interface
|
250
|
+
|
251
|
+
```ruby
|
252
|
+
nic = azure_network_service
|
253
|
+
.network_interfaces
|
254
|
+
.get('<Resource Group name>', '<Network Interface name>')
|
255
|
+
puts "#{nic.name}"
|
256
|
+
```
|
257
|
+
|
258
|
+
## Update Network Interface Card
|
259
|
+
|
260
|
+
You can update network interface by passing only updated attributes, in the form of hash.
|
261
|
+
For example,
|
262
|
+
```ruby
|
263
|
+
nic.update(private_ip_allocation_method: 'Static', private_ip_address: '10.0.0.0')
|
264
|
+
```
|
265
|
+
## Attach/Detach resources to Network Interface Card
|
266
|
+
|
267
|
+
Attach Subnet, Public-IP or Network-Security-Group as following
|
268
|
+
```ruby
|
269
|
+
subnet_id = "<NEW-SUBNET-ID>"
|
270
|
+
nic.attach_subnet(subnet_id)
|
271
|
+
|
272
|
+
public_ip_id = "<NEW-PUBLIC_IP-ID>"
|
273
|
+
nic.attach_public_ip(public_ip_id)
|
274
|
+
|
275
|
+
nsg_id = "<NEW-NSG-ID>"
|
276
|
+
nic.attach_network_security_group(nsg_id)
|
277
|
+
|
278
|
+
```
|
279
|
+
Detach Public-IP or Network-Security-Group as following
|
280
|
+
|
281
|
+
```ruby
|
282
|
+
nic.detach_public_ip
|
283
|
+
|
284
|
+
nic.detach_network_security_group
|
285
|
+
|
286
|
+
```
|
287
|
+
`Note: You can't detach subnet from Network Interface.`
|
288
|
+
|
289
|
+
## Destroy a single Network Interface Card
|
290
|
+
|
291
|
+
Get a network interface object from the get method and then destroy that network interface.
|
292
|
+
|
293
|
+
```ruby
|
294
|
+
nic.destroy
|
295
|
+
```
|
296
|
+
|
297
|
+
## Create Public IP
|
298
|
+
|
299
|
+
Create a new public IP. The parameter, type can be Dynamic or Static.
|
300
|
+
|
301
|
+
```ruby
|
302
|
+
pubip = azure_network_service.public_ips.create(
|
303
|
+
name: '<Public IP name>',
|
304
|
+
resource_group: '<Resource Group name>',
|
305
|
+
location: 'westus',
|
306
|
+
public_ip_allocation_method: 'Static'
|
307
|
+
)
|
308
|
+
```
|
309
|
+
|
310
|
+
## Check for Public IP
|
311
|
+
|
312
|
+
Checks if the Public IP already exists or not.
|
313
|
+
|
314
|
+
```ruby
|
315
|
+
azure_network_service.public_ips.check_if_exists('<Public IP name>', '<Resource Group name>')
|
316
|
+
```
|
317
|
+
|
318
|
+
## List Public IPs
|
319
|
+
|
320
|
+
List network interfaces in a resource group
|
321
|
+
|
322
|
+
```ruby
|
323
|
+
pubips = azure_network_service.public_ips(resource_group: '<Resource Group name>')
|
324
|
+
pubips.each do |pubip|
|
325
|
+
puts "#{pubip.name}"
|
326
|
+
end
|
327
|
+
```
|
328
|
+
|
329
|
+
## Retrieve a single Public Ip
|
330
|
+
|
331
|
+
Get a single record of Public Ip
|
332
|
+
|
333
|
+
```ruby
|
334
|
+
pubip = azure_network_service
|
335
|
+
.public_ips
|
336
|
+
.get('<Resource Group name>', '<Public IP name>')
|
337
|
+
puts "#{pubip.name}"
|
338
|
+
```
|
339
|
+
|
340
|
+
## Update Public Ip
|
341
|
+
|
342
|
+
Get a Public IP object from the get method and then update that public IP. You can update the Public IP by passing the modifiable attributes in the form of a hash.
|
343
|
+
|
344
|
+
```ruby
|
345
|
+
pubip.update(
|
346
|
+
public_ip_allocation_method: '<IP Allocation Method>',
|
347
|
+
idle_timeout_in_minutes: '<Idle Timeout In Minutes>',
|
348
|
+
domain_name_label: '<Domain Name Label>'
|
349
|
+
)
|
350
|
+
```
|
351
|
+
|
352
|
+
## Destroy a single Public Ip
|
353
|
+
|
354
|
+
Get a Public IP object from the get method and then destroy that public IP.
|
355
|
+
|
356
|
+
```ruby
|
357
|
+
pubip.destroy
|
358
|
+
```
|
359
|
+
|
360
|
+
## Create Network Security Group
|
361
|
+
|
362
|
+
Network security group requires a resource group to create.
|
363
|
+
|
364
|
+
```ruby
|
365
|
+
azure_network_service.network_security_groups.create(
|
366
|
+
name: '<Network Security Group name>',
|
367
|
+
resource_group: '<Resource Group name>',
|
368
|
+
location: 'eastus',
|
369
|
+
security_rules: [{
|
370
|
+
name: '<Security Rule name>',
|
371
|
+
protocol: 'tcp',
|
372
|
+
source_port_range: '22',
|
373
|
+
destination_port_range: '22',
|
374
|
+
source_address_prefix: '0.0.0.0/0',
|
375
|
+
destination_address_prefix: '0.0.0.0/0',
|
376
|
+
access: 'Allow',
|
377
|
+
priority: '100',
|
378
|
+
direction: 'Inbound'
|
379
|
+
}]
|
380
|
+
)
|
381
|
+
```
|
382
|
+
|
383
|
+
## List Network Security Groups
|
384
|
+
|
385
|
+
List all the network security groups in a resource group
|
386
|
+
|
387
|
+
```ruby
|
388
|
+
network_security_groups = azure_network_service.network_security_groups(resource_group: '<Resource Group name>')
|
389
|
+
network_security_groups.each do |nsg|
|
390
|
+
puts "#{nsg.name}"
|
391
|
+
end
|
392
|
+
```
|
393
|
+
|
394
|
+
## Retrieve a single Network Security Group
|
395
|
+
|
396
|
+
Get a single record of Network Security Group
|
397
|
+
|
398
|
+
```ruby
|
399
|
+
nsg = azure_network_service
|
400
|
+
.network_security_groups
|
401
|
+
.get('<Resource Group Name>','<Network Security Group name>')
|
402
|
+
puts "#{nsg.name}"
|
403
|
+
```
|
404
|
+
|
405
|
+
## Update Security Rules
|
406
|
+
|
407
|
+
You can update security rules by passing the modified attributes in the form of hash.
|
408
|
+
|
409
|
+
```ruby
|
410
|
+
nsg.update_security_rules(
|
411
|
+
security_rules:
|
412
|
+
[
|
413
|
+
{
|
414
|
+
name: '<Security Rule name>',
|
415
|
+
protocol: 'tcp',
|
416
|
+
source_port_range: '*',
|
417
|
+
destination_port_range: '*',
|
418
|
+
source_address_prefix: '0.0.0.0/0',
|
419
|
+
destination_address_prefix: '0.0.0.0/0',
|
420
|
+
access: 'Allow',
|
421
|
+
priority: '100',
|
422
|
+
direction: 'Inbound'
|
423
|
+
}
|
424
|
+
]
|
425
|
+
)
|
426
|
+
```
|
427
|
+
`Note: You can't modify Name of a security rule.`
|
428
|
+
|
429
|
+
## Add and Remove Security Rules in a Network Security Group
|
430
|
+
|
431
|
+
Add array of security rules in the form of hash.
|
432
|
+
|
433
|
+
```ruby
|
434
|
+
nsg.add_security_rules(
|
435
|
+
[
|
436
|
+
{
|
437
|
+
name: '<Security Rule name>',
|
438
|
+
protocol: 'tcp',
|
439
|
+
source_port_range: '3389',
|
440
|
+
destination_port_range: '3389',
|
441
|
+
source_address_prefix: '0.0.0.0/0',
|
442
|
+
destination_address_prefix: '0.0.0.0/0',
|
443
|
+
access: 'Allow',
|
444
|
+
priority: '102',
|
445
|
+
direction: 'Inbound'
|
446
|
+
}
|
447
|
+
]
|
448
|
+
)
|
449
|
+
```
|
450
|
+
|
451
|
+
Delete security rule by providing its name.
|
452
|
+
|
453
|
+
```ruby
|
454
|
+
nsg.remove_security_rule('<Security Rule name>')
|
455
|
+
```
|
456
|
+
|
457
|
+
## Destroy a Network Security Group
|
458
|
+
|
459
|
+
Get a network security group object from the get method and then destroy that network security group.
|
460
|
+
|
461
|
+
```ruby
|
462
|
+
nsg.destroy
|
463
|
+
```
|
464
|
+
|
465
|
+
## Create Network Security Rule
|
466
|
+
|
467
|
+
Network security rule requires a resource group and network security group to create.
|
468
|
+
|
469
|
+
```ruby
|
470
|
+
azure_network_service.network_security_rules.create(
|
471
|
+
name: '<Security Rule name>',
|
472
|
+
resource_group: '<Resource Group name>',
|
473
|
+
protocol: 'tcp',
|
474
|
+
network_security_group_name: '<Network Security Group name>',
|
475
|
+
source_port_range: '22',
|
476
|
+
destination_port_range: '22',
|
477
|
+
source_address_prefix: '0.0.0.0/0',
|
478
|
+
destination_address_prefix: '0.0.0.0/0',
|
479
|
+
access: 'Allow',
|
480
|
+
priority: '100',
|
481
|
+
direction: 'Inbound'
|
482
|
+
)
|
483
|
+
```
|
484
|
+
|
485
|
+
## List Network Security Rules
|
486
|
+
|
487
|
+
List all the network security rules in a resource group and network security group
|
488
|
+
|
489
|
+
```ruby
|
490
|
+
network_security_rules = azure_network_service.network_security_rules(resource_group: '<Resource Group name>',
|
491
|
+
network_security_group_name: '<Network Security Group name>')
|
492
|
+
network_security_rules.each do |network_security_rule|
|
493
|
+
puts network_security_rule.name
|
494
|
+
end
|
495
|
+
```
|
496
|
+
|
497
|
+
## Retrieve a single Network Security Rule
|
498
|
+
|
499
|
+
Get a single record of Network Security Rule
|
500
|
+
|
501
|
+
```ruby
|
502
|
+
network_security_rule = azure_network_service
|
503
|
+
.network_security_rules
|
504
|
+
.get(<Resource Group Name>','<Network Security Group name>', '<Security Rule name>')
|
505
|
+
puts "#{network_security_rule.name}"
|
506
|
+
```
|
507
|
+
|
508
|
+
## Destroy a Network Security Rule
|
509
|
+
|
510
|
+
Get a network security rule object from the get method and then destroy that network security rule.
|
511
|
+
|
512
|
+
```ruby
|
513
|
+
network_security_rule.destroy
|
514
|
+
```
|
515
|
+
|
516
|
+
## Create External Load Balancer
|
517
|
+
|
518
|
+
Create a new load balancer.
|
519
|
+
|
520
|
+
```ruby
|
521
|
+
lb = azure_network_service.load_balancers.create(
|
522
|
+
name: '<Load Balancer name>',
|
523
|
+
resource_group: '<Resource Group name>',
|
524
|
+
location: 'westus',
|
525
|
+
|
526
|
+
frontend_ip_configurations:
|
527
|
+
[
|
528
|
+
{
|
529
|
+
name: 'fic',
|
530
|
+
private_ipallocation_method: 'Dynamic',
|
531
|
+
public_ipaddress_id: '/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/publicIPAddresses/<Public-IP-Name>'
|
532
|
+
}
|
533
|
+
],
|
534
|
+
backend_address_pool_names:
|
535
|
+
[
|
536
|
+
'pool1'
|
537
|
+
],
|
538
|
+
load_balancing_rules:
|
539
|
+
[
|
540
|
+
{
|
541
|
+
name: 'lb_rule_1',
|
542
|
+
frontend_ip_configuration_id: '/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load Balancer name>/frontendIPConfigurations/fic',
|
543
|
+
backend_address_pool_id: '/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load Balancer name>/backendAddressPools/pool1',
|
544
|
+
protocol: 'Tcp',
|
545
|
+
frontend_port: '80',
|
546
|
+
backend_port: '8080',
|
547
|
+
enable_floating_ip: false,
|
548
|
+
idle_timeout_in_minutes: 4,
|
549
|
+
load_distribution: "Default"
|
550
|
+
}
|
551
|
+
],
|
552
|
+
inbound_nat_rules:
|
553
|
+
[
|
554
|
+
{
|
555
|
+
name: 'RDP-Traffic',
|
556
|
+
frontend_ip_configuration_id: '/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load Balancer name>/frontendIPConfigurations/fic',
|
557
|
+
protocol: 'Tcp',
|
558
|
+
frontend_port: 3389,
|
559
|
+
backend_port: 3389
|
560
|
+
}
|
561
|
+
]
|
562
|
+
)
|
563
|
+
```
|
564
|
+
|
565
|
+
## Create Internal Load Balancer
|
566
|
+
|
567
|
+
```ruby
|
568
|
+
|
569
|
+
lb = azure_network_service.load_balancers.create(
|
570
|
+
name: '<Load Balancer name>',
|
571
|
+
resource_group: '<Resource Group name>',
|
572
|
+
location: 'westus',
|
573
|
+
frontend_ip_configurations:
|
574
|
+
[
|
575
|
+
{
|
576
|
+
name: 'LB-Frontend',
|
577
|
+
private_ipallocation_method: 'Static',
|
578
|
+
private_ipaddress: '10.1.2.5',
|
579
|
+
subnet_id: subnet.id
|
580
|
+
}
|
581
|
+
],
|
582
|
+
backend_address_pool_names:
|
583
|
+
[
|
584
|
+
'LB-backend'
|
585
|
+
],
|
586
|
+
load_balancing_rules:
|
587
|
+
[
|
588
|
+
{
|
589
|
+
name: 'HTTP',
|
590
|
+
frontend_ip_configuration_id: "/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load-Balancer-Name>/frontendIPConfigurations/LB-Frontend",
|
591
|
+
backend_address_pool_id: "/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load-Balancer-Name>/backendAddressPools/LB-backend",
|
592
|
+
probe_id: "/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers<Load-Balancer-Name>lb/probes/HealthProbe",
|
593
|
+
protocol: 'Tcp',
|
594
|
+
frontend_port: '80',
|
595
|
+
backend_port: '80'
|
596
|
+
}
|
597
|
+
],
|
598
|
+
inbound_nat_rules:
|
599
|
+
[
|
600
|
+
{
|
601
|
+
name: 'RDP1',
|
602
|
+
frontend_ip_configuration_id: "/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load-Balancer-Name>/frontendIPConfigurations/LB-Frontend",
|
603
|
+
protocol: 'Tcp',
|
604
|
+
frontend_port: 3441,
|
605
|
+
backend_port: 3389
|
606
|
+
},
|
607
|
+
{
|
608
|
+
name: 'RDP2',
|
609
|
+
frontend_ip_configuration_id: "/subscriptions/<Subscriptionid>/resourceGroups/<Resource Group name>/providers/Microsoft.Network/loadBalancers/<Load-Balancer-Name>/frontendIPConfigurations/LB-Frontend",
|
610
|
+
protocol: 'Tcp',
|
611
|
+
frontend_port: 3442,
|
612
|
+
backend_port: 3389
|
613
|
+
}
|
614
|
+
],
|
615
|
+
probes:
|
616
|
+
[
|
617
|
+
{
|
618
|
+
name: 'HealthProbe',
|
619
|
+
protocol: 'http',
|
620
|
+
request_path: 'HealthProbe.aspx',
|
621
|
+
port: '80',
|
622
|
+
interval_in_seconds: 15,
|
623
|
+
number_of_probes: 2
|
624
|
+
}
|
625
|
+
]
|
626
|
+
)
|
627
|
+
```
|
628
|
+
|
629
|
+
## List Load Balancers
|
630
|
+
|
631
|
+
List all load balancers in a resource group
|
632
|
+
|
633
|
+
```ruby
|
634
|
+
lbs = azure_network_service.load_balancers(resource_group: '<Resource Group name>')
|
635
|
+
lbs.each do |lb|
|
636
|
+
puts "#{lb.name}"
|
637
|
+
end
|
638
|
+
```
|
639
|
+
|
640
|
+
## Retrieve a single Load Balancer
|
641
|
+
|
642
|
+
Get a single record of Load Balancer
|
643
|
+
|
644
|
+
```ruby
|
645
|
+
lb = azure_network_service
|
646
|
+
.load_balancers
|
647
|
+
.get('<Resource Group name>', '<Load Balancer name>')
|
648
|
+
puts "#{lb.name}"
|
649
|
+
```
|
650
|
+
|
651
|
+
## Destroy a Load Balancer
|
652
|
+
|
653
|
+
Get a load balancer object from the get method and then destroy that load balancer.
|
654
|
+
|
655
|
+
```ruby
|
656
|
+
lb.destroy
|
657
|
+
```
|
658
|
+
|
659
|
+
## Create Virtual Network Gateway
|
660
|
+
|
661
|
+
Create a new Virtual Network Gateway.
|
662
|
+
|
663
|
+
```ruby
|
664
|
+
network_gateway = network.virtual_network_gateways.create(
|
665
|
+
name: '<Virtual Network Gateway Name>',
|
666
|
+
location: 'eastus',
|
667
|
+
tags: {
|
668
|
+
key1: 'value1',
|
669
|
+
key2: 'value2'
|
670
|
+
},
|
671
|
+
ip_configurations: [
|
672
|
+
{
|
673
|
+
name: 'default',
|
674
|
+
private_ipallocation_method: 'Dynamic',
|
675
|
+
public_ipaddress_id: '/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Network/publicIPAddresses/{public_ip_name}',
|
676
|
+
subnet_id: '/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Network/virtualNetworks/{virtual_network_name}/subnets/{subnet_name}',
|
677
|
+
private_ipaddress: nil
|
678
|
+
}
|
679
|
+
],
|
680
|
+
resource_group: 'learn_fog',
|
681
|
+
sku_name: 'Standard',
|
682
|
+
sku_tier: 'Standard',
|
683
|
+
sku_capacity: 2,
|
684
|
+
gateway_type: 'ExpressRoute',
|
685
|
+
enable_bgp: true,
|
686
|
+
gateway_size: nil,
|
687
|
+
asn: 100,
|
688
|
+
bgp_peering_address: nil,
|
689
|
+
peer_weight: 3,
|
690
|
+
vpn_type: 'RouteBased',
|
691
|
+
vpn_client_address_pool: [],
|
692
|
+
gateway_default_site: '/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Network/localNetworkGateways/{local_network_gateway_name}',
|
693
|
+
default_sites: [],
|
694
|
+
vpn_client_configuration: {
|
695
|
+
address_pool: ['192.168.0.4', '192.168.0.5'],
|
696
|
+
root_certificates: [
|
697
|
+
{
|
698
|
+
name: 'root',
|
699
|
+
public_cert_data: 'certificate data'
|
700
|
+
}
|
701
|
+
],
|
702
|
+
revoked_certificates: [
|
703
|
+
{
|
704
|
+
name: 'revoked',
|
705
|
+
thumbprint: 'thumb print detail'
|
706
|
+
}
|
707
|
+
]
|
708
|
+
}
|
709
|
+
)
|
710
|
+
```
|
711
|
+
|
712
|
+
## List Virtual Network Gateways
|
713
|
+
|
714
|
+
List all virtual network gateways in a resource group
|
715
|
+
|
716
|
+
```ruby
|
717
|
+
network_gateways = network.virtual_network_gateways(resource_group: '<Resource Group Name>')
|
718
|
+
network_gateways.each do |gateway|
|
719
|
+
puts "#{gateway.name}"
|
720
|
+
end
|
721
|
+
```
|
722
|
+
|
723
|
+
## Retrieve single Virtual Network Gateway
|
724
|
+
|
725
|
+
Get single record of Virtual Network Gateway
|
726
|
+
|
727
|
+
```ruby
|
728
|
+
network_gateway = network.virtual_network_gateways.get('<Resource Group Name>', '<Virtual Network Gateway Name>')
|
729
|
+
puts "#{network_gateway.name}"
|
730
|
+
```
|
731
|
+
|
732
|
+
## Destroy single Virtual Network Gateway
|
733
|
+
|
734
|
+
Get a virtual network gateway object from the get method and then destroy that virtual network gateway.
|
735
|
+
|
736
|
+
```ruby
|
737
|
+
network_gateway.destroy
|
738
|
+
```
|
739
|
+
|
740
|
+
## Create Local Network Gateway
|
741
|
+
|
742
|
+
Create a new Local Network Gateway.
|
743
|
+
|
744
|
+
```ruby
|
745
|
+
local_network_gateway = network.local_network_gateways.create(
|
746
|
+
name: "<Local Network Gateway Name>",
|
747
|
+
location: "eastus",
|
748
|
+
tags: {
|
749
|
+
key1: "value1",
|
750
|
+
key2: "value2"
|
751
|
+
},
|
752
|
+
resource_group: "<Resource Group Name>",
|
753
|
+
gateway_ip_address: '192.168.1.1',
|
754
|
+
local_network_address_space_prefixes: [],
|
755
|
+
asn: 100,
|
756
|
+
bgp_peering_address: '192.168.1.2',
|
757
|
+
peer_weight: 3
|
758
|
+
)
|
759
|
+
```
|
760
|
+
|
761
|
+
## List Local Network Gateways
|
762
|
+
|
763
|
+
List all local network gateways in a resource group
|
764
|
+
|
765
|
+
```ruby
|
766
|
+
local_network_gateways = network.local_network_gateways(resource_group: '<Resource Group Name>')
|
767
|
+
local_network_gateways.each do |gateway|
|
768
|
+
puts "#{gateway.name}"
|
769
|
+
end
|
770
|
+
```
|
771
|
+
|
772
|
+
## Retrieve single Local Network Gateway
|
773
|
+
|
774
|
+
Get single record of Local Network Gateway
|
775
|
+
|
776
|
+
```ruby
|
777
|
+
local_network_gateway = network.local_network_gateways.get('<Resource Group Name>', '<Local Network Gateway Name>')
|
778
|
+
puts "#{local_network_gateway.name}"
|
779
|
+
```
|
780
|
+
|
781
|
+
## Destroy single Local Network Gateway
|
782
|
+
|
783
|
+
Get a local network gateway object from the get method and then destroy that local network gateway.
|
784
|
+
|
785
|
+
```ruby
|
786
|
+
local_network_gateway.destroy
|
787
|
+
```
|
788
|
+
|
789
|
+
## Express Route
|
790
|
+
|
791
|
+
Microsoft Azure ExpressRoute lets you extend your on-premises networks into the Microsoft cloud over a dedicated private connection facilitated by a connectivity provider.
|
792
|
+
For more details about express route [click here](https://azure.microsoft.com/en-us/documentation/articles/expressroute-introduction/).
|
793
|
+
|
794
|
+
# Express Route Circuit
|
795
|
+
|
796
|
+
The Circuit represents the entity created by customer to register with an express route service provider with intent to connect to Microsoft.
|
797
|
+
|
798
|
+
## Create an Express Route Circuit
|
799
|
+
|
800
|
+
Create a new Express Route Circuit.
|
801
|
+
|
802
|
+
```ruby
|
803
|
+
circuit = network.express_route_circuits.create(
|
804
|
+
"name": "<Circuit Name>",
|
805
|
+
"location": "eastus",
|
806
|
+
"resource_group": "<Resource Group Name>",
|
807
|
+
"tags": {
|
808
|
+
"key1": 'value1',
|
809
|
+
"key2": 'value2'
|
810
|
+
},
|
811
|
+
"sku_name": "Standard_MeteredData",
|
812
|
+
"sku_tier": "Standard",
|
813
|
+
"sku_family": "MeteredData",
|
814
|
+
"service_provider_name": "Telenor",
|
815
|
+
"peering_location": "London",
|
816
|
+
"bandwidth_in_mbps": 100,
|
817
|
+
"peerings": [
|
818
|
+
{
|
819
|
+
"name": "AzurePublicPeering",
|
820
|
+
"peering_type": "AzurePublicPeering",
|
821
|
+
"peer_asn": 100,
|
822
|
+
"primary_peer_address_prefix": "192.168.1.0/30",
|
823
|
+
"secondary_peer_address_prefix": "192.168.2.0/30",
|
824
|
+
"vlan_id": 200
|
825
|
+
}
|
826
|
+
]
|
827
|
+
)
|
828
|
+
```
|
829
|
+
|
830
|
+
## List Express Route Circuits
|
831
|
+
|
832
|
+
List all express route circuits in a resource group
|
833
|
+
|
834
|
+
```ruby
|
835
|
+
circuits = network.express_route_circuits(resource_group: '<Resource Group Name>')
|
836
|
+
circuits.each do |circuit|
|
837
|
+
puts "#{circuit.name}"
|
838
|
+
end
|
839
|
+
```
|
840
|
+
|
841
|
+
## Retrieve a single Express Route Circuit
|
842
|
+
|
843
|
+
Get a single record of Express Route Circuit
|
844
|
+
|
845
|
+
```ruby
|
846
|
+
circuit = network.express_route_circuits.get("<Resource Group Name>", "<Circuit Name>")
|
847
|
+
puts "#{circuit.name}"
|
848
|
+
```
|
849
|
+
|
850
|
+
## Destroy a single Express Route Circuit
|
851
|
+
|
852
|
+
Get an express route circuit object from the get method and then destroy that express route circuit.
|
853
|
+
|
854
|
+
```ruby
|
855
|
+
circuit.destroy
|
856
|
+
```
|
857
|
+
# Express Route Authorization
|
858
|
+
|
859
|
+
Authorization is part of Express Route circuit.
|
860
|
+
|
861
|
+
## Create an Express Route Circuit Authorization
|
862
|
+
|
863
|
+
Create a new Express Route Circuit Authorization. Parameter 'authorization_status' can be 'Available' or 'InUse'.
|
864
|
+
|
865
|
+
```ruby
|
866
|
+
authorization = network.express_route_circuit_authorizations.create(
|
867
|
+
"resource_group": "<Resourse Group Name>",
|
868
|
+
"name": "<Resource-Unique-Name>",
|
869
|
+
"circuit_name": "<Circuit Name>",
|
870
|
+
"authorization_status": "Available",
|
871
|
+
"authorization_name": "<Authorization-Name>",
|
872
|
+
)
|
873
|
+
```
|
874
|
+
|
875
|
+
## List Express Route Circuit Authorizations
|
876
|
+
|
877
|
+
List all express route circuit authorizations in a resource group.
|
878
|
+
|
879
|
+
```ruby
|
880
|
+
authorizations = network.express_route_circuit_authorizations(resource_group: '<Resource Group Name>', circuit_name: '<Circuit Name>')
|
881
|
+
authorizations.each do |authorization|
|
882
|
+
puts "#{authorization.name}"
|
883
|
+
end
|
884
|
+
```
|
885
|
+
|
886
|
+
## Retrieve single Express Route Circuit Authorization
|
887
|
+
|
888
|
+
Get a single record of Express Route Circuit Authorization.
|
889
|
+
|
890
|
+
```ruby
|
891
|
+
authorization = network.express_route_circuit_authorizations.get("<Resource Group Name>", "Circuit Name", "Authorization Name")
|
892
|
+
puts "#{authorization.name}"
|
893
|
+
```
|
894
|
+
|
895
|
+
## Destroy single Express Route Circuit Authorization
|
896
|
+
|
897
|
+
Get an express route circuit authorization object from the get method and then destroy that express route circuit authorization.
|
898
|
+
|
899
|
+
```ruby
|
900
|
+
authorization.destroy
|
901
|
+
```
|
902
|
+
|
903
|
+
|
904
|
+
# Express Route Peering
|
905
|
+
|
906
|
+
BGP Peering is part of Express Route circuit and defines the type of connectivity needed with Microsoft.
|
907
|
+
|
908
|
+
## Create an Express Route Circuit Peering
|
909
|
+
|
910
|
+
Create a new Express Route Circuit Peering.
|
911
|
+
|
912
|
+
```ruby
|
913
|
+
peering = network.express_route_circuit_peerings.create(
|
914
|
+
"name": "AzurePrivatePeering",
|
915
|
+
"circuit_name": "<Circuit Name>",
|
916
|
+
"resource_group": "<Resourse Group Name>",
|
917
|
+
"peering_type": "AzurePrivatePeering",
|
918
|
+
"peer_asn": 100,
|
919
|
+
"primary_peer_address_prefix": "192.168.3.0/30",
|
920
|
+
"secondary_peer_address_prefix": "192.168.4.0/30",
|
921
|
+
"vlan_id": 200
|
922
|
+
)
|
923
|
+
```
|
924
|
+
|
925
|
+
## List Express Route Circuit Peerings
|
926
|
+
|
927
|
+
List all express route circuit peerings in a resource group
|
928
|
+
|
929
|
+
```ruby
|
930
|
+
peerings = network.express_route_circuit_peerings(resource_group: '<Resource Group Name>', circuit_name: '<Circuit Name>')
|
931
|
+
peerings.each do |peering|
|
932
|
+
puts "#{peering.name}"
|
933
|
+
end
|
934
|
+
```
|
935
|
+
|
936
|
+
## Retrieve single Express Route Circuit Peering
|
937
|
+
|
938
|
+
Get a single record of Express Route Circuit Peering
|
939
|
+
|
940
|
+
```ruby
|
941
|
+
peering = network.express_route_circuit_peerings.get("<Resource Group Name>", "<Peering Name>", "Circuit Name")
|
942
|
+
puts "#{peering.peering_type}"
|
943
|
+
```
|
944
|
+
|
945
|
+
## Destroy single Express Route Circuit Peering
|
946
|
+
|
947
|
+
Get an express route circuit peering object from the get method and then destroy that express route circuit peering.
|
948
|
+
|
949
|
+
```ruby
|
950
|
+
peering.destroy
|
951
|
+
```
|
952
|
+
|
953
|
+
# Express Route Service Provider
|
954
|
+
|
955
|
+
Express Route Service Providers are telcos and exchange providers who are approved in the system to provide Express Route connectivity.
|
956
|
+
|
957
|
+
## List Express Route Service Providers
|
958
|
+
|
959
|
+
List all express route service providers
|
960
|
+
|
961
|
+
```ruby
|
962
|
+
service_providers = network.express_route_service_providers
|
963
|
+
puts service_providers
|
964
|
+
```
|
965
|
+
|
966
|
+
## Create Virtual Network Gateway Connection
|
967
|
+
|
968
|
+
Create a new Virtual Network Gateway Connection.
|
969
|
+
|
970
|
+
```ruby
|
971
|
+
gateway_connection = network.virtual_network_gateway_connections.create(
|
972
|
+
name: '<Virtual Network Gateway Connection Name>',
|
973
|
+
location: 'eastus',
|
974
|
+
tags: {
|
975
|
+
key1: 'value1',
|
976
|
+
key2: 'value2'
|
977
|
+
},
|
978
|
+
resource_group: '<Resource Group Name>',
|
979
|
+
virtual_network_gateway1: {
|
980
|
+
name: 'firstgateway',
|
981
|
+
resource_group: '<Resource Group Name>'
|
982
|
+
},
|
983
|
+
virtual_network_gateway2: {
|
984
|
+
name: 'secondgateway',
|
985
|
+
resource_group: '<Resource Group Name>'
|
986
|
+
}
|
987
|
+
connection_type: 'VNet-to-VNet'
|
988
|
+
)
|
989
|
+
```
|
990
|
+
|
991
|
+
## List Virtual Network Gateway Connections
|
992
|
+
|
993
|
+
List all virtual network gateway connections in a resource group
|
994
|
+
|
995
|
+
```ruby
|
996
|
+
gateway_connections = network.virtual_network_gateway_connections(resource_group: '<Resource Group Name>')
|
997
|
+
gateway_connections.each do |connection|
|
998
|
+
puts "#{connection.name}"
|
999
|
+
end
|
1000
|
+
```
|
1001
|
+
|
1002
|
+
## Retrieve single Virtual Network Gateway Connection
|
1003
|
+
|
1004
|
+
Get single record of Virtual Network Gateway Connection
|
1005
|
+
|
1006
|
+
```ruby
|
1007
|
+
gateway_connection = network.virtual_network_gateway_connections.get('<Resource Group Name>', '<Virtual Network Gateway Connection Name>')
|
1008
|
+
puts "#{gateway_connection.name}"
|
1009
|
+
```
|
1010
|
+
|
1011
|
+
## Destroy single Virtual Network Gateway Connection
|
1012
|
+
|
1013
|
+
Get a virtual network gateway connection object from the get method and then destroy that virtual network gateway connection.
|
1014
|
+
|
1015
|
+
```ruby
|
1016
|
+
gateway_connection.destroy
|
1017
|
+
```
|
1018
|
+
|
1019
|
+
## Get the shared key for a connection
|
1020
|
+
|
1021
|
+
```ruby
|
1022
|
+
shared_key = network.get_connection_shared_key('<Resource Group Name>', '<Virtual Network Gateway Connection Name>')
|
1023
|
+
puts gateway_connection
|
1024
|
+
```
|
1025
|
+
|
1026
|
+
## Set the shared key for a connection
|
1027
|
+
|
1028
|
+
```ruby
|
1029
|
+
network.set_connection_shared_key('<Resource Group Name>', '<Virtual Network Gateway Connection Name>', 'Value')
|
1030
|
+
```
|
1031
|
+
|
1032
|
+
## Reset the shared key for a connection
|
1033
|
+
|
1034
|
+
```ruby
|
1035
|
+
network.reset_connection_shared_key('<Resource Group Name>', '<Virtual Network Gateway Connection Name>', <Key Length in Integer>)
|
1036
|
+
```
|
1037
|
+
|
1038
|
+
|
1039
|
+
## Support and Feedback
|
1040
|
+
Your feedback is highly appreciated! If you have specific issues with the fog ARM, you should file an issue via Github.
|