File: backend_services.rb

package info (click to toggle)
ruby-fog-google 1.19.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,568 kB
  • sloc: ruby: 16,775; makefile: 3
file content (23 lines) | stat: -rw-r--r-- 585 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require "rubygems"
require "fog"

def test
  connection = Fog::Compute.new(:provider => "google")
  health = connection.http_health_checks.create(:name => "test-checks")
  health.wait_for { health.ready? }
  backend = connection.backend_services.create(
    :name => "backend-test",
    :health_checks => [health.self_link],
    :port => 8080,
    :timeout_sec => 40,
    :backends => [{ "group" => "resource_view self_link" }]
  )
  backend.get_health

  puts connection.backend_services.all

  backend = connection.backend_services.get("backend-test")
  backend.get_health
end

test