mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-24 02:46:27 +00:00
* feat: support multi ingestion keys * fix: remove unwanted changes * feat: limits ui * feat: handle limit updates from component * feat: handle limit updates per signal * feat: integrate multiple ingestion key api * feat: handle crud for limits * fix: lint errors * feat: support query search for ingestion name * feat: show utilized size in limits * feat: show multiple ingestions ui only if gateway is enabled * feat: handle decimal values for ingestion size * feat: enable multiple ingestion keys for all users with gateway enabled * chore: remove yarn.lock --------- Co-authored-by: Yunus A M <younix@Yunuss-MacBook-Pro.local> Co-authored-by: Prashant Shahi <prashant@signoz.io>
30 lines
771 B
TypeScript
30 lines
771 B
TypeScript
import { GatewayApiV1Instance } from 'api';
|
|
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
|
|
import { AxiosError } from 'axios';
|
|
import { ErrorResponse, SuccessResponse } from 'types/api';
|
|
import {
|
|
CreateIngestionKeyProps,
|
|
IngestionKeyProps,
|
|
} from 'types/api/ingestionKeys/types';
|
|
|
|
const createIngestionKey = async (
|
|
props: CreateIngestionKeyProps,
|
|
): Promise<SuccessResponse<IngestionKeyProps> | ErrorResponse> => {
|
|
try {
|
|
const response = await GatewayApiV1Instance.post('/workspaces/me/keys', {
|
|
...props,
|
|
});
|
|
|
|
return {
|
|
statusCode: 200,
|
|
error: null,
|
|
message: response.data.status,
|
|
payload: response.data.data,
|
|
};
|
|
} catch (error) {
|
|
return ErrorResponseHandler(error as AxiosError);
|
|
}
|
|
};
|
|
|
|
export default createIngestionKey;
|