v1

latestOpenAPI 3.1.02026-07-13154170539.0 KB
Contexts

Add Logs To Context

Adds existing logs to a context within a project. The logs must already exist in the project and can be specified by their IDs or by log_args criteria. The same logs can be associated with multiple contexts.

The context_name can be provided as a string or as an object with a name field. If the context doesn't exist, it will be created automatically.

If copy=True, new copies of the logs will be created and added to the context. If copy=False (default), the existing logs will be associated with the context.

post/v0/project/{project_name}/contexts/add_logs

Path parameters

project_namestring required

Name of the project to create context in.

Name of the project to create context in.

Request body

context_namestring required

Name of the context to add logs to.

log_idsinteger[] nullable

List of log IDs to add to the context. At least one log ID must be provided.

log_argsobject nullable

Dictionary of arguments (e.g. filter_expr) to select logs by criteria.

copyboolean

If True, a copy of each log is created and then added to the context. If False, the existing log associations are simply used.

Example request

{
  "context_name": "experiment1/trial1",
  "log_ids": [
    123,
    456,
    789
  ],
  "log_args": {
    "filter_expr": "metric > 0.9"
  }
}

Response

Successful Response

{"stackTrail":"paths:/v0/project/{project_name}/contexts/add_logs:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}