Skip to content

Commit

Permalink
Remove any 7.x references to *_policy vs *_config
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Sep 21, 2020
1 parent 26f4901 commit 87cf130
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 629 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
DeleteAgentConfigResponse,
GetFullAgentConfigResponse,
} from '../../../common';
import { defaultIngestErrorHandler } from '../../errors';

export const getAgentConfigsHandler: RequestHandler<
undefined,
Expand Down Expand Up @@ -65,11 +66,8 @@ export const getAgentConfigsHandler: RequestHandler<
);

return response.ok({ body });
} catch (e) {
return response.customError({
statusCode: 500,
body: { message: e.message },
});
} catch (error) {
return defaultIngestErrorHandler({ error, response });
}
};

Expand All @@ -93,11 +91,8 @@ export const getOneAgentConfigHandler: RequestHandler<TypeOf<
body: { message: 'Agent config not found' },
});
}
} catch (e) {
return response.customError({
statusCode: 500,
body: { message: e.message },
});
} catch (error) {
return defaultIngestErrorHandler({ error, response });
}
};

Expand Down Expand Up @@ -147,11 +142,8 @@ export const createAgentConfigHandler: RequestHandler<
return response.ok({
body,
});
} catch (e) {
return response.customError({
statusCode: 500,
body: { message: e.message },
});
} catch (error) {
return defaultIngestErrorHandler({ error, response });
}
};

Expand All @@ -175,11 +167,8 @@ export const updateAgentConfigHandler: RequestHandler<
return response.ok({
body,
});
} catch (e) {
return response.customError({
statusCode: 500,
body: { message: e.message },
});
} catch (error) {
return defaultIngestErrorHandler({ error, response });
}
};

Expand All @@ -203,11 +192,8 @@ export const copyAgentConfigHandler: RequestHandler<
return response.ok({
body,
});
} catch (e) {
return response.customError({
statusCode: 500,
body: { message: e.message },
});
} catch (error) {
return defaultIngestErrorHandler({ error, response });
}
};

Expand All @@ -225,11 +211,8 @@ export const deleteAgentConfigsHandler: RequestHandler<
return response.ok({
body,
});
} catch (e) {
return response.customError({
statusCode: 500,
body: { message: e.message },
});
} catch (error) {
return defaultIngestErrorHandler({ error, response });
}
};

Expand Down Expand Up @@ -259,11 +242,8 @@ export const getFullAgentConfig: RequestHandler<
body: { message: 'Agent config not found' },
});
}
} catch (e) {
return response.customError({
statusCode: 500,
body: { message: e.message },
});
} catch (error) {
return defaultIngestErrorHandler({ error, response });
}
};

Expand Down Expand Up @@ -296,10 +276,7 @@ export const downloadFullAgentConfig: RequestHandler<
body: { message: 'Agent config not found' },
});
}
} catch (e) {
return response.customError({
statusCode: 500,
body: { message: e.message },
});
} catch (error) {
return defaultIngestErrorHandler({ error, response });
}
};
278 changes: 0 additions & 278 deletions x-pack/plugins/ingest_manager/server/routes/agent_policy/handlers.ts

This file was deleted.

Loading

0 comments on commit 87cf130

Please sign in to comment.