edgegrid-node
Summary
A Node.js command line client, reference implementation and authentication library for EdgeGrid.
Installation
npm -g install edgegrid-node
Configuration
To use the command line client, a configuration file named .egnode
needs to be present in the user's home directory (i.e. $HOME/.egnode
). The configuration file is in ini format. A profile named 'default' must be defined but additional profiles can be defined as well.
Four properties can be defined in a profile, 3 of which are required:
- clientToken (required)
- clientSecret (required)
- accessToken (required)
- baseUrl
Sample config file:
; configuration file with default profile
[default]
clientToken=akaa-qersdfqwerasdfqwerasdfqwerf
clientSecret=qwerasdfqwerasdfqwerasdfqwerasdfqwerasdfqwer
accessToken=akaa-asdfqwerasdfqwerasdfqwerasdfqwera
baseUrl=akaa-zxcvasdfzxcvasdfzcxvasdf.luna.akamaiapis.net
Usage
GET
$ edgegrid-node -H "Content-Type:application/json" \
-H "Accept:application/json" \
-p "/edgegrid-service/path/to/resource"
POST
$ edgegrid-node -H "Content-Type:application/json" \
-H "Accept:application/json" \
-m "POST" \
-d @./dataFile.json \
-p "/edgegrid-service/path/to/resource"
--help
Usage: edgegrid-node [options]
Options:
-h, --help output usage information
-V, --version output the version number
-f, --config-file [file] Configuration file
-P, --config-profile [profile] Configuration profile [default]
-m, --method [method] http method (default: "GET")
-b, --base-url [url] Base URL
-H, --header [header] Header - format: "foo:bar"
-d, --data [data] Post data
-p, --path [url] URL path: Example: "/p/a/t/h?query=string"