You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

55 lines
1.3 KiB

from __future__ import annotations
from datetime import datetime
from pydantic import BaseModel
from pydantic import Field
class PlacementPolicySummary(BaseModel):
id: str
file_class: str
require_local: bool
stable_replica_count: int
opportunistic_replica_count: int
preferred_backend_ids: list[str]
excluded_backend_ids: list[str]
max_non_local_size_bytes: int | None
created_at: datetime
updated_at: datetime
class PlacementPolicyListResponse(BaseModel):
items: list[PlacementPolicySummary]
class UpsertPlacementPolicyRequest(BaseModel):
require_local: bool
stable_replica_count: int
opportunistic_replica_count: int
preferred_backend_ids: list[str] = Field(default_factory=list)
excluded_backend_ids: list[str] = Field(default_factory=list)
max_non_local_size_bytes: int | None = None
class PlacementPolicyMutationResponse(BaseModel):
ok: bool = True
policy: PlacementPolicySummary
class PlacementDecisionBackendSummary(BaseModel):
id: str
name: str
type: str
stability_class: str
read_priority: int
write_priority: int
class PlacementDecisionResponse(BaseModel):
file_class: str
mime_type: str | None
size_bytes: int | None
non_local_allowed: bool
policy: PlacementPolicySummary
selected_backends: list[PlacementDecisionBackendSummary]