Skip to content
Start here

Check source connectivity

client.R2.SuperSlurper.ConnectivityPrecheck.Source(ctx, params) (*SuperSlurperConnectivityPrecheckSourceResponse, error)
PUT/accounts/{account_id}/slurper/source/connectivity-precheck

Check whether tokens are valid against the source bucket

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
ParametersExpand Collapse
params SuperSlurperConnectivityPrecheckSourceParams
AccountID param.Field[string]

Path param

Bucket param.Field[string]

Body param

AccessKeyID string
SecretAccessKey string
const SuperSlurperConnectivityPrecheckSourceParamsR2SlurperS3SourceSchemaVendorS3 SuperSlurperConnectivityPrecheckSourceParamsR2SlurperS3SourceSchemaVendor = "s3"
Endpoint param.Field[string]Optional

Body param: Custom S3-compatible endpoint that must use https://.

formaturi
Keys param.Field[[]string]Optional

Body param

PathPrefix param.Field[string]Optional

Body param

Region param.Field[string]Optional

Body param

ReturnsExpand Collapse
type SuperSlurperConnectivityPrecheckSourceResponse struct{…}
ConnectivityStatus SuperSlurperConnectivityPrecheckSourceResponseConnectivityStatusOptional
One of the following:
const SuperSlurperConnectivityPrecheckSourceResponseConnectivityStatusSuccess SuperSlurperConnectivityPrecheckSourceResponseConnectivityStatus = "success"
const SuperSlurperConnectivityPrecheckSourceResponseConnectivityStatusError SuperSlurperConnectivityPrecheckSourceResponseConnectivityStatus = "error"

Check source connectivity

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.R2.SuperSlurper.ConnectivityPrecheck.Source(context.TODO(), r2.SuperSlurperConnectivityPrecheckSourceParams{
    AccountID: cloudflare.F("account_id"),
    Body: r2.SuperSlurperConnectivityPrecheckSourceParamsBodyR2SlurperS3SourceSchema{
      Bucket: cloudflare.F("bucket"),
      Secret: cloudflare.F(r2.SuperSlurperConnectivityPrecheckSourceParamsBodyR2SlurperS3SourceSchemaSecret{
        AccessKeyID: cloudflare.F("accessKeyId"),
        SecretAccessKey: cloudflare.F("secretAccessKey"),
      }),
      Vendor: cloudflare.F(r2.SuperSlurperConnectivityPrecheckSourceParamsBodyR2SlurperS3SourceSchemaVendorS3),
    },
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.ConnectivityStatus)
}
{
  "errors": [
    {
      "code": 7003,
      "message": "No route for the URI",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": {
    "connectivityStatus": "success"
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 7003,
      "message": "No route for the URI",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": {
    "connectivityStatus": "success"
  },
  "success": true
}