- )
- end
- def register_host2queues(hostname, queues)
- @hostname = hostname
- @queues = queues
- RestClient.put(
"http://#{@host}:#{@port}/set_host2queues?host=#{@hostname}&queues=#{@queues}", {}
- )
- end
这可以封装成类: 因为这样子就不需要调用确定的函数 ==> Update.delete(queues) ==> Update.delete(mac) 尽量避免重复 class Update: @queues @mac def delete def register
good idea, i will consider it later
Thanks, Shenwei
- def delete_mac2host
- RestClient.put(
"http://#{@host}:#{@port}/del_host_mac?mac=#{@mac}", {}
- )
- end
- def delete_host2queues
- RestClient.put(
"http://#{@host}:#{@port}/del_host2queues?host=#{@hostname}", {}
- )
- end
end
2.23.0