fog-azure-rm-temp 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +17 -0
- data/.gitignore +6 -0
- data/.hound.yml +2 -0
- data/.rubocop.yml +38 -0
- data/.travis.yml +33 -0
- data/CHANGELOG.md +271 -0
- data/CONTRIBUTING.md +40 -0
- data/CONTRIBUTORS.md +8 -0
- data/Gemfile +3 -0
- data/LICENSE.md +20 -0
- data/README.md +96 -0
- data/fog-azure-rm.gemspec +37 -0
- data/lib/fog/azurerm.rb +89 -0
- data/lib/fog/azurerm/application_gateway.rb +75 -0
- data/lib/fog/azurerm/async_response.rb +36 -0
- data/lib/fog/azurerm/compute.rb +98 -0
- data/lib/fog/azurerm/config.rb +1 -0
- data/lib/fog/azurerm/constants.rb +61 -0
- data/lib/fog/azurerm/credentials.rb +40 -0
- data/lib/fog/azurerm/dns.rb +68 -0
- data/lib/fog/azurerm/docs/application_gateway.md +243 -0
- data/lib/fog/azurerm/docs/compute.md +400 -0
- data/lib/fog/azurerm/docs/dns.md +148 -0
- data/lib/fog/azurerm/docs/key_vault.md +88 -0
- data/lib/fog/azurerm/docs/network.md +1129 -0
- data/lib/fog/azurerm/docs/resources.md +175 -0
- data/lib/fog/azurerm/docs/sql.md +168 -0
- data/lib/fog/azurerm/docs/storage.md +463 -0
- data/lib/fog/azurerm/docs/structure.md +53 -0
- data/lib/fog/azurerm/docs/traffic_manager.md +159 -0
- data/lib/fog/azurerm/key_vault.rb +51 -0
- data/lib/fog/azurerm/models/application_gateway/backend_address_pool.rb +24 -0
- data/lib/fog/azurerm/models/application_gateway/backend_http_setting.rb +28 -0
- data/lib/fog/azurerm/models/application_gateway/frontend_ip_configuration.rb +26 -0
- data/lib/fog/azurerm/models/application_gateway/frontend_port.rb +20 -0
- data/lib/fog/azurerm/models/application_gateway/gateway.rb +613 -0
- data/lib/fog/azurerm/models/application_gateway/gateways.rb +30 -0
- data/lib/fog/azurerm/models/application_gateway/http_listener.rb +30 -0
- data/lib/fog/azurerm/models/application_gateway/ip_configuration.rb +26 -0
- data/lib/fog/azurerm/models/application_gateway/probe.rb +30 -0
- data/lib/fog/azurerm/models/application_gateway/request_routing_rule.rb +27 -0
- data/lib/fog/azurerm/models/application_gateway/ssl_certificate.rb +24 -0
- data/lib/fog/azurerm/models/application_gateway/url_path_map.rb +30 -0
- data/lib/fog/azurerm/models/compute/availability_set.rb +43 -0
- data/lib/fog/azurerm/models/compute/availability_sets.rb +35 -0
- data/lib/fog/azurerm/models/compute/caching_types.rb +13 -0
- data/lib/fog/azurerm/models/compute/creation_data.rb +21 -0
- data/lib/fog/azurerm/models/compute/disk_create_option.rb +16 -0
- data/lib/fog/azurerm/models/compute/disk_create_option_types.rb +13 -0
- data/lib/fog/azurerm/models/compute/encryption_settings.rb +29 -0
- data/lib/fog/azurerm/models/compute/image_disk_reference.rb +15 -0
- data/lib/fog/azurerm/models/compute/managed_disk.rb +77 -0
- data/lib/fog/azurerm/models/compute/managed_disks.rb +43 -0
- data/lib/fog/azurerm/models/compute/operation_status_response.rb +18 -0
- data/lib/fog/azurerm/models/compute/server.rb +199 -0
- data/lib/fog/azurerm/models/compute/servers.rb +47 -0
- data/lib/fog/azurerm/models/compute/virtual_machine_extension.rb +76 -0
- data/lib/fog/azurerm/models/compute/virtual_machine_extensions.rb +31 -0
- data/lib/fog/azurerm/models/dns/record_set.rb +91 -0
- data/lib/fog/azurerm/models/dns/record_sets.rb +34 -0
- data/lib/fog/azurerm/models/dns/zone.rb +58 -0
- data/lib/fog/azurerm/models/dns/zones.rb +29 -0
- data/lib/fog/azurerm/models/key_vault/access_policy_entry.rb +31 -0
- data/lib/fog/azurerm/models/key_vault/vault.rb +76 -0
- data/lib/fog/azurerm/models/key_vault/vaults.rb +27 -0
- data/lib/fog/azurerm/models/network/express_route_circuit.rb +86 -0
- data/lib/fog/azurerm/models/network/express_route_circuit_authorization.rb +50 -0
- data/lib/fog/azurerm/models/network/express_route_circuit_authorizations.rb +28 -0
- data/lib/fog/azurerm/models/network/express_route_circuit_peering.rb +91 -0
- data/lib/fog/azurerm/models/network/express_route_circuit_peerings.rb +27 -0
- data/lib/fog/azurerm/models/network/express_route_circuits.rb +30 -0
- data/lib/fog/azurerm/models/network/express_route_service_provider.rb +29 -0
- data/lib/fog/azurerm/models/network/express_route_service_providers.rb +18 -0
- data/lib/fog/azurerm/models/network/frontend_ip_configuration.rb +27 -0
- data/lib/fog/azurerm/models/network/inbound_nat_pool.rb +26 -0
- data/lib/fog/azurerm/models/network/inbound_nat_rule.rb +26 -0
- data/lib/fog/azurerm/models/network/ipallocation_method.rb +12 -0
- data/lib/fog/azurerm/models/network/load_balancer.rb +247 -0
- data/lib/fog/azurerm/models/network/load_balancers.rb +36 -0
- data/lib/fog/azurerm/models/network/load_balancing_rule.rb +37 -0
- data/lib/fog/azurerm/models/network/local_network_gateway.rb +60 -0
- data/lib/fog/azurerm/models/network/local_network_gateways.rb +27 -0
- data/lib/fog/azurerm/models/network/network_interface.rb +121 -0
- data/lib/fog/azurerm/models/network/network_interfaces.rb +30 -0
- data/lib/fog/azurerm/models/network/network_security_group.rb +112 -0
- data/lib/fog/azurerm/models/network/network_security_groups.rb +30 -0
- data/lib/fog/azurerm/models/network/network_security_rule.rb +66 -0
- data/lib/fog/azurerm/models/network/network_security_rules.rb +31 -0
- data/lib/fog/azurerm/models/network/path_rule.rb +30 -0
- data/lib/fog/azurerm/models/network/probe.rb +28 -0
- data/lib/fog/azurerm/models/network/public_ip.rb +68 -0
- data/lib/fog/azurerm/models/network/public_ips.rb +30 -0
- data/lib/fog/azurerm/models/network/security_rule_access.rb +12 -0
- data/lib/fog/azurerm/models/network/security_rule_direction.rb +12 -0
- data/lib/fog/azurerm/models/network/security_rule_protocol.rb +13 -0
- data/lib/fog/azurerm/models/network/subnet.rb +66 -0
- data/lib/fog/azurerm/models/network/subnets.rb +31 -0
- data/lib/fog/azurerm/models/network/virtual_network.rb +107 -0
- data/lib/fog/azurerm/models/network/virtual_network_gateway.rb +137 -0
- data/lib/fog/azurerm/models/network/virtual_network_gateway_connection.rb +76 -0
- data/lib/fog/azurerm/models/network/virtual_network_gateway_connections.rb +27 -0
- data/lib/fog/azurerm/models/network/virtual_network_gateways.rb +30 -0
- data/lib/fog/azurerm/models/network/virtual_networks.rb +36 -0
- data/lib/fog/azurerm/models/network/vpn_client_configuration.rb +34 -0
- data/lib/fog/azurerm/models/network/vpn_client_revoked_certificates.rb +22 -0
- data/lib/fog/azurerm/models/network/vpn_client_root_certificates.rb +22 -0
- data/lib/fog/azurerm/models/resources/azure_resource.rb +25 -0
- data/lib/fog/azurerm/models/resources/azure_resources.rb +32 -0
- data/lib/fog/azurerm/models/resources/dependency.rb +27 -0
- data/lib/fog/azurerm/models/resources/deployment.rb +65 -0
- data/lib/fog/azurerm/models/resources/deployments.rb +30 -0
- data/lib/fog/azurerm/models/resources/provider.rb +27 -0
- data/lib/fog/azurerm/models/resources/provider_resource_type.rb +22 -0
- data/lib/fog/azurerm/models/resources/resource_group.rb +32 -0
- data/lib/fog/azurerm/models/resources/resource_groups.rb +29 -0
- data/lib/fog/azurerm/models/sql/firewall_rule.rb +48 -0
- data/lib/fog/azurerm/models/sql/firewall_rules.rb +32 -0
- data/lib/fog/azurerm/models/sql/sql_database.rb +67 -0
- data/lib/fog/azurerm/models/sql/sql_databases.rb +32 -0
- data/lib/fog/azurerm/models/sql/sql_server.rb +49 -0
- data/lib/fog/azurerm/models/sql/sql_servers.rb +31 -0
- data/lib/fog/azurerm/models/storage/data_disk.rb +27 -0
- data/lib/fog/azurerm/models/storage/directories.rb +70 -0
- data/lib/fog/azurerm/models/storage/directory.rb +151 -0
- data/lib/fog/azurerm/models/storage/file.rb +263 -0
- data/lib/fog/azurerm/models/storage/files.rb +183 -0
- data/lib/fog/azurerm/models/storage/kind.rb +12 -0
- data/lib/fog/azurerm/models/storage/recovery_vault.rb +50 -0
- data/lib/fog/azurerm/models/storage/recovery_vaults.rb +27 -0
- data/lib/fog/azurerm/models/storage/sku_name.rb +15 -0
- data/lib/fog/azurerm/models/storage/sku_tier.rb +12 -0
- data/lib/fog/azurerm/models/storage/storage_account.rb +89 -0
- data/lib/fog/azurerm/models/storage/storage_accounts.rb +40 -0
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_end_point.rb +82 -0
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_end_points.rb +30 -0
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +88 -0
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profiles.rb +27 -0
- data/lib/fog/azurerm/network.rb +178 -0
- data/lib/fog/azurerm/requests/application_gateway/check_ag_exists.rb +31 -0
- data/lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb +301 -0
- data/lib/fog/azurerm/requests/application_gateway/delete_application_gateway.rb +26 -0
- data/lib/fog/azurerm/requests/application_gateway/get_application_gateway.rb +159 -0
- data/lib/fog/azurerm/requests/application_gateway/list_application_gateways.rb +29 -0
- data/lib/fog/azurerm/requests/application_gateway/start_application_gateway.rb +27 -0
- data/lib/fog/azurerm/requests/application_gateway/stop_application_gateway.rb +27 -0
- data/lib/fog/azurerm/requests/application_gateway/update_sku_attributes.rb +28 -0
- data/lib/fog/azurerm/requests/application_gateway/update_subnet_id_in_gateway_ip_configuration.rb +29 -0
- data/lib/fog/azurerm/requests/compute/attach_data_disk_to_vm.rb +172 -0
- data/lib/fog/azurerm/requests/compute/check_availability_set_exists.rb +31 -0
- data/lib/fog/azurerm/requests/compute/check_managed_disk_exists.rb +33 -0
- data/lib/fog/azurerm/requests/compute/check_vm_exists.rb +39 -0
- data/lib/fog/azurerm/requests/compute/check_vm_extension_exists.rb +31 -0
- data/lib/fog/azurerm/requests/compute/check_vm_status.rb +38 -0
- data/lib/fog/azurerm/requests/compute/create_availability_set.rb +48 -0
- data/lib/fog/azurerm/requests/compute/create_or_update_managed_disk.rb +121 -0
- data/lib/fog/azurerm/requests/compute/create_or_update_vm_extension.rb +63 -0
- data/lib/fog/azurerm/requests/compute/create_virtual_machine.rb +264 -0
- data/lib/fog/azurerm/requests/compute/deallocate_virtual_machine.rb +35 -0
- data/lib/fog/azurerm/requests/compute/delete_availability_set.rb +27 -0
- data/lib/fog/azurerm/requests/compute/delete_managed_disk.rb +29 -0
- data/lib/fog/azurerm/requests/compute/delete_virtual_machine.rb +35 -0
- data/lib/fog/azurerm/requests/compute/delete_vm_extension.rb +28 -0
- data/lib/fog/azurerm/requests/compute/detach_data_disk_from_vm.rb +103 -0
- data/lib/fog/azurerm/requests/compute/generalize_virtual_machine.rb +35 -0
- data/lib/fog/azurerm/requests/compute/get_availability_set.rb +32 -0
- data/lib/fog/azurerm/requests/compute/get_managed_disk.rb +64 -0
- data/lib/fog/azurerm/requests/compute/get_virtual_machine.rb +86 -0
- data/lib/fog/azurerm/requests/compute/get_vm_extension.rb +46 -0
- data/lib/fog/azurerm/requests/compute/grant_access_to_managed_disk.rb +30 -0
- data/lib/fog/azurerm/requests/compute/list_availability_sets.rb +40 -0
- data/lib/fog/azurerm/requests/compute/list_available_sizes_for_virtual_machine.rb +64 -0
- data/lib/fog/azurerm/requests/compute/list_managed_disks_by_rg.rb +66 -0
- data/lib/fog/azurerm/requests/compute/list_managed_disks_in_subscription.rb +66 -0
- data/lib/fog/azurerm/requests/compute/list_virtual_machines.rb +69 -0
- data/lib/fog/azurerm/requests/compute/power_off_virtual_machine.rb +35 -0
- data/lib/fog/azurerm/requests/compute/redeploy_virtual_machine.rb +35 -0
- data/lib/fog/azurerm/requests/compute/restart_virtual_machine.rb +35 -0
- data/lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb +33 -0
- data/lib/fog/azurerm/requests/compute/start_virtual_machine.rb +35 -0
- data/lib/fog/azurerm/requests/dns/check_record_set_exists.rb +31 -0
- data/lib/fog/azurerm/requests/dns/check_zone_exists.rb +33 -0
- data/lib/fog/azurerm/requests/dns/create_or_update_record_set.rb +71 -0
- data/lib/fog/azurerm/requests/dns/create_or_update_zone.rb +57 -0
- data/lib/fog/azurerm/requests/dns/delete_record_set.rb +28 -0
- data/lib/fog/azurerm/requests/dns/delete_zone.rb +28 -0
- data/lib/fog/azurerm/requests/dns/get_record_set.rb +47 -0
- data/lib/fog/azurerm/requests/dns/get_records_from_record_set.rb +32 -0
- data/lib/fog/azurerm/requests/dns/get_zone.rb +41 -0
- data/lib/fog/azurerm/requests/dns/list_record_sets.rb +63 -0
- data/lib/fog/azurerm/requests/dns/list_zones.rb +72 -0
- data/lib/fog/azurerm/requests/key_vault/check_vault_exists.rb +31 -0
- data/lib/fog/azurerm/requests/key_vault/create_or_update_vault.rb +105 -0
- data/lib/fog/azurerm/requests/key_vault/delete_vault.rb +28 -0
- data/lib/fog/azurerm/requests/key_vault/get_vault.rb +54 -0
- data/lib/fog/azurerm/requests/key_vault/list_vaults.rb +56 -0
- data/lib/fog/azurerm/requests/network/add_address_prefixes_in_virtual_network.rb +68 -0
- data/lib/fog/azurerm/requests/network/add_dns_servers_in_virtual_network.rb +76 -0
- data/lib/fog/azurerm/requests/network/add_security_rules.rb +154 -0
- data/lib/fog/azurerm/requests/network/add_subnets_in_virtual_network.rb +71 -0
- data/lib/fog/azurerm/requests/network/attach_network_security_group_to_subnet.rb +57 -0
- data/lib/fog/azurerm/requests/network/attach_resource_to_nic.rb +89 -0
- data/lib/fog/azurerm/requests/network/attach_route_table_to_subnet.rb +57 -0
- data/lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_express_route_circuit_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_load_balancer_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_local_net_gateway_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_net_sec_group_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_net_sec_rule_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_network_interface_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_public_ip_exists.rb +33 -0
- data/lib/fog/azurerm/requests/network/check_subnet_exists.rb +32 -0
- data/lib/fog/azurerm/requests/network/check_virtual_network_exists.rb +33 -0
- data/lib/fog/azurerm/requests/network/check_vnet_gateway_connection_exists.rb +32 -0
- data/lib/fog/azurerm/requests/network/check_vnet_gateway_exists.rb +32 -0
- data/lib/fog/azurerm/requests/network/create_load_balancer.rb +189 -0
- data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit.rb +111 -0
- data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit_authorization.rb +51 -0
- data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit_peering.rb +79 -0
- data/lib/fog/azurerm/requests/network/create_or_update_local_network_gateway.rb +80 -0
- data/lib/fog/azurerm/requests/network/create_or_update_network_interface.rb +120 -0
- data/lib/fog/azurerm/requests/network/create_or_update_network_security_group.rb +177 -0
- data/lib/fog/azurerm/requests/network/create_or_update_network_security_rule.rb +59 -0
- data/lib/fog/azurerm/requests/network/create_or_update_public_ip.rb +59 -0
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb +110 -0
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway.rb +159 -0
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway_connection.rb +83 -0
- data/lib/fog/azurerm/requests/network/create_subnet.rb +54 -0
- data/lib/fog/azurerm/requests/network/delete_express_route_circuit.rb +28 -0
- data/lib/fog/azurerm/requests/network/delete_express_route_circuit_authorization.rb +29 -0
- data/lib/fog/azurerm/requests/network/delete_express_route_circuit_peering.rb +28 -0
- data/lib/fog/azurerm/requests/network/delete_load_balancer.rb +28 -0
- data/lib/fog/azurerm/requests/network/delete_local_network_gateway.rb +29 -0
- data/lib/fog/azurerm/requests/network/delete_network_interface.rb +28 -0
- data/lib/fog/azurerm/requests/network/delete_network_security_group.rb +30 -0
- data/lib/fog/azurerm/requests/network/delete_network_security_rule.rb +30 -0
- data/lib/fog/azurerm/requests/network/delete_public_ip.rb +27 -0
- data/lib/fog/azurerm/requests/network/delete_subnet.rb +28 -0
- data/lib/fog/azurerm/requests/network/delete_virtual_network.rb +28 -0
- data/lib/fog/azurerm/requests/network/delete_virtual_network_gateway.rb +28 -0
- data/lib/fog/azurerm/requests/network/delete_virtual_network_gateway_connection.rb +29 -0
- data/lib/fog/azurerm/requests/network/detach_network_security_group_from_subnet.rb +51 -0
- data/lib/fog/azurerm/requests/network/detach_resource_from_nic.rb +81 -0
- data/lib/fog/azurerm/requests/network/detach_route_table_from_subnet.rb +51 -0
- data/lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb +23 -0
- data/lib/fog/azurerm/requests/network/get_connection_shared_key.rb +25 -0
- data/lib/fog/azurerm/requests/network/get_express_route_circuit.rb +51 -0
- data/lib/fog/azurerm/requests/network/get_express_route_circuit_authorization.rb +35 -0
- data/lib/fog/azurerm/requests/network/get_express_route_circuit_peering.rb +48 -0
- data/lib/fog/azurerm/requests/network/get_load_balancer.rb +170 -0
- data/lib/fog/azurerm/requests/network/get_local_network_gateway.rb +47 -0
- data/lib/fog/azurerm/requests/network/get_network_interface.rb +60 -0
- data/lib/fog/azurerm/requests/network/get_network_security_group.rb +165 -0
- data/lib/fog/azurerm/requests/network/get_network_security_rule.rb +47 -0
- data/lib/fog/azurerm/requests/network/get_public_ip.rb +41 -0
- data/lib/fog/azurerm/requests/network/get_subnet.rb +37 -0
- data/lib/fog/azurerm/requests/network/get_virtual_network.rb +62 -0
- data/lib/fog/azurerm/requests/network/get_virtual_network_gateway.rb +45 -0
- data/lib/fog/azurerm/requests/network/get_virtual_network_gateway_connection.rb +47 -0
- data/lib/fog/azurerm/requests/network/list_express_route_circuit_authorizations.rb +37 -0
- data/lib/fog/azurerm/requests/network/list_express_route_circuit_peerings.rb +44 -0
- data/lib/fog/azurerm/requests/network/list_express_route_circuits.rb +53 -0
- data/lib/fog/azurerm/requests/network/list_express_route_service_providers.rb +37 -0
- data/lib/fog/azurerm/requests/network/list_load_balancers.rb +31 -0
- data/lib/fog/azurerm/requests/network/list_load_balancers_in_subscription.rb +31 -0
- data/lib/fog/azurerm/requests/network/list_local_network_gateways.rb +50 -0
- data/lib/fog/azurerm/requests/network/list_network_interfaces.rb +67 -0
- data/lib/fog/azurerm/requests/network/list_network_security_groups.rb +169 -0
- data/lib/fog/azurerm/requests/network/list_network_security_rules.rb +51 -0
- data/lib/fog/azurerm/requests/network/list_public_ips.rb +46 -0
- data/lib/fog/azurerm/requests/network/list_subnets.rb +55 -0
- data/lib/fog/azurerm/requests/network/list_virtual_network_gateway_connections.rb +50 -0
- data/lib/fog/azurerm/requests/network/list_virtual_network_gateways.rb +43 -0
- data/lib/fog/azurerm/requests/network/list_virtual_networks.rb +74 -0
- data/lib/fog/azurerm/requests/network/list_virtual_networks_in_subscription.rb +74 -0
- data/lib/fog/azurerm/requests/network/remove_address_prefixes_from_virtual_network.rb +69 -0
- data/lib/fog/azurerm/requests/network/remove_dns_servers_from_virtual_network.rb +69 -0
- data/lib/fog/azurerm/requests/network/remove_security_rule.rb +157 -0
- data/lib/fog/azurerm/requests/network/remove_subnets_from_virtual_network.rb +59 -0
- data/lib/fog/azurerm/requests/network/reset_connection_shared_key.rb +36 -0
- data/lib/fog/azurerm/requests/network/set_connection_shared_key.rb +36 -0
- data/lib/fog/azurerm/requests/resources/check_azure_resource_exists.rb +40 -0
- data/lib/fog/azurerm/requests/resources/check_deployment_exists.rb +30 -0
- data/lib/fog/azurerm/requests/resources/check_resource_group_exists.rb +30 -0
- data/lib/fog/azurerm/requests/resources/create_deployment.rb +97 -0
- data/lib/fog/azurerm/requests/resources/create_resource_group.rb +39 -0
- data/lib/fog/azurerm/requests/resources/delete_deployment.rb +28 -0
- data/lib/fog/azurerm/requests/resources/delete_resource_group.rb +28 -0
- data/lib/fog/azurerm/requests/resources/delete_resource_tag.rb +44 -0
- data/lib/fog/azurerm/requests/resources/get_deployment.rb +81 -0
- data/lib/fog/azurerm/requests/resources/get_resource_group.rb +47 -0
- data/lib/fog/azurerm/requests/resources/list_deployments.rb +77 -0
- data/lib/fog/azurerm/requests/resources/list_resource_groups.rb +51 -0
- data/lib/fog/azurerm/requests/resources/list_tagged_resources.rb +50 -0
- data/lib/fog/azurerm/requests/resources/tag_resource.rb +43 -0
- data/lib/fog/azurerm/requests/sql/check_database_exists.rb +21 -0
- data/lib/fog/azurerm/requests/sql/check_firewall_rule_exists.rb +21 -0
- data/lib/fog/azurerm/requests/sql/check_sql_server_exists.rb +21 -0
- data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +68 -0
- data/lib/fog/azurerm/requests/sql/create_or_update_firewall_rule.rb +42 -0
- data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +50 -0
- data/lib/fog/azurerm/requests/sql/delete_database.rb +28 -0
- data/lib/fog/azurerm/requests/sql/delete_firewall_rule.rb +29 -0
- data/lib/fog/azurerm/requests/sql/delete_sql_server.rb +29 -0
- data/lib/fog/azurerm/requests/sql/get_database.rb +42 -0
- data/lib/fog/azurerm/requests/sql/get_firewall_rule.rb +37 -0
- data/lib/fog/azurerm/requests/sql/get_sql_server.rb +34 -0
- data/lib/fog/azurerm/requests/sql/list_databases.rb +58 -0
- data/lib/fog/azurerm/requests/sql/list_firewall_rules.rb +49 -0
- data/lib/fog/azurerm/requests/sql/list_sql_servers.rb +44 -0
- data/lib/fog/azurerm/requests/storage/acquire_blob_lease.rb +32 -0
- data/lib/fog/azurerm/requests/storage/acquire_container_lease.rb +32 -0
- data/lib/fog/azurerm/requests/storage/check_container_exists.rb +30 -0
- data/lib/fog/azurerm/requests/storage/check_storage_account_exists.rb +37 -0
- data/lib/fog/azurerm/requests/storage/check_storage_account_name_availability.rb +44 -0
- data/lib/fog/azurerm/requests/storage/commit_blob_blocks.rb +30 -0
- data/lib/fog/azurerm/requests/storage/compare_container_blobs.rb +148 -0
- data/lib/fog/azurerm/requests/storage/copy_blob.rb +30 -0
- data/lib/fog/azurerm/requests/storage/copy_blob_from_uri.rb +30 -0
- data/lib/fog/azurerm/requests/storage/create_block_blob.rb +108 -0
- data/lib/fog/azurerm/requests/storage/create_container.rb +40 -0
- data/lib/fog/azurerm/requests/storage/create_disk.rb +62 -0
- data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +54 -0
- data/lib/fog/azurerm/requests/storage/create_page_blob.rb +31 -0
- data/lib/fog/azurerm/requests/storage/create_storage_account.rb +64 -0
- data/lib/fog/azurerm/requests/storage/delete_blob.rb +32 -0
- data/lib/fog/azurerm/requests/storage/delete_container.rb +31 -0
- data/lib/fog/azurerm/requests/storage/delete_disk.rb +36 -0
- data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +35 -0
- data/lib/fog/azurerm/requests/storage/delete_storage_account.rb +27 -0
- data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +60 -0
- data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +61 -0
- data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +56 -0
- data/lib/fog/azurerm/requests/storage/get_backup_container.rb +53 -0
- data/lib/fog/azurerm/requests/storage/get_backup_item.rb +58 -0
- data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +53 -0
- data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +64 -0
- data/lib/fog/azurerm/requests/storage/get_blob.rb +163 -0
- data/lib/fog/azurerm/requests/storage/get_blob_http_url.rb +39 -0
- data/lib/fog/azurerm/requests/storage/get_blob_https_url.rb +39 -0
- data/lib/fog/azurerm/requests/storage/get_blob_properties.rb +55 -0
- data/lib/fog/azurerm/requests/storage/get_blob_url.rb +28 -0
- data/lib/fog/azurerm/requests/storage/get_container_acl.rb +30 -0
- data/lib/fog/azurerm/requests/storage/get_container_properties.rb +41 -0
- data/lib/fog/azurerm/requests/storage/get_container_url.rb +34 -0
- data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +49 -0
- data/lib/fog/azurerm/requests/storage/get_storage_access_keys.rb +32 -0
- data/lib/fog/azurerm/requests/storage/get_storage_account.rb +36 -0
- data/lib/fog/azurerm/requests/storage/list_blobs.rb +168 -0
- data/lib/fog/azurerm/requests/storage/list_containers.rb +73 -0
- data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +48 -0
- data/lib/fog/azurerm/requests/storage/list_storage_account_for_rg.rb +49 -0
- data/lib/fog/azurerm/requests/storage/list_storage_accounts.rb +49 -0
- data/lib/fog/azurerm/requests/storage/multipart_save_block_blob.rb +110 -0
- data/lib/fog/azurerm/requests/storage/put_blob_block.rb +30 -0
- data/lib/fog/azurerm/requests/storage/put_blob_metadata.rb +31 -0
- data/lib/fog/azurerm/requests/storage/put_blob_pages.rb +30 -0
- data/lib/fog/azurerm/requests/storage/put_blob_properties.rb +31 -0
- data/lib/fog/azurerm/requests/storage/put_container_acl.rb +31 -0
- data/lib/fog/azurerm/requests/storage/put_container_metadata.rb +31 -0
- data/lib/fog/azurerm/requests/storage/release_blob_lease.rb +30 -0
- data/lib/fog/azurerm/requests/storage/release_container_lease.rb +30 -0
- data/lib/fog/azurerm/requests/storage/save_page_blob.rb +111 -0
- data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +36 -0
- data/lib/fog/azurerm/requests/storage/start_backup.rb +54 -0
- data/lib/fog/azurerm/requests/storage/update_storage_account.rb +59 -0
- data/lib/fog/azurerm/requests/storage/wait_blob_copy_operation_to_finish.rb +56 -0
- data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_endpoint_exists.rb +31 -0
- data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_profile_exists.rb +31 -0
- data/lib/fog/azurerm/requests/traffic_manager/create_or_update_traffic_manager_endpoint.rb +54 -0
- data/lib/fog/azurerm/requests/traffic_manager/create_or_update_traffic_manager_profile.rb +120 -0
- data/lib/fog/azurerm/requests/traffic_manager/delete_traffic_manager_endpoint.rb +28 -0
- data/lib/fog/azurerm/requests/traffic_manager/delete_traffic_manager_profile.rb +26 -0
- data/lib/fog/azurerm/requests/traffic_manager/get_traffic_manager_endpoint.rb +39 -0
- data/lib/fog/azurerm/requests/traffic_manager/get_traffic_manager_profile.rb +80 -0
- data/lib/fog/azurerm/requests/traffic_manager/list_traffic_manager_profiles.rb +82 -0
- data/lib/fog/azurerm/resources.rb +71 -0
- data/lib/fog/azurerm/sql.rb +66 -0
- data/lib/fog/azurerm/storage.rb +155 -0
- data/lib/fog/azurerm/traffic_manager.rb +62 -0
- data/lib/fog/azurerm/utilities/general.rb +168 -0
- data/lib/fog/azurerm/utilities/logger_messages.yml +19 -0
- data/lib/fog/azurerm/version.rb +5 -0
- data/rake-script.sh +4 -0
- data/rakefile +29 -0
- data/test/api_stub.rb +128 -0
- data/test/api_stub/models/application_gateway/gateway.rb +165 -0
- data/test/api_stub/models/compute/availability_set.rb +50 -0
- data/test/api_stub/models/compute/managed_disk.rb +59 -0
- data/test/api_stub/models/compute/server.rb +190 -0
- data/test/api_stub/models/compute/virtual_machine_extension.rb +31 -0
- data/test/api_stub/models/dns/record_set.rb +57 -0
- data/test/api_stub/models/dns/zone.rb +29 -0
- data/test/api_stub/models/key_vault/vault.rb +39 -0
- data/test/api_stub/models/network/express_route_circuit.rb +47 -0
- data/test/api_stub/models/network/express_route_circuit_authorization.rb +22 -0
- data/test/api_stub/models/network/express_route_circuit_peering.rb +33 -0
- data/test/api_stub/models/network/express_route_service_provider.rb +29 -0
- data/test/api_stub/models/network/load_balancer.rb +154 -0
- data/test/api_stub/models/network/local_network_gateway.rb +31 -0
- data/test/api_stub/models/network/network_interface.rb +72 -0
- data/test/api_stub/models/network/network_security_group.rb +95 -0
- data/test/api_stub/models/network/network_security_rule.rb +30 -0
- data/test/api_stub/models/network/public_ip.rb +36 -0
- data/test/api_stub/models/network/subnet.rb +36 -0
- data/test/api_stub/models/network/virtual_network.rb +62 -0
- data/test/api_stub/models/network/virtual_network_gateway.rb +26 -0
- data/test/api_stub/models/network/virtual_network_gateway_connection.rb +31 -0
- data/test/api_stub/models/resources/deployment.rb +116 -0
- data/test/api_stub/models/resources/resource.rb +43 -0
- data/test/api_stub/models/resources/resource_group.rb +24 -0
- data/test/api_stub/models/sql/sql_database.rb +30 -0
- data/test/api_stub/models/sql/sql_firewall_rule.rb +24 -0
- data/test/api_stub/models/sql/sql_server.rb +24 -0
- data/test/api_stub/models/storage/directory.rb +178 -0
- data/test/api_stub/models/storage/file.rb +181 -0
- data/test/api_stub/models/storage/recovery_vault.rb +23 -0
- data/test/api_stub/models/storage/storageaccount.rb +22 -0
- data/test/api_stub/models/traffic_manager/traffic_manager_end_point.rb +27 -0
- data/test/api_stub/models/traffic_manager/traffic_manager_profile.rb +75 -0
- data/test/api_stub/requests/application_gateway/gateway.rb +461 -0
- data/test/api_stub/requests/compute/availability_set.rb +57 -0
- data/test/api_stub/requests/compute/managed_disk.rb +102 -0
- data/test/api_stub/requests/compute/virtual_machine.rb +943 -0
- data/test/api_stub/requests/compute/virtual_machine_extension.rb +46 -0
- data/test/api_stub/requests/dns/record_set.rb +75 -0
- data/test/api_stub/requests/dns/zone.rb +52 -0
- data/test/api_stub/requests/key_vault/vault.rb +95 -0
- data/test/api_stub/requests/network/express_route_circuit.rb +100 -0
- data/test/api_stub/requests/network/express_route_circuit_authorization.rb +31 -0
- data/test/api_stub/requests/network/express_route_circuit_peering.rb +62 -0
- data/test/api_stub/requests/network/express_route_service_provider.rb +30 -0
- data/test/api_stub/requests/network/load_balancer.rb +388 -0
- data/test/api_stub/requests/network/local_network_gateway.rb +62 -0
- data/test/api_stub/requests/network/network_interface.rb +264 -0
- data/test/api_stub/requests/network/network_security_group.rb +225 -0
- data/test/api_stub/requests/network/network_security_rule.rb +72 -0
- data/test/api_stub/requests/network/public_ip.rb +71 -0
- data/test/api_stub/requests/network/subnet.rb +71 -0
- data/test/api_stub/requests/network/virtual_network.rb +125 -0
- data/test/api_stub/requests/network/virtual_network_gateway.rb +49 -0
- data/test/api_stub/requests/network/virtual_network_gateway_connection.rb +68 -0
- data/test/api_stub/requests/resources/deployment.rb +68 -0
- data/test/api_stub/requests/resources/resource.rb +45 -0
- data/test/api_stub/requests/resources/resource_group.rb +51 -0
- data/test/api_stub/requests/sql/database.rb +71 -0
- data/test/api_stub/requests/sql/firewall_rule.rb +50 -0
- data/test/api_stub/requests/sql/sql_server.rb +49 -0
- data/test/api_stub/requests/storage/directory.rb +89 -0
- data/test/api_stub/requests/storage/file.rb +243 -0
- data/test/api_stub/requests/storage/recovery_vault.rb +189 -0
- data/test/api_stub/requests/storage/storageaccount.rb +126 -0
- data/test/api_stub/requests/traffic_manager/traffic_manager_endpoint.rb +41 -0
- data/test/api_stub/requests/traffic_manager/traffic_manager_profile.rb +166 -0
- data/test/integration/README.md +14 -0
- data/test/integration/Virtual_network_gateway_connection.rb +220 -0
- data/test/integration/application_gateway.rb +253 -0
- data/test/integration/availability_set.rb +90 -0
- data/test/integration/blob.rb +297 -0
- data/test/integration/container.rb +160 -0
- data/test/integration/credentials/azure.yml +5 -0
- data/test/integration/data_disk.rb +90 -0
- data/test/integration/deployment.rb +78 -0
- data/test/integration/express_route_circuit.rb +139 -0
- data/test/integration/external_load_balancer.rb +155 -0
- data/test/integration/internal_load_balancer.rb +144 -0
- data/test/integration/key_vault.rb +98 -0
- data/test/integration/local_network_gateway.rb +91 -0
- data/test/integration/managed_disk.rb +113 -0
- data/test/integration/network_interface.rb +156 -0
- data/test/integration/network_security_group.rb +133 -0
- data/test/integration/network_security_rule.rb +102 -0
- data/test/integration/public_ip.rb +83 -0
- data/test/integration/record_set.rb +126 -0
- data/test/integration/resource_group.rb +59 -0
- data/test/integration/resource_tag.rb +91 -0
- data/test/integration/server.rb +266 -0
- data/test/integration/server_custom_image.rb +127 -0
- data/test/integration/sql_server.rb +175 -0
- data/test/integration/storage_account.rb +123 -0
- data/test/integration/subnet.rb +122 -0
- data/test/integration/traffic_manager.rb +137 -0
- data/test/integration/virtual_machine_extension.rb +165 -0
- data/test/integration/virtual_network.rb +162 -0
- data/test/integration/virtual_network_gateway.rb +125 -0
- data/test/integration/virtual_network_gateway_connection_to_express_route.rb +123 -0
- data/test/integration/zone.rb +81 -0
- data/test/models/application_gateway/test_gateway.rb +135 -0
- data/test/models/application_gateway/test_gateways.rb +55 -0
- data/test/models/compute/test_availability_set.rb +54 -0
- data/test/models/compute/test_availability_sets.rb +55 -0
- data/test/models/compute/test_managed_disk.rb +61 -0
- data/test/models/compute/test_managed_disks.rb +68 -0
- data/test/models/compute/test_server.rb +201 -0
- data/test/models/compute/test_servers.rb +56 -0
- data/test/models/compute/test_virtual_machine_extension.rb +61 -0
- data/test/models/compute/test_virtual_machine_extensions.rb +49 -0
- data/test/models/dns/test_record_set.rb +86 -0
- data/test/models/dns/test_record_sets.rb +66 -0
- data/test/models/dns/test_zone.rb +50 -0
- data/test/models/dns/test_zones.rb +51 -0
- data/test/models/key_vault/test_vault.rb +39 -0
- data/test/models/key_vault/test_vaults.rb +55 -0
- data/test/models/network/test_express_route_circuit.rb +52 -0
- data/test/models/network/test_express_route_circuit_authorization.rb +50 -0
- data/test/models/network/test_express_route_circuit_authorizations.rb +56 -0
- data/test/models/network/test_express_route_circuit_peering.rb +53 -0
- data/test/models/network/test_express_route_circuit_peerings.rb +43 -0
- data/test/models/network/test_express_route_circuits.rb +55 -0
- data/test/models/network/test_express_route_service_providers.rb +30 -0
- data/test/models/network/test_load_balancer.rb +51 -0
- data/test/models/network/test_load_balancers.rb +55 -0
- data/test/models/network/test_local_network_gateway.rb +53 -0
- data/test/models/network/test_local_network_gateways.rb +55 -0
- data/test/models/network/test_network_interface.rb +96 -0
- data/test/models/network/test_network_interfaces.rb +55 -0
- data/test/models/network/test_network_security_group.rb +86 -0
- data/test/models/network/test_network_security_groups.rb +54 -0
- data/test/models/network/test_network_security_rule.rb +44 -0
- data/test/models/network/test_network_security_rules.rb +55 -0
- data/test/models/network/test_public_ip.rb +61 -0
- data/test/models/network/test_public_ips.rb +55 -0
- data/test/models/network/test_subnet.rb +83 -0
- data/test/models/network/test_subnets.rb +56 -0
- data/test/models/network/test_virtual_network.rb +106 -0
- data/test/models/network/test_virtual_network_gateway.rb +62 -0
- data/test/models/network/test_virtual_network_gateway_connection.rb +59 -0
- data/test/models/network/test_virtual_network_gateway_connections.rb +55 -0
- data/test/models/network/test_virtual_network_gateways.rb +55 -0
- data/test/models/network/test_virtual_networks.rb +67 -0
- data/test/models/resources/test_deployment.rb +55 -0
- data/test/models/resources/test_deployments.rb +51 -0
- data/test/models/resources/test_resource.rb +22 -0
- data/test/models/resources/test_resource_group.rb +44 -0
- data/test/models/resources/test_resource_groups.rb +51 -0
- data/test/models/resources/test_resources.rb +52 -0
- data/test/models/sql/test_database.rb +67 -0
- data/test/models/sql/test_databases.rb +42 -0
- data/test/models/sql/test_firewall_rule.rb +55 -0
- data/test/models/sql/test_firewall_rules.rb +42 -0
- data/test/models/sql/test_sql_server.rb +57 -0
- data/test/models/sql/test_sql_servers.rb +41 -0
- data/test/models/storage/test_data_disk.rb +23 -0
- data/test/models/storage/test_directories.rb +74 -0
- data/test/models/storage/test_directory.rb +178 -0
- data/test/models/storage/test_file.rb +294 -0
- data/test/models/storage/test_files.rb +234 -0
- data/test/models/storage/test_recovery_vault.rb +61 -0
- data/test/models/storage/test_recovery_vaults.rb +47 -0
- data/test/models/storage/test_storage_account.rb +88 -0
- data/test/models/storage/test_storage_accounts.rb +78 -0
- data/test/models/traffic_manager/test_traffic_manager_end_point.rb +54 -0
- data/test/models/traffic_manager/test_traffic_manager_end_points.rb +56 -0
- data/test/models/traffic_manager/test_traffic_manager_profile.rb +62 -0
- data/test/models/traffic_manager/test_traffic_manager_profiles.rb +55 -0
- data/test/requests/application_gateway/test_check_ag_exists.rb +31 -0
- data/test/requests/application_gateway/test_create_or_update_application_gateway.rb +35 -0
- data/test/requests/application_gateway/test_delete_application_gateway.rb +23 -0
- data/test/requests/application_gateway/test_get_application_gateway.rb +24 -0
- data/test/requests/application_gateway/test_list_application_gateways.rb +24 -0
- data/test/requests/application_gateway/test_start_application_gateway.rb +25 -0
- data/test/requests/application_gateway/test_stop_application_gateway.rb +25 -0
- data/test/requests/compute/test_attach_data_disk_to_vm.rb +90 -0
- data/test/requests/compute/test_check_availability_set_exists.rb +31 -0
- data/test/requests/compute/test_check_managed_disk_exists.rb +31 -0
- data/test/requests/compute/test_check_vm_exists.rb +31 -0
- data/test/requests/compute/test_check_vm_extension_exists.rb +31 -0
- data/test/requests/compute/test_create_availability_set.rb +28 -0
- data/test/requests/compute/test_create_or_update_managed_disk.rb +38 -0
- data/test/requests/compute/test_create_virtual_machine.rb +90 -0
- data/test/requests/compute/test_create_vm_extension.rb +35 -0
- data/test/requests/compute/test_deallocate_virtual_machine.rb +32 -0
- data/test/requests/compute/test_delete_availability_set.rb +23 -0
- data/test/requests/compute/test_delete_managed_disk.rb +23 -0
- data/test/requests/compute/test_delete_virtual_machine.rb +32 -0
- data/test/requests/compute/test_detach_data_disk_from_vm.rb +32 -0
- data/test/requests/compute/test_generalize_virtual_machine.rb +32 -0
- data/test/requests/compute/test_get_availability_set.rb +24 -0
- data/test/requests/compute/test_get_managed_disk.rb +24 -0
- data/test/requests/compute/test_get_virtual_machine.rb +24 -0
- data/test/requests/compute/test_get_vm_extension.rb +26 -0
- data/test/requests/compute/test_get_vm_status.rb +25 -0
- data/test/requests/compute/test_grant_access_to_managed_disk.rb +26 -0
- data/test/requests/compute/test_list_availability_sets.rb +24 -0
- data/test/requests/compute/test_list_available_sizes_for_virtual_machine.rb +33 -0
- data/test/requests/compute/test_list_managed_disks_by_rg.rb +24 -0
- data/test/requests/compute/test_list_managed_disks_in_subscription.rb +24 -0
- data/test/requests/compute/test_list_virtual_machines.rb +24 -0
- data/test/requests/compute/test_power_off_virtual_machine.rb +32 -0
- data/test/requests/compute/test_redeploy_virtual_machine.rb +33 -0
- data/test/requests/compute/test_restart_virtual_machine.rb +32 -0
- data/test/requests/compute/test_revoke_access_to_managed_disk.rb +24 -0
- data/test/requests/compute/test_start_virtual_machine.rb +32 -0
- data/test/requests/compute/test_update_vm_extension.rb +35 -0
- data/test/requests/dns/test_check_record_set_exists.rb +31 -0
- data/test/requests/dns/test_check_zone_exists.rb +35 -0
- data/test/requests/dns/test_create_record_set.rb +46 -0
- data/test/requests/dns/test_create_zone.rb +37 -0
- data/test/requests/dns/test_delete_record_set.rb +24 -0
- data/test/requests/dns/test_delete_zone.rb +24 -0
- data/test/requests/dns/test_get_record_set.rb +24 -0
- data/test/requests/dns/test_get_records_from_record_set.rb +42 -0
- data/test/requests/dns/test_get_zone.rb +35 -0
- data/test/requests/dns/test_list_record_sets.rb +35 -0
- data/test/requests/dns/test_list_zones.rb +26 -0
- data/test/requests/key_vault/test_check_vault_exists.rb +31 -0
- data/test/requests/key_vault/test_create_or_update_vault.rb +25 -0
- data/test/requests/key_vault/test_delete_vault.rb +23 -0
- data/test/requests/key_vault/test_get_vault.rb +24 -0
- data/test/requests/key_vault/test_list_vaults.rb +24 -0
- data/test/requests/network/test_add_address_prefixes_in_virtual_network.rb +29 -0
- data/test/requests/network/test_add_dns_servers_in_virtual_network.rb +29 -0
- data/test/requests/network/test_add_security_rules.rb +43 -0
- data/test/requests/network/test_add_subnets_in_virtual_network.rb +29 -0
- data/test/requests/network/test_attach_network_security_group_to_subnet.rb +26 -0
- data/test/requests/network/test_attach_resource_to_nic.rb +43 -0
- data/test/requests/network/test_attach_route_table_to_subnet.rb +26 -0
- data/test/requests/network/test_check_express_route_cir_auth_exists.rb +31 -0
- data/test/requests/network/test_check_express_route_circuit_exists.rb +31 -0
- data/test/requests/network/test_check_load_balancer_exists.rb +31 -0
- data/test/requests/network/test_check_local_net_gateway_exists.rb +31 -0
- data/test/requests/network/test_check_net_sec_group_exists.rb +31 -0
- data/test/requests/network/test_check_net_sec_rule_exists.rb +31 -0
- data/test/requests/network/test_check_network_interface_exists.rb +31 -0
- data/test/requests/network/test_check_public_ip_exists.rb +30 -0
- data/test/requests/network/test_check_subnet_exists.rb +31 -0
- data/test/requests/network/test_check_virtual_network_exists.rb +34 -0
- data/test/requests/network/test_check_vnet_gateway_connection_exists.rb +31 -0
- data/test/requests/network/test_check_vnet_gateway_exists.rb +31 -0
- data/test/requests/network/test_create_express_route_circuit.rb +39 -0
- data/test/requests/network/test_create_express_route_circuit_authorization.rb +35 -0
- data/test/requests/network/test_create_express_route_circuit_peering.rb +37 -0
- data/test/requests/network/test_create_load_balancer.rb +49 -0
- data/test/requests/network/test_create_local_network_gateway.rb +36 -0
- data/test/requests/network/test_create_network_interface.rb +42 -0
- data/test/requests/network/test_create_or_update_network_security_group.rb +38 -0
- data/test/requests/network/test_create_or_update_network_security_rule.rb +28 -0
- data/test/requests/network/test_create_or_update_virtual_network.rb +55 -0
- data/test/requests/network/test_create_public_ip.rb +35 -0
- data/test/requests/network/test_create_subnet.rb +35 -0
- data/test/requests/network/test_create_virtual_network_gateway.rb +37 -0
- data/test/requests/network/test_create_virtual_network_gateway_connection.rb +36 -0
- data/test/requests/network/test_delete_express_route_circuit.rb +24 -0
- data/test/requests/network/test_delete_express_route_circuit_authorization.rb +23 -0
- data/test/requests/network/test_delete_express_route_circuit_peering.rb +24 -0
- data/test/requests/network/test_delete_load_balancer.rb +24 -0
- data/test/requests/network/test_delete_local_network_gateway.rb +23 -0
- data/test/requests/network/test_delete_network_interface.rb +24 -0
- data/test/requests/network/test_delete_network_security_group.rb +25 -0
- data/test/requests/network/test_delete_network_security_rule.rb +25 -0
- data/test/requests/network/test_delete_public_ip.rb +24 -0
- data/test/requests/network/test_delete_subnet.rb +24 -0
- data/test/requests/network/test_delete_virtual_network.rb +24 -0
- data/test/requests/network/test_delete_virtual_network_gateway.rb +24 -0
- data/test/requests/network/test_delete_virtual_network_gateway_connection.rb +23 -0
- data/test/requests/network/test_detach_network_security_group_from_subnet.rb +26 -0
- data/test/requests/network/test_detach_resource_from_nic.rb +41 -0
- data/test/requests/network/test_detach_route_table_from_subnet.rb +26 -0
- data/test/requests/network/test_get_available_ipaddresses_count.rb +18 -0
- data/test/requests/network/test_get_connection_shared_key.rb +24 -0
- data/test/requests/network/test_get_express_route_circuit.rb +24 -0
- data/test/requests/network/test_get_express_route_circuit_authorization.rb +24 -0
- data/test/requests/network/test_get_express_route_circuit_peering.rb +24 -0
- data/test/requests/network/test_get_load_balancer.rb +24 -0
- data/test/requests/network/test_get_local_network_gateway.rb +24 -0
- data/test/requests/network/test_get_network_interface.rb +24 -0
- data/test/requests/network/test_get_network_security_group.rb +26 -0
- data/test/requests/network/test_get_network_security_rule.rb +26 -0
- data/test/requests/network/test_get_public_ip.rb +26 -0
- data/test/requests/network/test_get_subnet.rb +26 -0
- data/test/requests/network/test_get_virtual_network.rb +26 -0
- data/test/requests/network/test_get_virtual_network_gateway.rb +24 -0
- data/test/requests/network/test_get_virtual_network_gateway_connection.rb +24 -0
- data/test/requests/network/test_list_express_route_circuit_authorizations.rb +24 -0
- data/test/requests/network/test_list_express_route_circuit_peerings.rb +24 -0
- data/test/requests/network/test_list_express_route_circuits.rb +26 -0
- data/test/requests/network/test_list_express_route_service_providers.rb +24 -0
- data/test/requests/network/test_list_load_balancers.rb +24 -0
- data/test/requests/network/test_list_local_network_gateways.rb +24 -0
- data/test/requests/network/test_list_network_interfaces.rb +24 -0
- data/test/requests/network/test_list_network_security_groups.rb +26 -0
- data/test/requests/network/test_list_network_security_rules.rb +26 -0
- data/test/requests/network/test_list_public_ips.rb +24 -0
- data/test/requests/network/test_list_subnets.rb +24 -0
- data/test/requests/network/test_list_virtual_network_gateway_connections.rb +24 -0
- data/test/requests/network/test_list_virtual_network_gateways.rb +24 -0
- data/test/requests/network/test_list_virtual_networks.rb +24 -0
- data/test/requests/network/test_list_virtual_networks_in_subscription.rb +24 -0
- data/test/requests/network/test_remove_address_prefixes_from_virtual_network.rb +29 -0
- data/test/requests/network/test_remove_dns_servers_from_virtual_network.rb +29 -0
- data/test/requests/network/test_remove_security_rule.rb +29 -0
- data/test/requests/network/test_remove_subnets_from_virtual_network.rb +29 -0
- data/test/requests/network/test_reset_connection_shared_key.rb +23 -0
- data/test/requests/network/test_set_connection_shared_key.rb +23 -0
- data/test/requests/network/test_update_public_ip.rb +34 -0
- data/test/requests/resources/test_check_azure_resource_exists.rb +22 -0
- data/test/requests/resources/test_check_deployment_exists.rb +29 -0
- data/test/requests/resources/test_check_resource_group_exists.rb +29 -0
- data/test/requests/resources/test_create_deployment.rb +32 -0
- data/test/requests/resources/test_create_resource_group.rb +24 -0
- data/test/requests/resources/test_delete_deployment.rb +25 -0
- data/test/requests/resources/test_delete_resource_group.rb +24 -0
- data/test/requests/resources/test_delete_resource_tag.rb +35 -0
- data/test/requests/resources/test_get_deployment.rb +24 -0
- data/test/requests/resources/test_get_resource_group.rb +24 -0
- data/test/requests/resources/test_list_deployments.rb +25 -0
- data/test/requests/resources/test_list_resource_groups.rb +24 -0
- data/test/requests/resources/test_list_tagged_resources.rb +24 -0
- data/test/requests/resources/test_tag_resource.rb +35 -0
- data/test/requests/sql/test_create_or_update_database.rb +25 -0
- data/test/requests/sql/test_create_or_update_firewall_rule.rb +25 -0
- data/test/requests/sql/test_create_or_update_sql_server.rb +25 -0
- data/test/requests/sql/test_delete_database.rb +23 -0
- data/test/requests/sql/test_delete_firewall_rule.rb +23 -0
- data/test/requests/sql/test_delete_sql_server.rb +23 -0
- data/test/requests/sql/test_get_database.rb +24 -0
- data/test/requests/sql/test_get_firewall_rule.rb +24 -0
- data/test/requests/sql/test_get_sql_server.rb +24 -0
- data/test/requests/sql/test_list_databases.rb +24 -0
- data/test/requests/sql/test_list_firewall_rules.rb +24 -0
- data/test/requests/sql/test_list_sql_servers.rb +24 -0
- data/test/requests/storage/test_acquire_blob_lease.rb +36 -0
- data/test/requests/storage/test_acquire_container_lease.rb +36 -0
- data/test/requests/storage/test_check_container_exists.rb +18 -0
- data/test/requests/storage/test_check_storage_account_exists.rb +34 -0
- data/test/requests/storage/test_check_storage_account_name_availability.rb +35 -0
- data/test/requests/storage/test_commit_blob_blocks.rb +34 -0
- data/test/requests/storage/test_compare_container_blobs.rb +36 -0
- data/test/requests/storage/test_copy_blob.rb +36 -0
- data/test/requests/storage/test_copy_blob_from_uri.rb +36 -0
- data/test/requests/storage/test_create_block_blob.rb +80 -0
- data/test/requests/storage/test_create_container.rb +36 -0
- data/test/requests/storage/test_create_disk.rb +70 -0
- data/test/requests/storage/test_create_page_blob.rb +34 -0
- data/test/requests/storage/test_create_recovery_vault.rb +35 -0
- data/test/requests/storage/test_create_storage_account.rb +34 -0
- data/test/requests/storage/test_delete_blob.rb +42 -0
- data/test/requests/storage/test_delete_container.rb +42 -0
- data/test/requests/storage/test_delete_disk.rb +30 -0
- data/test/requests/storage/test_delete_recovery_vault.rb +34 -0
- data/test/requests/storage/test_delete_storage_account.rb +28 -0
- data/test/requests/storage/test_disable_backup_protection.rb +52 -0
- data/test/requests/storage/test_enable_backup_protection.rb +66 -0
- data/test/requests/storage/test_get_all_backup_jobs.rb +35 -0
- data/test/requests/storage/test_get_backup_container.rb +35 -0
- data/test/requests/storage/test_get_backup_item.rb +35 -0
- data/test/requests/storage/test_get_backup_job_for_vm.rb +26 -0
- data/test/requests/storage/test_get_backup_protection_policy.rb +35 -0
- data/test/requests/storage/test_get_blob.rb +141 -0
- data/test/requests/storage/test_get_blob_http_url.rb +30 -0
- data/test/requests/storage/test_get_blob_https_url.rb +30 -0
- data/test/requests/storage/test_get_blob_properties.rb +45 -0
- data/test/requests/storage/test_get_blob_url.rb +75 -0
- data/test/requests/storage/test_get_container_acl.rb +37 -0
- data/test/requests/storage/test_get_container_properties.rb +45 -0
- data/test/requests/storage/test_get_container_url.rb +33 -0
- data/test/requests/storage/test_get_recovery_vault.rb +35 -0
- data/test/requests/storage/test_get_storage_access_keys.rb +24 -0
- data/test/requests/storage/test_get_storage_account.rb +25 -0
- data/test/requests/storage/test_list_blobs.rb +77 -0
- data/test/requests/storage/test_list_containers.rb +54 -0
- data/test/requests/storage/test_list_recovery_vault.rb +35 -0
- data/test/requests/storage/test_list_storage_accounts.rb +37 -0
- data/test/requests/storage/test_list_storage_accounts_for_rg.rb +37 -0
- data/test/requests/storage/test_multipart_save_block_blob.rb +105 -0
- data/test/requests/storage/test_put_blob_block.rb +34 -0
- data/test/requests/storage/test_put_blob_metadata.rb +36 -0
- data/test/requests/storage/test_put_blob_pages.rb +34 -0
- data/test/requests/storage/test_put_blob_properties.rb +39 -0
- data/test/requests/storage/test_put_container_acl.rb +34 -0
- data/test/requests/storage/test_put_container_metadata.rb +36 -0
- data/test/requests/storage/test_release_blob_lease.rb +34 -0
- data/test/requests/storage/test_release_container_lease.rb +34 -0
- data/test/requests/storage/test_save_page_blob.rb +115 -0
- data/test/requests/storage/test_set_recovery_vault_context.rb +34 -0
- data/test/requests/storage/test_start_backup.rb +55 -0
- data/test/requests/storage/test_update_storage_account.rb +34 -0
- data/test/requests/storage/test_wait_blob_copy_operation_to_finish.rb +148 -0
- data/test/requests/traffic_manager/test_check_traffic_manager_endpoint_exists.rb +31 -0
- data/test/requests/traffic_manager/test_check_traffic_manager_profile_exists.rb +31 -0
- data/test/requests/traffic_manager/test_create_traffic_manager_endpoint.rb +25 -0
- data/test/requests/traffic_manager/test_create_traffic_manager_profile.rb +25 -0
- data/test/requests/traffic_manager/test_delete_traffic_manager_endpoint.rb +23 -0
- data/test/requests/traffic_manager/test_delete_traffic_manager_profile.rb +23 -0
- data/test/requests/traffic_manager/test_get_traffic_manager_endpoint.rb +24 -0
- data/test/requests/traffic_manager/test_get_traffic_manager_profile.rb +24 -0
- data/test/requests/traffic_manager/test_list_traffic_manager_profiles.rb +24 -0
- data/test/requests/traffic_manager/test_update_traffic_manager_endpoint.rb +27 -0
- data/test/requests/traffic_manager/test_update_traffic_manager_profile.rb +27 -0
- data/test/smoke_tests/compute/test_resource_group_smoke.rb +37 -0
- data/test/test_credentials.rb +63 -0
- data/test/test_helper.rb +817 -0
- metadata +1074 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
# Fog
|
2
|
+
Whether you need compute, dns, storage, or a multitude of other services, fog provides an accessible entry point and facilitates cross service compatibility. Fog delivers the knowledge of cloud experts to you, helping you to bootstrap your cloud usage and guiding you as your own expertise develops.
|
3
|
+
|
4
|
+
By coding with fog from the start you avoid vendor lock-in and give yourself more flexibility to provide value. Whether you are writing a library, designing a software as a service product or just hacking on the weekend this flexibility is a huge boon.
|
5
|
+
|
6
|
+
# Structure
|
7
|
+
fog is the Ruby cloud computing library, top to bottom:
|
8
|
+
|
9
|
+
- Collections provide a simplified interface, making clouds easier to work with and switch between.
|
10
|
+
- Requests allow power users to get the most out of the features of each individual cloud.
|
11
|
+
- Mocks make testing and integrating a breeze.
|
12
|
+
|
13
|
+
#### Collections
|
14
|
+
Some collections are available across multiple providers:
|
15
|
+
- dns providers have `zones` and `records`
|
16
|
+
- compute providers have `images` and `servers`
|
17
|
+
|
18
|
+
Collections share basic CRUD type operations, such as:
|
19
|
+
- **all** - fetch every object of that type from the provider.
|
20
|
+
- **get** - fetch a single object by it’s identity from the provider.
|
21
|
+
|
22
|
+
#### Models
|
23
|
+
Many of the collection methods return individual objects, which also provide common methods:
|
24
|
+
- **destroy** - will destroy the persisted object from the provider.
|
25
|
+
- **save** - persist the object to the provider.
|
26
|
+
|
27
|
+
#### Requests
|
28
|
+
Requests allow you to dive deeper when the models just can’t cut it. You can see a list of available requests by calling `requests` on the connection object.
|
29
|
+
|
30
|
+
#### Mocks
|
31
|
+
As you might imagine, testing code using fog can be slow and expensive, constantly turning on and shutting down instances. Mocking allows skipping this overhead by providing an in-memory representation resources as you make requests.
|
32
|
+
|
33
|
+
# Fog Provider Directory Structure
|
34
|
+
```sh
|
35
|
+
Plugin Root
|
36
|
+
|--- lib
|
37
|
+
|--- fog
|
38
|
+
|--- azurerm.rb #registers provider
|
39
|
+
|--- azurerm
|
40
|
+
|--- compute.rb #registers all models, collections and requests
|
41
|
+
|--- dns.rb #registers all models, collections and requests
|
42
|
+
|--- storage.rb #registers all models, collections and requests
|
43
|
+
|--- models #models and collections
|
44
|
+
|--- compute #models and collections for compute
|
45
|
+
|--- dns
|
46
|
+
|--- storage
|
47
|
+
|--- requests #requests - includes Real and Mock Classes
|
48
|
+
|--- compute #requests for compute
|
49
|
+
|--- dns
|
50
|
+
|--- storage
|
51
|
+
```
|
52
|
+
|
53
|
+
For more information about fog structure [Click Here](http://fog.io/about/structure.html)
|
@@ -0,0 +1,159 @@
|
|
1
|
+
# Traffic Manager
|
2
|
+
|
3
|
+
This document explains how to get started using Azure Traffic Manager Service with Fog. With this gem you can create/update/list/delete Traffic Manager Profiles and End Points.
|
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 Traffic Manager Service:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
azure_traffic_manager_service = Fog::TrafficManager::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
|
+
:environment => '<AzureCloud/AzureChinaCloud/AzureUSGovernment/AzureGermanCloud>' # Azure cloud environment. Default is AzureCloud.
|
23
|
+
)
|
24
|
+
```
|
25
|
+
|
26
|
+
## Check Traffic Manager Profile Existence
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
azure_traffic_manager_service.traffic_manager_profiles.check_traffic_manager_profile_exists(<Resource Group Name>, <Profile Name>)
|
30
|
+
```
|
31
|
+
|
32
|
+
## Create Traffic Manager Profile
|
33
|
+
|
34
|
+
Create a new Traffic Manager Profile. The parameter 'traffic_routing_method' can be 'Performance', 'Weighted' or 'Priority'.
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
profile = azure_traffic_manager_service.traffic_manager_profiles.create(
|
38
|
+
name: '<Profile Name>',
|
39
|
+
resource_group: '<Resource Group Name>',
|
40
|
+
traffic_routing_method: 'Performance',
|
41
|
+
relative_name: '<Profile Relative Name>',
|
42
|
+
ttl: '30',
|
43
|
+
protocol: 'http',
|
44
|
+
port: '80',
|
45
|
+
path: '/monitorpage.aspx'
|
46
|
+
)
|
47
|
+
```
|
48
|
+
|
49
|
+
## List Traffic Manager Profiles
|
50
|
+
|
51
|
+
List Traffic Manager Profiles in a resource group
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
profiles = azure_traffic_manager_service.traffic_manager_profiles(resource_group: '<Resource Group name>')
|
55
|
+
profiles.each do |profile|
|
56
|
+
puts "#{profile.name}"
|
57
|
+
end
|
58
|
+
```
|
59
|
+
|
60
|
+
## Retrieve a single Traffic Manager Profile
|
61
|
+
|
62
|
+
Get a single record of Traffic Manager Profile
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
profile = azure_traffic_manager_service
|
66
|
+
.traffic_manager_profiles
|
67
|
+
.get('<Resource Group name>', '<Profile name>')
|
68
|
+
puts "#{profile.name}"
|
69
|
+
```
|
70
|
+
|
71
|
+
## Update a Traffic Manager Profile
|
72
|
+
|
73
|
+
Get a Traffic Manager Profile object from the get method and then update that Traffic Manager Profile. You can update the Traffic Manager Profile by passing the modifiable attributes in the form of a hash.
|
74
|
+
|
75
|
+
```ruby
|
76
|
+
profile.update(
|
77
|
+
traffic_routing_method: 'Weighted',
|
78
|
+
ttl: '35',
|
79
|
+
protocol: 'https',
|
80
|
+
port: '90',
|
81
|
+
path: '/monitorpage1.aspx'
|
82
|
+
)
|
83
|
+
```
|
84
|
+
|
85
|
+
## Destroy a single Traffic Manager Profile
|
86
|
+
|
87
|
+
Get a Traffic Manager Profile object from the get method and then destroy that Traffic Manager Profile.
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
profile.destroy
|
91
|
+
```
|
92
|
+
|
93
|
+
## Check Traffic Manager Endpoint Existence
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
azure_network_service.traffic_manager_end_points.check_traffic_manager_endpoint_exists(
|
97
|
+
<Resource Group Name>,
|
98
|
+
<Profile Name>,
|
99
|
+
<Endpoint Name>,
|
100
|
+
<Type(externalEndpoints)>
|
101
|
+
)
|
102
|
+
```
|
103
|
+
|
104
|
+
## Create Traffic Manager Endpoint
|
105
|
+
|
106
|
+
Traffic Manager Profile is pre-requisite of Traffic Manager Endpoint. Create a new Traffic Manager Endpoint. The parameter 'type' can be 'externalEndpoints, 'azureEndpoints' or 'nestedEndpoints'.
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
endpoint = azure_network_service.traffic_manager_end_points.create(
|
110
|
+
name: '<Endpoint Name>',
|
111
|
+
traffic_manager_profile_name: '<Profile Name>',
|
112
|
+
resource_group: '<Resource Group Name>',
|
113
|
+
type: 'externalEndpoints',
|
114
|
+
target: 'test.com',
|
115
|
+
endpoint_location: 'West US'
|
116
|
+
)
|
117
|
+
```
|
118
|
+
|
119
|
+
## List Traffic Manager Endpoints
|
120
|
+
|
121
|
+
List Traffic Manager Endpoints in a resource group.
|
122
|
+
|
123
|
+
```ruby
|
124
|
+
endpoints = azure_traffic_manager_service.traffic_manager_end_points(resource_group: '<Resource Group name>', traffic_manager_profile_name: '<Profile Name>')
|
125
|
+
endpoints.each do |endpoint|
|
126
|
+
puts "#{endpoint.name}"
|
127
|
+
end
|
128
|
+
```
|
129
|
+
|
130
|
+
## Retrieve a single Traffic Manager Endpoint
|
131
|
+
|
132
|
+
Get a single Traffic Manager Endpoint.
|
133
|
+
|
134
|
+
```ruby
|
135
|
+
endpoint = azure_traffic_manager_service
|
136
|
+
.traffic_manager_end_points
|
137
|
+
.get('<Resource Group name>', '<Profile Name>', '<Endpoint name>', '<Endpoint type>')
|
138
|
+
puts "#{endpoint.name}"
|
139
|
+
```
|
140
|
+
## Update a Traffic Manager Endpoint
|
141
|
+
|
142
|
+
Get a Traffic Manager Endpoint object from the get method and then update that Traffic Manager Endpoint. You can update the Traffic Manager Endpoint by passing the modifiable attributes in the form of a hash.
|
143
|
+
|
144
|
+
```ruby
|
145
|
+
endpoint.update(type: 'externalEndpoints',
|
146
|
+
target: 'test1.com',
|
147
|
+
endpoint_location: 'Central US')
|
148
|
+
```
|
149
|
+
|
150
|
+
## Destroy a single Traffic Manager Endpoint
|
151
|
+
|
152
|
+
Get a Traffic Manager Endpoint object from the get method and then destroy that Traffic Manager Endpoint.
|
153
|
+
|
154
|
+
```ruby
|
155
|
+
endpoint.destroy
|
156
|
+
```
|
157
|
+
|
158
|
+
## Support and Feedback
|
159
|
+
Your feedback is highly appreciated! If you have specific issues with the fog ARM, you should file an issue via Github.
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module Fog
|
2
|
+
module KeyVault
|
3
|
+
# This class registers models, requests and collections
|
4
|
+
class AzureRM < Fog::Service
|
5
|
+
requires :tenant_id
|
6
|
+
requires :client_id
|
7
|
+
requires :client_secret
|
8
|
+
requires :subscription_id
|
9
|
+
|
10
|
+
request_path 'fog/azurerm/requests/key_vault'
|
11
|
+
request :get_vault
|
12
|
+
request :list_vaults
|
13
|
+
request :create_or_update_vault
|
14
|
+
request :delete_vault
|
15
|
+
request :check_vault_exists
|
16
|
+
|
17
|
+
model_path 'fog/azurerm/models/key_vault'
|
18
|
+
model :vault
|
19
|
+
model :access_policy_entry
|
20
|
+
collection :vaults
|
21
|
+
|
22
|
+
# This class provides the mock implementation for unit tests.
|
23
|
+
class Mock
|
24
|
+
def initialize(_options = {})
|
25
|
+
begin
|
26
|
+
require 'azure_mgmt_key_vault'
|
27
|
+
rescue LoadError => e
|
28
|
+
retry if require('rubygems')
|
29
|
+
raise e.message
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# This class provides the actual implementation for service calls.
|
35
|
+
class Real
|
36
|
+
def initialize(options)
|
37
|
+
begin
|
38
|
+
require 'azure_mgmt_key_vault'
|
39
|
+
rescue LoadError => e
|
40
|
+
retry if require('rubygems')
|
41
|
+
raise e.message
|
42
|
+
end
|
43
|
+
|
44
|
+
credentials = Fog::Credentials::AzureRM.get_credentials(options[:tenant_id], options[:client_id], options[:client_secret])
|
45
|
+
@key_vault_client = ::Azure::ARM::KeyVault::KeyVaultManagementClient.new(credentials)
|
46
|
+
@key_vault_client.subscription_id = options[:subscription_id]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module ApplicationGateway
|
3
|
+
class AzureRM
|
4
|
+
# Backend Address Pool model class for Application Gateway Service
|
5
|
+
class BackendAddressPool < Fog::Model
|
6
|
+
identity :name
|
7
|
+
attribute :id
|
8
|
+
attribute :ip_addresses
|
9
|
+
|
10
|
+
def self.parse(backend_address_pool)
|
11
|
+
hash = {}
|
12
|
+
backend_addresses = backend_address_pool.backend_addresses
|
13
|
+
hash['id'] = backend_address_pool.id
|
14
|
+
hash['name'] = backend_address_pool.name
|
15
|
+
hash['ip_addresses'] = []
|
16
|
+
backend_addresses.each do |ip_address|
|
17
|
+
hash['ip_addresses'] << ip_address
|
18
|
+
end unless backend_addresses.nil?
|
19
|
+
hash
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Fog
|
2
|
+
module ApplicationGateway
|
3
|
+
class AzureRM
|
4
|
+
# Backend Http Settings model class for Application Gateway Service
|
5
|
+
class BackendHttpSetting < Fog::Model
|
6
|
+
identity :name
|
7
|
+
attribute :id
|
8
|
+
attribute :port
|
9
|
+
attribute :protocol
|
10
|
+
attribute :cookie_based_affinity
|
11
|
+
attribute :request_timeout
|
12
|
+
attribute :probe
|
13
|
+
|
14
|
+
def self.parse(backend_http_setting)
|
15
|
+
hash = {}
|
16
|
+
hash['id'] = backend_http_setting.id
|
17
|
+
hash['name'] = backend_http_setting.name
|
18
|
+
hash['port'] = backend_http_setting.port
|
19
|
+
hash['protocol'] = backend_http_setting.protocol
|
20
|
+
hash['cookie_based_affinity'] = backend_http_setting.cookie_based_affinity
|
21
|
+
hash['request_timeout'] = backend_http_setting.request_timeout
|
22
|
+
hash['probe'] = backend_http_setting.probe
|
23
|
+
hash
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Fog
|
2
|
+
module ApplicationGateway
|
3
|
+
class AzureRM
|
4
|
+
# Frontend IP Configuration model class for Application Gateway Service
|
5
|
+
class FrontendIPConfiguration < Fog::Model
|
6
|
+
identity :name
|
7
|
+
attribute :id
|
8
|
+
attribute :public_ip_address_id
|
9
|
+
attribute :private_ip_allocation_method
|
10
|
+
attribute :private_ip_address
|
11
|
+
attribute :subnet_id
|
12
|
+
def self.parse(frontend_ip_configuration)
|
13
|
+
hash = {}
|
14
|
+
hash['id'] = frontend_ip_configuration.id
|
15
|
+
hash['name'] = frontend_ip_configuration.name
|
16
|
+
hash['public_ip_address_id'] = frontend_ip_configuration.public_ipaddress.id unless frontend_ip_configuration.public_ipaddress.nil?
|
17
|
+
hash['private_ip_allocation_method'] = frontend_ip_configuration.private_ipallocation_method
|
18
|
+
private_ip_address = frontend_ip_configuration.private_ipaddress
|
19
|
+
hash['private_ip_address'] = private_ip_address
|
20
|
+
hash['subnet_id'] = frontend_ip_configuration.subnet.id unless frontend_ip_configuration.subnet.nil?
|
21
|
+
hash
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module ApplicationGateway
|
3
|
+
class AzureRM
|
4
|
+
# Frontenf Port model class for Application Gateway Service
|
5
|
+
class FrontendPort < Fog::Model
|
6
|
+
identity :name
|
7
|
+
attribute :id
|
8
|
+
attribute :port
|
9
|
+
|
10
|
+
def self.parse(frontend_port)
|
11
|
+
hash = {}
|
12
|
+
hash['id'] = frontend_port.id
|
13
|
+
hash['name'] = frontend_port.name
|
14
|
+
hash['port'] = frontend_port.port
|
15
|
+
hash
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,613 @@
|
|
1
|
+
module Fog
|
2
|
+
module ApplicationGateway
|
3
|
+
class AzureRM
|
4
|
+
# Gateway model class for Application Gateway Service
|
5
|
+
class Gateway < Fog::Model
|
6
|
+
identity :name
|
7
|
+
attribute :id
|
8
|
+
attribute :location
|
9
|
+
attribute :resource_group
|
10
|
+
attribute :provisioning_state
|
11
|
+
attribute :sku_name
|
12
|
+
attribute :sku_tier
|
13
|
+
attribute :sku_capacity
|
14
|
+
attribute :operational_state
|
15
|
+
attribute :gateway_ip_configurations
|
16
|
+
attribute :ssl_certificates
|
17
|
+
attribute :frontend_ip_configurations
|
18
|
+
attribute :frontend_ports
|
19
|
+
attribute :probes
|
20
|
+
attribute :backend_address_pools
|
21
|
+
attribute :backend_http_settings_list
|
22
|
+
attribute :http_listeners
|
23
|
+
attribute :url_path_maps
|
24
|
+
attribute :request_routing_rules
|
25
|
+
|
26
|
+
def self.parse(gateway)
|
27
|
+
hash = {}
|
28
|
+
hash['name'] = gateway.name
|
29
|
+
hash['id'] = gateway.id
|
30
|
+
hash['location'] = gateway.location
|
31
|
+
hash['resource_group'] = get_resource_group_from_id(gateway.id)
|
32
|
+
hash['provisioning_state'] = gateway.provisioning_state
|
33
|
+
unless gateway.sku.nil?
|
34
|
+
hash['sku_name'] = gateway.sku.name
|
35
|
+
hash['sku_tier'] = gateway.sku.tier
|
36
|
+
hash['sku_capacity'] = gateway.sku.capacity
|
37
|
+
end
|
38
|
+
hash['operational_state'] = gateway.operational_state
|
39
|
+
|
40
|
+
hash['gateway_ip_configurations'] = []
|
41
|
+
gateway.gateway_ipconfigurations.each do |ip_configuration|
|
42
|
+
gateway_ip_configuration = Fog::ApplicationGateway::AzureRM::IPConfiguration.new
|
43
|
+
hash['gateway_ip_configurations'] << gateway_ip_configuration.merge_attributes(Fog::ApplicationGateway::AzureRM::IPConfiguration.parse(ip_configuration))
|
44
|
+
end unless gateway.gateway_ipconfigurations.nil?
|
45
|
+
|
46
|
+
hash['ssl_certificates'] = []
|
47
|
+
gateway.ssl_certificates.each do |certificate|
|
48
|
+
ssl_certificate = Fog::ApplicationGateway::AzureRM::SslCertificate.new
|
49
|
+
hash['ssl_certificates'] << ssl_certificate.merge_attributes(Fog::ApplicationGateway::AzureRM::SslCertificate.parse(certificate))
|
50
|
+
end unless gateway.ssl_certificates.nil?
|
51
|
+
|
52
|
+
hash['frontend_ip_configurations'] = []
|
53
|
+
gateway.frontend_ipconfigurations.each do |frontend_ip_config|
|
54
|
+
frontend_ip_configuration = Fog::ApplicationGateway::AzureRM::FrontendIPConfiguration.new
|
55
|
+
hash['frontend_ip_configurations'] << frontend_ip_configuration.merge_attributes(Fog::ApplicationGateway::AzureRM::FrontendIPConfiguration.parse(frontend_ip_config))
|
56
|
+
end unless gateway.frontend_ipconfigurations.nil?
|
57
|
+
|
58
|
+
hash['frontend_ports'] = []
|
59
|
+
gateway.frontend_ports.each do |port|
|
60
|
+
frontend_port = Fog::ApplicationGateway::AzureRM::FrontendPort.new
|
61
|
+
hash['frontend_ports'] << frontend_port.merge_attributes(Fog::ApplicationGateway::AzureRM::FrontendPort.parse(port))
|
62
|
+
end unless gateway.frontend_ports.nil?
|
63
|
+
|
64
|
+
hash['probes'] = []
|
65
|
+
gateway.probes.each do |probe|
|
66
|
+
gateway_probe = Fog::ApplicationGateway::AzureRM::Probe.new
|
67
|
+
hash['probes'] << gateway_probe.merge_attributes(Fog::ApplicationGateway::AzureRM::Probe.parse(probe))
|
68
|
+
end unless gateway.probes.nil?
|
69
|
+
|
70
|
+
hash['backend_address_pools'] = []
|
71
|
+
gateway.backend_address_pools.each do |address|
|
72
|
+
backend_address_pool = Fog::ApplicationGateway::AzureRM::BackendAddressPool.new
|
73
|
+
hash['backend_address_pools'] << backend_address_pool.merge_attributes(Fog::ApplicationGateway::AzureRM::BackendAddressPool.parse(address))
|
74
|
+
end unless gateway.backend_address_pools.nil?
|
75
|
+
|
76
|
+
hash['backend_http_settings_list'] = []
|
77
|
+
gateway.backend_http_settings_collection.each do |http_setting|
|
78
|
+
backend_http_setting = Fog::ApplicationGateway::AzureRM::BackendHttpSetting.new
|
79
|
+
hash['backend_http_settings_list'] << backend_http_setting.merge_attributes(Fog::ApplicationGateway::AzureRM::BackendHttpSetting.parse(http_setting))
|
80
|
+
end unless gateway.backend_http_settings_collection.nil?
|
81
|
+
|
82
|
+
hash['http_listeners'] = []
|
83
|
+
gateway.http_listeners.each do |listener|
|
84
|
+
http_listener = Fog::ApplicationGateway::AzureRM::HttpListener.new
|
85
|
+
hash['http_listeners'] << http_listener.merge_attributes(Fog::ApplicationGateway::AzureRM::HttpListener.parse(listener))
|
86
|
+
end unless gateway.http_listeners.nil?
|
87
|
+
|
88
|
+
hash['url_path_maps'] = []
|
89
|
+
gateway.url_path_maps.each do |map|
|
90
|
+
url_path_map = Fog::ApplicationGateway::AzureRM::UrlPathMap.new
|
91
|
+
hash['url_path_maps'] << url_path_map.merge_attributes(Fog::ApplicationGateway::AzureRM::UrlPathMap.parse(map))
|
92
|
+
end unless gateway.url_path_maps.nil?
|
93
|
+
|
94
|
+
hash['request_routing_rules'] = []
|
95
|
+
gateway.request_routing_rules.each do |rule|
|
96
|
+
request_routing_rule = Fog::ApplicationGateway::AzureRM::RequestRoutingRule.new
|
97
|
+
hash['request_routing_rules'] << request_routing_rule.merge_attributes(Fog::ApplicationGateway::AzureRM::RequestRoutingRule.parse(rule))
|
98
|
+
end unless gateway.request_routing_rules.nil?
|
99
|
+
hash
|
100
|
+
end
|
101
|
+
|
102
|
+
def save
|
103
|
+
requires :name, :location, :resource_group, :sku_name, :sku_tier, :sku_capacity, :gateway_ip_configurations, :frontend_ip_configurations, :frontend_ports, :backend_address_pools, :backend_http_settings_list, :http_listeners, :request_routing_rules
|
104
|
+
|
105
|
+
validate_gateway_ip_configurations(gateway_ip_configurations) unless gateway_ip_configurations.nil?
|
106
|
+
validate_ssl_certificates(ssl_certificates) unless ssl_certificates.nil?
|
107
|
+
validate_frontend_ip_configurations(frontend_ip_configurations) unless frontend_ip_configurations.nil?
|
108
|
+
validate_frontend_ports(frontend_ports) unless frontend_ports.nil?
|
109
|
+
validate_probes(probes) unless probes.nil?
|
110
|
+
validate_backend_address_pools(backend_address_pools) unless backend_address_pools.nil?
|
111
|
+
validate_backend_http_settings_list(backend_http_settings_list) unless backend_http_settings_list.nil?
|
112
|
+
validate_http_listeners(http_listeners) unless http_listeners.nil?
|
113
|
+
validate_url_path_maps(url_path_maps) unless url_path_maps.nil?
|
114
|
+
validate_request_routing_rules(request_routing_rules) unless request_routing_rules.nil?
|
115
|
+
gateway = service.create_or_update_application_gateway(application_gateway_params)
|
116
|
+
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
117
|
+
end
|
118
|
+
|
119
|
+
def application_gateway_params
|
120
|
+
{
|
121
|
+
name: name,
|
122
|
+
location: location,
|
123
|
+
resource_group: resource_group,
|
124
|
+
sku_name: sku_name,
|
125
|
+
sku_tier: sku_tier,
|
126
|
+
sku_capacity: sku_capacity,
|
127
|
+
gateway_ip_configurations: gateway_ip_configurations,
|
128
|
+
ssl_certificates: ssl_certificates,
|
129
|
+
frontend_ip_configurations: frontend_ip_configurations,
|
130
|
+
frontend_ports: frontend_ports,
|
131
|
+
probes: probes,
|
132
|
+
backend_address_pools: backend_address_pools,
|
133
|
+
backend_http_settings_list: backend_http_settings_list,
|
134
|
+
http_listeners: http_listeners,
|
135
|
+
url_path_maps: url_path_maps,
|
136
|
+
request_routing_rules: request_routing_rules
|
137
|
+
}
|
138
|
+
end
|
139
|
+
|
140
|
+
def validate_gateway_ip_configurations(gateway_ip_configurations)
|
141
|
+
if gateway_ip_configurations.is_a?(Array)
|
142
|
+
if gateway_ip_configurations.any?
|
143
|
+
gateway_ip_configurations.each do |gateway_ip_configuration|
|
144
|
+
if gateway_ip_configuration.is_a?(Hash)
|
145
|
+
validate_gateway_ip_configuration_params(gateway_ip_configuration)
|
146
|
+
else
|
147
|
+
raise(ArgumentError, ':gateway_ip_configurations must be an Array of Hashes')
|
148
|
+
end
|
149
|
+
end
|
150
|
+
else
|
151
|
+
raise(ArgumentError, ':gateway_ip_configurations must not be an empty Array')
|
152
|
+
end
|
153
|
+
else
|
154
|
+
raise(ArgumentError, ':gateway_ip_configurations must be an Array')
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
def validate_gateway_ip_configuration_params(gateway_ip_configuration)
|
159
|
+
required_params = [
|
160
|
+
:name,
|
161
|
+
:subnet_id
|
162
|
+
]
|
163
|
+
missing = required_params.select { |p| p unless gateway_ip_configuration.key?(p) }
|
164
|
+
if missing.length == 1
|
165
|
+
raise(ArgumentError, "#{missing.first} is required for this operation")
|
166
|
+
elsif missing.any?
|
167
|
+
raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation")
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
def validate_ssl_certificates(ssl_certificates)
|
172
|
+
if ssl_certificates.is_a?(Array)
|
173
|
+
if ssl_certificates.any?
|
174
|
+
ssl_certificates.each do |ssl_certificate|
|
175
|
+
if ssl_certificate.is_a?(Hash)
|
176
|
+
validate_ssl_certificate_params(ssl_certificate)
|
177
|
+
else
|
178
|
+
raise(ArgumentError, ':ssl_certificates must be an Array of Hashes')
|
179
|
+
end
|
180
|
+
end
|
181
|
+
else
|
182
|
+
raise(ArgumentError, ':ssl_certificates must not be an empty Array')
|
183
|
+
end
|
184
|
+
else
|
185
|
+
raise(ArgumentError, ':ssl_certificates must be an Array')
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
def validate_ssl_certificate_params(ssl_certificate)
|
190
|
+
required_params = [
|
191
|
+
:name,
|
192
|
+
:data,
|
193
|
+
:password,
|
194
|
+
:public_cert_data
|
195
|
+
]
|
196
|
+
missing = required_params.select { |p| p unless ssl_certificate.key?(p) }
|
197
|
+
if missing.length == 1
|
198
|
+
raise(ArgumentError, "#{missing.first} is required for this operation")
|
199
|
+
elsif missing.any?
|
200
|
+
raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation")
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
def validate_frontend_ip_configurations(frontend_ip_configurations)
|
205
|
+
if frontend_ip_configurations.is_a?(Array)
|
206
|
+
if frontend_ip_configurations.any?
|
207
|
+
frontend_ip_configurations.each do |frontend_ip_configuration|
|
208
|
+
if frontend_ip_configuration.is_a?(Hash)
|
209
|
+
validate_frontend_ip_configuration_params(frontend_ip_configuration)
|
210
|
+
else
|
211
|
+
raise(ArgumentError, ':frontend_ip_configurations must be an Array of Hashes')
|
212
|
+
end
|
213
|
+
end
|
214
|
+
else
|
215
|
+
raise(ArgumentError, ':frontend_ip_configurations must not be an empty Array')
|
216
|
+
end
|
217
|
+
else
|
218
|
+
raise(ArgumentError, ':frontend_ip_configurations must be an Array')
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
def validate_frontend_ip_configuration_params(frontend_ip_configuration)
|
223
|
+
required_params = [
|
224
|
+
:name
|
225
|
+
]
|
226
|
+
missing = required_params.select { |p| p unless frontend_ip_configuration.key?(p) }
|
227
|
+
if missing.length == 1
|
228
|
+
raise(ArgumentError, "#{missing.first} is required for this operation")
|
229
|
+
elsif missing.any?
|
230
|
+
raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation")
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
def validate_frontend_ports(frontend_ports)
|
235
|
+
if frontend_ports.is_a?(Array)
|
236
|
+
if frontend_ports.any?
|
237
|
+
frontend_ports.each do |frontend_port|
|
238
|
+
if frontend_port.is_a?(Hash)
|
239
|
+
validate_frontend_port_params(frontend_port)
|
240
|
+
else
|
241
|
+
raise(ArgumentError, ':frontend_ports must be an Array of Hashes')
|
242
|
+
end
|
243
|
+
end
|
244
|
+
else
|
245
|
+
raise(ArgumentError, ':frontend_ports must not be an empty Array')
|
246
|
+
end
|
247
|
+
else
|
248
|
+
raise(ArgumentError, ':frontend_ports must be an Array')
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
def validate_frontend_port_params(frontend_port)
|
253
|
+
required_params = [
|
254
|
+
:name,
|
255
|
+
:port
|
256
|
+
]
|
257
|
+
missing = required_params.select { |p| p unless frontend_port.key?(p) }
|
258
|
+
if missing.length == 1
|
259
|
+
raise(ArgumentError, "#{missing.first} is required for this operation")
|
260
|
+
elsif missing.any?
|
261
|
+
raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation")
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
def validate_probes(probes)
|
266
|
+
if probes.is_a?(Array)
|
267
|
+
if probes.any?
|
268
|
+
probes.each do |probe|
|
269
|
+
if probe.is_a?(Hash)
|
270
|
+
validate_probe_params(probe)
|
271
|
+
else
|
272
|
+
raise(ArgumentError, ':probes must be an Array of Hashes')
|
273
|
+
end
|
274
|
+
end
|
275
|
+
else
|
276
|
+
raise(ArgumentError, ':probes must not be an empty Array')
|
277
|
+
end
|
278
|
+
else
|
279
|
+
raise(ArgumentError, ':probes must be an Array')
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
def validate_probe_params(probe)
|
284
|
+
required_params = [
|
285
|
+
:name,
|
286
|
+
:protocol,
|
287
|
+
:host,
|
288
|
+
:path,
|
289
|
+
:interval,
|
290
|
+
:timeout,
|
291
|
+
:unhealthy_threshold
|
292
|
+
]
|
293
|
+
missing = required_params.select { |p| p unless probe.key?(p) }
|
294
|
+
if missing.length == 1
|
295
|
+
raise(ArgumentError, "#{missing.first} is required for this operation")
|
296
|
+
elsif missing.any?
|
297
|
+
raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation")
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
301
|
+
def validate_backend_address_pools(backend_address_pools)
|
302
|
+
if backend_address_pools.is_a?(Array)
|
303
|
+
if backend_address_pools.any?
|
304
|
+
backend_address_pools.each do |backend_address_pool|
|
305
|
+
if backend_address_pool.is_a?(Hash)
|
306
|
+
validate_backend_address_pool_params(backend_address_pool)
|
307
|
+
else
|
308
|
+
raise(ArgumentError, ':backend_address_pools must be an Array of Hashes')
|
309
|
+
end
|
310
|
+
end
|
311
|
+
else
|
312
|
+
raise(ArgumentError, ':backend_address_pools must not be an empty Array')
|
313
|
+
end
|
314
|
+
else
|
315
|
+
raise(ArgumentError, ':backend_address_pools must be an Array')
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
def validate_backend_address_pool_params(backend_address_pool)
|
320
|
+
required_params = [
|
321
|
+
:name,
|
322
|
+
:ip_addresses
|
323
|
+
]
|
324
|
+
missing = required_params.select { |p| p unless backend_address_pool.key?(p) }
|
325
|
+
if missing.length == 1
|
326
|
+
raise(ArgumentError, "#{missing.first} is required for this operation")
|
327
|
+
elsif missing.any?
|
328
|
+
raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation")
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
def validate_backend_http_settings_list(backend_http_settings_list)
|
333
|
+
if backend_http_settings_list.is_a?(Array)
|
334
|
+
if backend_http_settings_list.any?
|
335
|
+
backend_http_settings_list.each do |backend_http_settings|
|
336
|
+
if backend_http_settings.is_a?(Hash)
|
337
|
+
validate_backend_http_settings_params(backend_http_settings)
|
338
|
+
else
|
339
|
+
raise(ArgumentError, ':backend_http_settings_list must be an Array of Hashes')
|
340
|
+
end
|
341
|
+
end
|
342
|
+
else
|
343
|
+
raise(ArgumentError, ':backend_http_settings_list must not be an empty Array')
|
344
|
+
end
|
345
|
+
else
|
346
|
+
raise(ArgumentError, ':backend_http_settings_list must be an Array')
|
347
|
+
end
|
348
|
+
end
|
349
|
+
|
350
|
+
def validate_backend_http_settings_params(backend_http_settings)
|
351
|
+
required_params = [
|
352
|
+
:name,
|
353
|
+
:port,
|
354
|
+
:protocol,
|
355
|
+
:cookie_based_affinity
|
356
|
+
]
|
357
|
+
missing = required_params.select { |p| p unless backend_http_settings.key?(p) }
|
358
|
+
if missing.length == 1
|
359
|
+
raise(ArgumentError, "#{missing.first} is required for this operation")
|
360
|
+
elsif missing.any?
|
361
|
+
raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation")
|
362
|
+
end
|
363
|
+
end
|
364
|
+
|
365
|
+
def validate_http_listeners(http_listeners)
|
366
|
+
if http_listeners.is_a?(Array)
|
367
|
+
if http_listeners.any?
|
368
|
+
http_listeners.each do |http_listener|
|
369
|
+
if http_listener.is_a?(Hash)
|
370
|
+
validate_http_listener_params(http_listener)
|
371
|
+
else
|
372
|
+
raise(ArgumentError, ':http_listeners must be an Array of Hashes')
|
373
|
+
end
|
374
|
+
end
|
375
|
+
else
|
376
|
+
raise(ArgumentError, ':http_listeners must not be an empty Array')
|
377
|
+
end
|
378
|
+
else
|
379
|
+
raise(ArgumentError, ':http_listeners must be an Array')
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
def validate_http_listener_params(http_listener)
|
384
|
+
required_params = [
|
385
|
+
:name,
|
386
|
+
:frontend_ip_config_id,
|
387
|
+
:frontend_port_id,
|
388
|
+
:protocol
|
389
|
+
]
|
390
|
+
missing = required_params.select { |p| p unless http_listener.key?(p) }
|
391
|
+
if missing.length == 1
|
392
|
+
raise(ArgumentError, "#{missing.first} is required for this operation")
|
393
|
+
elsif missing.any?
|
394
|
+
raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation")
|
395
|
+
end
|
396
|
+
end
|
397
|
+
|
398
|
+
def validate_url_path_maps(url_path_maps)
|
399
|
+
if url_path_maps.is_a?(Array)
|
400
|
+
if url_path_maps.any?
|
401
|
+
url_path_maps.each do |url_path_map|
|
402
|
+
if url_path_map.is_a?(Hash)
|
403
|
+
validate_url_path_map_params(url_path_map)
|
404
|
+
else
|
405
|
+
raise(ArgumentError, ':url_path_maps must be an Array of Hashes')
|
406
|
+
end
|
407
|
+
end
|
408
|
+
else
|
409
|
+
raise(ArgumentError, ':url_path_maps must not be an empty Array')
|
410
|
+
end
|
411
|
+
else
|
412
|
+
raise(ArgumentError, ':url_path_maps must be an Array')
|
413
|
+
end
|
414
|
+
end
|
415
|
+
|
416
|
+
def validate_url_path_map_params(url_path_map)
|
417
|
+
required_params = [
|
418
|
+
:name,
|
419
|
+
:default_backend_address_pool_id,
|
420
|
+
:default_backend_http_settings_id,
|
421
|
+
:path_rules
|
422
|
+
]
|
423
|
+
missing = required_params.select { |p| p unless url_path_map.key?(p) }
|
424
|
+
if missing.length == 1
|
425
|
+
raise(ArgumentError, "#{missing.first} is required for this operation")
|
426
|
+
elsif missing.any?
|
427
|
+
raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation")
|
428
|
+
end
|
429
|
+
end
|
430
|
+
|
431
|
+
def validate_request_routing_rules(request_routing_rules)
|
432
|
+
if request_routing_rules.is_a?(Array)
|
433
|
+
if request_routing_rules.any?
|
434
|
+
request_routing_rules.each do |request_routing_rule|
|
435
|
+
if request_routing_rule.is_a?(Hash)
|
436
|
+
validate_request_routing_rule_params(request_routing_rule)
|
437
|
+
else
|
438
|
+
raise(ArgumentError, ':request_routing_rules must be an Array of Hashes')
|
439
|
+
end
|
440
|
+
end
|
441
|
+
else
|
442
|
+
raise(ArgumentError, ':request_routing_rules must not be an empty Array')
|
443
|
+
end
|
444
|
+
else
|
445
|
+
raise(ArgumentError, ':request_routing_rules must be an Array')
|
446
|
+
end
|
447
|
+
end
|
448
|
+
|
449
|
+
def validate_request_routing_rule_params(request_routing_rule)
|
450
|
+
required_params = [
|
451
|
+
:type,
|
452
|
+
:http_listener_id
|
453
|
+
]
|
454
|
+
missing = required_params.select { |p| p unless request_routing_rule.key?(p) }
|
455
|
+
if missing.length == 1
|
456
|
+
raise(ArgumentError, "#{missing.first} is required for this operation")
|
457
|
+
elsif missing.any?
|
458
|
+
raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation")
|
459
|
+
end
|
460
|
+
end
|
461
|
+
|
462
|
+
def serialize_sub_resources(gateway_params)
|
463
|
+
ip_configurations = []
|
464
|
+
gateway_params[:gateway_ip_configurations].each do |ip_configuration|
|
465
|
+
hash = {}
|
466
|
+
ip_configuration.attributes.each { |key, value| hash[key] = value }
|
467
|
+
ip_configurations << hash
|
468
|
+
end
|
469
|
+
gateway_params[:gateway_ip_configurations] = ip_configurations
|
470
|
+
ssl_certificates = []
|
471
|
+
gateway_params[:ssl_certificates].each do |ssl_certificate|
|
472
|
+
hash = {}
|
473
|
+
ssl_certificate.attributes.each { |key, value| hash[key] = value }
|
474
|
+
ssl_certificates << hash
|
475
|
+
end
|
476
|
+
gateway_params[:ssl_certificates] = ssl_certificates
|
477
|
+
frontend_ip_configurations = []
|
478
|
+
gateway_params[:frontend_ip_configurations].each do |frontend_ip_configuration|
|
479
|
+
hash = {}
|
480
|
+
frontend_ip_configuration.attributes.each { |key, value| hash[key] = value }
|
481
|
+
frontend_ip_configurations << hash
|
482
|
+
end
|
483
|
+
gateway_params[:frontend_ip_configurations] = frontend_ip_configurations
|
484
|
+
frontend_ports = []
|
485
|
+
gateway_params[:frontend_ports].each do |frontend_port|
|
486
|
+
hash = {}
|
487
|
+
frontend_port.attributes.each { |key, value| hash[key] = value }
|
488
|
+
frontend_ports << hash
|
489
|
+
end
|
490
|
+
gateway_params[:frontend_ports] = frontend_ports
|
491
|
+
probes = []
|
492
|
+
gateway_params[:probes].each do |probe|
|
493
|
+
hash = {}
|
494
|
+
probe.attributes.each { |key, value| hash[key] = value }
|
495
|
+
probes << hash
|
496
|
+
end
|
497
|
+
gateway_params[:probes] = probes
|
498
|
+
backend_address_pools = []
|
499
|
+
gateway_params[:backend_address_pools].each do |backend_address_pool|
|
500
|
+
hash = {}
|
501
|
+
backend_address_pool.attributes.each { |key, value| hash[key] = value }
|
502
|
+
backend_address_pools << hash
|
503
|
+
end
|
504
|
+
gateway_params[:backend_address_pools] = backend_address_pools
|
505
|
+
backend_address_ip_addresses = []
|
506
|
+
gateway_params[:backend_address_pools].each do |backend_address_pool|
|
507
|
+
backend_address_pool[:ip_addresses].each do |ip_address|
|
508
|
+
hash = {}
|
509
|
+
ip_address.instance_variables.each_with_object({}) { |instance_variable| hash[:ipAddress] = ip_address.instance_variable_get(instance_variable) }
|
510
|
+
backend_address_ip_addresses << hash
|
511
|
+
end
|
512
|
+
backend_address_pool[:ip_addresses] = backend_address_ip_addresses
|
513
|
+
end
|
514
|
+
backend_http_settings_list = []
|
515
|
+
gateway_params[:backend_http_settings_list].each do |backend_http_setting|
|
516
|
+
hash = {}
|
517
|
+
backend_http_setting.attributes.each { |key, value| hash[key] = value }
|
518
|
+
backend_http_settings_list << hash
|
519
|
+
end
|
520
|
+
gateway_params[:backend_http_settings_list] = backend_http_settings_list
|
521
|
+
http_listeners = []
|
522
|
+
gateway_params[:http_listeners].each do |http_listener|
|
523
|
+
hash = {}
|
524
|
+
http_listener.attributes.each { |key, value| hash[key] = value }
|
525
|
+
http_listeners << hash
|
526
|
+
end
|
527
|
+
gateway_params[:http_listeners] = http_listeners
|
528
|
+
url_path_maps = []
|
529
|
+
gateway_params[:url_path_maps].each do |url_path_map|
|
530
|
+
hash = {}
|
531
|
+
url_path_map.attributes.each { |key, value| hash[key] = value }
|
532
|
+
url_path_maps << hash
|
533
|
+
end
|
534
|
+
gateway_params[:url_path_maps] = url_path_maps
|
535
|
+
request_routing_rules = []
|
536
|
+
gateway_params[:request_routing_rules].each do |request_routing_rule|
|
537
|
+
hash = {}
|
538
|
+
request_routing_rule.attributes.each { |key, value| hash[key] = value }
|
539
|
+
request_routing_rules << hash
|
540
|
+
end
|
541
|
+
gateway_params[:request_routing_rules] = request_routing_rules
|
542
|
+
gateway_params
|
543
|
+
end
|
544
|
+
|
545
|
+
def update_sku(sku_name, sku_capacity = nil)
|
546
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
547
|
+
gateway = service.update_sku_attributes(gateway_hash, sku_name, sku_capacity)
|
548
|
+
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
549
|
+
end
|
550
|
+
|
551
|
+
def update_gateway_ip_configuration(subnet_id)
|
552
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
553
|
+
gateway = service.update_subnet_id_in_gateway_ip_configuration(gateway_hash, subnet_id)
|
554
|
+
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
555
|
+
end
|
556
|
+
|
557
|
+
def add_ssl_certificate(ssl_certificate_obj)
|
558
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
559
|
+
gateway_hash[:ssl_certificates] << ssl_certificate_obj
|
560
|
+
gateway = service.create_or_update_application_gateway(gateway_hash)
|
561
|
+
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
562
|
+
end
|
563
|
+
|
564
|
+
def remove_ssl_certificate(ssl_certificate_obj)
|
565
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
566
|
+
gateway_hash[:ssl_certificates].delete(ssl_certificate_obj)
|
567
|
+
gateway = service.create_or_update_application_gateway(gateway_hash)
|
568
|
+
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
569
|
+
end
|
570
|
+
|
571
|
+
def add_frontend_port(frontend_port_obj)
|
572
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
573
|
+
gateway_hash[:frontend_ports] << frontend_port_obj
|
574
|
+
gateway = service.create_or_update_application_gateway(gateway_hash)
|
575
|
+
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
576
|
+
end
|
577
|
+
|
578
|
+
def remove_frontend_port(frontend_port_obj)
|
579
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
580
|
+
gateway_hash[:frontend_ports].delete(frontend_port_obj)
|
581
|
+
gateway = service.create_or_update_application_gateway(gateway_hash)
|
582
|
+
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
583
|
+
end
|
584
|
+
|
585
|
+
def add_probe(probe_obj)
|
586
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
587
|
+
gateway_hash[:probes] << probe_obj
|
588
|
+
gateway = service.create_or_update_application_gateway(gateway_hash)
|
589
|
+
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
590
|
+
end
|
591
|
+
|
592
|
+
def remove_probe(probe_obj)
|
593
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
594
|
+
gateway_hash[:probes].delete(probe_obj)
|
595
|
+
gateway = service.create_or_update_application_gateway(gateway_hash)
|
596
|
+
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
597
|
+
end
|
598
|
+
|
599
|
+
def start
|
600
|
+
service.start_application_gateway(resource_group, name)
|
601
|
+
end
|
602
|
+
|
603
|
+
def stop
|
604
|
+
service.stop_application_gateway(resource_group, name)
|
605
|
+
end
|
606
|
+
|
607
|
+
def destroy
|
608
|
+
service.delete_application_gateway(resource_group, name)
|
609
|
+
end
|
610
|
+
end
|
611
|
+
end
|
612
|
+
end
|
613
|
+
end
|