tm_create_variables_set
Creates a variables set from CSV content to replace macro placeholders in request profiles, enabling parameterized load testing.
Instructions
Create a new variables set from inline CSV content.
csv_content is the full CSV as a string — header row plus
data rows. The server parses + validates at upload time and
rejects malformed or oversized inputs with a typed
:class:ToolError.
The header row's column names define which $$macro$$
placeholders this set substitutes when attached to a profile.
Example::
userId,token,weight
u-1001,tk-abc,5
u-1002,tk-def,1Attached to a profile whose URL is
https://api.example.com/users/$$userId$$ and which sends
header Authorization: Bearer $$token$$, each request:
Picks a row (weighted random in
ROWmode — row 1 with 5/6 probability, row 2 with 1/6; sequential inSEQUENTIALmode).Substitutes the row's
userIdandtokencolumns into the matching placeholders.Sends the resulting request.
mode defaults to "ROW" (weighted per-row sampling).
Other accepted values: "COLUMN" (per-column independent
sampling) and "SEQUENTIAL" (ordered walk, for captured-
traffic replay). ROW mode REQUIRES a weight column
(case-insensitive header); COLUMN accepts an optional shared
weight column AND per-column {col}_weight overrides;
SEQUENTIAL ignores weights. See the helper docstring in
_validate_variables_set_mode for the full mode contract.
Returns the created set's metadata (id, name, mode,
macroColumns, weightColumn, rowCount, byteSize). The AI host
typically follows with attaching the new set to a profile —
that's handled via tm_update_profile on the profile
side (variables-set attachment is on the profile, not the
set).
Quota: each account has a per-user variables-set quota.
A 400 with Variables-set quota reached means delete an
existing set first.
Duplicate names rejected (strict-uniqueness semantics).
Per-user, names must be unique — a second create call with
a name that already exists 400s with A variables set named 'X' already exists. The endpoint deliberately doesn't
auto-suffix (unlike the capture-import path which does
(2), (3), …). Pick a fresh name, or
:func:tm_rename_variables_set / :func:tm_delete_variables_set
the existing one before re-creating.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| csv_content | Yes | ||
| mode | No | ROW |