docs: Update README and module docstrings to clarify legacy API usage and CRUD operations in Elytra PIM Web API

This commit is contained in:
claudi 2026-03-25 08:20:50 +01:00
parent c9353cf8ea
commit 638b68214b
3 changed files with 37 additions and 23 deletions

View file

@ -1,11 +1,19 @@
# Lobster PIM Legacy REST API Client
This subpackage provides a Python client for accessing the legacy REST API of Lobster PIM (Product Information Management system). It offers access to scheduled jobs and protocol logs through a clean, Pydantic-based interface.
This subpackage provides a Python client for accessing the **legacy REST API** of Lobster PIM (now called Elytra).
## ⚠️ Important: Legacy API vs. New Web API
The Lobster REST API is the **legacy API** that provides read-only access to:
- **Scheduled Jobs** (`/rest/job/*`) - Job execution and monitoring
- **Protocol Logs** (`/rest/protocol/*`) - Execution logs and protocol information
**For CRUD operations** on products, product groups, attributes, media, and other resources in the new Elytra PIM Web API, use the [`ElytraClient`](../client.py) with the OpenAPI-based Web API instead.
## Features
- **Job Management**: Access, monitor, and execute scheduled jobs
- **Protocol/Log Access**: Retrieve execution logs and protocol information
- **Job Management**: Get, monitor, and execute scheduled jobs (read-only)
- **Protocol/Log Access**: Retrieve execution logs and protocol information (read-only)
- **Authentication**: Support for both username/password and API token authentication
- **Job Control**: Execute jobs with parameter overrides and queue management
- **Type Safety**: Full Pydantic model validation for all API responses

View file

@ -1,4 +1,11 @@
"""Lobster PIM Legacy REST API client and utilities"""
"""Lobster PIM Legacy REST API client and utilities
This module provides access to the legacy Lobster REST API, which offers
read-only access to Scheduled Jobs and Protocol logs.
For CRUD operations on products, product groups, attributes, media, and other
resources in the new Elytra PIM Web API, use the ElytraClient instead.
"""
from .auth import AuthMethod, RestApiAuth
from .client import LobsterRestApiClient
@ -17,18 +24,23 @@ from .models import (
)
__all__ = [
# Authentication
"RestApiAuth",
"AuthMethod",
# Client
"LobsterRestApiClient",
# Job models
"JobInfo",
"JobDetailInfo",
"JobOverviewResponse",
"JobExecutionResponse",
"JobControlRequest",
"JobControlResponse",
# Protocol models
"ProtocolInfo",
"ProtocolListResponse",
"ProtocolCategoryInfo",
"ProtocolCategoryListResponse",
# Error model
"ErrorResponse",
]

View file

@ -1,34 +1,25 @@
"""Lobster PIM Legacy REST API Client."""
from .attribute_groups import AttributeGroupsMixin
from .attributes import AttributesMixin
from .base import LobsterRestApiClientBase
from .jobs import JobsMixin
from .media import MediaMixin
from .product_groups import ProductGroupsMixin
from .products import ProductsMixin
from .protocols import ProtocolsMixin
from .text import TextMixin
from .tree_groups import TreeGroupsMixin
class LobsterRestApiClient(
LobsterRestApiClientBase,
JobsMixin,
ProtocolsMixin,
ProductsMixin,
ProductGroupsMixin,
TreeGroupsMixin,
AttributesMixin,
AttributeGroupsMixin,
MediaMixin,
TextMixin,
):
"""
Complete client for the Lobster PIM Legacy REST API.
Legacy REST API client for the Lobster PIM system.
Combines base infrastructure with domain-specific mixins for organized
access to all API endpoints across jobs, protocols, products, media, etc.
Provides read-only access to Scheduled Jobs and Protocol logs via the
Lobster REST API endpoints. Only supports GET operations on:
- Scheduled Jobs (/rest/job/*)
- Protocols (/rest/protocol/*)
The new Elytra PIM Web API (for CRUD operations on products, groups,
attributes, media, etc.) should use the ElytraClient instead.
Example:
>>> from elytra_client.rest_api.client import LobsterRestApiClient
@ -37,10 +28,13 @@ class LobsterRestApiClient(
>>> auth = RestApiAuth.from_bearer_token("your-token")
>>> client = LobsterRestApiClient("http://localhost:8080", auth)
>>>
>>> # Access jobs
>>> # Access jobs (read-only)
>>> jobs = client.get_all_active_jobs()
>>> job_detail = client.get_job_detail(job_id=172475107)
>>>
>>> # Access protocols (read-only)
>>> protocols = client.get_protocols()
>>> products = client.get_all_products()
>>> protocol = client.get_protocol(protocol_id="176728573")
"""
pass