# Instance Types

## Get Instance Type

`client.InstanceTypes.Get(ctx, region, name) (*InstanceType, error)`

**get** `/v1/instance_types/{region}/{name}`

Get an instance type by region and name

### Parameters

- `region InstanceTypeGetParamsRegion`

  - `const InstanceTypeGetParamsRegionUsSva2 InstanceTypeGetParamsRegion = "us-sva-2"`

- `name string`

### Returns

- `type InstanceType struct{…}`

  Instance type.

  - `Chipset string`

  - `CreatedAt Time`

    When the Instance Type was created.

  - `Family string`

  - `MemoryGB int64`

  - `Name string`

  - `NetworkBandwidthGbps float64`

    Network bandwidth in Gbps.

  - `Region RegionName`

    Region the resource is in.

    - `const RegionNameUsSva2 RegionName = "us-sva-2"`

  - `Series string`

  - `UpdatedAt Time`

    When the Instance Type was updated.

  - `Vcpu int64`

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/instance_types"
  "github.com/nirvana-labs/nirvana-go/option"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  instanceType, err := client.InstanceTypes.Get(
    context.TODO(),
    instance_types.InstanceTypeGetParamsRegionUsSva2,
    "n1-standard-8",
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", instanceType.NetworkBandwidthGbps)
}
```

#### Response

```json
{
  "chipset": "amd-epyc-9354p",
  "created_at": "2025-01-01T00:00:00Z",
  "family": "standard",
  "memory_gb": 32,
  "name": "n1-standard-8",
  "network_bandwidth_gbps": 1,
  "region": "us-sva-2",
  "series": "n1",
  "updated_at": "2025-01-01T00:00:00Z",
  "vcpu": 8
}
```

## List Instance Types

`client.InstanceTypes.List(ctx, query) (*Cursor[InstanceType], error)`

**get** `/v1/instance_types`

List instance types

### Parameters

- `query InstanceTypeListParams`

  - `Cursor param.Field[string]`

    Pagination cursor returned by a previous request

  - `Limit param.Field[int64]`

    Maximum number of items to return

### Returns

- `type InstanceType struct{…}`

  Instance type.

  - `Chipset string`

  - `CreatedAt Time`

    When the Instance Type was created.

  - `Family string`

  - `MemoryGB int64`

  - `Name string`

  - `NetworkBandwidthGbps float64`

    Network bandwidth in Gbps.

  - `Region RegionName`

    Region the resource is in.

    - `const RegionNameUsSva2 RegionName = "us-sva-2"`

  - `Series string`

  - `UpdatedAt Time`

    When the Instance Type was updated.

  - `Vcpu int64`

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/instance_types"
  "github.com/nirvana-labs/nirvana-go/option"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.InstanceTypes.List(context.TODO(), instance_types.InstanceTypeListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "items": [
    {
      "chipset": "amd-epyc-9354p",
      "created_at": "2025-01-01T00:00:00Z",
      "family": "standard",
      "memory_gb": 32,
      "name": "n1-standard-8",
      "network_bandwidth_gbps": 1,
      "region": "us-sva-2",
      "series": "n1",
      "updated_at": "2025-01-01T00:00:00Z",
      "vcpu": 8
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```

## Domain Types

### Instance Type

- `type InstanceType struct{…}`

  Instance type.

  - `Chipset string`

  - `CreatedAt Time`

    When the Instance Type was created.

  - `Family string`

  - `MemoryGB int64`

  - `Name string`

  - `NetworkBandwidthGbps float64`

    Network bandwidth in Gbps.

  - `Region RegionName`

    Region the resource is in.

    - `const RegionNameUsSva2 RegionName = "us-sva-2"`

  - `Series string`

  - `UpdatedAt Time`

    When the Instance Type was updated.

  - `Vcpu int64`

### Instance Type List

- `type InstanceTypeList struct{…}`

  - `Items []InstanceType`

    - `Chipset string`

    - `CreatedAt Time`

      When the Instance Type was created.

    - `Family string`

    - `MemoryGB int64`

    - `Name string`

    - `NetworkBandwidthGbps float64`

      Network bandwidth in Gbps.

    - `Region RegionName`

      Region the resource is in.

      - `const RegionNameUsSva2 RegionName = "us-sva-2"`

    - `Series string`

    - `UpdatedAt Time`

      When the Instance Type was updated.

    - `Vcpu int64`

  - `Pagination Pagination`

    Pagination response details.

    - `NextCursor string`

    - `PreviousCursor string`

    - `TotalCount int64`
