def list_all(
project,
environment,
limit: nil,
offset: nil,
product: nil,
timeout: nil
)def list_all: (
String project,
String environment,
?limit: Integer?,
?offset: Integer?,
?product: (String | Symbol)?,
?timeout: seconds?
) -> Array[variable_resource]Walks every page and returns a single array of the live variables in an environment. Requests run one after another until hasMore turns false, so a large environment costs one round trip per 100 variables and the entire set is held in memory at once.
limit: is the page size here, not a total cap, and it is clamped to 100. offset: sets where the walk starts, so a non-zero value silently drops the variables before it.
There is no partial result. An error midway through the walk discards the pages already fetched, so budget for the whole thing succeeding or nothing.
Example
require "envless/sdk"
variables = Envless.variables.list_all("api", "production")
puts variables.sizeParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project | String | Yes | Project slug the environment belongs to. |
environment | String | Yes | Environment slug to read variables from. |
limit: | Integer | No | Page size for each underlying request, clamped to 100. |
offset: | Integer | No | Offset the walk starts from, defaults to 0. |
product: | String | Symbol | No | Product slug, needed when the project slug is not unique in the workspace. |
timeout: | Integer | Float | Rational | No | Seconds each attempt of this call may take, redirects and the response body included, before it raises Envless::NetworkError with timeout? set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
Array[variable_resource] with every live variable in the environment, values still ciphertext.
Reads the variables collection. list returns one page as an Envless::Page with items and pagination, list_all collects every page into an array, and iterate yields one item at a time to a block, fetching the next page only when it gets there. Without a block, iterate returns an Enumerator.
Worth knowing
- Use this to build the
baselineforapply, since the drift check needs every live variable and not just a page.
Required scopes
variables:read
Underlying endpoint
GET /projects/{slug}/environments/{environmentSlug}/variables
Request and response schema, every error code, and a live playground.
In TypeScript
envless.variables.listAll()
The same method in @goenvless/sdk, with the same request, retries and errors.