Obtenir des informations sur vos listener rules

Vous pouvez obtenir des informations sur une ou plusieurs listener rules que vous avez créées.

Cette action affiche la règle de la listener rule spécifiée, ainsi que la liste des machines virtuelles (VM) enregistrées avec celle-ci. Par défaut, des informations sur toutes les listener rules sont renvoyées.

Vous pouvez également modifier la règle de la listener rule existante. Pour en savoir plus, voir Modifier une listener rule.

Obtenir des informations sur vos listener rules avec OSC CLI

À ce jour, cette section est disponible en anglais uniquement.

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.

    • ListenerRuleNames: (optional) The names of the listener rules.

The ReadListenerRules command returns the following elements:

  • ListenerRules: The list of the rules to describe.

    • Action: The type of action for the rule (always forward).

    • HostNamePattern: A host-name pattern for the rule, with a maximum length of 128 characters. This host-name pattern supports maximum three wildcards, and must not contain any special characters except -.?.

    • ListenerId: The ID of the listener.

    • ListenerRuleId: The ID of the listener rule.

    • ListenerRuleName: A human-readable name for the listener rule.

    • PathPattern: A path pattern for the rule, with a maximum length of 128 characters. This path pattern supports maximum three wildcards, and must not contain any special characters except _-.$/~"'@:+?.

    • Priority: The priority level of the listener rule, between 1 and 19999 both included. Each rule must have a unique priority level. Otherwise, an error is returned.

    • VmIds: The IDs of the backend VMs.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

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
    }
  ]
}

Pages connexes

Méthodes API correspondantes