Getting Information About DHCP Options Sets

You can get information about one or more of your DHCP options sets, like their ID and the options they contain.

To display which DHCP options set is associated with a Net, see Getting Information About Your Nets.

Getting Information About DHCP Options Sets Using Cockpit v2

See the DHCP Options dashboard.

Getting Information About DHCP Options Sets Using OSC CLI

The ReadDhcpOptions command gets information about the content of one or more DHCP options sets.

Request sample
$ osc-cli api ReadDhcpOptions --profile "default" \
    --Filters '{
        "DhcpOptionsSetIds": ["dopt-12345678"]
      }'
Request sample
$ osc-cli api ReadDhcpOptions --profile "default" \
    --Filters '{
        "DomainNameServers": ["192.0.2.0", "198.51.100.0"],
        "DomainNames": ["example.com"]
      }'

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.

    • Default: (optional) If true, lists all default DHCP options set. If false, lists all non-default DHCP options set.

    • DhcpOptionsSetIds: (optional) The IDs of the DHCP options sets.

    • DomainNameServers: (optional) The IPs of the domain name servers used for the DHCP options sets.

    • DomainNames: (optional) The domain names used for the DHCP options sets.

    • LogServers: (optional) The IPs of the log servers used for the DHCP options sets.

    • NtpServers: (optional) The IPs of the Network Time Protocol (NTP) servers used for the DHCP options sets.

    • TagKeys: (optional) The keys of the tags associated with the DHCP options sets.

    • TagValues: (optional) The values of the tags associated with the DHCP options sets.

    • Tags: (optional) The key/value combination of the tags associated with the DHCP options sets, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}.

  • NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page.

  • ResultsPerPage: (optional) The maximum number of logs returned in a single response (between 1 and 1000, both included). By default, 100.

The ReadDhcpOptions command returns the following elements:

  • DhcpOptionsSets: Information about one or more DHCP options sets.

    • Default: If true, the DHCP options set is a default one. If false, it is not.

    • DhcpOptionsSetId: The ID of the DHCP options set.

    • DomainName: The domain name.

    • DomainNameServers: One or more IPs for the domain name servers.

    • LogServers: One or more IPs for the log servers.

    • NtpServers: One or more IPs for the NTP servers.

    • Tags: One or more tags associated with the DHCP options set.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

  • NextPageToken: The token to request the next page of results. Each token refers to a specific page.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "DhcpOptionsSets": [
    {
      "Tags": [],
      "NtpServers": [
        "203.0.113.0",
        "203.0.113.1"
      ],
      "Default": false,
      "DhcpOptionsSetId": "dopt-12345678",
      "DomainName": "example.com",
      "DomainNameServers": [
        "192.0.2.0",
        "198.51.100.0"
      ]
    }
  ]
}

Getting Information About DHCP Options Sets Using oapi-cli

The ReadDhcpOptions command gets information about the content of one or more DHCP options sets.

Request sample
$ oapi-cli --profile "default" ReadDhcpOptions \
    --Filters '{
        "DhcpOptionsSetIds": ["dopt-12345678"]
      }'
Request sample
$ oapi-cli --profile "default" ReadDhcpOptions \
    --Filters '{
        "DomainNameServers": ["192.0.2.0", "198.51.100.0"],
        "DomainNames": ["example.com"]
      }'

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.

    • Default: (optional) If true, lists all default DHCP options set. If false, lists all non-default DHCP options set.

    • DhcpOptionsSetIds: (optional) The IDs of the DHCP options sets.

    • DomainNameServers: (optional) The IPs of the domain name servers used for the DHCP options sets.

    • DomainNames: (optional) The domain names used for the DHCP options sets.

    • LogServers: (optional) The IPs of the log servers used for the DHCP options sets.

    • NtpServers: (optional) The IPs of the Network Time Protocol (NTP) servers used for the DHCP options sets.

    • TagKeys: (optional) The keys of the tags associated with the DHCP options sets.

    • TagValues: (optional) The values of the tags associated with the DHCP options sets.

    • Tags: (optional) The key/value combination of the tags associated with the DHCP options sets, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}.

  • NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page.

  • ResultsPerPage: (optional) The maximum number of logs returned in a single response (between 1 and 1000, both included). By default, 100.

