Class: CloudflareClient::Zone::RailgunConnections

Inherits:
Base show all
Defined in:
lib/cloudflare_client/zone/railgun_connections.rb

Constant Summary

Constants inherited from CloudflareClient::Zone

VALID_ZONE_STATUSES

Constants inherited from CloudflareClient

API_BASE, POSSIBLE_API_SETTINGS, VALID_BUNDLE_METHODS, VALID_DIRECTIONS, VALID_MATCHES, VERSION

Instance Attribute Summary

Attributes inherited from Base

#zone_id

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods inherited from CloudflareClient::Zone

#create_zone, #delete_zone, #edit_zone, #purge_zone_cache, #update_zone_settings, #zone, #zone_activation_check, #zone_setting, #zone_settings, #zones

Methods inherited from CloudflareClient

#initialize

Constructor Details

This class inherits a constructor from CloudflareClient::Zone::Base

Instance Method Details

#connect(id:) ⇒ Object

connect a railgun



27
28
29
# File 'lib/cloudflare_client/zone/railgun_connections.rb', line 27

def connect(id:)
  update_connection(id: id, connected: true)
end

#disconnect(id:) ⇒ Object

disconnect a railgun



33
34
35
# File 'lib/cloudflare_client/zone/railgun_connections.rb', line 33

def disconnect(id:)
  update_connection(id: id, connected: false)
end

#listObject

available railguns



7
8
9
# File 'lib/cloudflare_client/zone/railgun_connections.rb', line 7

def list
  cf_get(path: "/zones/#{zone_id}/railguns")
end

#show(id:) ⇒ Object

details of a single railgun



13
14
15
16
# File 'lib/cloudflare_client/zone/railgun_connections.rb', line 13

def show(id:)
  raise 'railgun id required' if id.nil?
  cf_get(path: "/zones/#{zone_id}/railguns/#{id}")
end

#test(id:) ⇒ Object

test a railgun connection



20
21
22
23
# File 'lib/cloudflare_client/zone/railgun_connections.rb', line 20

def test(id:)
  raise 'railgun id required' if id.nil?
  cf_get(path: "/zones/#{zone_id}/railguns/#{id}/diagnose")
end