docs: Update README and module docstrings to clarify legacy API usage and CRUD operations in Elytra PIM Web API
This commit is contained in:
parent
c9353cf8ea
commit
638b68214b
3 changed files with 37 additions and 23 deletions
|
|
@ -1,11 +1,19 @@
|
||||||
# Lobster PIM Legacy REST API Client
|
# 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
|
## Features
|
||||||
|
|
||||||
- **Job Management**: Access, monitor, and execute scheduled jobs
|
- **Job Management**: Get, monitor, and execute scheduled jobs (read-only)
|
||||||
- **Protocol/Log Access**: Retrieve execution logs and protocol information
|
- **Protocol/Log Access**: Retrieve execution logs and protocol information (read-only)
|
||||||
- **Authentication**: Support for both username/password and API token authentication
|
- **Authentication**: Support for both username/password and API token authentication
|
||||||
- **Job Control**: Execute jobs with parameter overrides and queue management
|
- **Job Control**: Execute jobs with parameter overrides and queue management
|
||||||
- **Type Safety**: Full Pydantic model validation for all API responses
|
- **Type Safety**: Full Pydantic model validation for all API responses
|
||||||
|
|
|
||||||
|
|
@ -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 .auth import AuthMethod, RestApiAuth
|
||||||
from .client import LobsterRestApiClient
|
from .client import LobsterRestApiClient
|
||||||
|
|
@ -17,18 +24,23 @@ from .models import (
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
# Authentication
|
||||||
"RestApiAuth",
|
"RestApiAuth",
|
||||||
"AuthMethod",
|
"AuthMethod",
|
||||||
|
# Client
|
||||||
"LobsterRestApiClient",
|
"LobsterRestApiClient",
|
||||||
|
# Job models
|
||||||
"JobInfo",
|
"JobInfo",
|
||||||
"JobDetailInfo",
|
"JobDetailInfo",
|
||||||
"JobOverviewResponse",
|
"JobOverviewResponse",
|
||||||
"JobExecutionResponse",
|
"JobExecutionResponse",
|
||||||
"JobControlRequest",
|
"JobControlRequest",
|
||||||
"JobControlResponse",
|
"JobControlResponse",
|
||||||
|
# Protocol models
|
||||||
"ProtocolInfo",
|
"ProtocolInfo",
|
||||||
"ProtocolListResponse",
|
"ProtocolListResponse",
|
||||||
"ProtocolCategoryInfo",
|
"ProtocolCategoryInfo",
|
||||||
"ProtocolCategoryListResponse",
|
"ProtocolCategoryListResponse",
|
||||||
|
# Error model
|
||||||
"ErrorResponse",
|
"ErrorResponse",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,25 @@
|
||||||
"""Lobster PIM Legacy REST API Client."""
|
"""Lobster PIM Legacy REST API Client."""
|
||||||
|
|
||||||
from .attribute_groups import AttributeGroupsMixin
|
|
||||||
from .attributes import AttributesMixin
|
|
||||||
from .base import LobsterRestApiClientBase
|
from .base import LobsterRestApiClientBase
|
||||||
from .jobs import JobsMixin
|
from .jobs import JobsMixin
|
||||||
from .media import MediaMixin
|
|
||||||
from .product_groups import ProductGroupsMixin
|
|
||||||
from .products import ProductsMixin
|
|
||||||
from .protocols import ProtocolsMixin
|
from .protocols import ProtocolsMixin
|
||||||
from .text import TextMixin
|
|
||||||
from .tree_groups import TreeGroupsMixin
|
|
||||||
|
|
||||||
|
|
||||||
class LobsterRestApiClient(
|
class LobsterRestApiClient(
|
||||||
LobsterRestApiClientBase,
|
LobsterRestApiClientBase,
|
||||||
JobsMixin,
|
JobsMixin,
|
||||||
ProtocolsMixin,
|
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
|
Provides read-only access to Scheduled Jobs and Protocol logs via the
|
||||||
access to all API endpoints across jobs, protocols, products, media, etc.
|
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:
|
Example:
|
||||||
>>> from elytra_client.rest_api.client import LobsterRestApiClient
|
>>> from elytra_client.rest_api.client import LobsterRestApiClient
|
||||||
|
|
@ -37,10 +28,13 @@ class LobsterRestApiClient(
|
||||||
>>> auth = RestApiAuth.from_bearer_token("your-token")
|
>>> auth = RestApiAuth.from_bearer_token("your-token")
|
||||||
>>> client = LobsterRestApiClient("http://localhost:8080", auth)
|
>>> client = LobsterRestApiClient("http://localhost:8080", auth)
|
||||||
>>>
|
>>>
|
||||||
>>> # Access jobs
|
>>> # Access jobs (read-only)
|
||||||
>>> jobs = client.get_all_active_jobs()
|
>>> jobs = client.get_all_active_jobs()
|
||||||
|
>>> job_detail = client.get_job_detail(job_id=172475107)
|
||||||
|
>>>
|
||||||
|
>>> # Access protocols (read-only)
|
||||||
>>> protocols = client.get_protocols()
|
>>> protocols = client.get_protocols()
|
||||||
>>> products = client.get_all_products()
|
>>> protocol = client.get_protocol(protocol_id="176728573")
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue