Skip to content

Commit

Permalink
Merge pull request #2791 from alexcreasy/RHOAIENG-6620
Browse files Browse the repository at this point in the history
Update TrustyAI APIs to use new endpoint (RHOAINENG-6620)
  • Loading branch information
openshift-merge-bot[bot] authored May 10, 2024
2 parents 26fa658 + 8ffabe6 commit 814b201
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const initIntercepts = ({
});
cy.interceptOdh(
'GET /api/service/trustyai/:namespace/trustyai-service/metrics/all/requests',
{ path: { namespace: 'test-project' } },
{ path: { namespace: 'test-project' }, query: { type: 'fairness' } },
mockMetricsRequest({ modelName: 'test-inference-service' }),
);
cy.interceptK8sList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ declare global {
type: 'GET /api/service/trustyai/:namespace/trustyai-service/metrics/all/requests',
options: {
path: { namespace: string };
query?: { type: string };
},
response: OdhResponse<BaseMetricListResponse>,
): Cypress.Chainable<null>;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/api/trustyai/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { K8sAPIOptions } from '~/k8sTypes';
import { BaseMetricCreationResponse, BaseMetricListResponse, BaseMetricRequest } from '~/api';
import { handleTrustyAIFailures } from './errorUtils';

export const getAllRequests =
export const getAllBiasRequests =
(hostPath: string) =>
(opts: K8sAPIOptions): Promise<BaseMetricListResponse> =>
handleTrustyAIFailures(proxyGET(hostPath, '/metrics/all/requests', {}, opts));
handleTrustyAIFailures(proxyGET(hostPath, '/metrics/all/requests', { type: 'fairness' }, opts));

export const getSpdRequests =
(hostPath: string) =>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/concepts/trustyai/useTrustyAIAPIState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
createSpdRequest,
deleteDirRequest,
deleteSpdRequest,
getAllRequests,
getAllBiasRequests,
getDirRequests,
getSpdRequests,
} from '~/api';
Expand All @@ -24,7 +24,7 @@ const useTrustyAIAPIState = (
deleteDirRequest: deleteDirRequest(path),
deleteSpdRequest: deleteSpdRequest(path),
listDirRequests: getDirRequests(path),
listRequests: getAllRequests(path),
listRequests: getAllBiasRequests(path),
listSpdRequests: getSpdRequests(path),
}),
[],
Expand Down

0 comments on commit 814b201

Please sign in to comment.