CentraSite Documentation : Runtime Governance with CentraSite : Important Considerations when Configuring REST or XML Virtual Services : Handling Virtual REST APIs with Multiple Resources : Scenario B : Context-Based Routing Action
Context-Based Routing Action
Given the Context-Based Routing action, specify a custom routing rule. Perform the following steps:
1. In CentraSite Business UI, display the details page for the native REST API. If you need procedures for this step, see Working with REST-based APIs in CentraSite.
2. In the action bar for the API, click Virtualize.
3. In the Virtualize <API_Name> (Step 1 of 3) wizard, select the virtual alias and it’s endpoint for reconfiguration.
4. Click Next.
5. In the Virtualize <API_Name> (Step 2 of 3) wizard, locate the “Context-Based” routing action in the Message Flow section.
6. Mouse hover the action name, and click the Configure icon to the right of the name. This opens the Context-Based Routing dialog box.
7. In the Default Route to endpoint field, modify the existing endpoint. Append the resource path tokenizer ${sys:resource_path} with the base URL in the format <base-url>/${sys:resource_path}.
Thus, for our sample endpoint:
http://www.phonestore.com/api/phones
The modified endpoint should be:
http://www.phonestore.com/api/${sys:resource_path}
8. Click the Add Routing Rule button.
a. Enter a name for the new routing rule.
b. For the Variable field, select Predefined Context Variable from the drop-down list.
c. In the Condition section of the dialog box, take the following steps.
a. Select String in the first Data Type field.
b. Select the Virtual Service Operation in the second Predefined Context field.
c. Specify the Equal To operator in the third field.
d. Specify the exact resource name in the Variable Value field. In our example, invoke.
e. In the Route To field, specify the native API endpoint.
In our sample,
http://www.phonestore.com/api/phones
f. Click OK to save the new routing rule.
9. Click OK and save the modified API.
Copyright © 2005-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback