Obtenir des informations sur vos NAT services

Vous pouvez obtenir des informations à propos d’une ou plusieurs de vos NAT services, comme son IP publique ou le Net et Subnet dans lesquels elle se trouve.

Obtenir des informations sur vos NAT services avec Cockpit v2

Voir le dashboard NAT Services.

Obtenir des informations sur vos NAT services avec OSC CLI

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

The ReadNatServices command lists one or more network address translation (NAT) services.

Request sample
$ osc-cli api ReadNatServices --profile "default" \
    --Filters '{
        "NatServiceIds": ["nat-12345678"]
      }'
Request sample
$ osc-cli api ReadNatServices --profile "default" \
    --Filters '{
        "NetIds": ["vpc-12345678", "vpc-87654321"],
        "SubnetIds": ["subnet-12345678"]
      }'

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.

    • ClientTokens: (optional) The idempotency tokens provided when creating the NAT services.

    • NatServiceIds: (optional) The IDs of the NAT services.

    • NetIds: (optional) The IDs of the Nets in which the NAT services are.

    • States: (optional) The states of the NAT services (pending | available | deleting | deleted).

    • SubnetIds: (optional) The IDs of the Subnets in which the NAT services are.

    • TagKeys: (optional) The keys of the tags associated with the NAT services.

    • TagValues: (optional) The values of the tags associated with the NAT services.

    • Tags: (optional) The key/value combination of the tags associated with the NAT services, 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 ReadNatServices command returns the following elements:

  • NatServices: Information about one or more NAT services.

    • ClientToken: The idempotency token provided when creating the NAT service.

    • NatServiceId: The ID of the NAT service.

    • NetId: The ID of the Net in which the NAT service is.

    • PublicIps: Information about the public IP or IPs associated with the NAT service.

      • PublicIp: The public IP associated with the NAT service.

      • PublicIpId: The allocation ID of the public IP associated with the NAT service.

    • State: The state of the NAT service (pending | available | deleting | deleted).

    • SubnetId: The ID of the Subnet in which the NAT service is.

    • Tags: One or more tags associated with the NAT service.

      • 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"
  },
  "NatServices": [
    {
      "Tags": [],
      "SubnetId": "subnet-12345678",
      "NatServiceId": "nat-12345678",
      "PublicIps": [
        {
          "PublicIpId": "eipalloc-12345678",
          "PublicIp": "192.0.2.0"
        }
      ],
      "NetId": "vpc-12345678",
      "State": "available"
    }
  ]
}

Obtenir des informations sur vos NAT services avec oapi-cli

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

The ReadNatServices command lists one or more network address translation (NAT) services.

Request sample
$ oapi-cli --profile "default" ReadNatServices \
    --Filters '{
        "NatServiceIds": ["nat-12345678"]
      }'
Request sample
$ oapi-cli --profile "default" ReadNatServices \
    --Filters '{
        "NetIds": ["vpc-12345678", "vpc-87654321"],
        "SubnetIds": ["subnet-12345678"]
      }'

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.

    • ClientTokens: (optional) The idempotency tokens provided when creating the NAT services.

    • NatServiceIds: (optional) The IDs of the NAT services.

    • NetIds: (optional) The IDs of the Nets in which the NAT services are.

    • States: (optional) The states of the NAT services (pending | available | deleting | deleted).

    • SubnetIds: (optional) The IDs of the Subnets in which the NAT services are.

    • TagKeys: (optional) The keys of the tags associated with the NAT services.

    • TagValues: (optional) The values of the tags associated with the NAT services.

    • Tags: (optional) The key/value combination of the tags associated with the NAT services, 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 ReadNatServices command returns the following elements:

  • NatServices: Information about one or more NAT services.

    • ClientToken: The idempotency token provided when creating the NAT service.

    • NatServiceId: The ID of the NAT service.

    • NetId: The ID of the Net in which the NAT service is.

    • PublicIps: Information about the public IP or IPs associated with the NAT service.

      • PublicIp: The public IP associated with the NAT service.

      • PublicIpId: The allocation ID of the public IP associated with the NAT service.

    • State: The state of the NAT service (pending | available | deleting | deleted).

    • SubnetId: The ID of the Subnet in which the NAT service is.

    • Tags: One or more tags associated with the NAT service.

      • 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"
  },
  "NatServices": [
    {
      "Tags": [],
      "SubnetId": "subnet-12345678",
      "NatServiceId": "nat-12345678",
      "PublicIps": [
        {
          "PublicIpId": "eipalloc-12345678",
          "PublicIp": "192.0.2.0"
        }
      ],
      "NetId": "vpc-12345678",
      "State": "available"
    }
  ]
}

