Setting up lookup keys
From DreamFactory
(Created page with "### Tutorial You can create as many lookup keys as you need using the admin console as well as the API. ### Setup Lookup Keys using admin console. Login to the admin consol...") |
|||
Line 1: | Line 1: | ||
− | + | === Tutorial === | |
You can create as many lookup keys as you need using the admin console as well as the API. | You can create as many lookup keys as you need using the admin console as well as the API. | ||
− | + | === Setup Lookup Keys using admin console. === | |
Login to the admin console and click on the 'Config' tab. From the left menu, click on the 'Global Lookup Keys' button. | Login to the admin console and click on the 'Config' tab. From the left menu, click on the 'Global Lookup Keys' button. | ||
Line 22: | Line 22: | ||
* Save it. | * Save it. | ||
− | + | ''Note: Checking the 'Private' checkbox will hide the value of the key.'' | |
− | + | === API Endpoints === | |
− | + | ==== Creating a new Lookup Key ==== | |
<pre>POST http://{url}/api/v2/system/lookup</pre> | <pre>POST http://{url}/api/v2/system/lookup</pre> | ||
Line 42: | Line 42: | ||
</source> | </source> | ||
− | + | ==== Editing a Lookup Key ==== | |
<pre>PATCH http://{url}/api/v2/system/lookup/{lookup_key_id}</pre> | <pre>PATCH http://{url}/api/v2/system/lookup/{lookup_key_id}</pre> | ||
Line 58: | Line 58: | ||
</source> | </source> | ||
− | + | === Example - Creating a new Lookup Key === | |
* Request Body: | * Request Body: | ||
Line 75: | Line 75: | ||
<pre>POST http://foo.com/api/v2/system/lookup</pre> | <pre>POST http://foo.com/api/v2/system/lookup</pre> | ||
− | + | === Example - Editing a Lookup Key === | |
* ID of the Lookup Key to edit: 1 | * ID of the Lookup Key to edit: 1 |
Revision as of 18:39, 3 February 2016
Contents
Tutorial
You can create as many lookup keys as you need using the admin console as well as the API.
Setup Lookup Keys using admin console.
Login to the admin console and click on the 'Config' tab. From the left menu, click on the 'Global Lookup Keys' button. You can create new Lookup key or edit an existing one using this 'Global Lookup Keys Overview' form.
To edit an existing Lookup Key...
- Select the Lookup Key from the '-- Select Lookup Key --' drop down.
- Edit the name and value field.
- Update it.
To add a new Lookup Key...
- Click on the [+] (plus) button.
- Add your name and value for the key.
- Save it.
Note: Checking the 'Private' checkbox will hide the value of the key.
API Endpoints
Creating a new Lookup Key
POST http://{url}/api/v2/system/lookup
Request Body:
{ "resource":[ { "name":"", "value":"", "private":bool } ] }
Editing a Lookup Key
PATCH http://{url}/api/v2/system/lookup/{lookup_key_id}
Request Body:
{ "resource":[ { "name":"", "value":"", "private":bool } ] }
Example - Creating a new Lookup Key
- Request Body:
{ "resource":[ { "name":"host", "value":"localhost", "private":false } ] }
- Request URL:
POST http://foo.com/api/v2/system/lookup
Example - Editing a Lookup Key
- ID of the Lookup Key to edit: 1
- Request Body:
{ "resource":[ { "name":"host", "value":"localhost", "private":true } ] }
- Request URL:
PATCH http://foo.com/api/v2/system/lookup/1