Skip to content
Start here

List Snapshots

client.MagicTransit.Connectors.Snapshots.List(ctx, connectorID, params) (*ConnectorSnapshotListResponse, error)
GET/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/snapshots

List Snapshots

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
connectorID string
params ConnectorSnapshotListParams
AccountID param.Field[string]

Path param: Account identifier

maxLength32
From param.Field[float64]

Query param

To param.Field[float64]

Query param

Cursor param.Field[string]Optional

Query param

Limit param.Field[float64]Optional

Query param

ReturnsExpand Collapse
type ConnectorSnapshotListResponse struct{…}
Count float64
Items []ConnectorSnapshotListResponseItem
A float64

Time the Snapshot was collected (seconds since the Unix epoch)

T float64

Time the Snapshot was recorded (seconds since the Unix epoch)

Cursor stringOptional

List Snapshots

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  snapshots, err := client.MagicTransit.Connectors.Snapshots.List(
    context.TODO(),
    "connector_id",
    magic_transit.ConnectorSnapshotListParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
      From: cloudflare.F(0.000000),
      To: cloudflare.F(0.000000),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", snapshots.Count)
}
{
  "result": {
    "count": 0,
    "items": [
      {
        "a": 0,
        "t": 0
      }
    ],
    "cursor": "cursor"
  },
  "success": true,
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ]
}
Returns Examples
{
  "result": {
    "count": 0,
    "items": [
      {
        "a": 0,
        "t": 0
      }
    ],
    "cursor": "cursor"
  },
  "success": true,
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ]
}