Obtenir des informations sur vos NAT gateways avec AWS CLI

Avant de commencer : Installez et configurez AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI.

Pour obtenir des informations à propos d’une ou plusieurs NAT gateways, utilisez la commande describe-nat-gateways en suivant cette syntaxe :

Exemple de requête
$ aws ec2 describe-nat-gateways \
    --profile YOUR_PROFILE \
    --nat-gateway-ids NOT_SPECIFIED \
    --filters "Name=state,Values=available" \
    --endpoint https://fcu.eu-west-2.outscale.com

Cette commande contient les attributs suivants que vous devez spécifier :

  • (optionnel) profile : Le profil nommé que vous voulez utiliser, créé pendant la configuration d’AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI.

  • (optionnel) nat-gateway-ids : Un ou plusieurs ID de NAT gateways.

  • (optionnel) filters : Un ou plusieurs filtres, au format "Name=X,Values=Y".

    Vous pouvez spécifier plusieurs valeurs pour un même filtre en utilisant le format "Name=X,Values=Y, Z".

    Les filtres suivants sont disponibles :

    • nat-gateway-id : L’ID de la NAT gateway.

    • state : L’état de la NAT gateway (pending | available | deleting | deleted). Pour en savoir plus, voir À propos des NAT services.

    • subnet-id : L’ID du subnet dans lequel est la NAT gateway.

    • vpc-id : L’ID du VPC dans lequel est la NAT gateway.

    • tag-key : La clé d’un tag associé à la ressource.

    • tag-value : La valeur d’un tag associé à la ressource.

    • tag:XXXX : La valeur d’un tag associé à la ressource, où XXXX est la clé du tag.

      Pour filtrer un tag dont la clé est XXXX et la valeur est YYYY, vous pouvez donc utiliser un des deux formats suivants :

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

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

  • endpoint : Le endpoint correspondant à la Région à laquelle vous voulez envoyer la requête. Pour en savoir plus, voir Installer et configurer AWS CLI.

La commande describe-nat-gateways renvoie les éléments suivants :

  • NatGateways : Informations à propos d’une ou plusieurs NAT gateways. Cet élément contient les informations suivantes :

  • CreateTime : La date et l’heure de création de la NAT gateway.

    • NatGatewayAddresses : Informations à propos de l’EIP associée à la NAT gateway. Cet élément contient les informations suivantes :

      • AllocationId : L’ID d’allocation de l’EIP.

      • PublicIp : L’EIP associée à la NAT gateway.

  • NatGatewayId : L’ID de la NAT gateway.

  • State : L’état de la NAT gateway. Pour en savoir plus, voir À propos des NAT services.

  • SubnetId : L’ID du subnet dans lequel est la NAT gateway.

  • VpcId : L’ID du VPC dans lequel est la NAT gateway.

  • Tags : Les tags associés à votre ressource.

    • Key : La clé du tag.

    • Value : La valeur du tag.

Exemple de résultat
{
  "NatGateways": [
    {
        "CreateTime": "2016-11-08T10:58:42.654Z",
        "NatGatewayAddresses": [
            {
                "AllocationId": "eipalloc-87654321",
                "PublicIp": "111.1.1.1"
            }
        ],
        "NatGatewayId": "nat-5678efgh",
        "State": "available",
        "SubnetId": "subnet-4321dcba",
        "VpcId": "vpc-1234abcd",
        "Tags": []
    }
  ]
}

Pages connexes

Méthodes API correspondantes

AWS™ et Amazon Web Services™ sont des marques de commerce d’Amazon Technologies, Inc. ou de ses affiliées aux États-Unis et/ou dans les autres pays.