Obtenir des informations sur le Net d’un projet

Vous pouvez obtenir des informations sur le Net d’un projet avec octl et OKS CLI.

Obenir des informations sur le Net d’un projet avec octl

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

The GetProjectNets command retrieves the Net details for a specific project by its ID. Returns the Net information associated with the specified project.

Request sample
$ octl kube api GetProjectNets <project_id> --profile "default"

The GetProjectNets command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the API request.

  • Nets: Net details associated with the project.

    • DhcpOptionsSetId: The ID of the DHCP options set.

    • 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).

    • Tenancy: The VM tenancy in the Net.

Result sample
{
  "ResponseContext": {
    "RequestId": "string"
  },
  "Nets": [
    {
      "DhcpOptionsSetId": "string",
      "IpRange": "string",
      "NetId": "string",
      "State": "string",
      "Tenancy": "string"
    }
  ]
}

Obenir des informations sur le Net d’un projet avec OKS CLI

La commande project nets vous permet de récupérer le Net d’un projet :

Exemple de requête
$ oks-cli project nets \
    --project-name NAME_OF_PROJECT \
    --output json

Cette commande contient les options suivantes que vous devez spécifier :

  • project-name : Le nom du projet sur lequel vous souhaitez obtenir des informations de Net.

  • (optionnel) output : Le format de sortie de la réponse (json | yaml | table). Par défaut, le format de la réponse est JSON.

La commande project nets renvoie les éléments suivants :

  • DhcpOptionsSetId : L’ID du groupe d’options DHCP.

  • IpRange : La plage d’IP du Net, en notation CIDR (par exemple, 10.0.0.0/16).

  • NetId : L’ID du Net.

  • State : L’état du Net (pending | available | deleting).

  • Tenancy : L’option d’allocation de la VM dans le Net.

Exemple de résultat
[
    {
        "DhcpOptionsSetId": "dopt-123a4bcd",
        "IpRange": "10.0.0.0/16",
        "NetId": "vpc-a1bc2345",
        "State": "available",
        "Tenancy": "default"
    }
]

Pages connexes

Méthode API correspondante