Getting Information About Your Listener Rules

You can get information about one or more listener rules that you created.

This action displays the pattern of the specified rule, as well as the list of virtual machines (VMs) registered with it. By default, information about all your listener rules is returned.

You can also modify the pattern of an existing listener rule. For more information, see Modifying a Listener Rule.

Getting Information About Your Listener Rules Using OSC CLI

The ReadListenerRules command lists one or more listener rules. By default, this action returns the full list of listener rules for the account.

Request sample
$ osc-cli api ReadListenerRules --profile "default" \
    --Filters '{
        "ListenerRuleNames": ["example-listener-rule"],
      }'

This command contains the following attributes that you need to specify:

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • Filters: (optional) One or more filters.

The ReadListenerRules command returns the following elements:

  • ListenerRules: The list of the rules to describe.

  • ResponseContext: Information about the context of the response.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "ListenerRules": [
    {
      "Priority": 10,
      "VmIds": [
        "i-12345678"
      ],
      "ListenerRuleName": "example-listener-rule",
      "Action": "forward",
      "ListenerId": 123456,
      "HostNamePattern": "*.example.com",
      "ListenerRuleId": 1234
    }
  ]
}

Related Pages

Corresponding API Methods