lib/fog/azurerm/docs/network.md in fog-azure-rm-0.1.2 vs lib/fog/azurerm/docs/network.md in fog-azure-rm-0.2.0
- old
+ new
@@ -13,16 +13,24 @@
Next, create a connection to the Network Service:
```ruby
azure_network_service = Fog::Network::AzureRM.new(
- tenant_id: '<Tenantid>', # Tenant id of Azure Active Directory Application
- client_id: '<Clientid>', # Client id of Azure Active Directory Application
- client_secret: '<ClientSecret>', # Client Secret of Azure Active Directory Application
- subscription_id: '<Subscriptionid>' # Subscription id of an Azure Account
+ tenant_id: '<Tenantid>', # Tenant id of Azure Active Directory Application
+ client_id: '<Clientid>', # Client id of Azure Active Directory Application
+ client_secret: '<ClientSecret>', # Client Secret of Azure Active Directory Application
+ subscription_id: '<Subscriptionid>', # Subscription id of an Azure Account
+ :environment => '<AzureCloud/AzureChinaCloud/AzureUSGovernment/AzureGermanCloud>' # Azure cloud environment. Default is AzureCloud.
)
```
+
+## Check Virtual Network Existence
+
+```ruby
+ azure_network_service.virtual_networks.check_virtual_network_exists(<Resource Group name>, <Virtual Network Name>)
+```
+
## Create Virtual Network
Create a new virtual network
Optional parameters for Virtual Network: subnets, dns_servers & address_prefixes
@@ -42,24 +50,28 @@
dns_servers: ['10.1.0.0','10.2.0.0'],
address_prefixes: ['10.1.0.0/16','10.2.0.0/16']
)
```
-## Check for Virtual Network
+## List Virtual Networks in Resource Group
-Checks if the Virtual Network already exists or not.
+List all virtual networks in a resource group
```ruby
- azure_network_service.virtual_networks.check_if_exists('<Virtual Network name>', '<Resource Group name>')
+ vnets = azure_network_service.virtual_networks(resource_group: '<Resource Group Name>')
+ vnets.each do |vnet|
+ puts "#{vnet.name}"
+ puts "#{vnet.location}"
+ end
```
-## List Virtual Networks
+## List Virtual Networks in Subscription
List all virtual networks in a subscription
```ruby
- vnets = azure_network_service.virtual_networks(resource_group: '<Resource Group Name>')
+ vnets = azure_network_service.virtual_networks
vnets.each do |vnet|
puts "#{vnet.name}"
puts "#{vnet.location}"
end
```
@@ -124,10 +136,16 @@
```ruby
vnet.destroy
```
+## Check Subnet Existence
+
+```ruby
+ azure_network_service.subnets.check_subnet_exists(<Resource Group name>, <Virtual Network Name>, <Subnet Name>)
+```
+
## Create Subnet
Create a new Subnet
Optional parameters: network_security_group_id, route_table_id & address_prefix
@@ -215,10 +233,16 @@
```ruby
subnet.destroy
```
+## Check Network Interface Card Existence
+
+```ruby
+ azure_network_service.network_interfaces.check_network_interface_exists(<Resource Group name>, <Network Interface name>)
+```
+
## Create Network Interface Card
Create a new network interface. Skip public_ip_address_id parameter to create network interface without PublicIP. The parameter, private_ip_allocation_method can be Dynamic or Static.
```ruby
@@ -292,10 +316,16 @@
```ruby
nic.destroy
```
+## Check Public IP Existence
+
+```ruby
+ azure_network_service.public_ips.check_public_ip_exists(<Resource Group name>, <Public IP name>>)
+```
+
## Create Public IP
Create a new public IP. The parameter, type can be Dynamic or Static.
```ruby
@@ -355,10 +385,16 @@
```ruby
pubip.destroy
```
+## Check Network Security Group Existence
+
+```ruby
+ azure_network_service.network_security_groups.check_net_sec_group_exists(<Resource Group name>, <Network Security Group name>)
+```
+
## Create Network Security Group
Network security group requires a resource group to create.
```ruby
@@ -460,10 +496,16 @@
```ruby
nsg.destroy
```
+## Check Network Security Rule Existence
+
+```ruby
+ azure_network_service.network_security_rules.check_net_sec_rule_exists(<Resource Group name>, <Network Security Group name>, <Security Rule name>)
+```
+
## Create Network Security Rule
Network security rule requires a resource group and network security group to create.
```ruby
@@ -511,10 +553,16 @@
```ruby
network_security_rule.destroy
```
+## Check External Load Balancer Existence
+
+```ruby
+ azure_network_service.load_balancers.check_load_balancer_exists(<Resource Group name>, <Load Balancer name>)
+```
+
## Create External Load Balancer
Create a new load balancer.
```ruby
@@ -635,10 +683,21 @@
lbs.each do |lb|
puts "#{lb.name}"
end
```
+## List Load Balancers in subscription
+
+List all load balancers in a subscription
+
+```ruby
+ lbs = azure_network_service.load_balancers
+ lbs.each do |lb|
+ puts "#{lb.name}"
+ end
+```
+
## Retrieve a single Load Balancer
Get a single record of Load Balancer
```ruby
@@ -654,10 +713,16 @@
```ruby
lb.destroy
```
+## Check Virtual Network Gateway Existence
+
+```ruby
+ azure_network_service.virtual_network_gateways.check_vnet_gateway_exists(<Resource Group name>, <Virtual Network Gateway Name>)
+```
+
## Create Virtual Network Gateway
Create a new Virtual Network Gateway.
```ruby
@@ -735,10 +800,16 @@
```ruby
network_gateway.destroy
```
+## Check Local Network Gateway Existence
+
+```ruby
+ azure_network_service.local_network_gateways.check_local_net_gateway_exists(<Resource Group name>, <Local Network Gateway Name>)
+```
+
## Create Local Network Gateway
Create a new Local Network Gateway.
```ruby
@@ -793,10 +864,16 @@
# Express Route Circuit
The Circuit represents the entity created by customer to register with an express route service provider with intent to connect to Microsoft.
+## Check Express Route Circuit Existence
+
+```ruby
+ azure_network_service.express_route_circuits.check_express_route_circuit_exists(<Resource Group name>, <Circuit Name>)
+```
+
## Create an Express Route Circuit
Create a new Express Route Circuit.
```ruby
@@ -856,10 +933,16 @@
```
# Express Route Authorization
Authorization is part of Express Route circuit.
+## Check Express Route Circuit Authorization Existence
+
+```ruby
+ azure_network_service.express_route_circuit_authorizations.check_express_route_cir_auth_exists(<Resource Group name>, <Circuit Name>, <Authorization-Name>)
+```
+
## Create an Express Route Circuit Authorization
Create a new Express Route Circuit Authorization. Parameter 'authorization_status' can be 'Available' or 'InUse'.
```ruby
@@ -959,9 +1042,15 @@
List all express route service providers
```ruby
service_providers = network.express_route_service_providers
puts service_providers
+```
+
+## Check Virtual Network Gateway Connection Existence
+
+```ruby
+ azure_network_service.virtual_network_gateway_connections.check_vnet_gateway_connection_exists(<Resource Group name>, <Virtual Network Gateway Connection Name>)
```
## Create Virtual Network Gateway Connection
Create a new Virtual Network Gateway Connection.