steps.api.cloud_objects.cloud_platform
Classes
Platform class representing a worker in the cloud system. |
Module Contents
- class steps.api.cloud_objects.cloud_platform.Platform(name: str = '', type: str = 'simulator', platform_id: str = None, worker_id: str = str(uuid4()), specs: dict[str] = {'available_commands': ['probs']}, **kwargs)[source]
Bases:
steps.api.cloud_objects.cloud_base.ACloudObjectPlatform class representing a worker in the cloud system.
This class handles worker registration, job management, and platform permissions.
- Parameters:
name – Name of the platform
type – Type of platform (default: “simulator”)
platform_id – Platform ID (None for new platforms)
worker_id – Worker ID (defaults to a new UUID)
specs – Platform specifications
kwargs – Additional attributes to set on the platform
- Raises:
AssertionError – If Platform.ADMIN is None or not an admin
- classmethod get_api(context: steps.api.utils.CloudContext) steps.api.utils.Api[source]
- register(context: steps.api.utils.CloudContext, register_dict: dict[str] = None) None[source]
Register this platform in the cloud.
- Parameters:
context – Cloud context for API configuration
register_dict – Dictionary with registration parameters (optional)
- Raises:
RuntimeError – If platform registration fails
- read(context: steps.api.utils.CloudContext) dict[str][source]
Read this platform’s information from the cloud.
- Parameters:
context – Cloud context for API configuration
- Returns:
Dictionary with platform data from response
- Raises:
RuntimeError – If reading platform data fails
- update(context: steps.api.utils.CloudContext, update_dict: dict) None[source]
Update this platform’s information in the cloud.
- Parameters:
context – Cloud context for API configuration
update_dict – Dictionary with fields to update
- Raises:
RuntimeError – If updating platform data fails
- delete(context: steps.api.utils.CloudContext) None[source]
Delete this platform from the cloud.
- Parameters:
context – Cloud context for API configuration
- Raises:
RuntimeError – If deleting the platform fails
- fetch_job(context: steps.api.utils.CloudContext) steps.api.cloud_objects.cloud_job.Job[source]
Fetch a job for this platform to process.
- Parameters:
context – Cloud context for API configuration
- Returns:
Job object for the fetched job
- Raises:
RuntimeError – If fetching a job fails
- assign_user(context: steps.api.utils.CloudContext, user: steps.api.cloud_objects.cloud_user.User) None[source]
- classmethod list_all(context: steps.api.utils.CloudContext) list[Platform][source]
List all platforms in the cloud.
- Parameters:
context – Cloud context for API configuration
- Returns:
List of Platform objects
- Raises:
AssertionError – If ADMIN is not an admin
RuntimeError – If listing platforms fails