Obtenir des informations sur vos Nets
Vous pouvez obtenir des informations à propos d’un ou plusieurs de vos Nets, comme leur bloc CIDR ou leur option d’allocation.
Des informations sur vos Nets sont également disponibles depuis les machines virtuelles (VM) elles-mêmes. Pour en savoir plus, voir Accéder aux metadata et user data d’une VM.
Obtenir des informations sur vos Nets avec OSC CLI
|
À ce jour, cette section est disponible en anglais uniquement. |
The ReadNets command lists one or more Nets.
$ osc-cli api ReadNets --profile "default" \
--Filters '{
"NetIds": ["vpc-12345678"]
}'
$ osc-cli api ReadNets --profile "default" \
--Filters '{
"States": ["available"]
}'
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.-
DhcpOptionsSetIds: (optional) The IDs of the DHCP options sets. -
IpRanges: (optional) The IP ranges for the Nets, in CIDR notation (for example,10.0.0.0/16). -
IsDefault: (optional) If true, the Net used is the default one. -
NetIds: (optional) The IDs of the Nets. -
States: (optional) The states of the Nets (pending|available|deleting). -
TagKeys: (optional) The keys of the tags associated with the Nets. -
TagValues: (optional) The values of the tags associated with the Nets. -
Tags: (optional) The key/value combination of the tags associated with the Nets, 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 (between1and1000, both included).
The ReadNets command returns the following elements:
-
Nets: Information about the described Nets.-
DhcpOptionsSetId: The ID of the DHCP options set (ordefaultif you want to associate the default one). -
IpRange: The IP range for the Net, in CIDR notation (for example,10.0.0.0/16). -
NetId: The ID of the Net. -
State: The state of the Net (pending|available|deleting). -
Tags: One or more tags associated with the Net.-
Key: The key of the tag, with a minimum of 1 character. -
Value: The value of the tag, between 0 and 255 characters.
-
-
Tenancy: The VM tenancy in a Net.
-
-
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.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Nets": [
{
"Tags": [],
"DhcpOptionsSetId": "dopt-12345678",
"IpRange": "10.0.0.0/16",
"Tenancy": "default",
"NetId": "vpc-12345678",
"State": "available"
}
]
}
Obtenir des informations sur vos Nets avec oapi-cli
|
À ce jour, cette section est disponible en anglais uniquement. |
The ReadNets command lists one or more Nets.
$ oapi-cli --profile "default" ReadNets \
--Filters '{
"NetIds": ["vpc-12345678"]
}'
$ oapi-cli --profile "default" ReadNets \
--Filters '{
"States": ["available"]
}'
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.-
DhcpOptionsSetIds: (optional) The IDs of the DHCP options sets. -
IpRanges: (optional) The IP ranges for the Nets, in CIDR notation (for example,10.0.0.0/16). -
IsDefault: (optional) If true, the Net used is the default one. -
NetIds: (optional) The IDs of the Nets. -
States: (optional) The states of the Nets (pending|available|deleting). -
TagKeys: (optional) The keys of the tags associated with the Nets. -
TagValues: (optional) The values of the tags associated with the Nets. -
Tags: (optional) The key/value combination of the tags associated with the Nets, 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 (between1and1000, both included).
The ReadNets command returns the following elements:
-
Nets: Information about the described Nets.-
DhcpOptionsSetId: The ID of the DHCP options set (ordefaultif you want to associate the default one). -
IpRange: The IP range for the Net, in CIDR notation (for example,10.0.0.0/16). -
NetId: The ID of the Net. -
State: The state of the Net (pending|available|deleting). -
Tags: One or more tags associated with the Net.-
Key: The key of the tag, with a minimum of 1 character. -
Value: The value of the tag, between 0 and 255 characters.
-
-
Tenancy: The VM tenancy in a Net.
-
-
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.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Nets": [
{
"Tags": [],
"DhcpOptionsSetId": "dopt-12345678",
"IpRange": "10.0.0.0/16",
"Tenancy": "default",
"NetId": "vpc-12345678",
"State": "available"
}
]
}
Obtenir des informations sur vos VPC avec AWS CLI
Avant de commencer : Installez et configurez AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI. |
Obtenir des informations générales sur un VPC
Pour obtenir des informations générales sur un ou plusieurs de vos VPC, utilisez la commande describe-vpcs en suivant cette syntaxe :
$ aws ec2 describe-vpcs \
--profile YOUR_PROFILE \
--vpc-ids vpc-12345678 \
--filters Name=X,Values=Y \
--endpoint https://fcu.eu-west-2.outscale.com
Cette commande contient les options suivantes 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)
vpc-ids: Un ou plusieurs ID de VPC. -
(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 :
-
vpc-id: L’ID du VPC. -
state: L’état du VPC. Pour en savoir plus, voir À propos des Nets. -
cidr: Le bloc CIDR exact du VPC. -
cidr-block: Le bloc CIDR exact du VPC (similaire àcidretcidrBlock). -
cidrBlock: Le bloc CIDR exact du VPC (similaire àcidretcidr-block). -
dhcp-options-id: L’ID d’un groupe d’options DHCP associé au VPC. Pour en savoir plus, voir À propos des options DHCP. -
is-default: Indique si le VPC est celui par défaut (toujoursfalse, car 3DS OUTSCALE ne fournit pas de VPC par défaut). -
isDefault: Alias deis-default.
-
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ùXXXXest la clé du tag.Pour filtrer un tag dont la clé est
XXXXet la valeur estYYYY, 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-vpcs renvoie les éléments suivants :
-
Vpcs: Informations à propos d’un ou plusieurs VPC. Cet élément contient les informations suivantes :-
VpcId: L’ID du VPC. -
InstanceTenancy: L’option d’allocation pour les instances lancées dans le VPC. Pour en savoir plus, voir À propos des VM > Allocation des VM et VM dédiées. -
Tags: Un ou plusieurs tags associés avec le VPC. Cet élément contient les informations suivantes :-
Value: La valeur du tag. -
Key: La clé du tag.
-
-
State: L’état du VPC. Pour en savoir plus, voir À propos des Nets. -
DhcpOptionsId: L’ID du groupe d’options DHCP associé au VPC. Pour en savoir plus, voir À propos des options DHCP. -
CidrBlock: La plage d’IP pour le VPC, en notation CIDR. -
IsDefault: Toujoursfalse, car 3DS OUTSCALE ne fournit pas de VPC par défaut.
-
"Vpcs": [
{
"VpcId": "vpc-12345678",
"InstanceTenancy": "default",
"Tags": [
{
"Value": "VPC1",
"Key": "Name"
}
],
"State": "available",
"DhcpOptionsId": "dopt-1234abcd",
"CidrBlock": "10.0.0.0/16",
"IsDefault": false
}
]
}
Obtenir des informations sur un attribut d’un VPC
Pour obtenir des informations à propos d’un attribut d’un VPC, utilisez la commande describe-vpc-attribute en suivant cette syntaxe :
$ aws ec2 describe-vpc-attribute \
--profile YOUR_PROFILE \
--vpc-id vpc-123456789 \
--attribute \
--endpoint https://fcu.eu-west-2.outscale.com
Cette commande contient les options suivantes 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. -
vpc-id: L’ID du VPC. -
attribute: Le nom de l’attribut (enableDnsSupport|enableDnsHostnames).Vous ne pouvez spécifier qu’un attribut à la fois.
-
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-vpc-attribute renvoie les éléments suivants :
-
VpcId: L’ID du VPC. -
EnableDnsSupport, si vous l’avez spécifié comme attribut à décrire. Cet élément contient l’information suivante :-
Value: Sitrue, les serveurs DNS du VPC résolvent les noms d’hôtes DNS de vos instances en IP correspondantes. Sifalse, il ne l’est pas.
-
-
EnableDnsHostName, si vous l’avez spécifié comme attribut à décrire. Cet élément contient l’information suivante :-
Value: Sitrue, les instances lancées dans le VPC obtiennent des noms d’hôtes DNS. Sifalse, il ne l’est pas.
-
{
"VpcId": "vpc-a01106c2",
"EnableDnsSupport": {
"Value": true
}
}
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.