Class: Zt::RemoteAPI::ZeroTierAPI

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/zt/remote_api.rb

Instance Method Summary collapse

Constructor Details

#initializeZeroTierAPI

Returns a new instance of ZeroTierAPI.



13
14
15
16
17
18
19
20
21
# File 'lib/zt/remote_api.rb', line 13

def initialize
  @ztc = Zt::Conf.instance.conf
  # noinspection RubyStringKeysInHashInspection
  @req_opts = {
    headers: {
      'Authorization' => "Bearer #{@ztc.zt['token']}"
    }
  }
end

Instance Method Details

#network_members(network_id) ⇒ Object



27
28
29
# File 'lib/zt/remote_api.rb', line 27

def network_members(network_id)
  get_parsed("/network/#{network_id}/member")
end

#networksObject



23
24
25
# File 'lib/zt/remote_api.rb', line 23

def networks
  get_parsed('/network')
end