Class: Civo::LoadBalancer

Inherits:
Base
  • Object
show all
Defined in:
app/models/civo/load_balancer.rb

Instance Method Summary collapse

Instance Method Details

#delete_loadbalancerObject



65
66
67
# File 'app/models/civo/load_balancer.rb', line 65

def delete_loadbalancer
  { result: "Success" }.to_json
end

#get_loadbalancerObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'app/models/civo/load_balancer.rb', line 38

def get_loadbalancer
  {
    id: 23,
    name: "Johnny",
    algorithm: "round_robin",
    state: "available",
    public_ipv4: "192.168.1.10",
    private_ipv4: "10.10.10.10",
    firewall_id: "86E2749F-8FA1-4D49-8833-299D02E585B8",
    cluster_id: "96E2749F-8FA1-4D49-8833-299D02E585B8",
    endpoints: [
      {
        ip: "192.168.1.4",
        protocol: "TCP",
        source_port: 80,
        target_port: 31579
      },
      {
        ip: "192.168.1.5",
        protocol: "TCP",
        source_port: 80,
        target_port: 31579
      }
    ]
  }.to_json
end

#loadbalancersObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/models/civo/load_balancer.rb', line 13

def loadbalancers
  [
    {
      id: 23,
      name: "Johnny",
      algorithm: "round_robin",
      state: "available",
      public_ipv4: "192.168.1.10",
      private_ipv4: "10.10.10.10",
      firewall_id: "86E2749F-8FA1-4D49-8833-299D02E585B8",
      cluster_id: "96E2749F-8FA1-4D49-8833-299D02E585B8"
    },
    {
      id: 223,
      name: "Dep",
      algorithm: "weighted_fixed",
      state: "available",
      public_ipv4: "192.168.1.30",
      private_ipv4: "10.10.10.12",
      firewall_id: "36E2749F-8FA1-4D49-8833-299D02E585B8",
      cluster_id: "46E2749F-8FA1-4D49-8833-299D02E585B8"
    }
  ].to_json
end

#to_partial_pathObject



9
10
11
# File 'app/models/civo/load_balancer.rb', line 9

def to_partial_path
  "civo/loadbalancer"
end