Integration Module¶
This section documents the integration components of the Nextmv Cloud API.
integration
¶
Integration module for interacting with Nextmv Cloud integrations.
This module provides functionality to interact with integrations in Nextmv Cloud, including integration management.
| CLASS | DESCRIPTION |
|---|---|
IntegrationType |
Enum representing the type of an integration. |
IntegrationProvider |
Enum representing the provider of an integration. |
Integration |
Class representing an integration in Nextmv Cloud. |
| FUNCTION | DESCRIPTION |
|---|---|
list_integrations |
Function to list all integrations in Nextmv Cloud. |
Integration
¶
Bases: BaseModel
Represents an integration in Nextmv Cloud. An integration allows Nextmv Cloud to communicate with external systems or services.
You can import the Integration class directly from cloud:
You can use the Integration.get class method to retrieve an existing
integration from Nextmv Cloud, to ensure that all fields are properly
populated.
| PARAMETER | DESCRIPTION |
|---|---|
|
The unique identifier of the integration.
TYPE:
|
|
Client to use for interacting with the Nextmv Cloud API.
TYPE:
|
|
The name of the integration.
TYPE:
|
|
An optional description of the integration.
TYPE:
|
|
Indicates whether the integration is global (available to all applications in the account).
TYPE:
|
|
List of application IDs that have access to this integration.
TYPE:
|
|
The type of the integration (runtime or data).
TYPE:
|
|
List of execution types supported by the integration.
TYPE:
|
|
The provider of the integration.
TYPE:
|
|
Configuration specific to the integration provider.
TYPE:
|
|
The timestamp when the integration was created.
TYPE:
|
|
The timestamp when the integration was last updated.
TYPE:
|
application_ids
class-attribute
instance-attribute
¶
List of application IDs that have access to this integration.
client
class-attribute
instance-attribute
¶
Client to use for interacting with the Nextmv Cloud API.
created_at
class-attribute
instance-attribute
¶
The timestamp when the integration was created.
delete
¶
Deletes the integration from Nextmv Cloud.
| RAISES | DESCRIPTION |
|---|---|
HTTPError
|
If the response status code is not 2xx. |
Examples:
>>> from nextmv.cloud import Client, Integration
>>> client = Client(api_key="your_api_key")
>>> integration = Integration.get(client=client, integration_id="your_integration_id")
>>> integration.delete()
Source code in nextmv/nextmv/cloud/integration.py
description
class-attribute
instance-attribute
¶
An optional description of the integration.
endpoint
class-attribute
instance-attribute
¶
Base endpoint for the integration.
exec_types
class-attribute
instance-attribute
¶
List of execution types supported by the integration.
get
classmethod
¶
get(client: Client, integration_id: str) -> Integration
Retrieve an existing integration from Nextmv Cloud.
This method should be used for validating that the integration exists,
and not rely simply on instantiating the Integration class. Using
this method ensures that all the fields of the Integration class are
properly populated.
| PARAMETER | DESCRIPTION |
|---|---|
|
Client to use for interacting with the Nextmv Cloud API.
TYPE:
|
|
The unique identifier of the integration to retrieve.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Integration
|
The retrieved integration instance. |
| RAISES | DESCRIPTION |
|---|---|
HTTPError
|
If the response status code is not 2xx. |
Examples:
>>> from nextmv.cloud import Client, Integration
>>> client = Client(api_key="your_api_key")
>>> integration = Integration.get(client=client, integration_id="your_integration_id")
>>> print(integration.to_dict())
Source code in nextmv/nextmv/cloud/integration.py
integration_id
class-attribute
instance-attribute
¶
integration_id: str = Field(
serialization_alias="id",
validation_alias=AliasChoices("id", "integration_id"),
)
The unique identifier of the integration.
integration_type
class-attribute
instance-attribute
¶
integration_type: IntegrationType | None = Field(
serialization_alias="type",
validation_alias=AliasChoices(
"type", "integration_type"
),
default=None,
)
The type of the integration (runtime or data).
is_global
class-attribute
instance-attribute
¶
is_global: bool = Field(
serialization_alias="global",
validation_alias=AliasChoices("global", "is_global"),
default=False,
)
Indicates whether the integration is global (available to all applications in the account).
model_post_init
¶
new
classmethod
¶
new(
client: Client,
name: str,
integration_type: IntegrationType | str,
exec_types: list[ManifestType | str],
provider: IntegrationProvider | str,
provider_config: dict[str, Any],
integration_id: str | None = None,
description: str | None = None,
is_global: bool = False,
application_ids: list[str] | None = None,
exist_ok: bool = False,
) -> Integration
Create a new integration directly in Nextmv Cloud.
| PARAMETER | DESCRIPTION |
|---|---|
|
Client to use for interacting with the Nextmv Cloud API.
TYPE:
|
|
The name of the integration.
TYPE:
|
|
The type of the integration. Please refer to the
TYPE:
|
|
List of execution types supported by the integration. Please refer
to the
TYPE:
|
|
The provider of the integration. Please refer to the
TYPE:
|
|
Configuration specific to the integration provider.
TYPE:
|
|
The unique identifier of the integration. If not provided, it will be generated automatically.
TYPE:
|
|
An optional description of the integration.
TYPE:
|
|
Indicates whether the integration is global (available to all applications in the account). Default is False.
TYPE:
|
|
List of application IDs that have access to this integration.
TYPE:
|
|
If True and an integration with the same ID already exists, return the existing integration instead of creating a new one.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Integration
|
The created integration instance. |
| RAISES | DESCRIPTION |
|---|---|
HTTPError
|
If the response status code is not 2xx. |
ValueError
|
If both |
Examples:
>>> from nextmv.cloud import Client, Integration, IntegrationType, IntegrationProvider, ManifestType
>>> client = Client(api_key="your_api_key")
>>> integration = Integration.new(
... client=client,
... name="my_integration",
... integration_type=IntegrationType.RUNTIME,
... exec_types=[ManifestType.PYTHON],
... provider=IntegrationProvider.DBX,
... provider_config={"config_key": "config_value"},
... )
>>> print(integration.to_dict())
Source code in nextmv/nextmv/cloud/integration.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | |
provider
class-attribute
instance-attribute
¶
provider: IntegrationProvider | None = None
The provider of the integration.
provider_config
class-attribute
instance-attribute
¶
Configuration specific to the integration provider.
update
¶
update(
name: str | None = None,
integration_type: IntegrationType | str | None = None,
exec_types: list[ManifestType | str] | None = None,
provider: IntegrationProvider | str | None = None,
provider_config: dict[str, Any] | None = None,
description: str | None = None,
is_global: bool | None = None,
application_ids: list[str] | None = None,
) -> Integration
Updates the integration in Nextmv Cloud.
| PARAMETER | DESCRIPTION |
|---|---|
|
The new name of the integration.
TYPE:
|
|
The new type of the integration. Please refer to the
TYPE:
|
|
New list of execution types supported by the integration. Please refer
to the
TYPE:
|
|
The new provider of the integration. Please refer to the
TYPE:
|
|
New configuration specific to the integration provider.
TYPE:
|
|
The new description of the integration.
TYPE:
|
|
Indicates whether the integration is global (available to all applications in the account). If not provided, the current value is preserved.
TYPE:
|
|
New list of application IDs that have access to this integration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Integration
|
The updated integration instance. |
| RAISES | DESCRIPTION |
|---|---|
HTTPError
|
If the response status code is not 2xx. |
Examples:
>>> from nextmv.cloud import Client, Integration
>>> client = Client(api_key="your_api_key")
>>> integration = Integration.get(client=client, integration_id="your_integration_id")
>>> updated_integration = integration.update(name="new_name")
>>> print(updated_integration.to_dict())
Source code in nextmv/nextmv/cloud/integration.py
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | |
updated_at
class-attribute
instance-attribute
¶
The timestamp when the integration was last updated.
IntegrationProvider
¶
IntegrationType
¶
list_integrations
¶
list_integrations(client: Client) -> list[Integration]
List all integrations in Nextmv Cloud for the given client.
You can import the list_integrations method directly from cloud:
| PARAMETER | DESCRIPTION |
|---|---|
|
Client to use for interacting with the Nextmv Cloud API.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[Integration]
|
List of integrations. |
| RAISES | DESCRIPTION |
|---|---|
HTTPError
|
If the response status code is not 2xx. |
Examples:
>>> from nextmv.cloud import Client, list_integrations
>>> client = Client(api_key="your_api_key")
>>> integrations = list_integrations(client=client)
>>> for integration in integrations:
... print(integration.to_dict())