-
Notifications
You must be signed in to change notification settings - Fork 0
/
ip.clj
33 lines (29 loc) · 863 Bytes
/
ip.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(ns leaseweb.v1.ip
(:require [clojure.string :as str]
[clojure.tools.logging :as log]
[cheshire.core :refer :all]
[leaseweb.v1.core :as l]))
(def api-path "/ips")
(defn list
[]
(:ips (l/validate
(if (l/initialized?)
(l/call {:method "GET"
:resource api-path})
{:status 403}) 200 {:ips nil} )))
(defn describe
[ip-address]
{:ip (l/validate
(if (l/initialized?)
(l/call {:method "GET"
:resource api-path "/" ip-address})
{:status 403}) 200 {:ip nil})})
(defn update
[ip-address reverse-lookup null-routed]
(l/validate
(if (l/initialized?)
(l/call {:method "PUT"
:resource api-path "/" ip-address
:body {:reverseLookup reverse-lookup
:nullRouted null-routed}})
{:status 403}) 200))