Skip to content

Version Module

This section documents the version components of the Nextmv Cloud API.

version

Manages application versions within the Nextmv Cloud API.

This module provides data models for representing application versions, their executables, and associated requirements. These models are used for interacting with version-related endpoints of the Nextmv Cloud API, allowing users to define, retrieve, and manage different versions of their decision applications.

CLASS DESCRIPTION
VersionExecutableRequirements

Defines the requirements for a version's executable, such as type and runtime.

VersionExecutable

Represents the executable artifact for a specific application version.

Version

Represents a version of an application, linking to its executable and metadata.

Version

Bases: BaseModel

A version of an application representing a code artifact or a compiled binary.

You can import the Version class directly from cloud:

from nextmv.cloud import Version

This class encapsulates all details of a specific version of an application, including its metadata, associated executable, and timestamps.

PARAMETER DESCRIPTION

id

Unique identifier for the version.

TYPE: str

application_id

Identifier of the application to which this version belongs.

TYPE: str

name

User-defined name for the version (e.g., "v1.0.0", "feature-branch-build").

TYPE: str

description

A more detailed description of the version and its changes.

TYPE: str

executable

The executable artifact associated with this version.

TYPE: VersionExecutable

created_at

Timestamp indicating when the version was created.

TYPE: datetime

updated_at

Timestamp indicating when the version was last updated.

TYPE: datetime

Examples:

>>> from datetime import datetime
>>> reqs = VersionExecutableRequirements(executable_type="binary", runtime="java11")
>>> exe = VersionExecutable(
...     id="exec-abc",
...     user_email="[email protected]",
...     uploaded_at=datetime.now(),
...     requirements=reqs
... )
>>> version_info = Version(
...     id="ver-xyz",
...     application_id="app-123",
...     name="Initial Release",
...     description="First stable release of the model.",
...     executable=exe,
...     created_at=datetime.now(),
...     updated_at=datetime.now()
... )
>>> print(version_info.name)
Initial Release

application_id instance-attribute

application_id: str

ID of the application that this is a version of.

created_at instance-attribute

created_at: datetime

Creation time of the version.

description instance-attribute

description: str

Description of the version.

executable instance-attribute

executable: VersionExecutable

Executable for the version.

id instance-attribute

id: str

ID of the version.

name instance-attribute

name: str

Name of the version.

updated_at instance-attribute

updated_at: datetime

Last update time of the version.

VersionExecutable

Bases: BaseModel

Executable for a version.

You can import the VersionExecutable class directly from cloud:

from nextmv.cloud import VersionExecutable

This class holds information about the actual executable file or image associated with an application version, including who uploaded it and when.

PARAMETER DESCRIPTION

id

Unique identifier for the version executable.

TYPE: str

user_email

Email of the user who uploaded the executable.

TYPE: str

uploaded_at

Timestamp indicating when the executable was uploaded.

TYPE: datetime

requirements

The specific requirements for this executable.

TYPE: VersionExecutableRequirements

Examples:

>>> from datetime import datetime
>>> reqs = VersionExecutableRequirements(executable_type="docker", runtime="custom")
>>> executable = VersionExecutable(
...     id="exec-123",
...     user_email="[email protected]",
...     uploaded_at=datetime.now(),
...     requirements=reqs
... )
>>> print(executable.id)
exec-123

id instance-attribute

id: str

ID of the version.

requirements instance-attribute

Requirements for the executable.

uploaded_at instance-attribute

uploaded_at: datetime

Time the executable was uploaded.

user_email instance-attribute

user_email: str

Email of the user who uploaded the executable.

VersionExecutableRequirements

Bases: BaseModel

Requirements for a version executable.

You can import the VersionExecutableRequirements class directly from cloud:

from nextmv.cloud import VersionExecutableRequirements

These requirements specify the environment and type of executable needed to run a particular version of an application.

PARAMETER DESCRIPTION

executable_type

The type of the executable (e.g., "binary", "docker").

TYPE: str

runtime

The runtime environment for the executable (e.g., "go", "python").

TYPE: str

Examples:

>>> requirements = VersionExecutableRequirements(
...     executable_type="binary",
...     runtime="go1.x"
... )
>>> print(requirements.executable_type)
binary

executable_type instance-attribute

executable_type: str

Type of the executable.

runtime instance-attribute

runtime: str

Runtime for the executable.