Honeytokens
UpdateHoneytoken
Update a honeytoken
Updates a honeytoken's relation or action.
Usage
result, err := client.Honeytokens.UpdateHoneytoken(ctx, "prj_xxx", "hnt_xxx", pgbeam.HoneytokenInput{
RelationName: "customer_ssns",
Action: "...",
})Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ctx | context.Context | Yes | Request context |
| projectID | string | Yes | Unique project identifier (prefixed, e.g. prj_xxx). |
| honeytokenID | string | Yes | Unique honeytoken identifier (prefixed, e.g. hnt_xxx). |
| req | pgbeam.HoneytokenInput | Yes | Request body |
| req.SchemaName | *string | No | Optional schema. Null or empty matches the unqualified/public form. |
| req.RelationName | string | Yes | Relation (table or view) name of the decoy. |
| req.Action | string | Yes | Response when the honeytoken is tripped. |
Response
(*pgbeam.Honeytoken, error): updated honeytoken.
Example
import pgbeam "go.pgbeam.com/sdk"
client := pgbeam.NewClient(&pgbeam.ClientOptions{
APIKey: "pgb_your_api_key",
})
result, err := client.Honeytokens.UpdateHoneytoken(ctx, "prj_xxx", "hnt_xxx", pgbeam.HoneytokenInput{
SchemaName: "public",
RelationName: "customer_ssns",
Action: "...",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result)Errors
| Status | Description |
|---|---|
| 400 | Invalid request parameters. |
| 401 | Missing or invalid authentication. |
| 403 | Operation not allowed by current plan limits. |
| 404 | Resource not found. |