def list_all(
limit: nil,
offset: nil,
search: nil,
order: nil,
product: nil,
timeout: nil
)def list_all: (
?limit: Integer?,
?offset: Integer?,
?search: (String | Symbol)?,
?order: ("name" | "asc" | "desc")?,
?product: (String | Symbol)?,
?timeout: seconds?
) -> Array[project_resource]Walks every page for you and returns the flattened result. Use it when the workspace is small enough that holding all projects in memory is fine and you would rather not manage offsets.
The trap is limit:, which here sets the page size used while walking, not a cap on how many projects come back. Asking for a limit of 5 still returns everything, just in more round trips. Duplicate slugs across products survive into the array, so continue keying off id.
Example
require "envless/sdk"
projects = Envless.projects.list_all(search: "api")
puts projects.sizeParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
product: | String | Symbol | No | Product slug or product uniqueId to restrict the walk to one product. |
limit: | Integer | No | Page size used while walking, clamped to 100. |
offset: | Integer | No | Row to start the walk from. |
search: | String | Symbol | No | Case insensitive substring match against project name and slug. |
order: | "name" | "asc" | "desc" | No | Defaults to name, which sorts A to Z. Pass asc for oldest first or desc for newest first on createdAt. |
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[project_resource] holding every project the key can reach.
Reads the projects 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
- Page size defaults to the API maximum of 100 and is clamped there, so a larger limit buys nothing.
- Nothing is returned until the final page lands. Prefer
iteratewhen you want to act on rows as they arrive.
Required scopes
projects:read
Underlying endpoint
GET /projects
Request and response schema, every error code, and a live playground.
In TypeScript
envless.projects.listAll()
The same method in @goenvless/sdk, with the same request, retries and errors.