Getting Information About Your API Access Rules

You can get information about your API access rules, like their ID, IP range, CA, and description.

Getting Information About Your API Access Rules Using Cockpit v2

  1. In the top right corner, click the IconProfil icon.
    A drop-down menu appears.

  2. Click IconAAR API Access Rules.
    The list of your API access rules appears.

Getting Information About Your API Access Rules Using OSC CLI

The ReadApiAccessRules command lists one or more API access rules.

Request sample: Example with access key/secret key authentication
$ osc-cli api ReadApiAccessRules --profile "default" \
    --Filters '{
        "ApiAccessRuleIds": ["aar-1234567890abcdef1234567890abcdef"],
      }'
Request sample: Example with login/password authentication
$ osc-cli api ReadApiAccessRules --profile "default" --authentication-method "password" --login "$OSC_EMAIL" --password "$OSC_PASSWORD" \
    --Filters '{
        "ApiAccessRuleIds": ["aar-1234567890abcdef1234567890abcdef"],
      }'

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.

    • ApiAccessRuleIds: (optional) One or more IDs of API access rules.

    • CaIds: (optional) One or more IDs of Client Certificate Authorities (CAs).

    • Cns: (optional) One or more Client Certificate Common Names (CNs).

    • Descriptions: (optional) One or more descriptions of API access rules.

    • IpRanges: (optional) One or more IPs or CIDR blocks (for example, 192.0.2.0/16).

The ReadApiAccessRules command returns the following elements:

  • ApiAccessRules: A list of API access rules.

    • ApiAccessRuleId: The ID of the API access rule.

    • CaIds: One or more IDs of Client Certificate Authorities (CAs) used for the API access rule.

    • Cns: One or more Client Certificate Common Names (CNs).

    • Description: The description of the API access rule.

    • IpRanges: One or more IP ranges used for the API access rule, in CIDR notation (for example, 192.0.2.0/16).

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "ApiAccessRules": [
    {
      "IpRanges": [
        "0.0.0.0/0"
      ],
      "ApiAccessRuleId": "aar-1234567890abcdef1234567890abcdef",
      "CaIds": [],
      "Cns": [],
      "Description": "Allows all IPv4 domain"
    },
    {
      "IpRanges": [
        "46.231.144.178/32"
      ],
      "ApiAccessRuleId": "aar-abcdef1234567890abcdef1234567890",
      "CaIds": [],
      "Cns": [],
      "Description": "Allows Outscale Cockpit of this region"
    }
  ]
}

Related Pages

Corresponding API Method