Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove legacy #560

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: run-explorer run-tests run-linters build-ui build-python build-docker run-docker compose-up
version="0.87.6"
version="0.88.0"
run-explorer:
@echo "Running explorer API server..."
# open "http://localhost:8000/static/index.html" || true
Expand Down
2 changes: 1 addition & 1 deletion cognite/neat/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.87.6"
__version__ = "0.88.0"
19 changes: 0 additions & 19 deletions cognite/neat/app/api/data_classes/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,6 @@ class RuleRequest(BaseModel):
rule: str


class UploadToCdfRequest(BaseModel):
file_name: str = ""
file_type: str = "workflow"
comments: str = ""
author: str = ""
tag: str = ""


class DownloadFromCdfRequest(BaseModel):
file_name: str = ""
file_type: str = "workflow"
version: str = ""


class LoadGraphRequest(BaseModel):
graph_source_template_name: str
source_location: str


class RunWorkflowRequest(BaseModel):
name: str
config: dict
Expand Down
10 changes: 6 additions & 4 deletions cognite/neat/app/api/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
from cognite.neat.app.api.asgi.metrics import prometheus_app
from cognite.neat.app.api.configuration import NEAT_APP, UI_PATH
from cognite.neat.app.api.context_manager import lifespan
from cognite.neat.app.api.routers import configuration, core, crud, data_exploration, metrics, rules, workflows
from cognite.neat.app.api.routers import (
configuration,
crud,
metrics,
workflows,
)
from cognite.neat.app.api.utils.logging import EndpointFilter

app = FastAPI(title="Neat", lifespan=lifespan)
Expand Down Expand Up @@ -45,10 +50,7 @@
app.include_router(configuration.router)
app.include_router(metrics.router)
app.include_router(workflows.router)
app.include_router(rules.router)
app.include_router(crud.router)
app.include_router(data_exploration.router)
app.include_router(core.router)


# General routes
Expand Down
91 changes: 0 additions & 91 deletions cognite/neat/app/api/routers/core.py

This file was deleted.

32 changes: 11 additions & 21 deletions cognite/neat/app/api/routers/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,13 @@
router = APIRouter()


@router.get("/api/cdf/neat-resources")
def get_neat_resources(resource_type: str | None = None):
if NEAT_APP.cdf_store is None:
return {"error": "NeatApp is not initialized"}
if resource_type is None:
return {"error": "Resource type is not specified"}
result = NEAT_APP.cdf_store.get_list_of_resources_from_cdf(resource_type=resource_type)
logging.debug(f"Got {len(result)} resources")
return {"result": result}


@router.post("/api/cdf/init-neat-resources")
def init_neat_cdf_resources(resource_type: str | None = None):
if NEAT_APP.cdf_store is None:
return {"error": "NeatApp is not initialized"}
NEAT_APP.cdf_store.init_cdf_resources(resource_type=resource_type)
return {"result": "ok"}


@router.post("/api/file/upload/{workflow_name}/{file_type}/{step_id}/{action}")
async def file_upload_handler(
files: list[UploadFile], workflow_name: str, file_type: str, step_id: str, action: str
files: list[UploadFile],
workflow_name: str,
file_type: str,
step_id: str,
action: str,
) -> dict[str, str]:
if NEAT_APP.cdf_store is None or NEAT_APP.workflow_manager is None:
return {"error": "NeatApp is not initialized"}
Expand Down Expand Up @@ -91,7 +76,12 @@ async def file_upload_handler(
if workflow is None:
return {"error": f"Workflow {workflow_name} not found"}
flow_msg = FlowMessage(
payload={"file_name": file_name, "hash": file_version, "full_path": full_path, "file_type": file_type}
payload={
"file_name": file_name,
"hash": file_version,
"full_path": full_path,
"file_type": file_type,
}
)
start_step_id = None if step_id == "none" else step_id

Expand Down
Loading
Loading