Common functions for the clusternator CLI/REST interface

Source:

Methods

(inner) buildURI(endpoint, user) → {string}

Parameters:
Name Type Description
endpoint string
user Object
Source:
Returns:
Type
string

(inner) failResponse(body, statusCode) → {string}

Parameters:
Name Type Description
body *
statusCode number
Source:
Returns:
Type
string

(inner) getUserConfig() → {Object|Error}

Source:
Returns:
Type
Object | Error

(inner) makeGetRequest(endpoint, useTokenopt) → {Q.Promise}

Parameters:
Name Type Attributes Description
endpoint string
useToken boolean <optional>
Source:
Returns:
Type
Q.Promise

(inner) makeGetRequestObject(uri, headers) → {Object}

Parameters:
Name Type Description
uri string
headers Object
Source:
Returns:
Type
Object

(inner) makeHeaders(useToken, user) → {Object}

Parameters:
Name Type Description
useToken boolean
user Object
Source:
Returns:
Type
Object

(inner) makePostRequest(endpoint, dataopt, useTokenopt) → {Q.Promise}

Parameters:
Name Type Attributes Description
endpoint string
data * <optional>
useToken boolean <optional>
Source:
Returns:
Type
Q.Promise

(inner) makePutPostReqObject(verb, uri, data, headers) → {Object}

Parameters:
Name Type Description
verb string
uri string
data *
headers Object
Source:
Returns:
Type
Object

(inner) makeRequest(verb, endpoint, dataopt, useTokenopt) → {Q.Promise}

Parameters:
Name Type Attributes Description
verb string
endpoint string
data * <optional>
useToken boolean <optional>

defaults to true, if false, won't use token

Source:
Returns:
Type
Q.Promise

(inner) makeRequestObject(verb, endpoint, dataopt, useTokenopt) → {Object|Error}

Parameters:
Name Type Attributes Description
verb string
endpoint string
data * <optional>
useToken boolean <optional>

defaults true

Source:
Returns:
Type
Object | Error

(inner) okayResponse(body) → {Q.Promise}

Parameters:
Name Type Description
body string
Source:
Returns:
Type
Q.Promise

(inner) safeParse(input) → {Error|*}

Parameters:
Name Type Description
input string
Source:
Returns:
Type
Error | *

(inner) warnNoEncryption(uri)

Parameters:
Name Type Description
uri string
Source: