Hear from Salesforce leaders on how to create and deploy Agentforce agents.
Contact Us 1-800-596-4880

Troubleshooting with the CLI

Anypoint Flex Gateway includes a flexctl dump CLI that enables you to query for information related to a gateway’s API instances, services, configuration, and available extensions (policies).

As an example, the following inline configuration snippet defines a single API instance named jsonplaceholder-api in the default namespace (it remains default because namespace is not explicitly defined.) Additionally, the snippet defines one included policy: http-basic-authentication-flex.

To run flexctl dump for Linux deployments, either add the user to the flex user group or run flexctl dump with the sudo command. To learn more, see Troubleshooting Linux Permissions.

Configuration Example

apiVersion: gateway.mulesoft.com/v1alpha1
kind: ApiInstance
metadata:
  name: jsonplaceholder-api
spec:
  address: http://0.0.0.0:8080
  services:
    jsonplaceholder:
      address: https://jsonplaceholder.typicode.com:443/
      routes:
        - rules:
            - path: /api(/users/.*)
            - path: /api(/comments/.*)
  policies:
    - policyRef:
        name: http-basic-authentication-flex
      config:
        username: chris
        password: admin

Run the CLI

  1. To see JSON representations of your API instances, services, configurations, and extensions, run the following command:

    flexctl dump
    ssh

    When running in a Docker or Podman container, run the command in the container itself.

    The command outputs four files:

    • api-instances.json

    • services.json

    • configuration.json

    • extensions.json

  2. View any of the JSON file contents by running cat followed by the file name:

    cat api-instances.json
    ssh

    The api-instances.json file contents resemble the following:

Change Verbosity Level

You can change the amount of information output by the flexctl dump CLI. For example, to increase verbosity to a value of 10, run flexctl dump with the following:

flexctl dump -v 10
ssh

Change Output Directory

Additionally, you can change the directory where flexctl dump outputs the four files. For example, to output to /tmp, run flexctl dump with the following:

flexctl dump --output-directory /tmp
ssh