Skip to content

Shadow module

Reference to the cloud.shadow.py module.

shadow

Classes for working with Nextmv Cloud shadow tests.

This module provides classes for interacting with shadow tests in Nextmv Cloud. It details the core data structures for these types of experiments.

CLASS DESCRIPTION
TestComparison

A structure to define comparison parameters for tests.

StartEvents

A structure to define start events for tests.

TerminationEvents

A structure to define termination events for tests.

ShadowTestMetadata

Metadata for a Nextmv Cloud shadow test.

ShadowTest

A Nextmv Cloud shadow test definition.

TestComparison

Bases: BaseModel

A structure to define comparison parameters for tests.

You can import the TestComparison class directly from cloud:

from nextmv.cloud import TestComparison
PARAMETER DESCRIPTION

baseline_instance_id

ID of the baseline instance for comparison.

TYPE: str

candidate_instance_ids

List of candidate instance IDs to compare against the baseline.

TYPE: list[str]

baseline_instance_id instance-attribute

baseline_instance_id: str

ID of the baseline instance for comparison.

candidate_instance_ids instance-attribute

candidate_instance_ids: list[str]

List of candidate instance IDs to compare against the baseline.

StartEvents

Bases: BaseModel

A structure to define start events for tests.

You can import the StartEvents class directly from cloud:

from nextmv.cloud import StartEvents
PARAMETER DESCRIPTION

time

Scheduled time for the test to start.

TYPE: datetime

time class-attribute instance-attribute

time: datetime | None = None

Scheduled time for the test to start.

TerminationEvents

Bases: BaseModel

A structure to define termination events for tests.

You can import the TerminationEvents class directly from cloud:

from nextmv.cloud import TerminationEvents
PARAMETER DESCRIPTION

time

Scheduled time for the test to terminate.

TYPE: datetime

maximum_runs instance-attribute

maximum_runs: int

Maximum number of runs for the test. Value must be between 1 and 300.

time class-attribute instance-attribute

time: datetime | None = None

Scheduled time for the test to terminate. A zero value means no limit.

model_post_init

model_post_init(__context)
Source code in nextmv-py/nextmv/nextmv/cloud/shadow.py
def model_post_init(self, __context):
    if self.maximum_runs < 1 or self.maximum_runs > 300:
        raise ValueError("maximum_runs must be between 1 and 300")

ShadowTestMetadata

Bases: BaseModel

Metadata for a Nextmv Cloud shadow test.

You can import the ShadowTestMetadata class directly from cloud:

from nextmv.cloud import ShadowTestMetadata
PARAMETER DESCRIPTION

shadow_test_id

The unique identifier of the shadow test.

TYPE: str

name

Name of the shadow test.

TYPE: str

description

Description of the shadow test.

TYPE: str

app_id

ID of the application to which the shadow test belongs.

TYPE: str

created_at

Creation date of the shadow test.

TYPE: datetime

updated_at

Last update date of the shadow test.

TYPE: datetime

status

The current status of the shadow test.

TYPE: ExperimentStatus

shadow_test_id class-attribute instance-attribute

shadow_test_id: str | None = Field(
    serialization_alias="id",
    validation_alias=AliasChoices("id", "shadow_test_id"),
    default=None,
)

The unique identifier of the shadow test.

name class-attribute instance-attribute

name: str | None = None

Name of the shadow test.

description class-attribute instance-attribute

description: str | None = None

Description of the shadow test.

app_id class-attribute instance-attribute

app_id: str | None = None

ID of the application to which the shadow test belongs.

created_at class-attribute instance-attribute

created_at: datetime | None = None

Creation date of the shadow test.

updated_at class-attribute instance-attribute

updated_at: datetime | None = None

Last update date of the shadow test.

status class-attribute instance-attribute

status: ExperimentStatus | None = None

The current status of the shadow test.

ShadowTest

Bases: BaseModel

A Nextmv Cloud shadow test definition.

A shadow test is a type of experiment where runs are executed in parallel to compare different instances.

You can import the ShadowTest class directly from cloud:

from nextmv.cloud import ShadowTest
PARAMETER DESCRIPTION

shadow_test_id

The unique identifier of the shadow test.

TYPE: str

name

Name of the shadow test.

TYPE: str

description

Description of the shadow test.

TYPE: str

app_id

ID of the application to which the shadow test belongs.

TYPE: str

created_at

Creation date of the shadow test.

TYPE: datetime

updated_at

Last update date of the shadow test.

TYPE: datetime

status

The current status of the shadow test.

TYPE: ExperimentStatus

completed_at

Completion date of the shadow test, if applicable.

TYPE: datetime

comparisons

List of test comparisons defined in the shadow test.

TYPE: list[TestComparison]

start_events

Start events for the shadow test.

TYPE: StartEvents

termination_events

Termination events for the shadow test.

TYPE: TerminationEvents

grouped_distributional_summaries

Grouped distributional summaries of the shadow test.

TYPE: list[dict[str, Any]]

runs

List of runs in the shadow test.

TYPE: list[Run]

shadow_test_id class-attribute instance-attribute

shadow_test_id: str | None = Field(
    serialization_alias="id",
    validation_alias=AliasChoices("id", "shadow_test_id"),
    default=None,
)

The unique identifier of the shadow test.

name class-attribute instance-attribute

name: str | None = None

Name of the shadow test.

description class-attribute instance-attribute

description: str | None = None

Description of the shadow test.

app_id class-attribute instance-attribute

app_id: str | None = None

ID of the application to which the shadow test belongs.

created_at class-attribute instance-attribute

created_at: datetime | None = None

Creation date of the shadow test.

updated_at class-attribute instance-attribute

updated_at: datetime | None = None

Last update date of the shadow test.

status class-attribute instance-attribute

status: ExperimentStatus | None = None

The current status of the shadow test.

completed_at class-attribute instance-attribute

completed_at: datetime | None = None

Completion date of the shadow test, if applicable.

comparisons class-attribute instance-attribute

comparisons: list[TestComparison] | None = None

List of test comparisons defined in the shadow test.

start_events class-attribute instance-attribute

start_events: StartEvents | None = None

Start events for the shadow test.

termination_events class-attribute instance-attribute

termination_events: TerminationEvents | None = None

Termination events for the shadow test.

grouped_distributional_summaries class-attribute instance-attribute

grouped_distributional_summaries: (
    list[dict[str, Any]] | None
) = None

Grouped distributional summaries of the shadow test.

runs class-attribute instance-attribute

runs: list[Run] | None = None

List of runs in the shadow test.

StopIntent

Bases: str, Enum

Intent for stopping a shadow test.

You can import the StopIntent class directly from cloud:

from nextmv.cloud import StopIntent
ATTRIBUTE DESCRIPTION
COMPLETE

The test is marked as complete.

TYPE: str

CANCEL

The test is canceled.

TYPE: str

COMPLETE class-attribute instance-attribute

COMPLETE = 'complete'

The test is marked as complete.

CANCEL class-attribute instance-attribute

CANCEL = 'cancel'

The test is canceled.