lablup / lablup/backend.ai

Add Domain (tenant) REST handler and DTO

Open
#9,055 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

Add REST API handler and shared DTO for Domain (tenant) CRUD management.

### DTO (common/dto/manager/domain/)
- types.py: DomainOrderField, OrderDirection
- request.py: CreateDomainRequest, UpdateDomainRequest, SearchDomainsRequest (filter/order/pagination), DeleteDomainRequest, PurgeDomainRequest
- response.py: DomainDTO, CreateDomainResponse, GetDomainResponse, SearchDomainsResponse, UpdateDomainResponse, DeleteDomainResponse, PurgeDomainResponse, PaginationInfo

### PathParam (manager/dto/domain_request.py)
- GetDomainPathParam(domain_name: str)

### Handler (manager/api/domain/)
- DomainAPIHandler class with create/get/search/update/delete/purge methods
- create_app() with routes:
- POST /admin/domains — create
- GET /admin/domains/{domain_name} — get
- POST /admin/domains/search — search
- PATCH /admin/domains/{domain_name} — update
- POST /admin/domains/delete — delete
- POST /admin/domains/purge — purge

### Adapter (manager/api/domain/adapter.py)
- DomainAdapter(BaseFilterAdapter) — convert_to_dto, build_updater, build_querier

### Reference
- GQL v2: manager/api/gql/domain_v2/ (query with filtering/pagination)
- V1 client: client/func/domain.py (6 GQL operations)
- Pattern: manager/api/notification/ (handler + adapter structure)

JIRA Issue: BA-4543

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.