Skip to content
DocsOpenAPI spec

    Get VPC Details

    client.Networking.VPCs.Get(ctx, vpcID) (*VPC, error)
    GET/v1/networking/vpcs/{vpc_id}

    Get details about a VPC

    ParametersExpand Collapse
    vpcID string
    ReturnsExpand Collapse
    type VPC struct{…}

    VPC details.

    ID string

    Unique identifier for the VPC.

    CreatedAt Time

    When the VPC was created.

    formatdate-time
    FirewallRuleIDs []string

    IDs of the Firewall Rules associated with the VPC.

    ManagedBy VPCManagedBy

    What manages the resource, or null when nothing does. A managed resource can be read but not changed.

    ID string

    ID of the thing managing the resource. For a vpc_egress_policy, the ID of the VPC.

    Type string

    Kind of thing managing the resource. A vpc_egress_policy manages the Firewall Rules that block outbound traffic to ports commonly used for abuse.

    One of the following:
    const VPCManagedByTypeSandboxCluster VPCManagedByType = "sandbox_cluster"
    const VPCManagedByTypeVPCEgressPolicy VPCManagedByType = "vpc_egress_policy"
    Name string

    Name of the VPC.

    ProjectID string

    Project ID the VPC belongs to.

    Region RegionName

    Region the resource is in.

    One of the following:
    const RegionNameUsSva2 RegionName = "us-sva-2"
    const RegionNameUsWdc1 RegionName = "us-wdc-1"

    Status of the resource.

    One of the following:
    const ResourceStatusPending ResourceStatus = "pending"
    const ResourceStatusCreating ResourceStatus = "creating"
    const ResourceStatusUpdating ResourceStatus = "updating"
    const ResourceStatusReady ResourceStatus = "ready"
    const ResourceStatusDeleting ResourceStatus = "deleting"
    const ResourceStatusDeleted ResourceStatus = "deleted"
    const ResourceStatusError ResourceStatus = "error"
    const ResourceStatusSuspended ResourceStatus = "suspended"
    Subnet Subnet

    Subnet of the VPC.

    ID string

    Unique identifier for the Subnet.

    CIDR string

    CIDR block for the Subnet.

    CreatedAt Time

    When the Subnet was created.

    formatdate-time
    Name string

    Name of the Subnet.

    UpdatedAt Time

    When the Subnet was updated.

    formatdate-time
    Tags []string

    Tags to attach to the VPC.

    UpdatedAt Time

    When the VPC was updated.

    formatdate-time

    Get VPC Details

    package main
    
    import (
      "context"
      "fmt"
    
      "github.com/nirvana-labs/nirvana-go"
      "github.com/nirvana-labs/nirvana-go/option"
    )
    
    func main() {
      client := nirvana.NewClient(
        option.WithAPIKey("My API Key"),
      )
      vpc, err := client.Networking.VPCs.Get(context.TODO(), "vpc_id")
      if err != nil {
        panic(err.Error())
      }
      fmt.Printf("%+v\n", vpc.ID)
    }
    
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "created_at": "2025-01-01T00:00:00Z",
      "firewall_rule_ids": [
        "123e4567-e89b-12d3-a456-426614174001",
        "123e4567-e89b-12d3-a456-426614174002"
      ],
      "managed_by": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "type": "sandbox_cluster"
      },
      "name": "my-vpc",
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "region": "us-sva-2",
      "status": "ready",
      "subnet": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "cidr": "10.128.35.128/25",
        "created_at": "2025-01-01T00:00:00Z",
        "name": "my-subnet",
        "updated_at": "2025-01-01T00:00:00Z"
      },
      "tags": [
        "production",
        "ethereum"
      ],
      "updated_at": "2025-01-01T00:00:00Z"
    }
    Returns Examples
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "created_at": "2025-01-01T00:00:00Z",
      "firewall_rule_ids": [
        "123e4567-e89b-12d3-a456-426614174001",
        "123e4567-e89b-12d3-a456-426614174002"
      ],
      "managed_by": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "type": "sandbox_cluster"
      },
      "name": "my-vpc",
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "region": "us-sva-2",
      "status": "ready",
      "subnet": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "cidr": "10.128.35.128/25",
        "created_at": "2025-01-01T00:00:00Z",
        "name": "my-subnet",
        "updated_at": "2025-01-01T00:00:00Z"
      },
      "tags": [
        "production",
        "ethereum"
      ],
      "updated_at": "2025-01-01T00:00:00Z"
    }