corestack_ enterprise_ variable_ set
Set a CoreStack Enterprise build variable.
When to use it
Create, change, clear or rename one of a CoreStack Enterprise environment's build variables: the Environment Variables
editor's Save. Every deployment of the environment receives it as CF_<name>.
valueleft out keeps the stored value (a rename alone).valueas""or null clears it: the variable stays, with no value.- Any other string sets it. A new variable needs one.
rename_torenames the variable and keeps its value, unlessvaluechanges it too, so a rename never needs the value shown first. The new name follows the rules for a new variable's name and must be free. A rename that only changes the case (api_tokentoAPI_TOKEN) is allowed.
The name rules below apply to a name being created and to rename_to. A variable the environment already has is found by
the name it was saved with, so one saved before today's rules (with a hyphen, say) can still be changed, cleared, or
renamed to a name that follows them.
The value is write-only: the answer, {variable: {name,, carries only the mask, and the
value is never shown again here. corestack_enterprise_variable_reveal shows it. For a CoreStack or CoreCluster site, use
corestack_deployments_variable_set by site_id instead.
The public API's PUT / does the same, with the same checks and
refusals in the same words.
Ask for it
Using the Corefinity MCP server, call corestack_enterprise_variable_set with enterprise_env_id 1530, name API_URL, value https://api.example.com. (Set a CoreStack Enterprise build variable.) Tell me what it returned.Inputs
A CoreStack Enterprise environment's id; for CoreStack or CoreCluster use the corestack_deployment_* tools. At least 1.
Without the CF_ prefix. A new name: letters, digits and underscores, starting with a letter or an underscore, at most 64 characters. An existing variable: its name as corestack_enterprise_variables_list gives it.
The variable's new name.
At most 2,048 characters, with no line breaks, control or invisible formatting characters.
Example call
{
"name": "corestack_enterprise_variable_set",
"arguments": {
"enterprise_env_id": 1530,
"name": "API_URL",
"value": "https://api.example.com"
}
}If it is refused
| Reason | What to do |
|---|---|
variable_invalid | A new name or rename_to that breaks the rule above or starts with CF_ ("Use letters, digits and underscores, starting with a letter or underscore, without the CF_ prefix (CoreStack adds it)."); a value that is too long, holds a line break, a control or an invisible formatting character, or a new variable with no value ("Use at most 2,048 characters, with no line breaks, control or invisible formatting characters."). |
variable_reserved | A new name (or rename_to) CoreStack sets itself, such as DOMAIN ("CF_DOMAIN is set by CoreStack. Choose another name."). An existing variable of such a name can still be changed or deleted. |
variable_tool_credential | A new name (or rename_to) of a build tool's credential (COMPOSER_AUTH, NPM_TOKEN, NODE_AUTH_TOKEN, YARN_NPM_AUTH_TOKEN, GITHUB_TOKEN, GITLAB_TOKEN, BITBUCKET_TOKEN, in any case): builds see it as CF_<name>, so the tool would never read it. |
too_many_variables | The environment already holds the most variables it can (limit in the list). |
exists | rename_to names another variable the environment already has ("This environment already has a variable with that name."). Choose another name, or delete that variable first. |
invalid_arguments | A CoreStack or CoreCluster environment; use the corestack_deployments_* tools by site_id. |
tenant_mismatch | The environment does not exist, is not the person's, or is hidden from them; and a rename of a variable the environment does not have. Both answers are the same, so read corestack_enterprise_variables_list to tell them apart. |
pin_refused | The grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it. |
scope_required | The token lacks a scope this call needs. Open the link in the answer to add it, then call again. |
rate_limited | Too many calls. Wait for the number of seconds the answer names. |
temporarily_unavailable | The Control Panel could not answer just now. Nothing was started; try again shortly. |
internal_error | Something went wrong on our side. Quote the trace id to support. |