Instance Module¶
This section documents the instance components of the Nextmv Cloud API.
instance
¶
Classes for working with Nextmv Cloud Instances.
This module provides classes for interacting with instances in Nextmv Cloud. It defines the core data structures for both instance configuration and the instance itself.
CLASS | DESCRIPTION |
---|---|
InstanceConfiguration |
Configuration settings for a Nextmv Cloud instance. |
Instance |
Representation of a Nextmv Cloud instance tied to an application version. |
Instance
¶
Bases: BaseModel
An instance of an application tied to a version with configuration.
You can import the Instance
class directly from cloud
:
A Nextmv Cloud instance represents a deployable configuration of an application version. Instances have their own unique identity and can be used to run jobs with specific configurations.
PARAMETER | DESCRIPTION |
---|---|
|
The unique identifier of the instance.
TYPE:
|
|
ID of the application that this instance belongs to.
TYPE:
|
|
ID of the application version this instance uses.
TYPE:
|
|
Human-readable name of the instance.
TYPE:
|
|
Detailed description of the instance.
TYPE:
|
|
Configuration settings for this instance.
TYPE:
|
|
Whether the instance is locked for modifications.
TYPE:
|
|
Timestamp when the instance was created.
TYPE:
|
|
Timestamp when the instance was last updated.
TYPE:
|
Examples:
>>> from nextmv.cloud import Instance, InstanceConfiguration
>>> instance = Instance(
... id="inst_1234567890",
... application_id="app_1234567890",
... version_id="ver_1234567890",
... name="Production Routing Instance",
... description="Instance for daily production routing jobs",
... configuration=InstanceConfiguration(execution_class="small"),
... locked=False,
... created_at=datetime.now(),
... updated_at=datetime.now()
... )
application_id
instance-attribute
¶
ID of the application that this is an instance of.
configuration
instance-attribute
¶
configuration: InstanceConfiguration
Configuration for the instance.
InstanceConfiguration
¶
Bases: BaseModel
Configuration for a Nextmv Cloud instance.
You can import the InstanceConfiguration
class directly from cloud
:
This class represents the configuration settings that can be applied to a Nextmv Cloud instance, including execution class, options, and secrets.
PARAMETER | DESCRIPTION |
---|---|
|
The execution class for the instance, which determines compute resources.
TYPE:
|
|
Runtime options/parameters for the application.
TYPE:
|
|
ID of the secrets collection to use with this instance.
TYPE:
|
Examples:
>>> config = InstanceConfiguration(
... execution_class="small",
... options={"max_runtime": 30},
... secrets_collection_id="sc_1234567890"
... )