Skip to content

Commit

Permalink
fixing endpoints nomenclature
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishnu Challa authored and jtaleric committed Dec 12, 2023
1 parent 1146c0e commit 0e2063d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ A team using a different backend will need to provide the code to enable utiliza
##### Endpoint

Steps for adding the data to the result of `/api/cpt/v1/jobs` endpoint
Steps for adding the data to the result of `/api/v1/cpt/jobs` endpoint

1. Create a custom mapper that will query your data backend and do the appropriate transformations for the data to match the fields described above.
This Mapper should always receive:
Expand All @@ -168,7 +168,7 @@ This Mapper should always receive:
This mapper should return
* A pandas DataFrame

2. In the `/api/cpt/v1/jobs` endpoint add the entry to the [`products`](https://github.com/cloud-bulldozer/cpt-dashboard/blob/1ce837ae17e0d3fa63f59c751078990b018905dc/backend/app/api/v1/endpoints/cpt/cptJobs.py#L12) dictionary that has the different data sources configured, the endpoint should query all configured mappers and append the resulting DataFrames to the overall response.
2. In the `/api/v1/cpt/jobs` endpoint add the entry to the [`products`](https://github.com/cloud-bulldozer/cpt-dashboard/blob/1ce837ae17e0d3fa63f59c751078990b018905dc/backend/app/api/v1/endpoints/cpt/cptJobs.py#L12) dictionary that has the different data sources configured, the endpoint should query all configured mappers and append the resulting DataFrames to the overall response.

##### Frontend

Expand Down
2 changes: 1 addition & 1 deletion backend/app/api/v1/endpoints/cpt/cptJobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"hce": hceMapper
}

@router.get('/api/cpt/v1/jobs',
@router.get('/api/v1/cpt/jobs',
summary="Returns a job list from all the products.",
description="Returns a list of jobs in the specified dates. \
If not dates are provided the API will default the values. \
Expand Down
8 changes: 4 additions & 4 deletions backend/app/api/v1/endpoints/ocp/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

"""
"""
@router.get('/api/ocp/v1/graph/trend/{version}/{count}/{benchmark}')
@router.get('/api/v1/ocp/graph/trend/{version}/{count}/{benchmark}')
async def trend(benchmark: str,count: int,version: str):
index = "ripsaw-kube-burner*"
meta = {}
Expand Down Expand Up @@ -54,7 +54,7 @@ async def trend(benchmark: str,count: int,version: str):
diff_cpu - Will accept the version, prev_version , count, benchmark and namespace to diff trend CPU
data.
"""
@router.get('/api/ocp/v1/graph/trend/{version}/{prev_version}/{count}/{benchmark}/cpu/{namespace}')
@router.get('/api/v1/ocp/graph/trend/{version}/{prev_version}/{count}/{benchmark}/cpu/{namespace}')
async def diff_cpu(namespace: str, benchmark: str, count: int, version: str, prev_version: str):
aTrend = await trend_cpu(namespace,benchmark,count,version)
bTrend = await trend_cpu(namespace,benchmark,count,prev_version)
Expand All @@ -64,7 +64,7 @@ async def diff_cpu(namespace: str, benchmark: str, count: int, version: str, pre
trend_cpu - Will accept the version, count, benchmark and namespace to trend CPU
data.
"""
@router.get('/api/ocp/v1/graph/trend/{version}/{count}/{benchmark}/cpu/{namespace}')
@router.get('/api/v1/ocp/graph/trend/{version}/{count}/{benchmark}/cpu/{namespace}')
async def trend_cpu(namespace: str, benchmark: str, count: int, version: str):
index = "ripsaw-kube-burner*"
meta = {}
Expand Down Expand Up @@ -109,7 +109,7 @@ def parseCPUResults(data: dict):
res.append(dat)
return res

@router.get('/api/ocp/v1/graph/{uuid}')
@router.get('/api/v1/ocp/graph/{uuid}')
async def graph(uuid: str):
index = ""
meta = await getMetadata(uuid, 'ocp.elasticsearch')
Expand Down
2 changes: 1 addition & 1 deletion backend/app/api/v1/endpoints/ocp/ocpJobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@



@router.get('/api/ocp/v1/jobs',
@router.get('/api/v1/ocp/jobs',
summary="Returns a job list",
description="Returns a list of jobs in the specified dates. \
If not dates are provided the API will default the values. \
Expand Down
2 changes: 1 addition & 1 deletion backend/app/api/v1/endpoints/ocp/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
router = APIRouter()


@router.get('/api/ocp/v1/jobs/{ci}/{job_id}',
@router.get('/api/v1/ocp/jobs/{ci}/{job_id}',
summary="Returns the details of a specified Job.")
async def results_for_job(
ci: str = Path(..., description="Name of the CI system tha tthe job belongs to.", examples=["PROW", "JENKINS"]),
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/store/Shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export const getUrl = () => {

export const BASE_URL = getUrl()

export const OCP_JOBS_API_V1 = "/api/ocp/v1/jobs"
export const OCP_GRAPH_API_V1 = "/api/ocp/v1/graph"
export const OCP_JOBS_API_V1 = "/api/v1/ocp/jobs"
export const OCP_GRAPH_API_V1 = "/api/v1/ocp/graph"

export const CPT_JOBS_API_V1 = "/api/cpt/v1/jobs"
export const CPT_JOBS_API_V1 = "/api/v1/cpt/jobs"

export const QUAY_JOBS_API_V1 = "/api/v1/quay/jobs"
export const QUAY_GRAPH_API_V1 = "/api/v1/quay/graph"

0 comments on commit 0e2063d

Please sign in to comment.