Iland Cloud Elixir SDK v0.1.2 Iland.Api

Provides a basic API wrapper for accessing the iland cloud API. The package handles API token retrieval and renewal behind the scenes. There are methods for performing the following types of HTTP requests:

GET
POST
PUT
DELETE

Summary

Functions

Add authorization, content-type and accept headers, to the given list of headers

Perform a DELETE request against the iland cloud API

Performs a GET request against the iland cloud API

Generates a absolute URL for the iland cloud API for the given relative URL

Perform a POST request against the iland cloud API

Perform a PUT request against the iland cloud API

Perform a HTTP request against the iland cloud API, using the supplied HTTP method, headers, and options

Functions

add_headers(headers \\ [])

Add authorization, content-type and accept headers, to the given list of headers.

delete(rel_path)

Perform a DELETE request against the iland cloud API.

get(rel_path)

Performs a GET request against the iland cloud API.

Examples

iex(1)> Iland.Api.get(“/user/testman”)

{:ok, “{“deleted”:false,”description”:””,”fullname”:”Test Man”,”name”:”testman”,”vcloud_href”:”https://man01.ilandcloud.com/api/admin/user/aaa7d338-7dbe-4aca-b903-69ad98fa4df9”,”email”:”fake@iland.com”,”phone”:”867-867-5309”,”im”:””,”type”:”LDAP”,”user_role_type”:”ORGANIZATION”,”active”:true,”locked”:false,”address”:””,”company”:”iland”,”city”:””,”state”:””,”zip”:””,”country”:”United States”}”}

iland_url(rel_path)

Generates a absolute URL for the iland cloud API for the given relative URL.

post(rel_path, body \\ "")

Perform a POST request against the iland cloud API.

put(rel_path, body \\ "")

Perform a PUT request against the iland cloud API.

request(method, rel_path, body \\ "", headers \\ [], opts \\ [])

Perform a HTTP request against the iland cloud API, using the supplied HTTP method, headers, and options.