Skip to content
Start here

Creates a dataset

client.CloudforceOne.ThreatEvents.Datasets.New(ctx, params) (*ThreatEventDatasetNewResponse, error)
POST/accounts/{account_id}/cloudforce-one/events/dataset/create

Creates a dataset

Security

API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Cloudforce One WriteCloudforce One Read
ParametersExpand Collapse
params ThreatEventDatasetNewParams
AccountID param.Field[string]

Path param: Account ID.

IsPublic param.Field[bool]

Body param: If true, then anyone can search the dataset. If false, then its limited to the account.

Name param.Field[string]

Body param: Used to describe the dataset within the account context.

minLength1
ReturnsExpand Collapse
type ThreatEventDatasetNewResponse struct{…}
IsPublic bool
Name string
UUID string
DeletedAt stringOptional

Creates a dataset

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  dataset, err := client.CloudforceOne.ThreatEvents.Datasets.New(context.TODO(), cloudforce_one.ThreatEventDatasetNewParams{
    AccountID: cloudflare.F("account_id"),
    IsPublic: cloudflare.F(true),
    Name: cloudflare.F("x"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", dataset.UUID)
}
{
  "isPublic": true,
  "name": "friendly dataset name",
  "uuid": "12345678-1234-1234-1234-1234567890ab",
  "deletedAt": "deletedAt"
}
Returns Examples
{
  "isPublic": true,
  "name": "friendly dataset name",
  "uuid": "12345678-1234-1234-1234-1234567890ab",
  "deletedAt": "deletedAt"
}