Environment
Datalayer Core / Environment
Class: Environment
Defined in: tech/datalayer/core/src/client/models/Environment.ts:44
Environment domain model that wraps API responses with convenient methods. Provides information about available computational environments.
Example
const environments = await sdk.listEnvironments();
const aiEnv = environments.find(env => env.name === 'ai-env');
console.log(aiEnv.title); // "AI Environment"
Constructors
Constructor
new Environment(
data
,_sdk
):Environment
Defined in: tech/datalayer/core/src/client/models/Environment.ts:54
Create an Environment instance.
Parameters
data
Environment
Environment data from API
_sdk
SDK instance (not currently used but kept for consistency)
Returns
Environment
Properties
_data
_data:
Environment
Defined in: tech/datalayer/core/src/client/models/Environment.ts:46
Internal
Accessors
burningRate
Get Signature
get burningRate():
number
Defined in: tech/datalayer/core/src/client/models/Environment.ts:74
Credits consumed per hour for this environment.
Returns
number
description
Get Signature
get description():
string
Defined in: tech/datalayer/core/src/client/models/Environment.ts:84
Clean description without HTML tags.
Returns
string
name
Get Signature
get name():
string
Defined in: tech/datalayer/core/src/client/models/Environment.ts:69
Unique name identifier for the environment (e.g., 'ai-env', 'python-cpu-env').
Returns
string
richDescription
Get Signature
get richDescription():
string
Defined in: tech/datalayer/core/src/client/models/Environment.ts:79
Rich description of the environment (contains HTML markup).
Returns
string
title
Get Signature
get title():
string
Defined in: tech/datalayer/core/src/client/models/Environment.ts:64
Human-readable title for the environment (e.g., 'AI Environment', 'Python CPU Environment').
Returns
string
Methods
rawData()
rawData():
Environment
Defined in: tech/datalayer/core/src/client/models/Environment.ts:116
Get the raw environment data exactly as received from the API. This preserves the original snake_case naming from the API response.
Returns
Environment
Raw environment data from API
toJSON()
toJSON():
EnvironmentJSON
Defined in: tech/datalayer/core/src/client/models/Environment.ts:100
Get environment data in camelCase format. Returns only the core fields that consumers need. This provides a stable interface regardless of API changes.
Returns
Core environment data with camelCase properties
toString()
toString():
string
Defined in: tech/datalayer/core/src/client/models/Environment.ts:121
String representation of the environment.
Returns
string