vipr_api.web.models package¶
Submodules¶
vipr_api.web.models.plugins module¶
Plugin Management Models for FastAPI endpoints.
- class vipr_api.web.models.plugins.PluginBatchDeleteResponse(*, success: bool, total_operations: int, successful_operations: int, failed_operations: int, results: List[PluginBatchResult], config_updated: bool = False)¶
Bases:
BaseModelResponse model for batch plugin delete endpoint.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- results: List[PluginBatchResult]¶
- class vipr_api.web.models.plugins.PluginBatchOperation(*, plugin_name: str, enabled: bool)¶
Bases:
BaseModelSingle operation in batch toggle request.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.plugins.PluginBatchResult(*, plugin_name: str, success: bool, enabled: bool | None = None, error: str | None = None, files_deleted: ~typing.List[str] = <factory>)¶
Bases:
BaseModelResult for a single plugin operation in batch.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.plugins.PluginBatchToggleResponse(*, success: bool, total_operations: int, successful_operations: int, failed_operations: int, results: List[PluginBatchResult], requires_restart: bool)¶
Bases:
BaseModelResponse model for batch plugin toggle endpoint.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- results: List[PluginBatchResult]¶
- class vipr_api.web.models.plugins.PluginDeleteResponse(*, success: bool, message: str, plugin_name: str, files_deleted: ~typing.List[str] = <factory>, config_updated: bool = False)¶
Bases:
BaseModelResponse model for plugin delete endpoint.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.plugins.PluginListResponse(*, builtin: ~typing.List[~vipr_api.web.models.plugins.PluginStatusModel] = <factory>, runtime: ~typing.List[~vipr_api.web.models.plugins.PluginStatusModel] = <factory>, total_count: int = 0, enabled_count: int = 0, runtime_count: int = 0, builtin_count: int = 0)¶
Bases:
BaseModelResponse model for plugin list endpoint.
- builtin: List[PluginStatusModel]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- runtime: List[PluginStatusModel]¶
- class vipr_api.web.models.plugins.PluginReloadResponse(*, success: bool, message: str, restart_triggered: bool = False, restart_method: str | None = None)¶
Bases:
BaseModelResponse model for plugin reload endpoint.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.plugins.PluginStatus(value)¶
-
Plugin status enumeration.
- DISABLED = 'disabled'¶
- ENABLED = 'enabled'¶
- ERROR = 'error'¶
- class vipr_api.web.models.plugins.PluginStatusModel(*, name: str, type: PluginType, status: PluginStatus, enabled: bool, loaded: bool, file_path: str | None = None, description: str | None = None, size_bytes: int | None = None, last_modified: datetime | None = None, validation_result: ValidationResult | None = None)¶
Bases:
BaseModelPlugin status information.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- status: PluginStatus¶
- type: PluginType¶
- validation_result: ValidationResult | None¶
- class vipr_api.web.models.plugins.PluginToggleRequest(*, enabled: bool)¶
Bases:
BaseModelModel for plugin enable/disable request.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.plugins.PluginToggleResponse(*, success: bool, message: str, plugin_name: str, enabled: bool, requires_restart: bool)¶
Bases:
BaseModelResponse model for plugin toggle endpoint.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.plugins.PluginType(value)¶
-
Plugin type enumeration.
- BUILTIN = 'builtin'¶
- RUNTIME = 'runtime'¶
- class vipr_api.web.models.plugins.PluginUploadResponse(*, success: bool, message: str, plugin_name: str, validation_result: ValidationResult)¶
Bases:
BaseModelResponse model for plugin upload endpoint.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- validation_result: ValidationResult¶
- class vipr_api.web.models.plugins.ValidationResult(*, valid: bool, errors: ~typing.List[str] = <factory>, warnings: ~typing.List[str] = <factory>, has_load_function: bool = False, syntax_valid: bool = False, security_passed: bool = False)¶
Bases:
BaseModelPlugin validation result.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
vipr_api.web.models.progress module¶
Progress tracking models for VIPR API.
- class vipr_api.web.models.progress.CeleryExecutionMode(value)¶
-
Celery execution modes.
- ASYNC = 'async'¶
- EAGER = 'eager'¶
- class vipr_api.web.models.progress.CeleryHealthStatus(value)¶
-
Celery health check status.
- HEALTHY = 'healthy'¶
- UNAVAILABLE = 'unavailable'¶
- class vipr_api.web.models.progress.HealthCheckResponse(*, celery_mode: CeleryExecutionMode, can_execute: bool, redis_required: bool, redis_available: bool | None = None, status: CeleryHealthStatus, error: str | None = None)¶
Bases:
BaseModelResponse model for health check endpoint.
- celery_mode: CeleryExecutionMode¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- status: CeleryHealthStatus¶
- class vipr_api.web.models.progress.TaskProgressResponse(*, task_id: str, status: CeleryState, message: str, progress: Dict[str, Any] | None = None, result: Dict[str, Any] | None = None, ui_data: Dict[str, Any] | None = None, error: str | None = None)¶
Bases:
BaseModelResponse model for task progress endpoints.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- status: CeleryState¶
vipr_api.web.models.reflectometry module¶
Reflectorch-specific models for the VIPR framework.
This module contains models specific to reflectometry data processing using reflectorch.
- class vipr_api.web.models.reflectometry.AvailableModel(*, name: str, max_num_layers: int, param_ranges: ModelParameterRanges)¶
Bases:
BaseModelInformation about an available reflectometry model.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- param_ranges: ModelParameterRanges¶
- class vipr_api.web.models.reflectometry.BoundWidthRanges(*, thicknesses: list[float], roughnesses: list[float], slds: list[float], r_scale: list[float] | None = None, q_offset: list[float] | None = None, log10_background: list[float] | None = None)¶
Bases:
BaseModelBound width ranges for subprior intervals.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.reflectometry.ModelParameterRanges(*, thicknesses: list[float], roughnesses: list[float], slds: list[float])¶
Bases:
BaseModelParameter ranges for a reflectometry model.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.reflectometry.ParameterBounds(*, thicknesses: list[float], roughnesses: list[float], slds: list[float], r_scale: list[float] | None = None, q_offset: list[float] | None = None, log10_background: list[float] | None = None)¶
Bases:
BaseModelReflectometry-specific parameter bounds for model configuration.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.reflectometry.ReflectometryModelParameters(*, max_layers: int, parameter_bounds: ParameterBounds, bound_width_ranges: BoundWidthRanges, requires_q_resolution: bool)¶
Bases:
BaseModelReflectometry-specific model parameters.
- bound_width_ranges: BoundWidthRanges¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- parameter_bounds: ParameterBounds¶
vipr_api.web.models.streaming module¶
Pydantic models for generic streaming functionality.
This module contains data models for RabbitMQ streaming endpoints that can be used across different domains/plugins, not just reflectorch.
- class vipr_api.web.models.streaming.ConsumerStatsInfo(*, total_tasks_triggered: int, is_consuming: bool, last_message_time: str | None = None)¶
Bases:
BaseModelConsumer statistics information for tasks response.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.streaming.ConsumerStatsResponse(*, consumer_id: str, is_consuming: bool, messages_received: int, tasks_triggered: int, processing_errors: int, start_time: str | None = None, last_message_time: str | None = None, uptime_seconds: float | None = None, configuration: dict[str, str])¶
Bases:
BaseModelConsumer statistics response.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.streaming.ConsumerTasksResponse(*, consumer_id: str, total_tasks_available: int, tasks: list[StreamingTask], consumer_stats: ConsumerStatsInfo)¶
Bases:
BaseModelResponse containing consumer tasks and metadata.
- consumer_stats: ConsumerStatsInfo¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- tasks: list[StreamingTask]¶
- class vipr_api.web.models.streaming.RabbitMQConfig(*, rabbitmq_url: str = 'amqp://localhost:5672/', exchange_name: str = 'vipr.experiments', routing_pattern: str = 'reflectometry.growth.#')¶
Bases:
BaseModelConfiguration for RabbitMQ connection.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.streaming.StreamingConfig(*, rabbitmq_config: RabbitMQConfig)¶
Bases:
BaseModelStreaming configuration wrapper.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- rabbitmq_config: RabbitMQConfig¶
- class vipr_api.web.models.streaming.StreamingResponse(*, consumer_id: str, status: str, message: str)¶
Bases:
BaseModelResponse from streaming operations.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.streaming.StreamingTask(*, task_id: str, triggered_at: str, growth_step: int, scan_id: str, csv_file_path: str, routing_key: str)¶
Bases:
BaseModelIndividual streaming task information.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr_api.web.models.streaming.VIPRConfigWithStreaming(*, config_name: str | None = None, vipr: VIPRInference, streaming: StreamingConfig | None = None)¶
Bases:
BaseModelComplete VIPR configuration including streaming capabilities.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- streaming: StreamingConfig | None¶
- vipr: VIPRInference¶