Spotinst Agent

1.1.260 · active · verified Sun Apr 12

The `spotinst-agent` is a Python-based executor designed as a spectrum instance agent. Its primary function is to run remote scripts, collect data, and deploy applications on machines using a polling architecture. It's an active project, with version 1.1.260 released in June 2024, and appears to follow a regular release cadence.

Warnings

Install

Imports

Quickstart

The `spotinst-agent` is primarily installed and deployed as a service, with its behavior configured through YAML files rather than direct Python API calls. The quickstart focuses on installation and a conceptual understanding of its operation. For programmatic interaction with Spotinst services, users should refer to the `spotinst-sdk` or `spotinst-sdk2` libraries.

# Install the agent
pip install spotinst-agent

# The Spotinst agent is typically run as a service or within a container.
# Its configuration is handled via YAML files (e.g., 'agent.yml') and worker configurations.
# Direct Python code interaction for 'spotinst-agent' itself is uncommon.
#
# Example of how you might *start* the agent process (conceptual, actual command depends on deployment):
# This usually involves running a command-line utility or daemonizing a script provided by the package.
# For example, if it had a main entry point:
# python -m spotinst_agent.main --config /path/to/agent.yml
#
# For interacting with Spotinst APIs programmatically, use the Spotinst SDK:
# import os
# from spotinst_sdk import SpotinstClient
# 
# # Authenticate using environment variables (recommended for quickstart)
# # export SPOTINST_TOKEN='YOUR_SPOTINST_API_TOKEN'
# # export SPOTINST_ACCOUNT='YOUR_SPOTINST_ACCOUNT_ID'
# 
# client = SpotinstClient(
#     auth_token=os.environ.get('SPOTINST_TOKEN', 'YOUR_SPOTINST_API_TOKEN'),
#     account_id=os.environ.get('SPOTINST_ACCOUNT', 'YOUR_SPOTINST_ACCOUNT_ID')
# )
# # Example: fetch all Elastigroups (this requires spotinst-sdk, not spotinst-agent)
# # elastigroups = client.get_all_elastigroups()
# # print(elastigroups)

view raw JSON →