Iland Cloud Elixir SDK v0.1.8 Iland.Api View Source

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

Link to this section Summary

Link to this section Functions

Link to this function add_auth_header(headers \\ %{}) View Source

Add authorization header, to the given list of headers.

Link to this function delete(rel_path, headers \\ %{Accept: "application/vnd.ilandcloud.api.v0.9+json"}) View Source

Perform a DELETE request against the iland cloud API.

Link to this function get(rel_path, headers \\ %{Accept: "application/vnd.ilandcloud.api.v0.9+json"}) View Source

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”}”}

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

Link to this function post(rel_path, body \\ "", headers \\ %{Accept: "application/vnd.ilandcloud.api.v0.9+json", "Content-Type": "application/vnd.ilandcloud.api.v0.9+json"}) View Source

Perform a POST request against the iland cloud API.

Link to this function put(rel_path, body \\ "", headers \\ %{Accept: "application/vnd.ilandcloud.api.v0.9+json", "Content-Type": "application/vnd.ilandcloud.api.v0.9+json"}) View Source

Perform a PUT request against the iland cloud API.

Link to this function request(method, rel_path, headers \\ %{Accept: "application/vnd.ilandcloud.api.v0.9+json", "Content-Type": "application/vnd.ilandcloud.api.v0.9+json"}, body \\ "", opts \\ []) View Source

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