Skip to content
Start here

List Connectors

client.MagicTransit.Connectors.List(ctx, query) (*SinglePage[ConnectorListResponse], error)
GET/accounts/{account_id}/magic/connectors

List Connectors

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Magic WAN WriteMagic WAN Read
ParametersExpand Collapse
query ConnectorListParams
AccountID param.Field[string]

Account identifier

maxLength32
ReturnsExpand Collapse
type ConnectorListResponse struct{…}
ID string
Activated bool
InterruptWindowDaysOfWeek []ConnectorListResponseInterruptWindowDaysOfWeek

Allowed days of the week for upgrades. Default is all days.

One of the following:
const ConnectorListResponseInterruptWindowDaysOfWeekSunday ConnectorListResponseInterruptWindowDaysOfWeek = "Sunday"
const ConnectorListResponseInterruptWindowDaysOfWeekMonday ConnectorListResponseInterruptWindowDaysOfWeek = "Monday"
const ConnectorListResponseInterruptWindowDaysOfWeekTuesday ConnectorListResponseInterruptWindowDaysOfWeek = "Tuesday"
const ConnectorListResponseInterruptWindowDaysOfWeekWednesday ConnectorListResponseInterruptWindowDaysOfWeek = "Wednesday"
const ConnectorListResponseInterruptWindowDaysOfWeekThursday ConnectorListResponseInterruptWindowDaysOfWeek = "Thursday"
const ConnectorListResponseInterruptWindowDaysOfWeekFriday ConnectorListResponseInterruptWindowDaysOfWeek = "Friday"
const ConnectorListResponseInterruptWindowDaysOfWeekSaturday ConnectorListResponseInterruptWindowDaysOfWeek = "Saturday"
InterruptWindowDurationHours float64
maximum24
minimum1
InterruptWindowEmbargoDates []string

List of dates (YYYY-MM-DD) when upgrades are blocked.

InterruptWindowHourOfDay float64
LastUpdated string
Notes string
Timezone string
Device ConnectorListResponseDeviceoptional
ID string
SerialNumber stringoptional
LastHeartbeat stringoptional
LastSeenVersion stringoptional
LicenseKey stringoptional

List Connectors

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/magic_transit"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.MagicTransit.Connectors.List(context.TODO(), magic_transit.ConnectorListParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": [
    {
      "id": "id",
      "activated": true,
      "interrupt_window_days_of_week": [
        "Sunday"
      ],
      "interrupt_window_duration_hours": 1,
      "interrupt_window_embargo_dates": [
        "string"
      ],
      "interrupt_window_hour_of_day": 0,
      "last_updated": "last_updated",
      "notes": "notes",
      "timezone": "timezone",
      "device": {
        "id": "id",
        "serial_number": "serial_number"
      },
      "last_heartbeat": "last_heartbeat",
      "last_seen_version": "last_seen_version",
      "license_key": "license_key"
    }
  ],
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": [
    {
      "id": "id",
      "activated": true,
      "interrupt_window_days_of_week": [
        "Sunday"
      ],
      "interrupt_window_duration_hours": 1,
      "interrupt_window_embargo_dates": [
        "string"
      ],
      "interrupt_window_hour_of_day": 0,
      "last_updated": "last_updated",
      "notes": "notes",
      "timezone": "timezone",
      "device": {
        "id": "id",
        "serial_number": "serial_number"
      },
      "last_heartbeat": "last_heartbeat",
      "last_seen_version": "last_seen_version",
      "license_key": "license_key"
    }
  ],
  "success": true
}