|
|
|
|
@ -7,7 +7,7 @@ from sqlalchemy import Delete, Select, func, desc, and_, text
|
|
|
|
|
from sqlalchemy.orm import selectinload
|
|
|
|
|
|
|
|
|
|
from src.auth.service import CurrentUser
|
|
|
|
|
from src.config import AEROS_BASE_URL, DEFAULT_PROJECT_NAME
|
|
|
|
|
from src.config import AEROS_BASE_URL, DEFAULT_PROJECT_NAME, RELIABILITY_SERVICE_API
|
|
|
|
|
from src.database.core import CollectorDbSession, DbSession
|
|
|
|
|
from src.database.service import search_filter_sort_paginate
|
|
|
|
|
from .model import AerosEquipment, AerosEquipmentDetail, MasterEquipment, AerosEquipmentGroup, ReliabilityPredictNonRepairable
|
|
|
|
|
@ -220,7 +220,7 @@ async def save_default_equipment(*, db_session: DbSession, project_name: str):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_asset_batch(location_tags: List[str], nr_location_tags: List[str],
|
|
|
|
|
base_url: str = "http://192.168.1.82:8000",
|
|
|
|
|
base_url: str = RELIABILITY_SERVICE_API,
|
|
|
|
|
timeout: int = 30)-> dict:
|
|
|
|
|
"""
|
|
|
|
|
Get asset batch data using GET request with JSON body.
|
|
|
|
|
@ -465,7 +465,7 @@ async def get_equipment_mttr(*, location_tag: str, client: httpx.AsyncClient) ->
|
|
|
|
|
"""
|
|
|
|
|
Get MTTR for a single equipment using provided client
|
|
|
|
|
"""
|
|
|
|
|
mttr_url = f"http://192.168.1.82:8000/reliability/asset/mttr/{location_tag}"
|
|
|
|
|
mttr_url = f"{RELIABILITY_SERVICE_API}/asset/mttr/{location_tag}"
|
|
|
|
|
try:
|
|
|
|
|
response = await client.get(mttr_url)
|
|
|
|
|
if response.status_code == 200:
|
|
|
|
|
@ -482,7 +482,7 @@ async def get_equipment_reliability_parameter(*, location_tag: str, client: http
|
|
|
|
|
"""
|
|
|
|
|
Get reliability parameters for a single equipment using provided client
|
|
|
|
|
"""
|
|
|
|
|
reliability_url = f"http://192.168.1.82:8000/reliability/reliability/{location_tag}/current"
|
|
|
|
|
reliability_url = f"{RELIABILITY_SERVICE_API}/reliability/{location_tag}/current"
|
|
|
|
|
try:
|
|
|
|
|
response = await client.get(reliability_url)
|
|
|
|
|
if response.status_code == 200:
|
|
|
|
|
|