# Slots ## Retrieve a list of all slots matching the specified parameters `client.NetworkInterconnects.Slots.List(ctx, params) (*SlotListResponse, error)` **get** `/accounts/{account_id}/cni/slots` Retrieve a list of all slots matching the specified parameters ### Parameters - `params SlotListParams` - `AccountID param.Field[string]` Path param: Customer account tag - `AddressContains param.Field[string]` Query param: If specified, only show slots with the given text in their address field - `Cursor param.Field[int64]` Query param - `Limit param.Field[int64]` Query param - `Occupied param.Field[bool]` Query param: If specified, only show slots with a specific occupied/unoccupied state - `Site param.Field[string]` Query param: If specified, only show slots located at the given site - `Speed param.Field[string]` Query param: If specified, only show slots that support the given speed ### Returns - `type SlotListResponse struct{…}` - `Items []SlotListResponseItem` - `ID string` Slot ID - `Facility SlotListResponseItemsFacility` - `Address []string` - `Name string` - `Occupied bool` Whether the slot is occupied or not - `Site string` - `Speed string` - `Account string` Customer account tag - `Next int64` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) slots, err := client.NetworkInterconnects.Slots.List(context.TODO(), network_interconnects.SlotListParams{ AccountID: cloudflare.F("account_id"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", slots.Items) } ``` #### Response ```json { "items": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "facility": { "address": [ "string" ], "name": "name" }, "occupied": true, "site": "site", "speed": "speed", "account": "account" } ], "next": 0 } ``` ## Get information about the specified slot `client.NetworkInterconnects.Slots.Get(ctx, slot, query) (*SlotGetResponse, error)` **get** `/accounts/{account_id}/cni/slots/{slot}` Get information about the specified slot ### Parameters - `slot string` - `query SlotGetParams` - `AccountID param.Field[string]` Customer account tag ### Returns - `type SlotGetResponse struct{…}` - `ID string` Slot ID - `Facility SlotGetResponseFacility` - `Address []string` - `Name string` - `Occupied bool` Whether the slot is occupied or not - `Site string` - `Speed string` - `Account string` Customer account tag ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) slot, err := client.NetworkInterconnects.Slots.Get( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", network_interconnects.SlotGetParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", slot.ID) } ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "facility": { "address": [ "string" ], "name": "name" }, "occupied": true, "site": "site", "speed": "speed", "account": "account" } ```