Class: Apitool::Client::Vpn

Inherits:
ApitoolClient show all
Defined in:
lib/apitool/client/vpn.rb

Instance Method Summary collapse

Methods inherited from ApitoolClient

#errors, #initialize, #request, #response, #result

Constructor Details

This class inherits a constructor from Apitool::Client::ApitoolClient

Instance Method Details

#create(options = {}) ⇒ Object

uuid: "some unique identifier",
identifier: "[email protected]"



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/apitool/client/vpn.rb', line 27

def create(options = {})
  parameters = {
    vpn: options
  }
  post("/vpns", parameters) do |response|
    if response.code == 200
      parse(response)
    else
      nil
    end
  end
end

#destroy(uuid) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'lib/apitool/client/vpn.rb', line 40

def destroy(uuid)
  delete("/vpns/#{uuid}") do |response|
    if response.code == 200
      parse(response)
    else
      nil
    end
  end
end

#indexObject



3
4
5
6
7
8
9
10
11
# File 'lib/apitool/client/vpn.rb', line 3

def index
  get('/vpns') do |response, request, result|
    if response.code == 200
      parse(response)
    else
      nil
    end
  end
end

#show(uuid) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/apitool/client/vpn.rb', line 13

def show(uuid)
  get("/vpns/#{uuid}") do |response|
    if response.code == 200
      parse(response)
    else
      nil
    end
  end
end