Skip to content
Start here

Updates an existing dataset

client.CloudforceOne.ThreatEvents.Datasets.Edit(ctx, datasetID, params) (*ThreatEventDatasetEditResponse, error)
PATCH/accounts/{account_id}/cloudforce-one/events/dataset/{dataset_id}

Updates an existing 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 Write
ParametersExpand Collapse
datasetID string

Dataset ID.

formatuuid
params ThreatEventDatasetEditParams
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 ThreatEventDatasetEditResponse struct{…}
IsPublic bool
Name string
UUID string
DeletedAt stringOptional

Updates an existing 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"),
  )
  response, err := client.CloudforceOne.ThreatEvents.Datasets.Edit(
    context.TODO(),
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    cloudforce_one.ThreatEventDatasetEditParams{
      AccountID: cloudflare.F("account_id"),
      IsPublic: cloudflare.F(true),
      Name: cloudflare.F("x"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.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"
}