restapi

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeys added in v1.3.0

func GetKeys(hash map[string]interface{}) []string

Handy helper to just dump the keys of a map into a slice

func GetObjectAtKey added in v1.3.0

func GetObjectAtKey(data map[string]interface{}, path string, debug bool) (interface{}, error)

Handy helper that will dig through a map and find something

 at the defined key. The returned data is not type checked
 Example:
 Given:
 {
   "attrs": {
     "id": 1234
   },
   "config": {
     "foo": "abc",
     "bar": "xyz"
   }
}

Result:
attrs/id => 1234
config/foo => "abc"

func GetStringAtKey added in v1.3.0

func GetStringAtKey(data map[string]interface{}, path string, debug bool) (string, error)

Using GetObjectAtKey, this function verifies the resulting

object is either a JSON string or Number and returns it as a string

func NewAPIClient

func NewAPIClient(i_uri string, i_insecure bool, i_username string, i_password string, i_headers map[string]string, i_timeout int, i_id_attribute string, i_copy_keys []string, i_wro bool, i_cro bool, i_debug bool) (*api_client, error)

Make a new api client for RESTful calls

func NewAPIObject

func NewAPIObject(i_client *api_client, i_get_path string, i_post_path string, i_put_path string, i_delete_path string, i_id string, i_ida string, i_data string, i_debug bool) (*api_object, error)

Make an api_object to manage a RESTful object in an API

func Provider

func Provider() terraform.ResourceProvider

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL