Create a new dataset
client.ZeroTrust.DLP.Datasets.New(ctx, params) (*DatasetCreation, error)
POST/accounts/{account_id}/dlp/datasets
Creates a new DLP (Data Loss Prevention) dataset for storing custom detection patterns. Datasets can contain exact match data, word lists, or EDM (Exact Data Match) configurations.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Create a new dataset
package main
import (
"context"
"fmt"
"github.com/stainless-sdks/cloudflare-go"
"github.com/stainless-sdks/cloudflare-go/option"
"github.com/stainless-sdks/cloudflare-go/zero_trust"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
datasetCreation, err := client.ZeroTrust.DLP.Datasets.New(context.TODO(), zero_trust.DLPDatasetNewParams{
AccountID: cloudflare.F("account_id"),
Name: cloudflare.F("name"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", datasetCreation.Dataset)
}
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"dataset": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"columns": [
{
"entry_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"header_name": "header_name",
"num_cells": 0,
"upload_status": "empty"
}
],
"created_at": "2019-12-27T18:11:19.117Z",
"encoding_version": 0,
"name": "name",
"num_cells": 0,
"secret": true,
"status": "empty",
"updated_at": "2019-12-27T18:11:19.117Z",
"uploads": [
{
"num_cells": 0,
"status": "empty",
"version": 0
}
],
"case_sensitive": true,
"description": "description"
},
"encoding_version": 0,
"max_cells": 0,
"version": 0,
"secret": "secret"
}
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"dataset": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"columns": [
{
"entry_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"header_name": "header_name",
"num_cells": 0,
"upload_status": "empty"
}
],
"created_at": "2019-12-27T18:11:19.117Z",
"encoding_version": 0,
"name": "name",
"num_cells": 0,
"secret": true,
"status": "empty",
"updated_at": "2019-12-27T18:11:19.117Z",
"uploads": [
{
"num_cells": 0,
"status": "empty",
"version": 0
}
],
"case_sensitive": true,
"description": "description"
},
"encoding_version": 0,
"max_cells": 0,
"version": 0,
"secret": "secret"
}
}