Skip to content

Commit

Permalink
feat(slo): add public access (elastic#165698)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdelemme authored Sep 6, 2023
1 parent b335c3a commit e8699ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions x-pack/plugins/observability/server/routes/slo/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const createSLORoute = createObservabilityServerRoute({
endpoint: 'POST /api/observability/slos 2023-10-31',
options: {
tags: ['access:slo_write'],
access: 'public',
},
params: createSLOParamsSchema,
handler: async ({ context, params, logger }) => {
Expand All @@ -95,6 +96,7 @@ const updateSLORoute = createObservabilityServerRoute({
endpoint: 'PUT /api/observability/slos/{id} 2023-10-31',
options: {
tags: ['access:slo_write'],
access: 'public',
},
params: updateSLOParamsSchema,
handler: async ({ context, params, logger }) => {
Expand All @@ -117,6 +119,7 @@ const deleteSLORoute = createObservabilityServerRoute({
endpoint: 'DELETE /api/observability/slos/{id} 2023-10-31',
options: {
tags: ['access:slo_write'],
access: 'public',
},
params: deleteSLOParamsSchema,
handler: async ({
Expand Down Expand Up @@ -145,6 +148,7 @@ const getSLORoute = createObservabilityServerRoute({
endpoint: 'GET /api/observability/slos/{id} 2023-10-31',
options: {
tags: ['access:slo_read'],
access: 'public',
},
params: getSLOParamsSchema,
handler: async ({ context, params }) => {
Expand All @@ -166,6 +170,7 @@ const enableSLORoute = createObservabilityServerRoute({
endpoint: 'POST /api/observability/slos/{id}/enable 2023-10-31',
options: {
tags: ['access:slo_write'],
access: 'public',
},
params: manageSLOParamsSchema,
handler: async ({ context, params, logger }) => {
Expand All @@ -188,6 +193,7 @@ const disableSLORoute = createObservabilityServerRoute({
endpoint: 'POST /api/observability/slos/{id}/disable 2023-10-31',
options: {
tags: ['access:slo_write'],
access: 'public',
},
params: manageSLOParamsSchema,
handler: async ({ context, params, logger }) => {
Expand All @@ -210,6 +216,7 @@ const findSLORoute = createObservabilityServerRoute({
endpoint: 'GET /api/observability/slos 2023-10-31',
options: {
tags: ['access:slo_read'],
access: 'public',
},
params: findSLOParamsSchema,
handler: async ({ context, params, logger }) => {
Expand Down Expand Up @@ -247,6 +254,7 @@ const findSloDefinitionsRoute = createObservabilityServerRoute({
endpoint: 'GET /internal/observability/slos/_definitions',
options: {
tags: ['access:slo_read'],
access: 'internal',
},
params: findSloDefinitionsParamsSchema,
handler: async ({ context, params }) => {
Expand Down Expand Up @@ -288,6 +296,7 @@ const getSLOInstancesRoute = createObservabilityServerRoute({
endpoint: 'GET /internal/observability/slos/{id}/_instances',
options: {
tags: ['access:slo_read'],
access: 'internal',
},
params: getSLOInstancesParamsSchema,
handler: async ({ context, params }) => {
Expand All @@ -309,6 +318,7 @@ const getDiagnosisRoute = createObservabilityServerRoute({
endpoint: 'GET /internal/observability/slos/_diagnosis',
options: {
tags: [],
access: 'internal',
},
params: undefined,
handler: async ({ context }) => {
Expand All @@ -331,6 +341,7 @@ const getSloBurnRates = createObservabilityServerRoute({
endpoint: 'POST /internal/observability/slos/{id}/_burn_rates',
options: {
tags: ['access:slo_read'],
access: 'internal',
},
params: getSLOBurnRatesParamsSchema,
handler: async ({ context, params }) => {
Expand All @@ -355,6 +366,7 @@ const getPreviewData = createObservabilityServerRoute({
endpoint: 'POST /internal/observability/slos/_preview',
options: {
tags: ['access:slo_read'],
access: 'internal',
},
params: getPreviewDataParamsSchema,
handler: async ({ context, params }) => {
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/observability/server/routes/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface ObservabilityRouteHandlerResources {
export interface ObservabilityRouteCreateOptions {
options: {
tags: string[];
access?: 'public' | 'internal';
};
}

Expand Down

0 comments on commit e8699ce

Please sign in to comment.