nextmv 0.27.0__py3-none-any.whl → 0.28.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nextmv/cloud/instance.py CHANGED
@@ -1,4 +1,16 @@
1
- """This module contains definitions for instances."""
1
+ """Classes for working with Nextmv Cloud Instances.
2
+
3
+ This module provides classes for interacting with instances in Nextmv Cloud.
4
+ It defines the core data structures for both instance configuration and the
5
+ instance itself.
6
+
7
+ Classes
8
+ -------
9
+ InstanceConfiguration
10
+ Configuration settings for a Nextmv Cloud instance.
11
+ Instance
12
+ Representation of a Nextmv Cloud instance tied to an application version.
13
+ """
2
14
 
3
15
  from datetime import datetime
4
16
  from typing import Optional
@@ -7,7 +19,34 @@ from nextmv.base_model import BaseModel
7
19
 
8
20
 
9
21
  class InstanceConfiguration(BaseModel):
10
- """Configuration for an instance."""
22
+ """Configuration for a Nextmv Cloud instance.
23
+
24
+ You can import the `InstanceConfiguration` class directly from `cloud`:
25
+
26
+ ```python
27
+ from nextmv.cloud import InstanceConfiguration
28
+ ```
29
+
30
+ This class represents the configuration settings that can be applied to a
31
+ Nextmv Cloud instance, including execution class, options, and secrets.
32
+
33
+ Parameters
34
+ ----------
35
+ execution_class : str, optional
36
+ The execution class for the instance, which determines compute resources.
37
+ options : dict, optional
38
+ Runtime options/parameters for the application.
39
+ secrets_collection_id : str, optional
40
+ ID of the secrets collection to use with this instance.
41
+
42
+ Examples
43
+ --------
44
+ >>> config = InstanceConfiguration(
45
+ ... execution_class="small",
46
+ ... options={"max_runtime": 30},
47
+ ... secrets_collection_id="sc_1234567890"
48
+ ... )
49
+ """
11
50
 
12
51
  execution_class: Optional[str] = None
13
52
  """Execution class for the instance."""
@@ -18,7 +57,54 @@ class InstanceConfiguration(BaseModel):
18
57
 
19
58
 
20
59
  class Instance(BaseModel):
21
- """A instance of an application tied to a version and further configuration."""
60
+ """An instance of an application tied to a version with configuration.
61
+
62
+ You can import the `Instance` class directly from `cloud`:
63
+
64
+ ```python
65
+ from nextmv.cloud import Instance
66
+ ```
67
+
68
+ A Nextmv Cloud instance represents a deployable configuration of an application
69
+ version. Instances have their own unique identity and can be used to run jobs
70
+ with specific configurations.
71
+
72
+ Parameters
73
+ ----------
74
+ id : str
75
+ The unique identifier of the instance.
76
+ application_id : str
77
+ ID of the application that this instance belongs to.
78
+ version_id : str
79
+ ID of the application version this instance uses.
80
+ name : str
81
+ Human-readable name of the instance.
82
+ description : str
83
+ Detailed description of the instance.
84
+ configuration : InstanceConfiguration
85
+ Configuration settings for this instance.
86
+ locked : bool
87
+ Whether the instance is locked for modifications.
88
+ created_at : datetime
89
+ Timestamp when the instance was created.
90
+ updated_at : datetime
91
+ Timestamp when the instance was last updated.
92
+
93
+ Examples
94
+ --------
95
+ >>> from nextmv.cloud import Instance, InstanceConfiguration
96
+ >>> instance = Instance(
97
+ ... id="inst_1234567890",
98
+ ... application_id="app_1234567890",
99
+ ... version_id="ver_1234567890",
100
+ ... name="Production Routing Instance",
101
+ ... description="Instance for daily production routing jobs",
102
+ ... configuration=InstanceConfiguration(execution_class="small"),
103
+ ... locked=False,
104
+ ... created_at=datetime.now(),
105
+ ... updated_at=datetime.now()
106
+ ... )
107
+ """
22
108
 
23
109
  id: str
24
110
  """ID of the instance."""