Setting up lookup keys

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsSetting up lookup keys
(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...")
 
(Set up Lookup Keys using admin console)
 
(6 intermediate revisions by 4 users not shown)
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.
+
=== Set up 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.  
+
Log in 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.  
+
You can create a new Lookup key or edit an existing one using this 'Global Lookup Keys Overview' form.  
  
[[File:Turorial setting lookup keys.png|800px]]
+
[[File:Tutorial setting lookup keys.png|800px]]
  
To edit an existing Lookup Key...
+
To edit an existing Lookup Key:
  
 
* Select the Lookup Key from the '-- Select Lookup Key --' drop down.
 
* Select the Lookup Key from the '-- Select Lookup Key --' drop down.
Line 16: Line 14:
 
* Update it.
 
* Update it.
  
To add a new Lookup Key...
+
To add a new Lookup Key:
  
 
* Click on the [+] (plus) button.
 
* Click on the [+] (plus) button.
Line 22: Line 20:
 
* Save it.
 
* Save it.
  
> _Note: Checking the 'Private' checkbox will hide the value of the key._
+
'''''Note:''' Checking the 'Private' checkbox will hide the value of the key.''
  
### API Endpoints
+
=== API Endpoints ===
  
#### Creating a new Lookup Key
+
==== 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 40:
 
</source>
 
</source>
  
#### Editing a Lookup Key
+
==== 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 56:
 
</source>
 
</source>
  
### Example - Creating a new Lookup Key
+
=== Example - Creating a new Lookup Key ===
  
 
* Request Body:
 
* Request Body:
Line 75: Line 73:
 
<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
+
=== Example - Editing a Lookup Key ===
  
 
* ID of the Lookup Key to edit: 1
 
* ID of the Lookup Key to edit: 1

Latest revision as of 22:38, 15 July 2016

You can create as many lookup keys as you need using the admin console as well as the API.

Set up Lookup Keys using admin console

Log in to the admin console and click on the 'Config' tab. From the left menu, click on the 'Global Lookup Keys' button. You can create a new Lookup key or edit an existing one using this 'Global Lookup Keys Overview' form.

Tutorial setting lookup keys.png

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