module ApiStub module Models module Network class LoadBalancer def self.create_load_balancer_response lb = '{ "name": "mylb1", "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1", "location": "North US", "tags": { "key": "value" }, "etag": "W/\"00000000-0000-0000-0000-000000000000\"", "properties": { "resourceGuid": "6ECBD4C1-0DC1-4D86-9F6E-4A58F83C9023", "provisioningState": "Succeeded", "frontendIPConfigurations": [{ "name": "myip1", "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/frontendIPConfigurations/myip1", "etag": "W/\"00000000-0000-0000-0000-000000000000\"", "properties": { "provisioningState": "Succeeded", "subnet": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myvnet1/subnets/mysubnet1" }, "privateIPAddress": "10.0.0.10", "privateIPAllocationMethod": "Static", "publicIPAddress": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/myip1" }, "loadBalancingRules": [{ "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/loadBalancingRules/rule1" }], "inboundNatRules": [{ "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/inboundNatRules/rule1" }] } }], "backendAddressPools": [{ "name": "pool1", "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/backendAddressPools/pool1", "etag": "W/\"00000000-0000-0000-0000-000000000000\"", "properties": { "provisioningState": "Succeeded", "backendIPConfigurations": [{ "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/vm1nic1/ipConfigurations/ip1" }], "loadBalancingRules": [{ "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/loadBalancingRules/rule1" }] } }], "loadBalancingRules": [{ "name": "HTTP Traffic", "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/loadBalancingRules/rule1", "etag": "W/\"00000000-0000-0000-0000-000000000000\"", "properties": { "provisioningState": "Succeeded", "frontendIPConfiguration": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/frontendIPConfigurations/ip1" }, "backendAddressPool": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/backendAddressPool/pool1" }, "protocol": "Tcp", "frontendPort": 80, "backendPort": 8080, "probe": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/probes/probe1" }, "enableFloatingIP": true, "idleTimeoutInMinutes": 4, "loadDistribution": "Default" } }], "probes": [{ "name": "my probe 1", "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/probes/my probe 1", "etag": "W/\"00000000-0000-0000-0000-000000000000\"", "properties": { "provisioningState": "Succeeded", "protocol": "Tcp", "port": 8080, "requestPath": "myprobeapp1/myprobe1.svc", "intervalInSeconds": 5, "numberOfProbes": 16, "loadBalancingRules": [{ "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/loadBalancingRules/rule1" }] } }], "inboundNatRules": [{ "name": "RDP Traffic", "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/inboundNatRules/RDP Traffic", "etag": "W/\"00000000-0000-0000-0000-000000000000\"", "properties": { "provisioningState": "Succeeded", "frontendIPConfiguration": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/frontendIPConfigurations/ip1" }, "backendIPConfiguration": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/vm1nic1/ipConfigurations/ip1" }, "protocol": "Tcp", "frontendPort": 3389, "backendPort": 3389 } }], "inboundNatPools": [{ "name": "RDPForVMSS1", "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers /Microsoft.Network/loadBalancers/myLB1/inboundNatRules/RDPForVMSS1", "etag": "W/\"00000000-0000-0000-0000-000000000000\"", "properties": { "provisioningState": "Updating|Deleting|Failed|Succeeded", "frontendIPConfiguration": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/frontendIPConfigurations/ip1" }, "protocol": "Tcp", "frontendPortRangeStart": 50000, "frontendPortRangeEnd": 50500, "backendPort": 3389 } }] } }' JSON.parse(lb) end end end end end