Modifying an API Access Rule

You can modify the description or the range of IPs for an API access rule.

Modifying an API Access Rule Using Cockpit v2

The new rule you specify fully replaces the old rule. Therefore, for a parameter that is not specified, any previously set value is deleted.

If, as result of your modification, you no longer have access to the APIs, you will need to contact the Support team to regain access. For more information, see Technical Support.

  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.

  3. Check the box of the API access rule you want to modify.
    The API access rule is selected.

  4. Click IconEdit Update.
    The UPDATE API ACCESS RULE dialog box appears.

  5. (optional) In the Description field, type a description for the API access rule.

  6. In the IP range field, type the range of IPs for the API access rule, in CIDR notation.

    If the button My IP does not work, check if a browser extension is blocking scripts on the page.

  7. Click Update.
    The API access rule is modified.

Modifying an API Access Rule Using OSC CLI

The UpdateApiAccessRule command modifies a specified API access rule.

  • The new rule you specify fully replaces the old rule. Therefore, for a parameter that is not specified, any previously set value is deleted.

  • If, as result of your modification, you no longer have access to the APIs, you will need to contact the Support team to regain access. For more information, see Technical Support.

Request sample: Example with access key/secret key authentication
$ osc-cli api UpdateApiAccessRule --profile "default" \
    --ApiAccessRuleId "aar-1234567890abcdef1234567890abcdef" \
    --IpRanges '["0.0.0.0/0"]' \
    --Description "Allows all Ipv4 domain"
Request sample: Example with login/password authentication
$ osc-cli api UpdateApiAccessRule --profile "default" --authentication-method "password" --login "$OSC_EMAIL" --password "$OSC_PASSWORD" \
    --ApiAccessRuleId "aar-1234567890abcdef1234567890abcdef" \
    --IpRanges '["0.0.0.0/0"]' \
    --Description "Allows all Ipv4 domain"

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

  • ApiAccessRuleId: The ID of the API access rule you want to update.

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

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

  • Description: (optional) A new description for the API access rule.

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

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

The UpdateApiAccessRule command returns the following elements:

  • ApiAccessRule: Information about the API access rule.

    • 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"
  },
  "ApiAccessRule": {
    "IpRanges": [
      "0.0.0.0/0"
    ],
    "ApiAccessRuleId": "aar-1234567890abcdef1234567890abcdef",
    "CaIds": [],
    "Cns": [],
    "Description": "Allows all IPv4 domain"
  }
}

Modifying an API Access Rule Using oapi-cli

The UpdateApiAccessRule command modifies a specified API access rule.

  • The new rule you specify fully replaces the old rule. Therefore, for a parameter that is not specified, any previously set value is deleted.

  • If, as result of your modification, you no longer have access to the APIs, you will need to contact the Support team to regain access. For more information, see Technical Support.

Request sample: Example with access key/secret key authentication
$ oapi-cli --profile "default" UpdateApiAccessRule \
    --ApiAccessRuleId "aar-1234567890abcdef1234567890abcdef" \
    --IpRanges '["0.0.0.0/0"]' \
    --Description "Allows all Ipv4 domain"
Request sample: Example with login/password authentication
$ oapi-cli --profile "default" --login "$OSC_EMAIL" --password "$OSC_PASSWORD" UpdateApiAccessRule \
    --ApiAccessRuleId "aar-1234567890abcdef1234567890abcdef" \
    --IpRanges '["0.0.0.0/0"]' \
    --Description "Allows all Ipv4 domain"

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

  • ApiAccessRuleId: The ID of the API access rule you want to update.

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

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

  • Description: (optional) A new description for the API access rule.

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

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

The UpdateApiAccessRule command returns the following elements:

  • ApiAccessRule: Information about the API access rule.

    • 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"
  },
  "ApiAccessRule": {
    "IpRanges": [
      "0.0.0.0/0"
    ],
    "ApiAccessRuleId": "aar-1234567890abcdef1234567890abcdef",
    "CaIds": [],
    "Cns": [],
    "Description": "Allows all IPv4 domain"
  }
}

Related Pages

Corresponding API Methods