The ReadDhcpOptions command returns the following elements:

  • DhcpOptionsSets: Information about one or more DHCP options sets.

    • Default: If true, the DHCP options set is a default one. If false, it is not.

    • DhcpOptionsSetId: The ID of the DHCP options set.

    • DomainName: The domain name.

    • DomainNameServers: One or more IPs for the domain name servers.

    • LogServers: One or more IPs for the log servers.

    • NtpServers: One or more IPs for the NTP servers.

    • Tags: One or more tags associated with the DHCP options set.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

  • NextPageToken: The token to request the next page of results. Each token refers to a specific page.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "DhcpOptionsSets": [
    {
      "Tags": [],
      "NtpServers": [
        "203.0.113.0",
        "203.0.113.1"
      ],
      "Default": false,
      "DhcpOptionsSetId": "dopt-12345678",
      "DomainName": "example.com",
      "DomainNameServers": [
        "192.0.2.0",
        "198.51.100.0"
      ]
    }
  ]
}

Getting Information About DHCP Options Sets Using AWS CLI

Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI.

To get information about one or more DHCP options sets, use the describe-dhcp-options command following this syntax:

Request sample
$ aws ec2 describe-dhcp-options \
    --profile YOUR_PROFILE \
    --dhcp-options-ids NOT_SPECIFIED \
    --filters [ \
               { \
                Name: Key, \
                Values: domain-name \
               } \
             ] \
    --endpoint https://fcu.eu-west-2.outscale.com

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

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • dhcp-options-ids: One or more IDs of DHCP options sets.

  • (optional) filters: One or more filters, in the "Name=X,Values=Y" format.

    You can specify several values for a same filter using the "Name=X,Values=Y, Z" format.

    The following filters are available:

    • dhcp-options-id: The ID of a set of DHCP options.

    • key: The name of one of the DHCP options (domain-name-servers, domain-name, ntp-servers, or log-servers).

    • value: The value for one of the DHCP options.

    • tag-key: The key of a tag associated with the resource.

    • tag-value: The value of a tag associated with the resource.

    • tag:XXXX: The value of a tag associated with the resource, where XXXX is the key of the tag.

      To filter a tag whose key is XXXX and value is YYYY, you can therefore use either of the following two formats:

      • --filters Name=tag-key,Values=XXXX Name=tag-value,Values=YYYY

      • --filters Name=tag:XXXX,Values=YYYY

  • endpoint: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.

The describe-dhcp-options command returns the following elements:

  • DhcpOptions: Information about one or more DHCP options sets. This element contains the following information:

    • DhcpConfigurations: Information about the DHCP options contained in the DHCP options set. This element contains the following information:

      • Value: One or more values for the DHCP option.

      • Key: The name of the DHCP option.

    • DhcpOptionsId: The ID of the DHCP options set.

    • Tags: One or more tags associated with the DHCP options set. This element contains the following information:

      • TagKey: The key of the tag associated with the resource.

      • TagValue: The value of the tag associated with the resource.

Result sample
 {
    "DhcpOptions": {
        "DhcpConfigurations": [
            {
                "Values": [
                    "10.2.5.2",
                    "10.2.5.1"
                ],
                "Key": "domain-name-servers"
            },
            {
                "Values": "mycompany.com",
                "Key": "domain-name"
            },
            {
                "Values": "10.2.5.2",
                "Key": "ntp-servers"
            },
            {
                "Values": "10.2.5.3"
                "Key": "log-servers"
            }
        ],
        "DhcpOptionsId": "dopt-1234abcd",
        "Tags": []
    }
}

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.