datagraph load-balancer-config describe
Setting Dedicated Load Balancer URLs for Anypoint Datagraph
If you’re unable to use Port 8082 on a CloudHub shared load balancer, you must set a URL for Anypoint DataGraph to use on a dedicated load balancer (DLB).
To set the URL, add a DLB mapping rule to the Anypoint DataGraph configuration.
Example Mapping Rules for a DLB URL
Based on the way DLB mapping rules work, you must configure the Input Path (Input URI) and the Output Path (App URI) so that the final DLB URL is able to access the endpoint of the Anypoint DataGraph application, which is /graphql
.
For example, consider the following mapping rules for examplelb.lb.anypointdns.net
depending on the value of the Input Path and a Datagraph app name of datagraph-xz082edx-1585-901xe374-d0x0
:
Index | Input URI (Input Path) | App name | App URI (Output Path) | Protocol |
---|---|---|---|---|
0 |
|
|
|
HTTPS |
1 |
|
|
|
HTTPS |
2 |
|
|
|
HTTPS |
3 |
|
|
|
HTTPS |
For each index, the appropriate DLB URL is:
-
Index 0:
examplelb.lb.anypointdns.net/graphql
-
Index 1:
examplelb.lb.anypointdns.net/datagraph/
-
Index 2:
examplelb.lb.anypointdns.net/datagraph/graphql
-
Index 3:
examplelb.lb.anypointdns.net/datagraph-xz082edx-1585-901xe374-d0x0/graphql
Prerequisites
-
You must have the Admin or Operator permission for the environment in which you want to specify a DLB URL.
-
You must be able to authenticate to and run commands from the Anypoint CLI.
-
You must be familiar with creating DLB mapping rules.
-
You must create and configure a DLB.
To complete this task, you:
-
Use the Anypoint CLI to gather details about your DLB and Anypoint DataGraph.
-
Use Anypoint Runtime Manager to create a mapping rule for the DLB.
-
Use the Anypoint CLI to add the DLB configuration to Anypoint DataGraph.
Gather Details about the DLB and Anypoint DataGraph
Gather the name of your DLB and the app name for Anypoint DataGraph.
-
Connect to the Anypoint CLI using your Anypoint Platform username and password.
-
If you did not previously set the environment, do so with the following command:
-
Using Anypoint CLI v3.x:
use environment <environment name>
-
Using Anypoint CLI v4.x:
conf environment <environment name>
-
-
Get the name of the DLB:
-
Using Anypoint CLI v3.x:
cloudhub load-balancer describe <dlb name>
-
Using Anypoint CLI v4.x:
cloudhub:load-balancer:describe <dlb name>
The expected output resembles:
Name | examplelb
-
-
Get the CloudHub domain for the Anypoint DataGraph app name:
-
Using Anypoint CLI v3.x:
datagraph load-balancer-config describe
-
Using Anypoint CLI v4.x:
datagraph:load-balancer-config:describe
The expected value resembles:
Domain | datagraph-xz082edx-1585-901xe374-d0x0
The DataGraph app name contains elements from your org ID and the environment ID.
-
-
Note the values for steps 3 and 4.
Create a Mapping Rule for the DLB
You set up the mapping rule in Runtime Manager.
-
From Anypoint Platform, select Runtime Manager.
-
From the navigation menu, select Load Balancers.
-
Click a load balancer name, and then click a certificate name.
Ensure your load balancer has a valid, CA-signed certificate, or the browser won’t connect to Anypoint DataGraph.
-
In the URL Mapping Rules section, click Add New Rule.
-
Complete the fields with the following values:
-
Input Path (
inputUri
): The URI that the client requests: for example,/{app}/
-
Target App (
appName
): The domain for the Anypoint DataGraph application discovered in Step 4 of the gathering details task -
Output Path (
appURI
): The URI string to pass to Anypoint DataGraph; for example/
or/graphql
-
Protocol (
upstreamProtocol
): httpsAnypoint DataGraph supports only HTTPS.
-
Add the DLB Configuration to Anypoint DataGraph
After you add the mapping rule, you configure the DLB for use with Anypoint Datagraph.
-
Check the DLB URL for Anypoint DataGraph:
-
Using Anypoint CLI v3.x:
-
Using Anypoint CLI v4.x:
datagraph:load-balancer-config:describe
By default, no value is returned for
dlbUrl
if you haven’t previously configured a DLB for that Anypoint DataGraph environment.
-
-
Add the new DLB URL:
-
Using Anypoint CLI v3.x:
datagraph load-balancer-config add <url>
-
Using Anypoint CLI v4.x:
datagraph:load-balancer-config:add <url>
Replace
<url>
with a valid URL that includes the DLB name and DataGraph app name (gathered in Steps 3 and 4 of the gathering details task) and the mapping rule Input Path, for example: -
Using Anypoint CLI v3.x:
datagraph load-balancer-config add examplelb.lb.anypointdns.net/datagraph/graphql
-
Using Anypoint CLI v4.x:
datagraph:load-balancer-config:add examplelb.lb.anypointdns.net/datagraph/graphql
Refer to Example Mapping Rules for a DLB URL if needed.
-
-
Validate that the value was updated:
-
Using Anypoint CLI v3.x:
datagraph load-balancer-config describe
-
Using Anypoint CLI v4.x:
datagraph:load-balancer-config:describe
The CLI returns details that include the application name for the Anypoint DataGraph load balancer and the full domain name for the DLB.
-
After you add this change, Anypoint DataGraph re-deploys, and you must wait for the status indicator to indicate that Anypoint DataGraph is up to date.
Remove the DLB Configuration from Anypoint DataGraph
You can remove the DLB configuration using the following command:
-
Using Anypoint CLI v3.x:
datagraph load-balancer-config remove
-
Using Anypoint CLI v4.x:
datagraph:load-balancer-config:remove
When you remove the configuration, Anypoint DataGraph redeploys.