SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
refactor(alertmanager): move API handlers to signozapiserver (#10941)
Pandeyb3da6fb25111
diff --git a/docs/api/openapi.yml b/docs/api/openapi.ymlindex 49ac26ef0c..628314dad6 100644--- a/docs/api/openapi.yml+++ b/docs/api/openapi.yml@@ -1,5 +1,126 @@components:schemas:+ AlertmanagertypesChannel:+ properties:+ createdAt:+ format: date-time+ type: string+ data:+ type: string+ id:+ type: string+ name:+ type: string+ orgId:+ type: string+ type:+ type: string+ updatedAt:+ format: date-time+ type: string+ required:+ - id+ - name+ - type+ - data+ - orgId+ type: object+ AlertmanagertypesDeprecatedGettableAlert:+ properties:+ annotations:+ $ref: '#/components/schemas/ModelLabelSet'+ endsAt:+ format: date-time+ type: string+ fingerprint:+ type: string+ generatorURL:+ type: string+ labels:+ $ref: '#/components/schemas/ModelLabelSet'+ receivers:+ items:+ type: string+ nullable: true+ type: array+ startsAt:+ format: date-time+ type: string+ status:+ $ref: '#/components/schemas/TypesAlertStatus'+ type: object+ AlertmanagertypesExpressionKind:+ enum:+ - rule+ - policy+ type: string+ AlertmanagertypesGettableRoutePolicy:+ properties:+ channels:+ items:+ type: string+ nullable: true+ type: array+ createdAt:+ format: date-time+ type: string+ createdBy:+ nullable: true+ type: string+ description:+ type: string+ expression:+ type: string+ id:+ type: string+ kind:+ $ref: '#/components/schemas/AlertmanagertypesExpressionKind'+ name:+ type: string+ tags:+ items:+ type: string+ nullable: true+ type: array+ updatedAt:+ format: date-time+ type: string+ updatedBy:+ nullable: true+ type: string+ required:+ - expression+ - channels+ - name+ - id+ - createdAt+ - updatedAt+ type: object+ AlertmanagertypesPostableRoutePolicy:+ properties:+ channels:+ items:+ type: string+ nullable: true+ type: array+ description:+ type: string+ expression:+ type: string+ kind:+ $ref: '#/components/schemas/AlertmanagertypesExpressionKind'+ name:+ type: string+ tags:+ items:+ type: string+ nullable: true+ type: array+ required:+ - expression+ - channels+ - name+ type: objectAuthtypesAttributeMapping:properties:email:@@ -914,154 +1035,1105 @@ components:required:- configtype: object- DashboardtypesDashboard:+ ConfigAuthorization:properties:- createdAt:- format: date-time+ credentials:type: string- createdBy:+ credentials_file:type: string- data:- $ref: '#/components/schemas/DashboardtypesStorableDashboardData'- id:+ credentials_ref:type: string- locked:- type: boolean- org_id:+ type:type: string- updatedAt:- format: date-time+ type: object+ ConfigBasicAuth:+ properties:+ password:type: string- updatedBy:+ password_file:+ type: string+ password_ref:+ type: string+ username:+ type: string+ username_file:+ type: string+ username_ref:type: stringtype: object- DashboardtypesGettablePublicDasbhboard:+ ConfigDiscordConfig:properties:- defaultTimeRange:+ avatar_url:type: string- publicPath:+ content:type: string- timeRangeEnabled:+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ message:+ type: string+ send_resolved:type: boolean+ title:+ type: string+ username:+ type: string+ webhook_url:+ $ref: '#/components/schemas/ConfigSecretURL'+ webhook_url_file:+ type: stringtype: object- DashboardtypesGettablePublicDashboardData:+ ConfigDuration:+ format: int64+ type: string+ ConfigEmailConfig:properties:- dashboard:- $ref: '#/components/schemas/DashboardtypesDashboard'- publicDashboard:- $ref: '#/components/schemas/DashboardtypesGettablePublicDasbhboard'+ auth_identity:+ type: string+ auth_password:+ type: string+ auth_password_file:+ type: string+ auth_secret:+ type: string+ auth_secret_file:+ type: string+ auth_username:+ type: string+ force_implicit_tls:+ nullable: true+ type: boolean+ from:+ type: string+ headers:+ additionalProperties:+ type: string+ type: object+ hello:+ type: string+ html:+ type: string+ require_tls:+ nullable: true+ type: boolean+ send_resolved:+ type: boolean+ smarthost:+ $ref: '#/components/schemas/ConfigHostPort'+ text:+ type: string+ threading:+ $ref: '#/components/schemas/ConfigThreadingConfig'+ tls_config:+ $ref: '#/components/schemas/ConfigTLSConfig'+ to:+ type: stringtype: object- DashboardtypesPostablePublicDashboard:+ ConfigHTTPClientConfig:properties:- defaultTimeRange:+ authorization:+ $ref: '#/components/schemas/ConfigAuthorization'+ basic_auth:+ $ref: '#/components/schemas/ConfigBasicAuth'+ bearer_token:type: string- timeRangeEnabled:+ bearer_token_file:+ type: string+ enable_http2:type: boolean+ follow_redirects:+ type: boolean+ http_headers:+ $ref: '#/components/schemas/ConfigHeaders'+ no_proxy:+ type: string+ oauth2:+ $ref: '#/components/schemas/ConfigOAuth2'+ proxy_connect_header:+ $ref: '#/components/schemas/ConfigProxyHeader'+ proxy_from_environment:+ type: boolean+ proxy_url:+ $ref: '#/components/schemas/ConfigURL'+ tls_config:+ $ref: '#/components/schemas/ConfigTLSConfig'type: object- DashboardtypesStorableDashboardData:- additionalProperties: {}+ ConfigHeaders:type: object- DashboardtypesUpdatablePublicDashboard:+ ConfigHostPort:+ type: object+ ConfigIncidentioConfig:properties:- defaultTimeRange:+ alert_source_token:type: string- timeRangeEnabled:+ alert_source_token_file:+ type: string+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ max_alerts:+ minimum: 0+ type: integer+ send_resolved:type: boolean+ timeout:+ $ref: '#/components/schemas/TimeDuration'+ url:+ $ref: '#/components/schemas/ConfigURLType2'+ url_file:+ type: stringtype: object- ErrorsJSON:+ ConfigJiraConfig:properties:- code:+ api_type:type: string- errors:+ api_url:+ $ref: '#/components/schemas/ConfigURLType2'+ custom_fields:+ additionalProperties: {}+ type: object+ description:+ $ref: '#/components/schemas/ConfigJiraFieldConfig'+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ issue_type:+ type: string+ labels:items:- $ref: '#/components/schemas/ErrorsResponseerroradditional'+ type: stringtype: array- message:+ priority:type: string- url:+ project:type: string- required:- - code- - message- type: object- ErrorsResponseerroradditional:- properties:- message:+ reopen_duration:+ $ref: '#/components/schemas/ModelDuration'+ reopen_transition:+ type: string+ resolve_transition:+ type: string+ send_resolved:+ type: boolean+ summary:+ $ref: '#/components/schemas/ConfigJiraFieldConfig'+ wont_fix_resolution:type: stringtype: object- FactoryResponse:+ ConfigJiraFieldConfig:properties:- healthy:- type: boolean- services:- additionalProperties:- items:- type: string- type: array+ enable_update:nullable: true- type: object+ type: boolean+ template:+ type: stringtype: object- FeaturetypesGettableFeature:+ ConfigMSTeamsConfig:properties:- defaultVariant:- type: string- description:+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ send_resolved:+ type: boolean+ summary:type: string- kind:+ text:type: string- name:+ title:type: string- resolvedValue: {}- stage:+ webhook_url:+ $ref: '#/components/schemas/ConfigSecretURL'+ webhook_url_file:type: string- variants:- additionalProperties: {}- nullable: true- type: objecttype: object- GatewaytypesGettableCreatedIngestionKey:+ ConfigMSTeamsV2Config:properties:- id:+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ send_resolved:+ type: boolean+ text:type: string- value:+ title:type: string- required:- - id- - value- type: object- GatewaytypesGettableCreatedIngestionKeyLimit:- properties:- id:+ webhook_url:+ $ref: '#/components/schemas/ConfigSecretURL'+ webhook_url_file:type: string- required:- - id- type: object- GatewaytypesGettableIngestionKeys:- properties:- _pagination:- $ref: '#/components/schemas/GatewaytypesPagination'- keys:- items:- $ref: '#/components/schemas/GatewaytypesIngestionKey'- nullable: true- type: arraytype: object- GatewaytypesIngestionKey:+ ConfigMattermostAttachment:properties:- created_at:- format: date-time+ author_icon:type: string- expires_at:- format: date-time+ author_link:type: string- id:+ author_name:type: string- limits:+ color:+ type: string+ fallback:+ type: string+ fields:items:- $ref: '#/components/schemas/GatewaytypesLimit'- nullable: true+ $ref: '#/components/schemas/ConfigMattermostField'type: array- name:+ footer:+ type: string+ footer_icon:+ type: string+ image_url:+ type: string+ pretext:+ type: string+ text:+ type: string+ thumb_url:+ type: string+ title:+ type: string+ title_link:+ type: string+ type: object+ ConfigMattermostConfig:+ properties:+ attachments:+ items:+ $ref: '#/components/schemas/ConfigMattermostAttachment'+ type: array+ channel:+ type: string+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ icon_emoji:+ type: string+ icon_url:+ type: string+ priority:+ $ref: '#/components/schemas/ConfigMattermostPriority'+ props:+ $ref: '#/components/schemas/ConfigMattermostProps'+ send_resolved:+ type: boolean+ text:+ type: string+ type:+ type: string+ username:+ type: string+ webhook_url:+ $ref: '#/components/schemas/ConfigSecretURL'+ webhook_url_file:+ type: string+ type: object+ ConfigMattermostField:+ properties:+ short:+ nullable: true+ type: boolean+ title:+ type: string+ value:+ type: string+ type: object+ ConfigMattermostPriority:+ properties:+ persistent_notifications:+ type: boolean+ priority:+ type: string+ requested_ack:+ type: boolean+ type: object+ ConfigMattermostProps:+ properties:+ card:+ type: string+ type: object+ ConfigOAuth2:+ properties:+ audience:+ type: string+ claims:+ additionalProperties: {}+ type: object+ client_certificate_key:+ type: string+ client_certificate_key_file:+ type: string+ client_certificate_key_id:+ type: string+ client_certificate_key_ref:+ type: string+ client_id:+ type: string+ client_secret:+ type: string+ client_secret_file:+ type: string+ client_secret_ref:+ type: string+ endpoint_params:+ additionalProperties:+ type: string+ type: object+ grant_type:+ type: string+ iss:+ type: string+ no_proxy:+ type: string+ proxy_connect_header:+ $ref: '#/components/schemas/ConfigProxyHeader'+ proxy_from_environment:+ type: boolean+ proxy_url:+ $ref: '#/components/schemas/ConfigURL'+ scopes:+ items:+ type: string+ type: array+ signature_algorithm:+ type: string+ token_url:+ type: string+ type: object+ ConfigOpsGenieConfig:+ properties:+ actions:+ type: string+ api_key:+ type: string+ api_key_file:+ type: string+ api_url:+ $ref: '#/components/schemas/ConfigURLType2'+ description:+ type: string+ details:+ additionalProperties:+ type: string+ type: object+ entity:+ type: string+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ message:+ type: string+ note:+ type: string+ priority:+ type: string+ responders:+ items:+ $ref: '#/components/schemas/ConfigOpsGenieConfigResponder'+ type: array+ send_resolved:+ type: boolean+ source:+ type: string+ tags:+ type: string+ update_alerts:+ type: boolean+ type: object+ ConfigOpsGenieConfigResponder:+ properties:+ id:+ type: string+ name:+ type: string+ type:+ type: string+ username:+ type: string+ type: object+ ConfigPagerdutyConfig:+ properties:+ class:+ type: string+ client:+ type: string+ client_url:+ type: string+ component:+ type: string+ description:+ type: string+ details:+ additionalProperties: {}+ type: object+ group:+ type: string+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ images:+ items:+ $ref: '#/components/schemas/ConfigPagerdutyImage'+ type: array+ links:+ items:+ $ref: '#/components/schemas/ConfigPagerdutyLink'+ type: array+ routing_key:+ type: string+ routing_key_file:+ type: string+ send_resolved:+ type: boolean+ service_key:+ type: string+ service_key_file:+ type: string+ severity:+ type: string+ source:+ type: string+ timeout:+ $ref: '#/components/schemas/TimeDuration'+ url:+ $ref: '#/components/schemas/ConfigURLType2'+ type: object+ ConfigPagerdutyImage:+ properties:+ alt:+ type: string+ href:+ type: string+ src:+ type: string+ type: object+ ConfigPagerdutyLink:+ properties:+ href:+ type: string+ text:+ type: string+ type: object+ ConfigProxyHeader:+ additionalProperties:+ items:+ type: string+ type: array+ type: object+ ConfigPushoverConfig:+ properties:+ device:+ type: string+ expire:+ $ref: '#/components/schemas/ConfigDuration'+ html:+ type: boolean+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ message:+ type: string+ monospace:+ type: boolean+ priority:+ type: string+ retry:+ $ref: '#/components/schemas/ConfigDuration'+ send_resolved:+ type: boolean+ sound:+ type: string+ title:+ type: string+ token:+ type: string+ token_file:+ type: string+ ttl:+ $ref: '#/components/schemas/ConfigDuration'+ url:+ type: string+ url_title:+ type: string+ user_key:+ type: string+ user_key_file:+ type: string+ type: object+ ConfigReceiver:+ properties:+ discord_configs:+ items:+ $ref: '#/components/schemas/ConfigDiscordConfig'+ type: array+ email_configs:+ items:+ $ref: '#/components/schemas/ConfigEmailConfig'+ type: array+ incidentio_configs:+ items:+ $ref: '#/components/schemas/ConfigIncidentioConfig'+ type: array+ jira_configs:+ items:+ $ref: '#/components/schemas/ConfigJiraConfig'+ type: array+ mattermost_configs:+ items:+ $ref: '#/components/schemas/ConfigMattermostConfig'+ type: array+ msteams_configs:+ items:+ $ref: '#/components/schemas/ConfigMSTeamsConfig'+ type: array+ msteamsv2_configs:+ items:+ $ref: '#/components/schemas/ConfigMSTeamsV2Config'+ type: array+ name:+ type: string+ opsgenie_configs:+ items:+ $ref: '#/components/schemas/ConfigOpsGenieConfig'+ type: array+ pagerduty_configs:+ items:+ $ref: '#/components/schemas/ConfigPagerdutyConfig'+ type: array+ pushover_configs:+ items:+ $ref: '#/components/schemas/ConfigPushoverConfig'+ type: array+ rocketchat_configs:+ items:+ $ref: '#/components/schemas/ConfigRocketchatConfig'+ type: array+ slack_configs:+ items:+ $ref: '#/components/schemas/ConfigSlackConfig'+ type: array+ sns_configs:+ items:+ $ref: '#/components/schemas/ConfigSNSConfig'+ type: array+ telegram_configs:+ items:+ $ref: '#/components/schemas/ConfigTelegramConfig'+ type: array+ victorops_configs:+ items:+ $ref: '#/components/schemas/ConfigVictorOpsConfig'+ type: array+ webex_configs:+ items:+ $ref: '#/components/schemas/ConfigWebexConfig'+ type: array+ webhook_configs:+ items:+ $ref: '#/components/schemas/ConfigWebhookConfig'+ type: array+ wechat_configs:+ items:+ $ref: '#/components/schemas/ConfigWechatConfig'+ type: array+ type: object+ ConfigRocketchatAttachmentAction:+ properties:+ image_url:+ type: string+ is_webview:+ type: boolean+ msg:+ type: string+ msg_in_chat_window:+ type: boolean+ msg_processing_type:+ type: string+ text:+ type: string+ type:+ type: string+ url:+ type: string+ webview_height_ratio:+ type: string+ type: object+ ConfigRocketchatAttachmentField:+ properties:+ short:+ nullable: true+ type: boolean+ title:+ type: string+ value:+ type: string+ type: object+ ConfigRocketchatConfig:+ properties:+ actions:+ items:+ $ref: '#/components/schemas/ConfigRocketchatAttachmentAction'+ type: array+ api_url:+ $ref: '#/components/schemas/ConfigURLType2'+ channel:+ type: string+ color:+ type: string+ emoji:+ type: string+ fields:+ items:+ $ref: '#/components/schemas/ConfigRocketchatAttachmentField'+ type: array+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ icon_url:+ type: string+ image_url:+ type: string+ link_names:+ type: boolean+ send_resolved:+ type: boolean+ short_fields:+ type: boolean+ text:+ type: string+ thumb_url:+ type: string+ title:+ type: string+ title_link:+ type: string+ token:+ type: string+ token_file:+ type: string+ token_id:+ type: string+ token_id_file:+ type: string+ type: object+ ConfigSNSConfig:+ properties:+ api_url:+ type: string+ attributes:+ additionalProperties:+ type: string+ type: object+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ message:+ type: string+ phone_number:+ type: string+ send_resolved:+ type: boolean+ sigv4:+ $ref: '#/components/schemas/Sigv4SigV4Config'+ subject:+ type: string+ target_arn:+ type: string+ topic_arn:+ type: string+ type: object+ ConfigSecretURL:+ type: object+ ConfigSlackAction:+ properties:+ confirm:+ $ref: '#/components/schemas/ConfigSlackConfirmationField'+ name:+ type: string+ style:+ type: string+ text:+ type: string+ type:+ type: string+ url:+ type: string+ value:+ type: string+ type: object+ ConfigSlackConfig:+ properties:+ actions:+ items:+ $ref: '#/components/schemas/ConfigSlackAction'+ type: array+ api_url:+ $ref: '#/components/schemas/ConfigSecretURL'+ api_url_file:+ type: string+ app_token:+ type: string+ app_token_file:+ type: string+ app_url:+ $ref: '#/components/schemas/ConfigURLType2'+ callback_id:+ type: string+ channel:+ type: string+ color:+ type: string+ fallback:+ type: string+ fields:+ items:+ $ref: '#/components/schemas/ConfigSlackField'+ type: array+ footer:+ type: string+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ icon_emoji:+ type: string+ icon_url:+ type: string+ image_url:+ type: string+ link_names:+ type: boolean+ message_text:+ type: string+ mrkdwn_in:+ items:+ type: string+ type: array+ pretext:+ type: string+ send_resolved:+ type: boolean+ short_fields:+ type: boolean+ text:+ type: string+ thumb_url:+ type: string+ timeout:+ $ref: '#/components/schemas/TimeDuration'+ title:+ type: string+ title_link:+ type: string+ username:+ type: string+ type: object+ ConfigSlackConfirmationField:+ properties:+ dismiss_text:+ type: string+ ok_text:+ type: string+ text:+ type: string+ title:+ type: string+ type: object+ ConfigSlackField:+ properties:+ short:+ nullable: true+ type: boolean+ title:+ type: string+ value:+ type: string+ type: object+ ConfigTLSConfig:+ properties:+ ca:+ type: string+ ca_file:+ type: string+ ca_ref:+ type: string+ cert:+ type: string+ cert_file:+ type: string+ cert_ref:+ type: string+ insecure_skip_verify:+ type: boolean+ key:+ type: string+ key_file:+ type: string+ key_ref:+ type: string+ max_version:+ minimum: 0+ type: integer+ min_version:+ minimum: 0+ type: integer+ server_name:+ type: string+ type: object+ ConfigTelegramConfig:+ properties:+ api_url:+ $ref: '#/components/schemas/ConfigURLType2'+ chat:+ format: int64+ type: integer+ chat_file:+ type: string+ disable_notifications:+ type: boolean+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ message:+ type: string+ message_thread_id:+ type: integer+ parse_mode:+ type: string+ send_resolved:+ type: boolean+ token:+ type: string+ token_file:+ type: string+ type: object+ ConfigThreadingConfig:+ properties:+ enabled:+ type: boolean+ thread_by_date:+ type: string+ type: object+ ConfigURL:+ type: object+ ConfigURLType2:+ type: object+ ConfigVictorOpsConfig:+ properties:+ api_key:+ type: string+ api_key_file:+ type: string+ api_url:+ $ref: '#/components/schemas/ConfigURLType2'+ custom_fields:+ additionalProperties:+ type: string+ type: object+ entity_display_name:+ type: string+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ message_type:+ type: string+ monitoring_tool:+ type: string+ routing_key:+ type: string+ send_resolved:+ type: boolean+ state_message:+ type: string+ type: object+ ConfigWebexConfig:+ properties:+ api_url:+ $ref: '#/components/schemas/ConfigURLType2'+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ message:+ type: string+ room_id:+ type: string+ send_resolved:+ type: boolean+ type: object+ ConfigWebhookConfig:+ properties:+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ max_alerts:+ minimum: 0+ type: integer+ send_resolved:+ type: boolean+ timeout:+ $ref: '#/components/schemas/TimeDuration'+ url:+ type: string+ url_file:+ type: string+ type: object+ ConfigWechatConfig:+ properties:+ agent_id:+ type: string+ api_secret:+ type: string+ api_secret_file:+ type: string+ api_url:+ $ref: '#/components/schemas/ConfigURLType2'+ corp_id:+ type: string+ http_config:+ $ref: '#/components/schemas/ConfigHTTPClientConfig'+ message:+ type: string+ message_type:+ type: string+ send_resolved:+ type: boolean+ to_party:+ type: string+ to_tag:+ type: string+ to_user:+ type: string+ type: object+ DashboardtypesDashboard:+ properties:+ createdAt:+ format: date-time+ type: string+ createdBy:+ type: string+ data:+ $ref: '#/components/schemas/DashboardtypesStorableDashboardData'+ id:+ type: string+ locked:+ type: boolean+ org_id:+ type: string+ updatedAt:+ format: date-time+ type: string+ updatedBy:+ type: string+ type: object+ DashboardtypesGettablePublicDasbhboard:+ properties:+ defaultTimeRange:+ type: string+ publicPath:+ type: string+ timeRangeEnabled:+ type: boolean+ type: object+ DashboardtypesGettablePublicDashboardData:+ properties:+ dashboard:+ $ref: '#/components/schemas/DashboardtypesDashboard'+ publicDashboard:+ $ref: '#/components/schemas/DashboardtypesGettablePublicDasbhboard'+ type: object+ DashboardtypesPostablePublicDashboard:+ properties:+ defaultTimeRange:+ type: string+ timeRangeEnabled:+ type: boolean+ type: object+ DashboardtypesStorableDashboardData:+ additionalProperties: {}+ type: object+ DashboardtypesUpdatablePublicDashboard:+ properties:+ defaultTimeRange:+ type: string+ timeRangeEnabled:+ type: boolean+ type: object+ ErrorsJSON:+ properties:+ code:+ type: string+ errors:+ items:+ $ref: '#/components/schemas/ErrorsResponseerroradditional'+ type: array+ message:+ type: string+ url:+ type: string+ required:+ - code+ - message+ type: object+ ErrorsResponseerroradditional:+ properties:+ message:+ type: string+ type: object+ FactoryResponse:+ properties:+ healthy:+ type: boolean+ services:+ additionalProperties:+ items:+ type: string+ type: array+ nullable: true+ type: object+ type: object+ FeaturetypesGettableFeature:+ properties:+ defaultVariant:+ type: string+ description:+ type: string+ kind:+ type: string+ name:+ type: string+ resolvedValue: {}+ stage:+ type: string+ variants:+ additionalProperties: {}+ nullable: true+ type: object+ type: object+ GatewaytypesGettableCreatedIngestionKey:+ properties:+ id:+ type: string+ value:+ type: string+ required:+ - id+ - value+ type: object+ GatewaytypesGettableCreatedIngestionKeyLimit:+ properties:+ id:+ type: string+ required:+ - id+ type: object+ GatewaytypesGettableIngestionKeys:+ properties:+ _pagination:+ $ref: '#/components/schemas/GatewaytypesPagination'+ keys:+ items:+ $ref: '#/components/schemas/GatewaytypesIngestionKey'+ nullable: true+ type: array+ type: object+ GatewaytypesIngestionKey:+ properties:+ created_at:+ format: date-time+ type: string+ expires_at:+ format: date-time+ type: string+ id:+ type: string+ limits:+ items:+ $ref: '#/components/schemas/GatewaytypesLimit'+ nullable: true+ type: array+ name:type: stringtags:items:@@ -1584,6 +2656,13 @@ components:- summary- exponentialhistogramtype: string+ ModelDuration:+ format: int64+ type: integer+ ModelLabelSet:+ additionalProperties:+ type: string+ type: objectPreferencetypesPreference:properties:allowedScopes:@@ -2698,6 +3777,8 @@ components:- name- expiresAttype: object+ Sigv4SigV4Config:+ type: objectTelemetrytypesFieldContext:enum:- metric@@ -2787,6 +3868,24 @@ components:type: stringtype: arraytype: object+ TimeDuration:+ format: int64+ type: integer+ TypesAlertStatus:+ properties:+ inhibitedBy:+ items:+ type: string+ nullable: true+ type: array+ silencedBy:+ items:+ type: string+ nullable: true+ type: array+ state:+ type: string+ type: objectTypesChangePasswordRequest:properties:newPassword:@@ -3058,18 +4157,183 @@ info:version: ""openapi: 3.0.3paths:+ /api/v1/alerts:+ get:+ deprecated: false+ description: This endpoint returns alerts for the organization+ operationId: GetAlerts+ responses:+ "200":+ content:+ application/json:+ schema:+ properties:+ data:+ items:+ $ref: '#/components/schemas/AlertmanagertypesDeprecatedGettableAlert'+ type: array+ status:+ type: string+ required:+ - status+ - data+ type: object+ description: OK+ "401":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unauthorized+ "403":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Forbidden+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Error+ security:+ - api_key:+ - VIEWER+ - tokenizer:+ - VIEWER+ summary: Get alerts+ tags:+ - alerts/api/v1/authz/check:post:deprecated: false- description: Checks if the authenticated user has permissions for given transactions- operationId: AuthzCheck+ description: Checks if the authenticated user has permissions for given transactions+ operationId: AuthzCheck+ requestBody:+ content:+ application/json:+ schema:+ items:+ $ref: '#/components/schemas/AuthtypesTransaction'+ type: array+ responses:+ "200":+ content:+ application/json:+ schema:+ properties:+ data:+ items:+ $ref: '#/components/schemas/AuthtypesGettableTransaction'+ type: array+ status:+ type: string+ required:+ - status+ - data+ type: object+ description: OK+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Error+ summary: Check permissions+ tags:+ - authz+ /api/v1/authz/resources:+ get:+ deprecated: false+ description: Gets all the available resources+ operationId: AuthzResources+ responses:+ "200":+ content:+ application/json:+ schema:+ properties:+ data:+ $ref: '#/components/schemas/AuthtypesGettableResources'+ status:+ type: string+ required:+ - status+ - data+ type: object+ description: OK+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Error+ summary: Get resources+ tags:+ - authz+ /api/v1/changePassword/{id}:+ post:+ deprecated: false+ description: This endpoint changes the password by id+ operationId: ChangePassword+ parameters:+ - in: path+ name: id+ required: true+ schema:+ type: stringrequestBody:content:application/json:schema:- items:- $ref: '#/components/schemas/AuthtypesTransaction'- type: array+ $ref: '#/components/schemas/TypesChangePasswordRequest'+ responses:+ "204":+ description: No Content+ "400":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Bad Request+ "401":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unauthorized+ "403":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Forbidden+ "404":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Not Found+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Error+ security:+ - api_key:+ - ADMIN+ - tokenizer:+ - ADMIN+ summary: Change password+ tags:+ - users+ /api/v1/channels:+ get:+ deprecated: false+ description: This endpoint lists all notification channels for the organization+ operationId: ListChannelsresponses:"200":content:@@ -3078,7 +4342,7 @@ paths:properties:data:items:- $ref: '#/components/schemas/AuthtypesGettableTransaction'+ $ref: '#/components/schemas/AlertmanagertypesChannel'type: arraystatus:type: string@@ -3087,20 +4351,144 @@ paths:- datatype: objectdescription: OK+ "401":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unauthorized+ "403":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Forbidden"500":content:application/json:schema:$ref: '#/components/schemas/RenderErrorResponse'description: Internal Server Error- summary: Check permissions+ security:+ - api_key:+ - VIEWER+ - tokenizer:+ - VIEWER+ summary: List notification channelstags:- - authz- /api/v1/authz/resources:+ - channels+ post:+ deprecated: false+ description: This endpoint creates a notification channel+ operationId: CreateChannel+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ConfigReceiver'+ responses:+ "201":+ content:+ application/json:+ schema:+ properties:+ data:+ $ref: '#/components/schemas/AlertmanagertypesChannel'+ status:+ type: string+ required:+ - status+ - data+ type: object+ description: Created+ "400":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Bad Request+ "401":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unauthorized+ "403":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Forbidden+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Error+ security:+ - api_key:+ - ADMIN+ - tokenizer:+ - ADMIN+ summary: Create notification channel+ tags:+ - channels+ /api/v1/channels/{id}:+ delete:+ deprecated: false+ description: This endpoint deletes a notification channel by ID+ operationId: DeleteChannelByID+ parameters:+ - in: path+ name: id+ required: true+ schema:+ type: string+ responses:+ "204":+ description: No Content+ "401":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unauthorized+ "403":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Forbidden+ "404":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Not Found+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Error+ security:+ - api_key:+ - ADMIN+ - tokenizer:+ - ADMIN+ summary: Delete notification channel+ tags:+ - channelsget:deprecated: false- description: Gets all the available resources- operationId: AuthzResources+ description: This endpoint returns a notification channel by ID+ operationId: GetChannelByID+ parameters:+ - in: path+ name: id+ required: true+ schema:+ type: stringresponses:"200":content:@@ -3108,7 +4496,7 @@ paths:schema:properties:data:- $ref: '#/components/schemas/AuthtypesGettableResources'+ $ref: '#/components/schemas/AlertmanagertypesChannel'status:type: stringrequired:@@ -3116,20 +4504,42 @@ paths:- datatype: objectdescription: OK+ "401":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unauthorized+ "403":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Forbidden+ "404":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Not Found"500":content:application/json:schema:$ref: '#/components/schemas/RenderErrorResponse'description: Internal Server Error- summary: Get resources+ security:+ - api_key:+ - VIEWER+ - tokenizer:+ - VIEWER+ summary: Get notification channel by IDtags:- - authz- /api/v1/changePassword/{id}:- post:+ - channels+ put:deprecated: false- description: This endpoint changes the password by id- operationId: ChangePassword+ description: This endpoint updates a notification channel by ID+ operationId: UpdateChannelByIDparameters:- in: pathname: id@@ -3140,7 +4550,7 @@ paths:content:application/json:schema:- $ref: '#/components/schemas/TypesChangePasswordRequest'+ $ref: '#/components/schemas/ConfigReceiver'responses:"204":description: No Content@@ -3167,7 +4577,52 @@ paths:application/json:schema:$ref: '#/components/schemas/RenderErrorResponse'- description: Not Found+ description: Not Found+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Error+ security:+ - api_key:+ - ADMIN+ - tokenizer:+ - ADMIN+ summary: Update notification channel+ tags:+ - channels+ /api/v1/channels/test:+ post:+ deprecated: false+ description: This endpoint tests a notification channel by sending a test notification+ operationId: TestChannel+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ConfigReceiver'+ responses:+ "204":+ description: No Content+ "400":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Bad Request+ "401":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unauthorized+ "403":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Forbidden"500":content:application/json:@@ -3176,12 +4631,12 @@ paths:description: Internal Server Errorsecurity:- api_key:- - ADMIN+ - EDITOR- tokenizer:- - ADMIN- summary: Change password+ - EDITOR+ summary: Test notification channeltags:- - users+ - channels/api/v1/cloud-integrations/{cloud_provider}/agent-check-in:post:deprecated: true@@ -5286,26 +6741,283 @@ paths:schema:$ref: '#/components/schemas/AuthtypesPostableRole'responses:- "201":+ "201":+ content:+ application/json:+ schema:+ properties:+ data:+ $ref: '#/components/schemas/TypesIdentifiable'+ status:+ type: string+ required:+ - status+ - data+ type: object+ description: Created+ "400":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Bad Request+ "401":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unauthorized+ "403":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Forbidden+ "409":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Conflict+ "451":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unavailable For Legal Reasons+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Error+ "501":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Not Implemented+ security:+ - api_key:+ - ADMIN+ - tokenizer:+ - ADMIN+ summary: Create role+ tags:+ - role+ /api/v1/roles/{id}:+ delete:+ deprecated: false+ description: This endpoint deletes a role+ operationId: DeleteRole+ parameters:+ - in: path+ name: id+ required: true+ schema:+ type: string+ responses:+ "204":+ content:+ application/json:+ schema:+ type: string+ description: No Content+ "401":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unauthorized+ "403":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Forbidden+ "404":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Not Found+ "451":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unavailable For Legal Reasons+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Error+ "501":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Not Implemented+ security:+ - api_key:+ - ADMIN+ - tokenizer:+ - ADMIN+ summary: Delete role+ tags:+ - role+ get:+ deprecated: false+ description: This endpoint gets a role+ operationId: GetRole+ parameters:+ - in: path+ name: id+ required: true+ schema:+ type: string+ responses:+ "200":+ content:+ application/json:+ schema:+ properties:+ data:+ $ref: '#/components/schemas/AuthtypesRole'+ status:+ type: string+ required:+ - status+ - data+ type: object+ description: OK+ "401":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unauthorized+ "403":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Forbidden+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Error+ security:+ - api_key:+ - ADMIN+ - tokenizer:+ - ADMIN+ summary: Get role+ tags:+ - role+ patch:+ deprecated: false+ description: This endpoint patches a role+ operationId: PatchRole+ parameters:+ - in: path+ name: id+ required: true+ schema:+ type: string+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/AuthtypesPatchableRole'+ responses:+ "204":+ content:+ application/json:+ schema:+ type: string+ description: No Content+ "401":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unauthorized+ "403":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Forbidden+ "404":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Not Found+ "451":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unavailable For Legal Reasons+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Error+ "501":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Not Implemented+ security:+ - api_key:+ - ADMIN+ - tokenizer:+ - ADMIN+ summary: Patch role+ tags:+ - role+ /api/v1/roles/{id}/relation/{relation}/objects:+ get:+ deprecated: false+ description: Gets all objects connected to the specified role via a given relation+ type+ operationId: GetObjects+ parameters:+ - in: path+ name: id+ required: true+ schema:+ type: string+ - in: path+ name: relation+ required: true+ schema:+ type: string+ responses:+ "200":content:application/json:schema:properties:data:- $ref: '#/components/schemas/TypesIdentifiable'+ items:+ $ref: '#/components/schemas/AuthtypesGettableObjects'+ type: arraystatus:type: stringrequired:- status- datatype: object- description: Created- "400":- content:- application/json:- schema:- $ref: '#/components/schemas/RenderErrorResponse'- description: Bad Request+ description: OK"401":content:application/json:@@ -5318,12 +7030,12 @@ paths:schema:$ref: '#/components/schemas/RenderErrorResponse'description: Forbidden- "409":+ "404":content:application/json:schema:$ref: '#/components/schemas/RenderErrorResponse'- description: Conflict+ description: Not Found"451":content:application/json:@@ -5347,20 +7059,30 @@ paths:- ADMIN- tokenizer:- ADMIN- summary: Create role+ summary: Get objects for a role by relationtags:- role- /api/v1/roles/{id}:- delete:+ patch:deprecated: false- description: This endpoint deletes a role- operationId: DeleteRole+ description: Patches the objects connected to the specified role via a given+ relation type+ operationId: PatchObjectsparameters:- in: pathname: idrequired: trueschema:type: string+ - in: path+ name: relation+ required: true+ schema:+ type: string+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/AuthtypesPatchableObjects'responses:"204":content:@@ -5368,6 +7090,12 @@ paths:schema:type: stringdescription: No Content+ "400":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Bad Request"401":content:application/json:@@ -5409,19 +7137,14 @@ paths:- ADMIN- tokenizer:- ADMIN- summary: Delete role+ summary: Patch objects for a role by relationtags:- role+ /api/v1/route_policies:get:deprecated: false- description: This endpoint gets a role- operationId: GetRole- parameters:- - in: path- name: id- required: true- schema:- type: string+ description: This endpoint lists all route policies for the organization+ operationId: GetAllRoutePoliciesresponses:"200":content:@@ -5429,7 +7152,9 @@ paths:schema:properties:data:- $ref: '#/components/schemas/AuthtypesRole'+ items:+ $ref: '#/components/schemas/AlertmanagertypesGettableRoutePolicy'+ type: arraystatus:type: stringrequired:@@ -5457,34 +7182,42 @@ paths:description: Internal Server Errorsecurity:- api_key:- - ADMIN+ - VIEWER- tokenizer:- - ADMIN- summary: Get role+ - VIEWER+ summary: List route policiestags:- - role- patch:+ - routepolicies+ post:deprecated: false- description: This endpoint patches a role- operationId: PatchRole- parameters:- - in: path- name: id- required: true- schema:- type: string+ description: This endpoint creates a route policy+ operationId: CreateRoutePolicyrequestBody:content:application/json:schema:- $ref: '#/components/schemas/AuthtypesPatchableRole'+ $ref: '#/components/schemas/AlertmanagertypesPostableRoutePolicy'responses:- "204":+ "201":content:application/json:schema:- type: string- description: No Content+ properties:+ data:+ $ref: '#/components/schemas/AlertmanagertypesGettableRoutePolicy'+ status:+ type: string+ required:+ - status+ - data+ type: object+ description: Created+ "400":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Bad Request"401":content:application/json:@@ -5497,55 +7230,76 @@ paths:schema:$ref: '#/components/schemas/RenderErrorResponse'description: Forbidden- "404":+ "500":content:application/json:schema:$ref: '#/components/schemas/RenderErrorResponse'- description: Not Found- "451":+ description: Internal Server Error+ security:+ - api_key:+ - ADMIN+ - tokenizer:+ - ADMIN+ summary: Create route policy+ tags:+ - routepolicies+ /api/v1/route_policies/{id}:+ delete:+ deprecated: false+ description: This endpoint deletes a route policy by ID+ operationId: DeleteRoutePolicyByID+ parameters:+ - in: path+ name: id+ required: true+ schema:+ type: string+ responses:+ "204":+ description: No Content+ "401":content:application/json:schema:$ref: '#/components/schemas/RenderErrorResponse'- description: Unavailable For Legal Reasons- "500":+ description: Unauthorized+ "403":content:application/json:schema:$ref: '#/components/schemas/RenderErrorResponse'- description: Internal Server Error- "501":+ description: Forbidden+ "404":content:application/json:schema:$ref: '#/components/schemas/RenderErrorResponse'- description: Not Implemented+ description: Not Found+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Errorsecurity:- api_key:- ADMIN- tokenizer:- ADMIN- summary: Patch role+ summary: Delete route policytags:- - role- /api/v1/roles/{id}/relation/{relation}/objects:+ - routepoliciesget:deprecated: false- description: Gets all objects connected to the specified role via a given relation- type- operationId: GetObjects+ description: This endpoint returns a route policy by ID+ operationId: GetRoutePolicyByIDparameters:- in: pathname: idrequired: trueschema:type: string- - in: path- name: relation- required: true- schema:- type: stringresponses:"200":content:@@ -5553,9 +7307,7 @@ paths:schema:properties:data:- items:- $ref: '#/components/schemas/AuthtypesGettableObjects'- type: array+ $ref: '#/components/schemas/AlertmanagertypesGettableRoutePolicy'status:type: stringrequired:@@ -5581,60 +7333,50 @@ paths:schema:$ref: '#/components/schemas/RenderErrorResponse'description: Not Found- "451":- content:- application/json:- schema:- $ref: '#/components/schemas/RenderErrorResponse'- description: Unavailable For Legal Reasons"500":content:application/json:schema:$ref: '#/components/schemas/RenderErrorResponse'description: Internal Server Error- "501":- content:- application/json:- schema:- $ref: '#/components/schemas/RenderErrorResponse'- description: Not Implementedsecurity:- api_key:- - ADMIN+ - VIEWER- tokenizer:- - ADMIN- summary: Get objects for a role by relation+ - VIEWER+ summary: Get route policy by IDtags:- - role- patch:+ - routepolicies+ put:deprecated: false- description: Patches the objects connected to the specified role via a given- relation type- operationId: PatchObjects+ description: This endpoint updates a route policy by ID+ operationId: UpdateRoutePolicyparameters:- in: pathname: idrequired: trueschema:type: string- - in: path- name: relation- required: true- schema:- type: stringrequestBody:content:application/json:schema:- $ref: '#/components/schemas/AuthtypesPatchableObjects'+ $ref: '#/components/schemas/AlertmanagertypesPostableRoutePolicy'responses:- "204":+ "200":content:application/json:schema:- type: string- description: No Content+ properties:+ data:+ $ref: '#/components/schemas/AlertmanagertypesGettableRoutePolicy'+ status:+ type: string+ required:+ - status+ - data+ type: object+ description: OK"400":content:application/json:@@ -5659,32 +7401,20 @@ paths:schema:$ref: '#/components/schemas/RenderErrorResponse'description: Not Found- "451":- content:- application/json:- schema:- $ref: '#/components/schemas/RenderErrorResponse'- description: Unavailable For Legal Reasons"500":content:application/json:schema:$ref: '#/components/schemas/RenderErrorResponse'description: Internal Server Error- "501":- content:- application/json:- schema:- $ref: '#/components/schemas/RenderErrorResponse'- description: Not Implementedsecurity:- api_key:- ADMIN- tokenizer:- ADMIN- summary: Patch objects for a role by relation+ summary: Update route policytags:- - role+ - routepolicies/api/v1/service_accounts:get:deprecated: false@@ -6442,6 +8172,51 @@ paths:summary: Updates my service accounttags:- serviceaccount+ /api/v1/testChannel:+ post:+ deprecated: true+ description: 'Deprecated: use /api/v1/channels/test instead'+ operationId: TestChannelDeprecated+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ConfigReceiver'+ responses:+ "204":+ description: No Content+ "400":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Bad Request+ "401":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Unauthorized+ "403":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Forbidden+ "500":+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/RenderErrorResponse'+ description: Internal Server Error+ security:+ - api_key:+ - EDITOR+ - tokenizer:+ - EDITOR+ summary: Test notification channel (deprecated)+ tags:+ - channels/api/v1/user:get:deprecated: falsediff --git a/ee/query-service/app/api/api.go b/ee/query-service/app/api/api.goindex f835653608..5713766369 100644--- a/ee/query-service/app/api/api.go+++ b/ee/query-service/app/api/api.go@@ -6,7 +6,6 @@ import ("github.com/SigNoz/signoz/ee/licensing/httplicensing""github.com/SigNoz/signoz/ee/query-service/usage"- "github.com/SigNoz/signoz/pkg/alertmanager""github.com/SigNoz/signoz/pkg/global""github.com/SigNoz/signoz/pkg/http/middleware"baseapp "github.com/SigNoz/signoz/pkg/query-service/app"@@ -49,7 +48,6 @@ func NewAPIHandler(opts APIHandlerOptions, signoz *signoz.SigNoz, config signoz.CloudIntegrationsController: opts.CloudIntegrationsController,LogsParsingPipelineController: opts.LogsParsingPipelineController,FluxInterval: opts.FluxInterval,- AlertmanagerAPI: alertmanager.NewAPI(signoz.Alertmanager),LicensingAPI: httplicensing.NewLicensingAPI(signoz.Licensing),Signoz: signoz,QueryParserAPI: queryparser.NewAPI(signoz.Instrumentation.ToProviderSettings(), signoz.QueryParser),diff --git a/frontend/src/api/generated/services/alerts/index.ts b/frontend/src/api/generated/services/alerts/index.tsnew file mode 100644index 0000000000..1352bd23db--- /dev/null+++ b/frontend/src/api/generated/services/alerts/index.ts@@ -0,0 +1,97 @@+/**+ * ! Do not edit manually+ * * The file has been auto-generated using Orval for SigNoz+ * * regenerate with 'yarn generate:api'+ * SigNoz+ */+import type {+ InvalidateOptions,+ QueryClient,+ QueryFunction,+ QueryKey,+ UseQueryOptions,+ UseQueryResult,+} from 'react-query';+import { useQuery } from 'react-query';++import type { ErrorType } from '../../../generatedAPIInstance';+import { GeneratedAPIInstance } from '../../../generatedAPIInstance';+import type { GetAlerts200, RenderErrorResponseDTO } from '../sigNoz.schemas';++/**+ * This endpoint returns alerts for the organization+ * @summary Get alerts+ */+export const getAlerts = (signal?: AbortSignal) => {+ return GeneratedAPIInstance<GetAlerts200>({+ url: `/api/v1/alerts`,+ method: 'GET',+ signal,+ });+};++export const getGetAlertsQueryKey = () => {+ return [`/api/v1/alerts`] as const;+};++export const getGetAlertsQueryOptions = <+ TData = Awaited<ReturnType<typeof getAlerts>>,+ TError = ErrorType<RenderErrorResponseDTO>+>(options?: {+ query?: UseQueryOptions<Awaited<ReturnType<typeof getAlerts>>, TError, TData>;+}) => {+ const { query: queryOptions } = options ?? {};++ const queryKey = queryOptions?.queryKey ?? getGetAlertsQueryKey();++ const queryFn: QueryFunction<Awaited<ReturnType<typeof getAlerts>>> = ({+ signal,+ }) => getAlerts(signal);++ return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<+ Awaited<ReturnType<typeof getAlerts>>,+ TError,+ TData+ > & { queryKey: QueryKey };+};++export type GetAlertsQueryResult = NonNullable<+ Awaited<ReturnType<typeof getAlerts>>+>;+export type GetAlertsQueryError = ErrorType<RenderErrorResponseDTO>;++/**+ * @summary Get alerts+ */++export function useGetAlerts<+ TData = Awaited<ReturnType<typeof getAlerts>>,+ TError = ErrorType<RenderErrorResponseDTO>+>(options?: {+ query?: UseQueryOptions<Awaited<ReturnType<typeof getAlerts>>, TError, TData>;+}): UseQueryResult<TData, TError> & { queryKey: QueryKey } {+ const queryOptions = getGetAlertsQueryOptions(options);++ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {+ queryKey: QueryKey;+ };++ query.queryKey = queryOptions.queryKey;++ return query;+}++/**+ * @summary Get alerts+ */+export const invalidateGetAlerts = async (+ queryClient: QueryClient,+ options?: InvalidateOptions,+): Promise<QueryClient> => {+ await queryClient.invalidateQueries(+ { queryKey: getGetAlertsQueryKey() },+ options,+ );++ return queryClient;+};diff --git a/frontend/src/api/generated/services/channels/index.ts b/frontend/src/api/generated/services/channels/index.tsnew file mode 100644index 0000000000..274772dbf9--- /dev/null+++ b/frontend/src/api/generated/services/channels/index.ts@@ -0,0 +1,646 @@+/**+ * ! Do not edit manually+ * * The file has been auto-generated using Orval for SigNoz+ * * regenerate with 'yarn generate:api'+ * SigNoz+ */+import type {+ InvalidateOptions,+ MutationFunction,+ QueryClient,+ QueryFunction,+ QueryKey,+ UseMutationOptions,+ UseMutationResult,+ UseQueryOptions,+ UseQueryResult,+} from 'react-query';+import { useMutation, useQuery } from 'react-query';++import type { BodyType, ErrorType } from '../../../generatedAPIInstance';+import { GeneratedAPIInstance } from '../../../generatedAPIInstance';+import type {+ ConfigReceiverDTO,+ CreateChannel201,+ DeleteChannelByIDPathParameters,+ GetChannelByID200,+ GetChannelByIDPathParameters,+ ListChannels200,+ RenderErrorResponseDTO,+ UpdateChannelByIDPathParameters,+} from '../sigNoz.schemas';++/**+ * This endpoint lists all notification channels for the organization+ * @summary List notification channels+ */+export const listChannels = (signal?: AbortSignal) => {+ return GeneratedAPIInstance<ListChannels200>({+ url: `/api/v1/channels`,+ method: 'GET',+ signal,+ });+};++export const getListChannelsQueryKey = () => {+ return [`/api/v1/channels`] as const;+};++export const getListChannelsQueryOptions = <+ TData = Awaited<ReturnType<typeof listChannels>>,+ TError = ErrorType<RenderErrorResponseDTO>+>(options?: {+ query?: UseQueryOptions<+ Awaited<ReturnType<typeof listChannels>>,+ TError,+ TData+ >;+}) => {+ const { query: queryOptions } = options ?? {};++ const queryKey = queryOptions?.queryKey ?? getListChannelsQueryKey();++ const queryFn: QueryFunction<Awaited<ReturnType<typeof listChannels>>> = ({+ signal,+ }) => listChannels(signal);++ return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<+ Awaited<ReturnType<typeof listChannels>>,+ TError,+ TData+ > & { queryKey: QueryKey };+};++export type ListChannelsQueryResult = NonNullable<+ Awaited<ReturnType<typeof listChannels>>+>;+export type ListChannelsQueryError = ErrorType<RenderErrorResponseDTO>;++/**+ * @summary List notification channels+ */++export function useListChannels<+ TData = Awaited<ReturnType<typeof listChannels>>,+ TError = ErrorType<RenderErrorResponseDTO>+>(options?: {+ query?: UseQueryOptions<+ Awaited<ReturnType<typeof listChannels>>,+ TError,+ TData+ >;+}): UseQueryResult<TData, TError> & { queryKey: QueryKey } {+ const queryOptions = getListChannelsQueryOptions(options);++ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {+ queryKey: QueryKey;+ };++ query.queryKey = queryOptions.queryKey;++ return query;+}++/**+ * @summary List notification channels+ */+export const invalidateListChannels = async (+ queryClient: QueryClient,+ options?: InvalidateOptions,+): Promise<QueryClient> => {+ await queryClient.invalidateQueries(+ { queryKey: getListChannelsQueryKey() },+ options,+ );++ return queryClient;+};++/**+ * This endpoint creates a notification channel+ * @summary Create notification channel+ */+export const createChannel = (+ configReceiverDTO: BodyType<ConfigReceiverDTO>,+ signal?: AbortSignal,+) => {+ return GeneratedAPIInstance<CreateChannel201>({+ url: `/api/v1/channels`,+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ data: configReceiverDTO,+ signal,+ });+};++export const getCreateChannelMutationOptions = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof createChannel>>,+ TError,+ { data: BodyType<ConfigReceiverDTO> },+ TContext+ >;+}): UseMutationOptions<+ Awaited<ReturnType<typeof createChannel>>,+ TError,+ { data: BodyType<ConfigReceiverDTO> },+ TContext+> => {+ const mutationKey = ['createChannel'];+ const { mutation: mutationOptions } = options+ ? options.mutation &&+ 'mutationKey' in options.mutation &&+ options.mutation.mutationKey+ ? options+ : { ...options, mutation: { ...options.mutation, mutationKey } }+ : { mutation: { mutationKey } };++ const mutationFn: MutationFunction<+ Awaited<ReturnType<typeof createChannel>>,+ { data: BodyType<ConfigReceiverDTO> }+ > = (props) => {+ const { data } = props ?? {};++ return createChannel(data);+ };++ return { mutationFn, ...mutationOptions };+};++export type CreateChannelMutationResult = NonNullable<+ Awaited<ReturnType<typeof createChannel>>+>;+export type CreateChannelMutationBody = BodyType<ConfigReceiverDTO>;+export type CreateChannelMutationError = ErrorType<RenderErrorResponseDTO>;++/**+ * @summary Create notification channel+ */+export const useCreateChannel = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof createChannel>>,+ TError,+ { data: BodyType<ConfigReceiverDTO> },+ TContext+ >;+}): UseMutationResult<+ Awaited<ReturnType<typeof createChannel>>,+ TError,+ { data: BodyType<ConfigReceiverDTO> },+ TContext+> => {+ const mutationOptions = getCreateChannelMutationOptions(options);++ return useMutation(mutationOptions);+};+/**+ * This endpoint deletes a notification channel by ID+ * @summary Delete notification channel+ */+export const deleteChannelByID = ({ id }: DeleteChannelByIDPathParameters) => {+ return GeneratedAPIInstance<void>({+ url: `/api/v1/channels/${id}`,+ method: 'DELETE',+ });+};++export const getDeleteChannelByIDMutationOptions = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof deleteChannelByID>>,+ TError,+ { pathParams: DeleteChannelByIDPathParameters },+ TContext+ >;+}): UseMutationOptions<+ Awaited<ReturnType<typeof deleteChannelByID>>,+ TError,+ { pathParams: DeleteChannelByIDPathParameters },+ TContext+> => {+ const mutationKey = ['deleteChannelByID'];+ const { mutation: mutationOptions } = options+ ? options.mutation &&+ 'mutationKey' in options.mutation &&+ options.mutation.mutationKey+ ? options+ : { ...options, mutation: { ...options.mutation, mutationKey } }+ : { mutation: { mutationKey } };++ const mutationFn: MutationFunction<+ Awaited<ReturnType<typeof deleteChannelByID>>,+ { pathParams: DeleteChannelByIDPathParameters }+ > = (props) => {+ const { pathParams } = props ?? {};++ return deleteChannelByID(pathParams);+ };++ return { mutationFn, ...mutationOptions };+};++export type DeleteChannelByIDMutationResult = NonNullable<+ Awaited<ReturnType<typeof deleteChannelByID>>+>;++export type DeleteChannelByIDMutationError = ErrorType<RenderErrorResponseDTO>;++/**+ * @summary Delete notification channel+ */+export const useDeleteChannelByID = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof deleteChannelByID>>,+ TError,+ { pathParams: DeleteChannelByIDPathParameters },+ TContext+ >;+}): UseMutationResult<+ Awaited<ReturnType<typeof deleteChannelByID>>,+ TError,+ { pathParams: DeleteChannelByIDPathParameters },+ TContext+> => {+ const mutationOptions = getDeleteChannelByIDMutationOptions(options);++ return useMutation(mutationOptions);+};+/**+ * This endpoint returns a notification channel by ID+ * @summary Get notification channel by ID+ */+export const getChannelByID = (+ { id }: GetChannelByIDPathParameters,+ signal?: AbortSignal,+) => {+ return GeneratedAPIInstance<GetChannelByID200>({+ url: `/api/v1/channels/${id}`,+ method: 'GET',+ signal,+ });+};++export const getGetChannelByIDQueryKey = ({+ id,+}: GetChannelByIDPathParameters) => {+ return [`/api/v1/channels/${id}`] as const;+};++export const getGetChannelByIDQueryOptions = <+ TData = Awaited<ReturnType<typeof getChannelByID>>,+ TError = ErrorType<RenderErrorResponseDTO>+>(+ { id }: GetChannelByIDPathParameters,+ options?: {+ query?: UseQueryOptions<+ Awaited<ReturnType<typeof getChannelByID>>,+ TError,+ TData+ >;+ },+) => {+ const { query: queryOptions } = options ?? {};++ const queryKey = queryOptions?.queryKey ?? getGetChannelByIDQueryKey({ id });++ const queryFn: QueryFunction<Awaited<ReturnType<typeof getChannelByID>>> = ({+ signal,+ }) => getChannelByID({ id }, signal);++ return {+ queryKey,+ queryFn,+ enabled: !!id,+ ...queryOptions,+ } as UseQueryOptions<+ Awaited<ReturnType<typeof getChannelByID>>,+ TError,+ TData+ > & { queryKey: QueryKey };+};++export type GetChannelByIDQueryResult = NonNullable<+ Awaited<ReturnType<typeof getChannelByID>>+>;+export type GetChannelByIDQueryError = ErrorType<RenderErrorResponseDTO>;++/**+ * @summary Get notification channel by ID+ */++export function useGetChannelByID<+ TData = Awaited<ReturnType<typeof getChannelByID>>,+ TError = ErrorType<RenderErrorResponseDTO>+>(+ { id }: GetChannelByIDPathParameters,+ options?: {+ query?: UseQueryOptions<+ Awaited<ReturnType<typeof getChannelByID>>,+ TError,+ TData+ >;+ },+): UseQueryResult<TData, TError> & { queryKey: QueryKey } {+ const queryOptions = getGetChannelByIDQueryOptions({ id }, options);++ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {+ queryKey: QueryKey;+ };++ query.queryKey = queryOptions.queryKey;++ return query;+}++/**+ * @summary Get notification channel by ID+ */+export const invalidateGetChannelByID = async (+ queryClient: QueryClient,+ { id }: GetChannelByIDPathParameters,+ options?: InvalidateOptions,+): Promise<QueryClient> => {+ await queryClient.invalidateQueries(+ { queryKey: getGetChannelByIDQueryKey({ id }) },+ options,+ );++ return queryClient;+};++/**+ * This endpoint updates a notification channel by ID+ * @summary Update notification channel+ */+export const updateChannelByID = (+ { id }: UpdateChannelByIDPathParameters,+ configReceiverDTO: BodyType<ConfigReceiverDTO>,+) => {+ return GeneratedAPIInstance<void>({+ url: `/api/v1/channels/${id}`,+ method: 'PUT',+ headers: { 'Content-Type': 'application/json' },+ data: configReceiverDTO,+ });+};++export const getUpdateChannelByIDMutationOptions = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof updateChannelByID>>,+ TError,+ {+ pathParams: UpdateChannelByIDPathParameters;+ data: BodyType<ConfigReceiverDTO>;+ },+ TContext+ >;+}): UseMutationOptions<+ Awaited<ReturnType<typeof updateChannelByID>>,+ TError,+ {+ pathParams: UpdateChannelByIDPathParameters;+ data: BodyType<ConfigReceiverDTO>;+ },+ TContext+> => {+ const mutationKey = ['updateChannelByID'];+ const { mutation: mutationOptions } = options+ ? options.mutation &&+ 'mutationKey' in options.mutation &&+ options.mutation.mutationKey+ ? options+ : { ...options, mutation: { ...options.mutation, mutationKey } }+ : { mutation: { mutationKey } };++ const mutationFn: MutationFunction<+ Awaited<ReturnType<typeof updateChannelByID>>,+ {+ pathParams: UpdateChannelByIDPathParameters;+ data: BodyType<ConfigReceiverDTO>;+ }+ > = (props) => {+ const { pathParams, data } = props ?? {};++ return updateChannelByID(pathParams, data);+ };++ return { mutationFn, ...mutationOptions };+};++export type UpdateChannelByIDMutationResult = NonNullable<+ Awaited<ReturnType<typeof updateChannelByID>>+>;+export type UpdateChannelByIDMutationBody = BodyType<ConfigReceiverDTO>;+export type UpdateChannelByIDMutationError = ErrorType<RenderErrorResponseDTO>;++/**+ * @summary Update notification channel+ */+export const useUpdateChannelByID = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof updateChannelByID>>,+ TError,+ {+ pathParams: UpdateChannelByIDPathParameters;+ data: BodyType<ConfigReceiverDTO>;+ },+ TContext+ >;+}): UseMutationResult<+ Awaited<ReturnType<typeof updateChannelByID>>,+ TError,+ {+ pathParams: UpdateChannelByIDPathParameters;+ data: BodyType<ConfigReceiverDTO>;+ },+ TContext+> => {+ const mutationOptions = getUpdateChannelByIDMutationOptions(options);++ return useMutation(mutationOptions);+};+/**+ * This endpoint tests a notification channel by sending a test notification+ * @summary Test notification channel+ */+export const testChannel = (+ configReceiverDTO: BodyType<ConfigReceiverDTO>,+ signal?: AbortSignal,+) => {+ return GeneratedAPIInstance<void>({+ url: `/api/v1/channels/test`,+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ data: configReceiverDTO,+ signal,+ });+};++export const getTestChannelMutationOptions = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof testChannel>>,+ TError,+ { data: BodyType<ConfigReceiverDTO> },+ TContext+ >;+}): UseMutationOptions<+ Awaited<ReturnType<typeof testChannel>>,+ TError,+ { data: BodyType<ConfigReceiverDTO> },+ TContext+> => {+ const mutationKey = ['testChannel'];+ const { mutation: mutationOptions } = options+ ? options.mutation &&+ 'mutationKey' in options.mutation &&+ options.mutation.mutationKey+ ? options+ : { ...options, mutation: { ...options.mutation, mutationKey } }+ : { mutation: { mutationKey } };++ const mutationFn: MutationFunction<+ Awaited<ReturnType<typeof testChannel>>,+ { data: BodyType<ConfigReceiverDTO> }+ > = (props) => {+ const { data } = props ?? {};++ return testChannel(data);+ };++ return { mutationFn, ...mutationOptions };+};++export type TestChannelMutationResult = NonNullable<+ Awaited<ReturnType<typeof testChannel>>+>;+export type TestChannelMutationBody = BodyType<ConfigReceiverDTO>;+export type TestChannelMutationError = ErrorType<RenderErrorResponseDTO>;++/**+ * @summary Test notification channel+ */+export const useTestChannel = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof testChannel>>,+ TError,+ { data: BodyType<ConfigReceiverDTO> },+ TContext+ >;+}): UseMutationResult<+ Awaited<ReturnType<typeof testChannel>>,+ TError,+ { data: BodyType<ConfigReceiverDTO> },+ TContext+> => {+ const mutationOptions = getTestChannelMutationOptions(options);++ return useMutation(mutationOptions);+};+/**+ * Deprecated: use /api/v1/channels/test instead+ * @deprecated+ * @summary Test notification channel (deprecated)+ */+export const testChannelDeprecated = (+ configReceiverDTO: BodyType<ConfigReceiverDTO>,+ signal?: AbortSignal,+) => {+ return GeneratedAPIInstance<void>({+ url: `/api/v1/testChannel`,+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ data: configReceiverDTO,+ signal,+ });+};++export const getTestChannelDeprecatedMutationOptions = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof testChannelDeprecated>>,+ TError,+ { data: BodyType<ConfigReceiverDTO> },+ TContext+ >;+}): UseMutationOptions<+ Awaited<ReturnType<typeof testChannelDeprecated>>,+ TError,+ { data: BodyType<ConfigReceiverDTO> },+ TContext+> => {+ const mutationKey = ['testChannelDeprecated'];+ const { mutation: mutationOptions } = options+ ? options.mutation &&+ 'mutationKey' in options.mutation &&+ options.mutation.mutationKey+ ? options+ : { ...options, mutation: { ...options.mutation, mutationKey } }+ : { mutation: { mutationKey } };++ const mutationFn: MutationFunction<+ Awaited<ReturnType<typeof testChannelDeprecated>>,+ { data: BodyType<ConfigReceiverDTO> }+ > = (props) => {+ const { data } = props ?? {};++ return testChannelDeprecated(data);+ };++ return { mutationFn, ...mutationOptions };+};++export type TestChannelDeprecatedMutationResult = NonNullable<+ Awaited<ReturnType<typeof testChannelDeprecated>>+>;+export type TestChannelDeprecatedMutationBody = BodyType<ConfigReceiverDTO>;+export type TestChannelDeprecatedMutationError = ErrorType<RenderErrorResponseDTO>;++/**+ * @deprecated+ * @summary Test notification channel (deprecated)+ */+export const useTestChannelDeprecated = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof testChannelDeprecated>>,+ TError,+ { data: BodyType<ConfigReceiverDTO> },+ TContext+ >;+}): UseMutationResult<+ Awaited<ReturnType<typeof testChannelDeprecated>>,+ TError,+ { data: BodyType<ConfigReceiverDTO> },+ TContext+> => {+ const mutationOptions = getTestChannelDeprecatedMutationOptions(options);++ return useMutation(mutationOptions);+};diff --git a/frontend/src/api/generated/services/routepolicies/index.ts b/frontend/src/api/generated/services/routepolicies/index.tsnew file mode 100644index 0000000000..5b52ba0f13--- /dev/null+++ b/frontend/src/api/generated/services/routepolicies/index.ts@@ -0,0 +1,482 @@+/**+ * ! Do not edit manually+ * * The file has been auto-generated using Orval for SigNoz+ * * regenerate with 'yarn generate:api'+ * SigNoz+ */+import type {+ InvalidateOptions,+ MutationFunction,+ QueryClient,+ QueryFunction,+ QueryKey,+ UseMutationOptions,+ UseMutationResult,+ UseQueryOptions,+ UseQueryResult,+} from 'react-query';+import { useMutation, useQuery } from 'react-query';++import type { BodyType, ErrorType } from '../../../generatedAPIInstance';+import { GeneratedAPIInstance } from '../../../generatedAPIInstance';+import type {+ AlertmanagertypesPostableRoutePolicyDTO,+ CreateRoutePolicy201,+ DeleteRoutePolicyByIDPathParameters,+ GetAllRoutePolicies200,+ GetRoutePolicyByID200,+ GetRoutePolicyByIDPathParameters,+ RenderErrorResponseDTO,+ UpdateRoutePolicy200,+ UpdateRoutePolicyPathParameters,+} from '../sigNoz.schemas';++/**+ * This endpoint lists all route policies for the organization+ * @summary List route policies+ */+export const getAllRoutePolicies = (signal?: AbortSignal) => {+ return GeneratedAPIInstance<GetAllRoutePolicies200>({+ url: `/api/v1/route_policies`,+ method: 'GET',+ signal,+ });+};++export const getGetAllRoutePoliciesQueryKey = () => {+ return [`/api/v1/route_policies`] as const;+};++export const getGetAllRoutePoliciesQueryOptions = <+ TData = Awaited<ReturnType<typeof getAllRoutePolicies>>,+ TError = ErrorType<RenderErrorResponseDTO>+>(options?: {+ query?: UseQueryOptions<+ Awaited<ReturnType<typeof getAllRoutePolicies>>,+ TError,+ TData+ >;+}) => {+ const { query: queryOptions } = options ?? {};++ const queryKey = queryOptions?.queryKey ?? getGetAllRoutePoliciesQueryKey();++ const queryFn: QueryFunction<+ Awaited<ReturnType<typeof getAllRoutePolicies>>+ > = ({ signal }) => getAllRoutePolicies(signal);++ return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<+ Awaited<ReturnType<typeof getAllRoutePolicies>>,+ TError,+ TData+ > & { queryKey: QueryKey };+};++export type GetAllRoutePoliciesQueryResult = NonNullable<+ Awaited<ReturnType<typeof getAllRoutePolicies>>+>;+export type GetAllRoutePoliciesQueryError = ErrorType<RenderErrorResponseDTO>;++/**+ * @summary List route policies+ */++export function useGetAllRoutePolicies<+ TData = Awaited<ReturnType<typeof getAllRoutePolicies>>,+ TError = ErrorType<RenderErrorResponseDTO>+>(options?: {+ query?: UseQueryOptions<+ Awaited<ReturnType<typeof getAllRoutePolicies>>,+ TError,+ TData+ >;+}): UseQueryResult<TData, TError> & { queryKey: QueryKey } {+ const queryOptions = getGetAllRoutePoliciesQueryOptions(options);++ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {+ queryKey: QueryKey;+ };++ query.queryKey = queryOptions.queryKey;++ return query;+}++/**+ * @summary List route policies+ */+export const invalidateGetAllRoutePolicies = async (+ queryClient: QueryClient,+ options?: InvalidateOptions,+): Promise<QueryClient> => {+ await queryClient.invalidateQueries(+ { queryKey: getGetAllRoutePoliciesQueryKey() },+ options,+ );++ return queryClient;+};++/**+ * This endpoint creates a route policy+ * @summary Create route policy+ */+export const createRoutePolicy = (+ alertmanagertypesPostableRoutePolicyDTO: BodyType<AlertmanagertypesPostableRoutePolicyDTO>,+ signal?: AbortSignal,+) => {+ return GeneratedAPIInstance<CreateRoutePolicy201>({+ url: `/api/v1/route_policies`,+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ data: alertmanagertypesPostableRoutePolicyDTO,+ signal,+ });+};++export const getCreateRoutePolicyMutationOptions = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof createRoutePolicy>>,+ TError,+ { data: BodyType<AlertmanagertypesPostableRoutePolicyDTO> },+ TContext+ >;+}): UseMutationOptions<+ Awaited<ReturnType<typeof createRoutePolicy>>,+ TError,+ { data: BodyType<AlertmanagertypesPostableRoutePolicyDTO> },+ TContext+> => {+ const mutationKey = ['createRoutePolicy'];+ const { mutation: mutationOptions } = options+ ? options.mutation &&+ 'mutationKey' in options.mutation &&+ options.mutation.mutationKey+ ? options+ : { ...options, mutation: { ...options.mutation, mutationKey } }+ : { mutation: { mutationKey } };++ const mutationFn: MutationFunction<+ Awaited<ReturnType<typeof createRoutePolicy>>,+ { data: BodyType<AlertmanagertypesPostableRoutePolicyDTO> }+ > = (props) => {+ const { data } = props ?? {};++ return createRoutePolicy(data);+ };++ return { mutationFn, ...mutationOptions };+};++export type CreateRoutePolicyMutationResult = NonNullable<+ Awaited<ReturnType<typeof createRoutePolicy>>+>;+export type CreateRoutePolicyMutationBody = BodyType<AlertmanagertypesPostableRoutePolicyDTO>;+export type CreateRoutePolicyMutationError = ErrorType<RenderErrorResponseDTO>;++/**+ * @summary Create route policy+ */+export const useCreateRoutePolicy = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof createRoutePolicy>>,+ TError,+ { data: BodyType<AlertmanagertypesPostableRoutePolicyDTO> },+ TContext+ >;+}): UseMutationResult<+ Awaited<ReturnType<typeof createRoutePolicy>>,+ TError,+ { data: BodyType<AlertmanagertypesPostableRoutePolicyDTO> },+ TContext+> => {+ const mutationOptions = getCreateRoutePolicyMutationOptions(options);++ return useMutation(mutationOptions);+};+/**+ * This endpoint deletes a route policy by ID+ * @summary Delete route policy+ */+export const deleteRoutePolicyByID = ({+ id,+}: DeleteRoutePolicyByIDPathParameters) => {+ return GeneratedAPIInstance<void>({+ url: `/api/v1/route_policies/${id}`,+ method: 'DELETE',+ });+};++export const getDeleteRoutePolicyByIDMutationOptions = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof deleteRoutePolicyByID>>,+ TError,+ { pathParams: DeleteRoutePolicyByIDPathParameters },+ TContext+ >;+}): UseMutationOptions<+ Awaited<ReturnType<typeof deleteRoutePolicyByID>>,+ TError,+ { pathParams: DeleteRoutePolicyByIDPathParameters },+ TContext+> => {+ const mutationKey = ['deleteRoutePolicyByID'];+ const { mutation: mutationOptions } = options+ ? options.mutation &&+ 'mutationKey' in options.mutation &&+ options.mutation.mutationKey+ ? options+ : { ...options, mutation: { ...options.mutation, mutationKey } }+ : { mutation: { mutationKey } };++ const mutationFn: MutationFunction<+ Awaited<ReturnType<typeof deleteRoutePolicyByID>>,+ { pathParams: DeleteRoutePolicyByIDPathParameters }+ > = (props) => {+ const { pathParams } = props ?? {};++ return deleteRoutePolicyByID(pathParams);+ };++ return { mutationFn, ...mutationOptions };+};++export type DeleteRoutePolicyByIDMutationResult = NonNullable<+ Awaited<ReturnType<typeof deleteRoutePolicyByID>>+>;++export type DeleteRoutePolicyByIDMutationError = ErrorType<RenderErrorResponseDTO>;++/**+ * @summary Delete route policy+ */+export const useDeleteRoutePolicyByID = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof deleteRoutePolicyByID>>,+ TError,+ { pathParams: DeleteRoutePolicyByIDPathParameters },+ TContext+ >;+}): UseMutationResult<+ Awaited<ReturnType<typeof deleteRoutePolicyByID>>,+ TError,+ { pathParams: DeleteRoutePolicyByIDPathParameters },+ TContext+> => {+ const mutationOptions = getDeleteRoutePolicyByIDMutationOptions(options);++ return useMutation(mutationOptions);+};+/**+ * This endpoint returns a route policy by ID+ * @summary Get route policy by ID+ */+export const getRoutePolicyByID = (+ { id }: GetRoutePolicyByIDPathParameters,+ signal?: AbortSignal,+) => {+ return GeneratedAPIInstance<GetRoutePolicyByID200>({+ url: `/api/v1/route_policies/${id}`,+ method: 'GET',+ signal,+ });+};++export const getGetRoutePolicyByIDQueryKey = ({+ id,+}: GetRoutePolicyByIDPathParameters) => {+ return [`/api/v1/route_policies/${id}`] as const;+};++export const getGetRoutePolicyByIDQueryOptions = <+ TData = Awaited<ReturnType<typeof getRoutePolicyByID>>,+ TError = ErrorType<RenderErrorResponseDTO>+>(+ { id }: GetRoutePolicyByIDPathParameters,+ options?: {+ query?: UseQueryOptions<+ Awaited<ReturnType<typeof getRoutePolicyByID>>,+ TError,+ TData+ >;+ },+) => {+ const { query: queryOptions } = options ?? {};++ const queryKey =+ queryOptions?.queryKey ?? getGetRoutePolicyByIDQueryKey({ id });++ const queryFn: QueryFunction<+ Awaited<ReturnType<typeof getRoutePolicyByID>>+ > = ({ signal }) => getRoutePolicyByID({ id }, signal);++ return {+ queryKey,+ queryFn,+ enabled: !!id,+ ...queryOptions,+ } as UseQueryOptions<+ Awaited<ReturnType<typeof getRoutePolicyByID>>,+ TError,+ TData+ > & { queryKey: QueryKey };+};++export type GetRoutePolicyByIDQueryResult = NonNullable<+ Awaited<ReturnType<typeof getRoutePolicyByID>>+>;+export type GetRoutePolicyByIDQueryError = ErrorType<RenderErrorResponseDTO>;++/**+ * @summary Get route policy by ID+ */++export function useGetRoutePolicyByID<+ TData = Awaited<ReturnType<typeof getRoutePolicyByID>>,+ TError = ErrorType<RenderErrorResponseDTO>+>(+ { id }: GetRoutePolicyByIDPathParameters,+ options?: {+ query?: UseQueryOptions<+ Awaited<ReturnType<typeof getRoutePolicyByID>>,+ TError,+ TData+ >;+ },+): UseQueryResult<TData, TError> & { queryKey: QueryKey } {+ const queryOptions = getGetRoutePolicyByIDQueryOptions({ id }, options);++ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {+ queryKey: QueryKey;+ };++ query.queryKey = queryOptions.queryKey;++ return query;+}++/**+ * @summary Get route policy by ID+ */+export const invalidateGetRoutePolicyByID = async (+ queryClient: QueryClient,+ { id }: GetRoutePolicyByIDPathParameters,+ options?: InvalidateOptions,+): Promise<QueryClient> => {+ await queryClient.invalidateQueries(+ { queryKey: getGetRoutePolicyByIDQueryKey({ id }) },+ options,+ );++ return queryClient;+};++/**+ * This endpoint updates a route policy by ID+ * @summary Update route policy+ */+export const updateRoutePolicy = (+ { id }: UpdateRoutePolicyPathParameters,+ alertmanagertypesPostableRoutePolicyDTO: BodyType<AlertmanagertypesPostableRoutePolicyDTO>,+) => {+ return GeneratedAPIInstance<UpdateRoutePolicy200>({+ url: `/api/v1/route_policies/${id}`,+ method: 'PUT',+ headers: { 'Content-Type': 'application/json' },+ data: alertmanagertypesPostableRoutePolicyDTO,+ });+};++export const getUpdateRoutePolicyMutationOptions = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof updateRoutePolicy>>,+ TError,+ {+ pathParams: UpdateRoutePolicyPathParameters;+ data: BodyType<AlertmanagertypesPostableRoutePolicyDTO>;+ },+ TContext+ >;+}): UseMutationOptions<+ Awaited<ReturnType<typeof updateRoutePolicy>>,+ TError,+ {+ pathParams: UpdateRoutePolicyPathParameters;+ data: BodyType<AlertmanagertypesPostableRoutePolicyDTO>;+ },+ TContext+> => {+ const mutationKey = ['updateRoutePolicy'];+ const { mutation: mutationOptions } = options+ ? options.mutation &&+ 'mutationKey' in options.mutation &&+ options.mutation.mutationKey+ ? options+ : { ...options, mutation: { ...options.mutation, mutationKey } }+ : { mutation: { mutationKey } };++ const mutationFn: MutationFunction<+ Awaited<ReturnType<typeof updateRoutePolicy>>,+ {+ pathParams: UpdateRoutePolicyPathParameters;+ data: BodyType<AlertmanagertypesPostableRoutePolicyDTO>;+ }+ > = (props) => {+ const { pathParams, data } = props ?? {};++ return updateRoutePolicy(pathParams, data);+ };++ return { mutationFn, ...mutationOptions };+};++export type UpdateRoutePolicyMutationResult = NonNullable<+ Awaited<ReturnType<typeof updateRoutePolicy>>+>;+export type UpdateRoutePolicyMutationBody = BodyType<AlertmanagertypesPostableRoutePolicyDTO>;+export type UpdateRoutePolicyMutationError = ErrorType<RenderErrorResponseDTO>;++/**+ * @summary Update route policy+ */+export const useUpdateRoutePolicy = <+ TError = ErrorType<RenderErrorResponseDTO>,+ TContext = unknown+>(options?: {+ mutation?: UseMutationOptions<+ Awaited<ReturnType<typeof updateRoutePolicy>>,+ TError,+ {+ pathParams: UpdateRoutePolicyPathParameters;+ data: BodyType<AlertmanagertypesPostableRoutePolicyDTO>;+ },+ TContext+ >;+}): UseMutationResult<+ Awaited<ReturnType<typeof updateRoutePolicy>>,+ TError,+ {+ pathParams: UpdateRoutePolicyPathParameters;+ data: BodyType<AlertmanagertypesPostableRoutePolicyDTO>;+ },+ TContext+> => {+ const mutationOptions = getUpdateRoutePolicyMutationOptions(options);++ return useMutation(mutationOptions);+};diff --git a/frontend/src/api/generated/services/sigNoz.schemas.ts b/frontend/src/api/generated/services/sigNoz.schemas.tsindex 8419bd1afd..777526bf0e 100644--- a/frontend/src/api/generated/services/sigNoz.schemas.ts+++ b/frontend/src/api/generated/services/sigNoz.schemas.ts@@ -4,6 +4,148 @@* * regenerate with 'yarn generate:api'* SigNoz*/+export interface AlertmanagertypesChannelDTO {+ /**+ * @type string+ * @format date-time+ */+ createdAt?: Date;+ /**+ * @type string+ */+ data: string;+ /**+ * @type string+ */+ id: string;+ /**+ * @type string+ */+ name: string;+ /**+ * @type string+ */+ orgId: string;+ /**+ * @type string+ */+ type: string;+ /**+ * @type string+ * @format date-time+ */+ updatedAt?: Date;+}++export interface AlertmanagertypesDeprecatedGettableAlertDTO {+ annotations?: ModelLabelSetDTO;+ /**+ * @type string+ * @format date-time+ */+ endsAt?: Date;+ /**+ * @type string+ */+ fingerprint?: string;+ /**+ * @type string+ */+ generatorURL?: string;+ labels?: ModelLabelSetDTO;+ /**+ * @type array+ * @nullable true+ */+ receivers?: string[] | null;+ /**+ * @type string+ * @format date-time+ */+ startsAt?: Date;+ status?: TypesAlertStatusDTO;+}++export enum AlertmanagertypesExpressionKindDTO {+ rule = 'rule',+ policy = 'policy',+}+export interface AlertmanagertypesGettableRoutePolicyDTO {+ /**+ * @type array+ * @nullable true+ */+ channels: string[] | null;+ /**+ * @type string+ * @format date-time+ */+ createdAt: Date;+ /**+ * @type string+ * @nullable true+ */+ createdBy?: string | null;+ /**+ * @type string+ */+ description?: string;+ /**+ * @type string+ */+ expression: string;+ /**+ * @type string+ */+ id: string;+ kind?: AlertmanagertypesExpressionKindDTO;+ /**+ * @type string+ */+ name: string;+ /**+ * @type array+ * @nullable true+ */+ tags?: string[] | null;+ /**+ * @type string+ * @format date-time+ */+ updatedAt: Date;+ /**+ * @type string+ * @nullable true+ */+ updatedBy?: string | null;+}++export interface AlertmanagertypesPostableRoutePolicyDTO {+ /**+ * @type array+ * @nullable true+ */+ channels: string[] | null;+ /**+ * @type string+ */+ description?: string;+ /**+ * @type string+ */+ expression: string;+ kind?: AlertmanagertypesExpressionKindDTO;+ /**+ * @type string+ */+ name: string;+ /**+ * @type array+ * @nullable true+ */+ tags?: string[] | null;+}+export interface AuthtypesAttributeMappingDTO {/*** @type string@@ -875,182 +1017,1643 @@ export interface CloudintegrationtypesOldAWSCollectionStrategyDTO {/*** @type string*/- provider?: string;+ provider?: string;+ /**+ * @type object+ */+ s3_buckets?: CloudintegrationtypesOldAWSCollectionStrategyDTOS3Buckets;+}++export type CloudintegrationtypesOldAWSLogsStrategyDTOCloudwatchLogsSubscriptionsItem = {+ /**+ * @type string+ */+ filter_pattern?: string;+ /**+ * @type string+ */+ log_group_name_prefix?: string;+};++export interface CloudintegrationtypesOldAWSLogsStrategyDTO {+ /**+ * @type array+ * @nullable true+ */+ cloudwatch_logs_subscriptions?:+ | CloudintegrationtypesOldAWSLogsStrategyDTOCloudwatchLogsSubscriptionsItem[]+ | null;+}++export type CloudintegrationtypesOldAWSMetricsStrategyDTOCloudwatchMetricStreamFiltersItem = {+ /**+ * @type array+ */+ MetricNames?: string[];+ /**+ * @type string+ */+ Namespace?: string;+};++export interface CloudintegrationtypesOldAWSMetricsStrategyDTO {+ /**+ * @type array+ * @nullable true+ */+ cloudwatch_metric_stream_filters?:+ | CloudintegrationtypesOldAWSMetricsStrategyDTOCloudwatchMetricStreamFiltersItem[]+ | null;+}++export interface CloudintegrationtypesPostableAccountDTO {+ config: CloudintegrationtypesPostableAccountConfigDTO;+ credentials: CloudintegrationtypesCredentialsDTO;+}++export interface CloudintegrationtypesPostableAccountConfigDTO {+ aws: CloudintegrationtypesAWSPostableAccountConfigDTO;+}++/**+ * @nullable+ */+export type CloudintegrationtypesPostableAgentCheckInDTOData = {+ [key: string]: unknown;+} | null;++export interface CloudintegrationtypesPostableAgentCheckInDTO {+ /**+ * @type string+ */+ account_id?: string;+ /**+ * @type string+ */+ cloud_account_id?: string;+ /**+ * @type string+ */+ cloudIntegrationId?: string;+ /**+ * @type object+ * @nullable true+ */+ data: CloudintegrationtypesPostableAgentCheckInDTOData;+ /**+ * @type string+ */+ providerAccountId?: string;+}++export interface CloudintegrationtypesProviderIntegrationConfigDTO {+ aws: CloudintegrationtypesAWSIntegrationConfigDTO;+}++export interface CloudintegrationtypesServiceDTO {+ assets: CloudintegrationtypesAssetsDTO;+ cloudIntegrationService: CloudintegrationtypesCloudIntegrationServiceDTO;+ dataCollected: CloudintegrationtypesDataCollectedDTO;+ /**+ * @type string+ */+ icon: string;+ /**+ * @type string+ */+ id: string;+ /**+ * @type string+ */+ overview: string;+ supportedSignals: CloudintegrationtypesSupportedSignalsDTO;+ telemetryCollectionStrategy: CloudintegrationtypesTelemetryCollectionStrategyDTO;+ /**+ * @type string+ */+ title: string;+}++export interface CloudintegrationtypesServiceConfigDTO {+ aws: CloudintegrationtypesAWSServiceConfigDTO;+}++export enum CloudintegrationtypesServiceIDDTO {+ alb = 'alb',+ 'api-gateway' = 'api-gateway',+ dynamodb = 'dynamodb',+ ec2 = 'ec2',+ ecs = 'ecs',+ eks = 'eks',+ elasticache = 'elasticache',+ lambda = 'lambda',+ msk = 'msk',+ rds = 'rds',+ s3sync = 's3sync',+ sns = 'sns',+ sqs = 'sqs',+}+export interface CloudintegrationtypesServiceMetadataDTO {+ /**+ * @type boolean+ */+ enabled: boolean;+ /**+ * @type string+ */+ icon: string;+ /**+ * @type string+ */+ id: string;+ /**+ * @type string+ */+ title: string;+}++export interface CloudintegrationtypesSupportedSignalsDTO {+ /**+ * @type boolean+ */+ logs?: boolean;+ /**+ * @type boolean+ */+ metrics?: boolean;+}++export interface CloudintegrationtypesTelemetryCollectionStrategyDTO {+ aws: CloudintegrationtypesAWSTelemetryCollectionStrategyDTO;+}++export interface CloudintegrationtypesUpdatableAccountDTO {+ config: CloudintegrationtypesAccountConfigDTO;+}++export interface CloudintegrationtypesUpdatableServiceDTO {+ config: CloudintegrationtypesServiceConfigDTO;+}++export interface ConfigAuthorizationDTO {+ /**+ * @type string+ */+ credentials?: string;+ /**+ * @type string+ */+ credentials_file?: string;+ /**+ * @type string+ */+ credentials_ref?: string;+ /**+ * @type string+ */+ type?: string;+}++export interface ConfigBasicAuthDTO {+ /**+ * @type string+ */+ password?: string;+ /**+ * @type string+ */+ password_file?: string;+ /**+ * @type string+ */+ password_ref?: string;+ /**+ * @type string+ */+ username?: string;+ /**+ * @type string+ */+ username_file?: string;+ /**+ * @type string+ */+ username_ref?: string;+}++export interface ConfigDiscordConfigDTO {+ /**+ * @type string+ */+ avatar_url?: string;+ /**+ * @type string+ */+ content?: string;+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type string+ */+ message?: string;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ /**+ * @type string+ */+ title?: string;+ /**+ * @type string+ */+ username?: string;+ webhook_url?: ConfigSecretURLDTO;+ /**+ * @type string+ */+ webhook_url_file?: string;+}++export type ConfigDurationDTO = string;++export type ConfigEmailConfigDTOHeaders = { [key: string]: string };++export interface ConfigEmailConfigDTO {+ /**+ * @type string+ */+ auth_identity?: string;+ /**+ * @type string+ */+ auth_password?: string;+ /**+ * @type string+ */+ auth_password_file?: string;+ /**+ * @type string+ */+ auth_secret?: string;+ /**+ * @type string+ */+ auth_secret_file?: string;+ /**+ * @type string+ */+ auth_username?: string;+ /**+ * @type boolean+ * @nullable true+ */+ force_implicit_tls?: boolean | null;+ /**+ * @type string+ */+ from?: string;+ /**+ * @type object+ */+ headers?: ConfigEmailConfigDTOHeaders;+ /**+ * @type string+ */+ hello?: string;+ /**+ * @type string+ */+ html?: string;+ /**+ * @type boolean+ * @nullable true+ */+ require_tls?: boolean | null;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ smarthost?: ConfigHostPortDTO;+ /**+ * @type string+ */+ text?: string;+ threading?: ConfigThreadingConfigDTO;+ tls_config?: ConfigTLSConfigDTO;+ /**+ * @type string+ */+ to?: string;+}++export interface ConfigHTTPClientConfigDTO {+ authorization?: ConfigAuthorizationDTO;+ basic_auth?: ConfigBasicAuthDTO;+ /**+ * @type string+ */+ bearer_token?: string;+ /**+ * @type string+ */+ bearer_token_file?: string;+ /**+ * @type boolean+ */+ enable_http2?: boolean;+ /**+ * @type boolean+ */+ follow_redirects?: boolean;+ http_headers?: ConfigHeadersDTO;+ /**+ * @type string+ */+ no_proxy?: string;+ oauth2?: ConfigOAuth2DTO;+ proxy_connect_header?: ConfigProxyHeaderDTO;+ /**+ * @type boolean+ */+ proxy_from_environment?: boolean;+ proxy_url?: ConfigURLDTO;+ tls_config?: ConfigTLSConfigDTO;+}++export interface ConfigHeadersDTO {+ [key: string]: unknown;+}++export interface ConfigHostPortDTO {+ [key: string]: unknown;+}++export interface ConfigIncidentioConfigDTO {+ /**+ * @type string+ */+ alert_source_token?: string;+ /**+ * @type string+ */+ alert_source_token_file?: string;+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type integer+ * @minimum 0+ */+ max_alerts?: number;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ timeout?: TimeDurationDTO;+ url?: ConfigURLType2DTO;+ /**+ * @type string+ */+ url_file?: string;+}++export type ConfigJiraConfigDTOCustomFields = { [key: string]: unknown };++export interface ConfigJiraConfigDTO {+ /**+ * @type string+ */+ api_type?: string;+ api_url?: ConfigURLType2DTO;+ /**+ * @type object+ */+ custom_fields?: ConfigJiraConfigDTOCustomFields;+ description?: ConfigJiraFieldConfigDTO;+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type string+ */+ issue_type?: string;+ /**+ * @type array+ */+ labels?: string[];+ /**+ * @type string+ */+ priority?: string;+ /**+ * @type string+ */+ project?: string;+ reopen_duration?: ModelDurationDTO;+ /**+ * @type string+ */+ reopen_transition?: string;+ /**+ * @type string+ */+ resolve_transition?: string;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ summary?: ConfigJiraFieldConfigDTO;+ /**+ * @type string+ */+ wont_fix_resolution?: string;+}++export interface ConfigJiraFieldConfigDTO {+ /**+ * @type boolean+ * @nullable true+ */+ enable_update?: boolean | null;+ /**+ * @type string+ */+ template?: string;+}++export interface ConfigMSTeamsConfigDTO {+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ /**+ * @type string+ */+ summary?: string;+ /**+ * @type string+ */+ text?: string;+ /**+ * @type string+ */+ title?: string;+ webhook_url?: ConfigSecretURLDTO;+ /**+ * @type string+ */+ webhook_url_file?: string;+}++export interface ConfigMSTeamsV2ConfigDTO {+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ /**+ * @type string+ */+ text?: string;+ /**+ * @type string+ */+ title?: string;+ webhook_url?: ConfigSecretURLDTO;+ /**+ * @type string+ */+ webhook_url_file?: string;+}++export interface ConfigMattermostAttachmentDTO {+ /**+ * @type string+ */+ author_icon?: string;+ /**+ * @type string+ */+ author_link?: string;+ /**+ * @type string+ */+ author_name?: string;+ /**+ * @type string+ */+ color?: string;+ /**+ * @type string+ */+ fallback?: string;+ /**+ * @type array+ */+ fields?: ConfigMattermostFieldDTO[];+ /**+ * @type string+ */+ footer?: string;+ /**+ * @type string+ */+ footer_icon?: string;+ /**+ * @type string+ */+ image_url?: string;+ /**+ * @type string+ */+ pretext?: string;+ /**+ * @type string+ */+ text?: string;+ /**+ * @type string+ */+ thumb_url?: string;+ /**+ * @type string+ */+ title?: string;+ /**+ * @type string+ */+ title_link?: string;+}++export interface ConfigMattermostConfigDTO {+ /**+ * @type array+ */+ attachments?: ConfigMattermostAttachmentDTO[];+ /**+ * @type string+ */+ channel?: string;+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type string+ */+ icon_emoji?: string;+ /**+ * @type string+ */+ icon_url?: string;+ priority?: ConfigMattermostPriorityDTO;+ props?: ConfigMattermostPropsDTO;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ /**+ * @type string+ */+ text?: string;+ /**+ * @type string+ */+ type?: string;+ /**+ * @type string+ */+ username?: string;+ webhook_url?: ConfigSecretURLDTO;+ /**+ * @type string+ */+ webhook_url_file?: string;+}++export interface ConfigMattermostFieldDTO {+ /**+ * @type boolean+ * @nullable true+ */+ short?: boolean | null;+ /**+ * @type string+ */+ title?: string;+ /**+ * @type string+ */+ value?: string;+}++export interface ConfigMattermostPriorityDTO {+ /**+ * @type boolean+ */+ persistent_notifications?: boolean;+ /**+ * @type string+ */+ priority?: string;+ /**+ * @type boolean+ */+ requested_ack?: boolean;+}++export interface ConfigMattermostPropsDTO {+ /**+ * @type string+ */+ card?: string;+}++export type ConfigOAuth2DTOClaims = { [key: string]: unknown };++export type ConfigOAuth2DTOEndpointParams = { [key: string]: string };++export interface ConfigOAuth2DTO {+ /**+ * @type string+ */+ audience?: string;+ /**+ * @type object+ */+ claims?: ConfigOAuth2DTOClaims;+ /**+ * @type string+ */+ client_certificate_key?: string;+ /**+ * @type string+ */+ client_certificate_key_file?: string;+ /**+ * @type string+ */+ client_certificate_key_id?: string;+ /**+ * @type string+ */+ client_certificate_key_ref?: string;+ /**+ * @type string+ */+ client_id?: string;+ /**+ * @type string+ */+ client_secret?: string;+ /**+ * @type string+ */+ client_secret_file?: string;+ /**+ * @type string+ */+ client_secret_ref?: string;+ /**+ * @type object+ */+ endpoint_params?: ConfigOAuth2DTOEndpointParams;+ /**+ * @type string+ */+ grant_type?: string;+ /**+ * @type string+ */+ iss?: string;+ /**+ * @type string+ */+ no_proxy?: string;+ proxy_connect_header?: ConfigProxyHeaderDTO;+ /**+ * @type boolean+ */+ proxy_from_environment?: boolean;+ proxy_url?: ConfigURLDTO;+ /**+ * @type array+ */+ scopes?: string[];+ /**+ * @type string+ */+ signature_algorithm?: string;+ /**+ * @type string+ */+ token_url?: string;+}++export type ConfigOpsGenieConfigDTODetails = { [key: string]: string };++export interface ConfigOpsGenieConfigDTO {+ /**+ * @type string+ */+ actions?: string;+ /**+ * @type string+ */+ api_key?: string;+ /**+ * @type string+ */+ api_key_file?: string;+ api_url?: ConfigURLType2DTO;+ /**+ * @type string+ */+ description?: string;+ /**+ * @type object+ */+ details?: ConfigOpsGenieConfigDTODetails;+ /**+ * @type string+ */+ entity?: string;+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type string+ */+ message?: string;+ /**+ * @type string+ */+ note?: string;+ /**+ * @type string+ */+ priority?: string;+ /**+ * @type array+ */+ responders?: ConfigOpsGenieConfigResponderDTO[];+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ /**+ * @type string+ */+ source?: string;+ /**+ * @type string+ */+ tags?: string;+ /**+ * @type boolean+ */+ update_alerts?: boolean;+}++export interface ConfigOpsGenieConfigResponderDTO {+ /**+ * @type string+ */+ id?: string;+ /**+ * @type string+ */+ name?: string;+ /**+ * @type string+ */+ type?: string;+ /**+ * @type string+ */+ username?: string;+}++export type ConfigPagerdutyConfigDTODetails = { [key: string]: unknown };++export interface ConfigPagerdutyConfigDTO {+ /**+ * @type string+ */+ class?: string;+ /**+ * @type string+ */+ client?: string;+ /**+ * @type string+ */+ client_url?: string;+ /**+ * @type string+ */+ component?: string;+ /**+ * @type string+ */+ description?: string;+ /**+ * @type object+ */+ details?: ConfigPagerdutyConfigDTODetails;+ /**+ * @type string+ */+ group?: string;+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type array+ */+ images?: ConfigPagerdutyImageDTO[];+ /**+ * @type array+ */+ links?: ConfigPagerdutyLinkDTO[];+ /**+ * @type string+ */+ routing_key?: string;+ /**+ * @type string+ */+ routing_key_file?: string;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ /**+ * @type string+ */+ service_key?: string;+ /**+ * @type string+ */+ service_key_file?: string;+ /**+ * @type string+ */+ severity?: string;+ /**+ * @type string+ */+ source?: string;+ timeout?: TimeDurationDTO;+ url?: ConfigURLType2DTO;+}++export interface ConfigPagerdutyImageDTO {+ /**+ * @type string+ */+ alt?: string;+ /**+ * @type string+ */+ href?: string;+ /**+ * @type string+ */+ src?: string;+}++export interface ConfigPagerdutyLinkDTO {+ /**+ * @type string+ */+ href?: string;+ /**+ * @type string+ */+ text?: string;+}++export interface ConfigProxyHeaderDTO {+ [key: string]: string[];+}++export interface ConfigPushoverConfigDTO {+ /**+ * @type string+ */+ device?: string;+ expire?: ConfigDurationDTO;+ /**+ * @type boolean+ */+ html?: boolean;+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type string+ */+ message?: string;+ /**+ * @type boolean+ */+ monospace?: boolean;+ /**+ * @type string+ */+ priority?: string;+ retry?: ConfigDurationDTO;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ /**+ * @type string+ */+ sound?: string;+ /**+ * @type string+ */+ title?: string;+ /**+ * @type string+ */+ token?: string;+ /**+ * @type string+ */+ token_file?: string;+ ttl?: ConfigDurationDTO;+ /**+ * @type string+ */+ url?: string;+ /**+ * @type string+ */+ url_title?: string;+ /**+ * @type string+ */+ user_key?: string;+ /**+ * @type string+ */+ user_key_file?: string;+}++export interface ConfigReceiverDTO {+ /**+ * @type array+ */+ discord_configs?: ConfigDiscordConfigDTO[];+ /**+ * @type array+ */+ email_configs?: ConfigEmailConfigDTO[];+ /**+ * @type array+ */+ incidentio_configs?: ConfigIncidentioConfigDTO[];+ /**+ * @type array+ */+ jira_configs?: ConfigJiraConfigDTO[];+ /**+ * @type array+ */+ mattermost_configs?: ConfigMattermostConfigDTO[];+ /**+ * @type array+ */+ msteams_configs?: ConfigMSTeamsConfigDTO[];+ /**+ * @type array+ */+ msteamsv2_configs?: ConfigMSTeamsV2ConfigDTO[];+ /**+ * @type string+ */+ name?: string;+ /**+ * @type array+ */+ opsgenie_configs?: ConfigOpsGenieConfigDTO[];+ /**+ * @type array+ */+ pagerduty_configs?: ConfigPagerdutyConfigDTO[];+ /**+ * @type array+ */+ pushover_configs?: ConfigPushoverConfigDTO[];+ /**+ * @type array+ */+ rocketchat_configs?: ConfigRocketchatConfigDTO[];+ /**+ * @type array+ */+ slack_configs?: ConfigSlackConfigDTO[];+ /**+ * @type array+ */+ sns_configs?: ConfigSNSConfigDTO[];+ /**+ * @type array+ */+ telegram_configs?: ConfigTelegramConfigDTO[];+ /**+ * @type array+ */+ victorops_configs?: ConfigVictorOpsConfigDTO[];+ /**+ * @type array+ */+ webex_configs?: ConfigWebexConfigDTO[];+ /**+ * @type array+ */+ webhook_configs?: ConfigWebhookConfigDTO[];+ /**+ * @type array+ */+ wechat_configs?: ConfigWechatConfigDTO[];+}++export interface ConfigRocketchatAttachmentActionDTO {+ /**+ * @type string+ */+ image_url?: string;+ /**+ * @type boolean+ */+ is_webview?: boolean;+ /**+ * @type string+ */+ msg?: string;+ /**+ * @type boolean+ */+ msg_in_chat_window?: boolean;+ /**+ * @type string+ */+ msg_processing_type?: string;+ /**+ * @type string+ */+ text?: string;+ /**+ * @type string+ */+ type?: string;+ /**+ * @type string+ */+ url?: string;+ /**+ * @type string+ */+ webview_height_ratio?: string;+}++export interface ConfigRocketchatAttachmentFieldDTO {+ /**+ * @type boolean+ * @nullable true+ */+ short?: boolean | null;+ /**+ * @type string+ */+ title?: string;+ /**+ * @type string+ */+ value?: string;+}++export interface ConfigRocketchatConfigDTO {+ /**+ * @type array+ */+ actions?: ConfigRocketchatAttachmentActionDTO[];+ api_url?: ConfigURLType2DTO;+ /**+ * @type string+ */+ channel?: string;+ /**+ * @type string+ */+ color?: string;+ /**+ * @type string+ */+ emoji?: string;+ /**+ * @type array+ */+ fields?: ConfigRocketchatAttachmentFieldDTO[];+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type string+ */+ icon_url?: string;+ /**+ * @type string+ */+ image_url?: string;+ /**+ * @type boolean+ */+ link_names?: boolean;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ /**+ * @type boolean+ */+ short_fields?: boolean;+ /**+ * @type string+ */+ text?: string;+ /**+ * @type string+ */+ thumb_url?: string;+ /**+ * @type string+ */+ title?: string;+ /**+ * @type string+ */+ title_link?: string;+ /**+ * @type string+ */+ token?: string;+ /**+ * @type string+ */+ token_file?: string;+ /**+ * @type string+ */+ token_id?: string;+ /**+ * @type string+ */+ token_id_file?: string;+}++export type ConfigSNSConfigDTOAttributes = { [key: string]: string };++export interface ConfigSNSConfigDTO {+ /**+ * @type string+ */+ api_url?: string;+ /**+ * @type object+ */+ attributes?: ConfigSNSConfigDTOAttributes;+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type string+ */+ message?: string;+ /**+ * @type string+ */+ phone_number?: string;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ sigv4?: Sigv4SigV4ConfigDTO;+ /**+ * @type string+ */+ subject?: string;+ /**+ * @type string+ */+ target_arn?: string;+ /**+ * @type string+ */+ topic_arn?: string;+}++export interface ConfigSecretURLDTO {+ [key: string]: unknown;+}++export interface ConfigSlackActionDTO {+ confirm?: ConfigSlackConfirmationFieldDTO;+ /**+ * @type string+ */+ name?: string;+ /**+ * @type string+ */+ style?: string;+ /**+ * @type string+ */+ text?: string;+ /**+ * @type string+ */+ type?: string;+ /**+ * @type string+ */+ url?: string;+ /**+ * @type string+ */+ value?: string;+}++export interface ConfigSlackConfigDTO {+ /**+ * @type array+ */+ actions?: ConfigSlackActionDTO[];+ api_url?: ConfigSecretURLDTO;+ /**+ * @type string+ */+ api_url_file?: string;+ /**+ * @type string+ */+ app_token?: string;+ /**+ * @type string+ */+ app_token_file?: string;+ app_url?: ConfigURLType2DTO;+ /**+ * @type string+ */+ callback_id?: string;+ /**+ * @type string+ */+ channel?: string;+ /**+ * @type string+ */+ color?: string;+ /**+ * @type string+ */+ fallback?: string;+ /**+ * @type array+ */+ fields?: ConfigSlackFieldDTO[];+ /**+ * @type string+ */+ footer?: string;+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type string+ */+ icon_emoji?: string;+ /**+ * @type string+ */+ icon_url?: string;+ /**+ * @type string+ */+ image_url?: string;+ /**+ * @type boolean+ */+ link_names?: boolean;+ /**+ * @type string+ */+ message_text?: string;+ /**+ * @type array+ */+ mrkdwn_in?: string[];+ /**+ * @type string+ */+ pretext?: string;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ /**+ * @type boolean+ */+ short_fields?: boolean;+ /**+ * @type string+ */+ text?: string;+ /**+ * @type string+ */+ thumb_url?: string;+ timeout?: TimeDurationDTO;+ /**+ * @type string+ */+ title?: string;+ /**+ * @type string+ */+ title_link?: string;+ /**+ * @type string+ */+ username?: string;+}++export interface ConfigSlackConfirmationFieldDTO {+ /**+ * @type string+ */+ dismiss_text?: string;+ /**+ * @type string+ */+ ok_text?: string;+ /**+ * @type string+ */+ text?: string;+ /**+ * @type string+ */+ title?: string;+}++export interface ConfigSlackFieldDTO {+ /**+ * @type boolean+ * @nullable true+ */+ short?: boolean | null;+ /**+ * @type string+ */+ title?: string;+ /**+ * @type string+ */+ value?: string;+}++export interface ConfigTLSConfigDTO {+ /**+ * @type string+ */+ ca?: string;+ /**+ * @type string+ */+ ca_file?: string;+ /**+ * @type string+ */+ ca_ref?: string;+ /**+ * @type string+ */+ cert?: string;+ /**+ * @type string+ */+ cert_file?: string;+ /**+ * @type string+ */+ cert_ref?: string;+ /**+ * @type boolean+ */+ insecure_skip_verify?: boolean;+ /**+ * @type string+ */+ key?: string;+ /**+ * @type string+ */+ key_file?: string;+ /**+ * @type string+ */+ key_ref?: string;+ /**+ * @type integer+ * @minimum 0+ */+ max_version?: number;+ /**+ * @type integer+ * @minimum 0+ */+ min_version?: number;+ /**+ * @type string+ */+ server_name?: string;+}++export interface ConfigTelegramConfigDTO {+ api_url?: ConfigURLType2DTO;+ /**+ * @type integer+ * @format int64+ */+ chat?: number;+ /**+ * @type string+ */+ chat_file?: string;/**- * @type object+ * @type boolean*/- s3_buckets?: CloudintegrationtypesOldAWSCollectionStrategyDTOS3Buckets;-}--export type CloudintegrationtypesOldAWSLogsStrategyDTOCloudwatchLogsSubscriptionsItem = {+ disable_notifications?: boolean;+ http_config?: ConfigHTTPClientConfigDTO;/*** @type string*/- filter_pattern?: string;+ message?: string;+ /**+ * @type integer+ */+ message_thread_id?: number;/*** @type string*/- log_group_name_prefix?: string;-};--export interface CloudintegrationtypesOldAWSLogsStrategyDTO {+ parse_mode?: string;/**- * @type array- * @nullable true+ * @type boolean*/- cloudwatch_logs_subscriptions?:- | CloudintegrationtypesOldAWSLogsStrategyDTOCloudwatchLogsSubscriptionsItem[]- | null;-}--export type CloudintegrationtypesOldAWSMetricsStrategyDTOCloudwatchMetricStreamFiltersItem = {+ send_resolved?: boolean;/**- * @type array+ * @type string*/- MetricNames?: string[];+ token?: string;/*** @type string*/- Namespace?: string;-};+ token_file?: string;+}-export interface CloudintegrationtypesOldAWSMetricsStrategyDTO {+export interface ConfigThreadingConfigDTO {/**- * @type array- * @nullable true+ * @type boolean*/- cloudwatch_metric_stream_filters?:- | CloudintegrationtypesOldAWSMetricsStrategyDTOCloudwatchMetricStreamFiltersItem[]- | null;+ enabled?: boolean;+ /**+ * @type string+ */+ thread_by_date?: string;}-export interface CloudintegrationtypesPostableAccountDTO {- config: CloudintegrationtypesPostableAccountConfigDTO;- credentials: CloudintegrationtypesCredentialsDTO;+export interface ConfigURLDTO {+ [key: string]: unknown;}-export interface CloudintegrationtypesPostableAccountConfigDTO {- aws: CloudintegrationtypesAWSPostableAccountConfigDTO;+export interface ConfigURLType2DTO {+ [key: string]: unknown;}-/**- * @nullable- */-export type CloudintegrationtypesPostableAgentCheckInDTOData = {- [key: string]: unknown;-} | null;+export type ConfigVictorOpsConfigDTOCustomFields = { [key: string]: string };-export interface CloudintegrationtypesPostableAgentCheckInDTO {+export interface ConfigVictorOpsConfigDTO {/*** @type string*/- account_id?: string;+ api_key?: string;/*** @type string*/- cloud_account_id?: string;+ api_key_file?: string;+ api_url?: ConfigURLType2DTO;+ /**+ * @type object+ */+ custom_fields?: ConfigVictorOpsConfigDTOCustomFields;/*** @type string*/- cloudIntegrationId?: string;+ entity_display_name?: string;+ http_config?: ConfigHTTPClientConfigDTO;/**- * @type object- * @nullable true+ * @type string*/- data: CloudintegrationtypesPostableAgentCheckInDTOData;+ message_type?: string;/*** @type string*/- providerAccountId?: string;-}--export interface CloudintegrationtypesProviderIntegrationConfigDTO {- aws: CloudintegrationtypesAWSIntegrationConfigDTO;-}--export interface CloudintegrationtypesServiceDTO {- assets: CloudintegrationtypesAssetsDTO;- cloudIntegrationService: CloudintegrationtypesCloudIntegrationServiceDTO;- dataCollected: CloudintegrationtypesDataCollectedDTO;+ monitoring_tool?: string;/*** @type string*/- icon: string;+ routing_key?: string;+ /**+ * @type boolean+ */+ send_resolved?: boolean;/*** @type string*/- id: string;+ state_message?: string;+}++export interface ConfigWebexConfigDTO {+ api_url?: ConfigURLType2DTO;+ http_config?: ConfigHTTPClientConfigDTO;/*** @type string*/- overview: string;- supportedSignals: CloudintegrationtypesSupportedSignalsDTO;- telemetryCollectionStrategy: CloudintegrationtypesTelemetryCollectionStrategyDTO;+ message?: string;/*** @type string*/- title: string;+ room_id?: string;+ /**+ * @type boolean+ */+ send_resolved?: boolean;}-export interface CloudintegrationtypesServiceConfigDTO {- aws: CloudintegrationtypesAWSServiceConfigDTO;+export interface ConfigWebhookConfigDTO {+ http_config?: ConfigHTTPClientConfigDTO;+ /**+ * @type integer+ * @minimum 0+ */+ max_alerts?: number;+ /**+ * @type boolean+ */+ send_resolved?: boolean;+ timeout?: TimeDurationDTO;+ /**+ * @type string+ */+ url?: string;+ /**+ * @type string+ */+ url_file?: string;}-export enum CloudintegrationtypesServiceIDDTO {- alb = 'alb',- 'api-gateway' = 'api-gateway',- dynamodb = 'dynamodb',- ec2 = 'ec2',- ecs = 'ecs',- eks = 'eks',- elasticache = 'elasticache',- lambda = 'lambda',- msk = 'msk',- rds = 'rds',- s3sync = 's3sync',- sns = 'sns',- sqs = 'sqs',-}-export interface CloudintegrationtypesServiceMetadataDTO {+export interface ConfigWechatConfigDTO {/**- * @type boolean+ * @type string*/- enabled: boolean;+ agent_id?: string;/*** @type string*/- icon: string;+ api_secret?: string;/*** @type string*/- id: string;+ api_secret_file?: string;+ api_url?: ConfigURLType2DTO;/*** @type string*/- title: string;-}--export interface CloudintegrationtypesSupportedSignalsDTO {+ corp_id?: string;+ http_config?: ConfigHTTPClientConfigDTO;/**- * @type boolean+ * @type string*/- logs?: boolean;+ message?: string;+ /**+ * @type string+ */+ message_type?: string;/*** @type boolean*/- metrics?: boolean;-}--export interface CloudintegrationtypesTelemetryCollectionStrategyDTO {- aws: CloudintegrationtypesAWSTelemetryCollectionStrategyDTO;-}--export interface CloudintegrationtypesUpdatableAccountDTO {- config: CloudintegrationtypesAccountConfigDTO;-}--export interface CloudintegrationtypesUpdatableServiceDTO {- config: CloudintegrationtypesServiceConfigDTO;+ send_resolved?: boolean;+ /**+ * @type string+ */+ to_party?: string;+ /**+ * @type string+ */+ to_tag?: string;+ /**+ * @type string+ */+ to_user?: string;}export interface DashboardtypesDashboardDTO {@@ -1809,6 +3412,12 @@ export enum MetrictypesTypeDTO {summary = 'summary',exponentialhistogram = 'exponentialhistogram',}+export type ModelDurationDTO = number;++export interface ModelLabelSetDTO {+ [key: string]: string;+}+export interface PreferencetypesPreferenceDTO {/*** @type array@@ -3109,6 +4718,10 @@ export interface ServiceaccounttypesUpdatableFactorAPIKeyDTO {name: string;}+export interface Sigv4SigV4ConfigDTO {+ [key: string]: unknown;+}+export enum TelemetrytypesFieldContextDTO {metric = 'metric',log = 'log',@@ -3196,6 +4809,25 @@ export interface TelemetrytypesTelemetryFieldValuesDTO {stringValues?: string[];}+export type TimeDurationDTO = number;++export interface TypesAlertStatusDTO {+ /**+ * @type array+ * @nullable true+ */+ inhibitedBy?: string[] | null;+ /**+ * @type array+ * @nullable true+ */+ silencedBy?: string[] | null;+ /**+ * @type string+ */+ state?: string;+}+export interface TypesChangePasswordRequestDTO {/*** @type string@@ -3542,6 +5174,17 @@ export interface ZeustypesPostableProfileDTO {where_did_you_discover_signoz: string;}+export type GetAlerts200 = {+ /**+ * @type array+ */+ data: AlertmanagertypesDeprecatedGettableAlertDTO[];+ /**+ * @type string+ */+ status: string;+};+export type AuthzCheck200 = {/*** @type array@@ -3564,6 +5207,42 @@ export type AuthzResources200 = {export type ChangePasswordPathParameters = {id: string;};+export type ListChannels200 = {+ /**+ * @type array+ */+ data: AlertmanagertypesChannelDTO[];+ /**+ * @type string+ */+ status: string;+};++export type CreateChannel201 = {+ data: AlertmanagertypesChannelDTO;+ /**+ * @type string+ */+ status: string;+};++export type DeleteChannelByIDPathParameters = {+ id: string;+};+export type GetChannelByIDPathParameters = {+ id: string;+};+export type GetChannelByID200 = {+ data: AlertmanagertypesChannelDTO;+ /**+ * @type string+ */+ status: string;+};++export type UpdateChannelByIDPathParameters = {+ id: string;+};export type AgentCheckInDeprecatedPathParameters = {cloudProvider: string;};@@ -4067,6 +5746,50 @@ export type PatchObjectsPathParameters = {id: string;relation: string;};+export type GetAllRoutePolicies200 = {+ /**+ * @type array+ */+ data: AlertmanagertypesGettableRoutePolicyDTO[];+ /**+ * @type string+ */+ status: string;+};++export type CreateRoutePolicy201 = {+ data: AlertmanagertypesGettableRoutePolicyDTO;+ /**+ * @type string+ */+ status: string;+};++export type DeleteRoutePolicyByIDPathParameters = {+ id: string;+};+export type GetRoutePolicyByIDPathParameters = {+ id: string;+};+export type GetRoutePolicyByID200 = {+ data: AlertmanagertypesGettableRoutePolicyDTO;+ /**+ * @type string+ */+ status: string;+};++export type UpdateRoutePolicyPathParameters = {+ id: string;+};+export type UpdateRoutePolicy200 = {+ data: AlertmanagertypesGettableRoutePolicyDTO;+ /**+ * @type string+ */+ status: string;+};+export type ListServiceAccounts200 = {/*** @type arraydiff --git a/pkg/alertmanager/handler.go b/pkg/alertmanager/handler.gonew file mode 100644index 0000000000..b93a71c709--- /dev/null+++ b/pkg/alertmanager/handler.go@@ -0,0 +1,31 @@+package alertmanager++import "net/http"++type Handler interface {+ GetAlerts(http.ResponseWriter, *http.Request)++ TestReceiver(http.ResponseWriter, *http.Request)++ ListChannels(http.ResponseWriter, *http.Request)++ ListAllChannels(http.ResponseWriter, *http.Request)++ GetChannelByID(http.ResponseWriter, *http.Request)++ CreateChannel(http.ResponseWriter, *http.Request)++ UpdateChannelByID(http.ResponseWriter, *http.Request)++ DeleteChannelByID(http.ResponseWriter, *http.Request)++ GetAllRoutePolicies(http.ResponseWriter, *http.Request)++ GetRoutePolicyByID(http.ResponseWriter, *http.Request)++ CreateRoutePolicy(http.ResponseWriter, *http.Request)++ UpdateRoutePolicy(http.ResponseWriter, *http.Request)++ DeleteRoutePolicyByID(http.ResponseWriter, *http.Request)+}diff --git a/pkg/alertmanager/api.go b/pkg/alertmanager/signozalertmanager/handler.gosimilarity index 76%rename from pkg/alertmanager/api.gorename to pkg/alertmanager/signozalertmanager/handler.goindex f83074fcb4..106897d13a 100644--- a/pkg/alertmanager/api.go+++ b/pkg/alertmanager/signozalertmanager/handler.go@@ -1,4 +1,4 @@-package alertmanager+package signozalertmanagerimport ("context"@@ -7,6 +7,7 @@ import ("net/http""time"+ "github.com/SigNoz/signoz/pkg/alertmanager""github.com/SigNoz/signoz/pkg/errors""github.com/SigNoz/signoz/pkg/http/render""github.com/SigNoz/signoz/pkg/types/alertmanagertypes"@@ -15,17 +16,15 @@ import ("github.com/gorilla/mux")-type API struct {- alertmanager Alertmanager+type handler struct {+ alertmanager alertmanager.Alertmanager}-func NewAPI(alertmanager Alertmanager) *API {- return &API{- alertmanager: alertmanager,- }+func NewHandler(alertmanager alertmanager.Alertmanager) alertmanager.Handler {+ return &handler{alertmanager: alertmanager}}-func (api *API) GetAlerts(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) GetAlerts(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()@@ -41,7 +40,7 @@ func (api *API) GetAlerts(rw http.ResponseWriter, req *http.Request) {return}- alerts, err := api.alertmanager.GetAlerts(ctx, claims.OrgID, params)+ alerts, err := handler.alertmanager.GetAlerts(ctx, claims.OrgID, params)if err != nil {render.Error(rw, err)return@@ -50,7 +49,7 @@ func (api *API) GetAlerts(rw http.ResponseWriter, req *http.Request) {render.Success(rw, http.StatusOK, alerts)}-func (api *API) TestReceiver(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) TestReceiver(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()@@ -73,7 +72,7 @@ func (api *API) TestReceiver(rw http.ResponseWriter, req *http.Request) {return}- err = api.alertmanager.TestReceiver(ctx, claims.OrgID, receiver)+ err = handler.alertmanager.TestReceiver(ctx, claims.OrgID, receiver)if err != nil {render.Error(rw, err)return@@ -82,7 +81,7 @@ func (api *API) TestReceiver(rw http.ResponseWriter, req *http.Request) {render.Success(rw, http.StatusNoContent, nil)}-func (api *API) ListChannels(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) ListChannels(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()@@ -92,7 +91,7 @@ func (api *API) ListChannels(rw http.ResponseWriter, req *http.Request) {return}- channels, err := api.alertmanager.ListChannels(ctx, claims.OrgID)+ channels, err := handler.alertmanager.ListChannels(ctx, claims.OrgID)if err != nil {render.Error(rw, err)return@@ -106,11 +105,11 @@ func (api *API) ListChannels(rw http.ResponseWriter, req *http.Request) {render.Success(rw, http.StatusOK, channels)}-func (api *API) ListAllChannels(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) ListAllChannels(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()- channels, err := api.alertmanager.ListAllChannels(ctx)+ channels, err := handler.alertmanager.ListAllChannels(ctx)if err != nil {render.Error(rw, err)return@@ -119,7 +118,7 @@ func (api *API) ListAllChannels(rw http.ResponseWriter, req *http.Request) {render.Success(rw, http.StatusOK, channels)}-func (api *API) GetChannelByID(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) GetChannelByID(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()@@ -147,7 +146,7 @@ func (api *API) GetChannelByID(rw http.ResponseWriter, req *http.Request) {return}- channel, err := api.alertmanager.GetChannelByID(ctx, claims.OrgID, id)+ channel, err := handler.alertmanager.GetChannelByID(ctx, claims.OrgID, id)if err != nil {render.Error(rw, err)return@@ -156,7 +155,7 @@ func (api *API) GetChannelByID(rw http.ResponseWriter, req *http.Request) {render.Success(rw, http.StatusOK, channel)}-func (api *API) UpdateChannelByID(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) UpdateChannelByID(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()@@ -197,7 +196,7 @@ func (api *API) UpdateChannelByID(rw http.ResponseWriter, req *http.Request) {return}- err = api.alertmanager.UpdateChannelByReceiverAndID(ctx, claims.OrgID, receiver, id)+ err = handler.alertmanager.UpdateChannelByReceiverAndID(ctx, claims.OrgID, receiver, id)if err != nil {render.Error(rw, err)return@@ -206,7 +205,7 @@ func (api *API) UpdateChannelByID(rw http.ResponseWriter, req *http.Request) {render.Success(rw, http.StatusNoContent, nil)}-func (api *API) DeleteChannelByID(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) DeleteChannelByID(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()@@ -234,7 +233,7 @@ func (api *API) DeleteChannelByID(rw http.ResponseWriter, req *http.Request) {return}- err = api.alertmanager.DeleteChannelByID(ctx, claims.OrgID, id)+ err = handler.alertmanager.DeleteChannelByID(ctx, claims.OrgID, id)if err != nil {render.Error(rw, err)return@@ -243,7 +242,7 @@ func (api *API) DeleteChannelByID(rw http.ResponseWriter, req *http.Request) {render.Success(rw, http.StatusNoContent, nil)}-func (api *API) CreateChannel(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) CreateChannel(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()@@ -266,7 +265,7 @@ func (api *API) CreateChannel(rw http.ResponseWriter, req *http.Request) {return}- channel, err := api.alertmanager.CreateChannel(ctx, claims.OrgID, receiver)+ channel, err := handler.alertmanager.CreateChannel(ctx, claims.OrgID, receiver)if err != nil {render.Error(rw, err)return@@ -275,7 +274,7 @@ func (api *API) CreateChannel(rw http.ResponseWriter, req *http.Request) {render.Success(rw, http.StatusCreated, channel)}-func (api *API) CreateRoutePolicy(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) CreateRoutePolicy(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()@@ -300,7 +299,7 @@ func (api *API) CreateRoutePolicy(rw http.ResponseWriter, req *http.Request) {return}- result, err := api.alertmanager.CreateRoutePolicy(ctx, &policy)+ result, err := handler.alertmanager.CreateRoutePolicy(ctx, &policy)if err != nil {render.Error(rw, err)return@@ -309,11 +308,11 @@ func (api *API) CreateRoutePolicy(rw http.ResponseWriter, req *http.Request) {render.Success(rw, http.StatusCreated, result)}-func (api *API) GetAllRoutePolicies(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) GetAllRoutePolicies(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()- policies, err := api.alertmanager.GetAllRoutePolicies(ctx)+ policies, err := handler.alertmanager.GetAllRoutePolicies(ctx)if err != nil {render.Error(rw, err)return@@ -322,7 +321,7 @@ func (api *API) GetAllRoutePolicies(rw http.ResponseWriter, req *http.Request) {render.Success(rw, http.StatusOK, policies)}-func (api *API) GetRoutePolicyByID(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) GetRoutePolicyByID(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()@@ -333,7 +332,7 @@ func (api *API) GetRoutePolicyByID(rw http.ResponseWriter, req *http.Request) {return}- policy, err := api.alertmanager.GetRoutePolicyByID(ctx, policyID)+ policy, err := handler.alertmanager.GetRoutePolicyByID(ctx, policyID)if err != nil {render.Error(rw, err)return@@ -342,7 +341,7 @@ func (api *API) GetRoutePolicyByID(rw http.ResponseWriter, req *http.Request) {render.Success(rw, http.StatusOK, policy)}-func (api *API) DeleteRoutePolicyByID(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) DeleteRoutePolicyByID(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()@@ -353,7 +352,7 @@ func (api *API) DeleteRoutePolicyByID(rw http.ResponseWriter, req *http.Request)return}- err := api.alertmanager.DeleteRoutePolicyByID(ctx, policyID)+ err := handler.alertmanager.DeleteRoutePolicyByID(ctx, policyID)if err != nil {render.Error(rw, err)return@@ -362,7 +361,7 @@ func (api *API) DeleteRoutePolicyByID(rw http.ResponseWriter, req *http.Request)render.Success(rw, http.StatusNoContent, nil)}-func (api *API) UpdateRoutePolicy(rw http.ResponseWriter, req *http.Request) {+func (handler *handler) UpdateRoutePolicy(rw http.ResponseWriter, req *http.Request) {ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)defer cancel()@@ -392,7 +391,7 @@ func (api *API) UpdateRoutePolicy(rw http.ResponseWriter, req *http.Request) {return}- result, err := api.alertmanager.UpdateRoutePolicyByID(ctx, policyID, &policy)+ result, err := handler.alertmanager.UpdateRoutePolicyByID(ctx, policyID, &policy)if err != nil {render.Error(rw, err)returndiff --git a/pkg/alertmanager/signozalertmanager/provider.go b/pkg/alertmanager/signozalertmanager/provider.goindex 63614fefda..98259f75e6 100644--- a/pkg/alertmanager/signozalertmanager/provider.go+++ b/pkg/alertmanager/signozalertmanager/provider.go@@ -309,8 +309,8 @@ func (provider *provider) CreateRoutePolicy(ctx context.Context, routeRequest *areturn &alertmanagertypes.GettableRoutePolicy{PostableRoutePolicy: *routeRequest,ID: route.ID.StringValue(),- CreatedAt: &route.CreatedAt,- UpdatedAt: &route.UpdatedAt,+ CreatedAt: route.CreatedAt,+ UpdatedAt: route.UpdatedAt,CreatedBy: &route.CreatedBy,UpdatedBy: &route.UpdatedBy,}, nil@@ -365,8 +365,8 @@ func (provider *provider) CreateRoutePolicies(ctx context.Context, routeRequestsresults = append(results, &alertmanagertypes.GettableRoutePolicy{PostableRoutePolicy: *routeRequest,ID: route.ID.StringValue(),- CreatedAt: &route.CreatedAt,- UpdatedAt: &route.UpdatedAt,+ CreatedAt: route.CreatedAt,+ UpdatedAt: route.UpdatedAt,CreatedBy: &route.CreatedBy,UpdatedBy: &route.UpdatedBy,})@@ -405,8 +405,8 @@ func (provider *provider) GetRoutePolicyByID(ctx context.Context, routeID stringTags: route.Tags,},ID: route.ID.StringValue(),- CreatedAt: &route.CreatedAt,- UpdatedAt: &route.UpdatedAt,+ CreatedAt: route.CreatedAt,+ UpdatedAt: route.UpdatedAt,CreatedBy: &route.CreatedBy,UpdatedBy: &route.UpdatedBy,}, nil@@ -439,8 +439,8 @@ func (provider *provider) GetAllRoutePolicies(ctx context.Context) ([]*alertmanaTags: route.Tags,},ID: route.ID.StringValue(),- CreatedAt: &route.CreatedAt,- UpdatedAt: &route.UpdatedAt,+ CreatedAt: route.CreatedAt,+ UpdatedAt: route.UpdatedAt,CreatedBy: &route.CreatedBy,UpdatedBy: &route.UpdatedBy,})@@ -508,8 +508,8 @@ func (provider *provider) UpdateRoutePolicyByID(ctx context.Context, routeID strreturn &alertmanagertypes.GettableRoutePolicy{PostableRoutePolicy: *route,ID: updatedRoute.ID.StringValue(),- CreatedAt: &updatedRoute.CreatedAt,- UpdatedAt: &updatedRoute.UpdatedAt,+ CreatedAt: updatedRoute.CreatedAt,+ UpdatedAt: updatedRoute.UpdatedAt,CreatedBy: &updatedRoute.CreatedBy,UpdatedBy: &updatedRoute.UpdatedBy,}, nildiff --git a/pkg/apiserver/signozapiserver/alertmanager.go b/pkg/apiserver/signozapiserver/alertmanager.gonew file mode 100644index 0000000000..6f88a7d566--- /dev/null+++ b/pkg/apiserver/signozapiserver/alertmanager.go@@ -0,0 +1,235 @@+package signozapiserver++import (+ "net/http"++ "github.com/SigNoz/signoz/pkg/http/handler"+ "github.com/SigNoz/signoz/pkg/types"+ "github.com/SigNoz/signoz/pkg/types/alertmanagertypes"+ "github.com/gorilla/mux"+)++func (provider *provider) addAlertmanagerRoutes(router *mux.Router) error {+ if err := router.Handle("/api/v1/channels", handler.New(provider.authZ.ViewAccess(provider.alertmanagerHandler.ListChannels), handler.OpenAPIDef{+ ID: "ListChannels",+ Tags: []string{"channels"},+ Summary: "List notification channels",+ Description: "This endpoint lists all notification channels for the organization",+ Request: nil,+ RequestContentType: "",+ Response: make([]*alertmanagertypes.Channel, 0),+ ResponseContentType: "application/json",+ SuccessStatusCode: http.StatusOK,+ ErrorStatusCodes: []int{},+ Deprecated: false,+ SecuritySchemes: newSecuritySchemes(types.RoleViewer),+ })).Methods(http.MethodGet).GetError(); err != nil {+ return err+ }++ if err := router.Handle("/api/v1/channels/{id}", handler.New(provider.authZ.ViewAccess(provider.alertmanagerHandler.GetChannelByID), handler.OpenAPIDef{+ ID: "GetChannelByID",+ Tags: []string{"channels"},+ Summary: "Get notification channel by ID",+ Description: "This endpoint returns a notification channel by ID",+ Request: nil,+ RequestContentType: "",+ Response: new(alertmanagertypes.Channel),+ ResponseContentType: "application/json",+ SuccessStatusCode: http.StatusOK,+ ErrorStatusCodes: []int{http.StatusNotFound},+ Deprecated: false,+ SecuritySchemes: newSecuritySchemes(types.RoleViewer),+ })).Methods(http.MethodGet).GetError(); err != nil {+ return err+ }++ if err := router.Handle("/api/v1/channels", handler.New(provider.authZ.AdminAccess(provider.alertmanagerHandler.CreateChannel), handler.OpenAPIDef{+ ID: "CreateChannel",+ Tags: []string{"channels"},+ Summary: "Create notification channel",+ Description: "This endpoint creates a notification channel",+ Request: new(alertmanagertypes.Receiver),+ RequestContentType: "application/json",+ Response: new(alertmanagertypes.Channel),+ ResponseContentType: "application/json",+ SuccessStatusCode: http.StatusCreated,+ ErrorStatusCodes: []int{http.StatusBadRequest},+ Deprecated: false,+ SecuritySchemes: newSecuritySchemes(types.RoleAdmin),+ })).Methods(http.MethodPost).GetError(); err != nil {+ return err+ }++ if err := router.Handle("/api/v1/channels/{id}", handler.New(provider.authZ.AdminAccess(provider.alertmanagerHandler.UpdateChannelByID), handler.OpenAPIDef{+ ID: "UpdateChannelByID",+ Tags: []string{"channels"},+ Summary: "Update notification channel",+ Description: "This endpoint updates a notification channel by ID",+ Request: new(alertmanagertypes.Receiver),+ RequestContentType: "application/json",+ Response: nil,+ ResponseContentType: "",+ SuccessStatusCode: http.StatusNoContent,+ ErrorStatusCodes: []int{http.StatusBadRequest, http.StatusNotFound},+ Deprecated: false,+ SecuritySchemes: newSecuritySchemes(types.RoleAdmin),+ })).Methods(http.MethodPut).GetError(); err != nil {+ return err+ }++ if err := router.Handle("/api/v1/channels/{id}", handler.New(provider.authZ.AdminAccess(provider.alertmanagerHandler.DeleteChannelByID), handler.OpenAPIDef{+ ID: "DeleteChannelByID",+ Tags: []string{"channels"},+ Summary: "Delete notification channel",+ Description: "This endpoint deletes a notification channel by ID",+ Request: nil,+ RequestContentType: "",+ Response: nil,+ ResponseContentType: "",+ SuccessStatusCode: http.StatusNoContent,+ ErrorStatusCodes: []int{http.StatusNotFound},+ Deprecated: false,+ SecuritySchemes: newSecuritySchemes(types.RoleAdmin),+ })).Methods(http.MethodDelete).GetError(); err != nil {+ return err+ }++ if err := router.Handle("/api/v1/channels/test", handler.New(provider.authZ.EditAccess(provider.alertmanagerHandler.TestReceiver), handler.OpenAPIDef{+ ID: "TestChannel",+ Tags: []string{"channels"},+ Summary: "Test notification channel",+ Description: "This endpoint tests a notification channel by sending a test notification",+ Request: new(alertmanagertypes.Receiver),+ RequestContentType: "application/json",+ Response: nil,+ ResponseContentType: "",+ SuccessStatusCode: http.StatusNoContent,+ ErrorStatusCodes: []int{http.StatusBadRequest},+ Deprecated: false,+ SecuritySchemes: newSecuritySchemes(types.RoleEditor),+ })).Methods(http.MethodPost).GetError(); err != nil {+ return err+ }++ if err := router.Handle("/api/v1/testChannel", handler.New(provider.authZ.EditAccess(provider.alertmanagerHandler.TestReceiver), handler.OpenAPIDef{+ ID: "TestChannelDeprecated",+ Tags: []string{"channels"},+ Summary: "Test notification channel (deprecated)",+ Description: "Deprecated: use /api/v1/channels/test instead",+ Request: new(alertmanagertypes.Receiver),+ RequestContentType: "application/json",+ Response: nil,+ ResponseContentType: "",+ SuccessStatusCode: http.StatusNoContent,+ ErrorStatusCodes: []int{http.StatusBadRequest},+ Deprecated: true,+ SecuritySchemes: newSecuritySchemes(types.RoleEditor),+ })).Methods(http.MethodPost).GetError(); err != nil {+ return err+ }++ if err := router.Handle("/api/v1/route_policies", handler.New(provider.authZ.ViewAccess(provider.alertmanagerHandler.GetAllRoutePolicies), handler.OpenAPIDef{+ ID: "GetAllRoutePolicies",+ Tags: []string{"routepolicies"},+ Summary: "List route policies",+ Description: "This endpoint lists all route policies for the organization",+ Request: nil,+ RequestContentType: "",+ Response: make([]*alertmanagertypes.GettableRoutePolicy, 0),+ ResponseContentType: "application/json",+ SuccessStatusCode: http.StatusOK,+ ErrorStatusCodes: []int{},+ Deprecated: false,+ SecuritySchemes: newSecuritySchemes(types.RoleViewer),+ })).Methods(http.MethodGet).GetError(); err != nil {+ return err+ }++ if err := router.Handle("/api/v1/route_policies/{id}", handler.New(provider.authZ.ViewAccess(provider.alertmanagerHandler.GetRoutePolicyByID), handler.OpenAPIDef{+ ID: "GetRoutePolicyByID",+ Tags: []string{"routepolicies"},+ Summary: "Get route policy by ID",+ Description: "This endpoint returns a route policy by ID",+ Request: nil,+ RequestContentType: "",+ Response: new(alertmanagertypes.GettableRoutePolicy),+ ResponseContentType: "application/json",+ SuccessStatusCode: http.StatusOK,+ ErrorStatusCodes: []int{http.StatusNotFound},+ Deprecated: false,+ SecuritySchemes: newSecuritySchemes(types.RoleViewer),+ })).Methods(http.MethodGet).GetError(); err != nil {+ return err+ }++ if err := router.Handle("/api/v1/route_policies", handler.New(provider.authZ.AdminAccess(provider.alertmanagerHandler.CreateRoutePolicy), handler.OpenAPIDef{+ ID: "CreateRoutePolicy",+ Tags: []string{"routepolicies"},+ Summary: "Create route policy",+ Description: "This endpoint creates a route policy",+ Request: new(alertmanagertypes.PostableRoutePolicy),+ RequestContentType: "application/json",+ Response: new(alertmanagertypes.GettableRoutePolicy),+ ResponseContentType: "application/json",+ SuccessStatusCode: http.StatusCreated,+ ErrorStatusCodes: []int{http.StatusBadRequest},+ Deprecated: false,+ SecuritySchemes: newSecuritySchemes(types.RoleAdmin),+ })).Methods(http.MethodPost).GetError(); err != nil {+ return err+ }++ if err := router.Handle("/api/v1/route_policies/{id}", handler.New(provider.authZ.AdminAccess(provider.alertmanagerHandler.UpdateRoutePolicy), handler.OpenAPIDef{+ ID: "UpdateRoutePolicy",+ Tags: []string{"routepolicies"},+ Summary: "Update route policy",+ Description: "This endpoint updates a route policy by ID",+ Request: new(alertmanagertypes.PostableRoutePolicy),+ RequestContentType: "application/json",+ Response: new(alertmanagertypes.GettableRoutePolicy),+ ResponseContentType: "application/json",+ SuccessStatusCode: http.StatusOK,+ ErrorStatusCodes: []int{http.StatusBadRequest, http.StatusNotFound},+ Deprecated: false,+ SecuritySchemes: newSecuritySchemes(types.RoleAdmin),+ })).Methods(http.MethodPut).GetError(); err != nil {+ return err+ }++ if err := router.Handle("/api/v1/route_policies/{id}", handler.New(provider.authZ.AdminAccess(provider.alertmanagerHandler.DeleteRoutePolicyByID), handler.OpenAPIDef{+ ID: "DeleteRoutePolicyByID",+ Tags: []string{"routepolicies"},+ Summary: "Delete route policy",+ Description: "This endpoint deletes a route policy by ID",+ Request: nil,+ RequestContentType: "",+ Response: nil,+ ResponseContentType: "",+ SuccessStatusCode: http.StatusNoContent,+ ErrorStatusCodes: []int{http.StatusNotFound},+ Deprecated: false,+ SecuritySchemes: newSecuritySchemes(types.RoleAdmin),+ })).Methods(http.MethodDelete).GetError(); err != nil {+ return err+ }++ if err := router.Handle("/api/v1/alerts", handler.New(provider.authZ.ViewAccess(provider.alertmanagerHandler.GetAlerts), handler.OpenAPIDef{+ ID: "GetAlerts",+ Tags: []string{"alerts"},+ Summary: "Get alerts",+ Description: "This endpoint returns alerts for the organization",+ Request: nil,+ RequestContentType: "",+ Response: make(alertmanagertypes.DeprecatedGettableAlerts, 0),+ ResponseContentType: "application/json",+ SuccessStatusCode: http.StatusOK,+ ErrorStatusCodes: []int{},+ Deprecated: false,+ SecuritySchemes: newSecuritySchemes(types.RoleViewer),+ })).Methods(http.MethodGet).GetError(); err != nil {+ return err+ }++ return nil+}diff --git a/pkg/apiserver/signozapiserver/provider.go b/pkg/apiserver/signozapiserver/provider.goindex c4d5616653..cfeec92d54 100644--- a/pkg/apiserver/signozapiserver/provider.go+++ b/pkg/apiserver/signozapiserver/provider.go@@ -3,6 +3,7 @@ package signozapiserverimport ("context"+ "github.com/SigNoz/signoz/pkg/alertmanager""github.com/SigNoz/signoz/pkg/apiserver""github.com/SigNoz/signoz/pkg/authz""github.com/SigNoz/signoz/pkg/factory"@@ -57,6 +58,7 @@ type provider struct {factoryHandler factory.HandlercloudIntegrationHandler cloudintegration.HandlerruleStateHistoryHandler rulestatehistory.Handler+ alertmanagerHandler alertmanager.Handler}func NewFactory(@@ -83,6 +85,7 @@ func NewFactory(factoryHandler factory.Handler,cloudIntegrationHandler cloudintegration.Handler,ruleStateHistoryHandler rulestatehistory.Handler,+ alertmanagerHandler alertmanager.Handler,) factory.ProviderFactory[apiserver.APIServer, apiserver.Config] {return factory.NewProviderFactory(factory.MustNewName("signoz"), func(ctx context.Context, providerSettings factory.ProviderSettings, config apiserver.Config) (apiserver.APIServer, error) {return newProvider(@@ -112,6 +115,7 @@ func NewFactory(factoryHandler,cloudIntegrationHandler,ruleStateHistoryHandler,+ alertmanagerHandler,)})}@@ -143,6 +147,7 @@ func newProvider(factoryHandler factory.Handler,cloudIntegrationHandler cloudintegration.Handler,ruleStateHistoryHandler rulestatehistory.Handler,+ alertmanagerHandler alertmanager.Handler,) (apiserver.APIServer, error) {settings := factory.NewScopedProviderSettings(providerSettings, "github.com/SigNoz/signoz/pkg/apiserver/signozapiserver")router := mux.NewRouter().UseEncodedPath()@@ -172,6 +177,7 @@ func newProvider(factoryHandler: factoryHandler,cloudIntegrationHandler: cloudIntegrationHandler,ruleStateHistoryHandler: ruleStateHistoryHandler,+ alertmanagerHandler: alertmanagerHandler,}provider.authZ = middleware.NewAuthZ(settings.Logger(), orgGetter, authz)@@ -272,6 +278,10 @@ func (provider *provider) AddToRouter(router *mux.Router) error {return err}+ if err := provider.addAlertmanagerRoutes(router); err != nil {+ return err+ }+return nil}diff --git a/pkg/query-service/app/http_handler.go b/pkg/query-service/app/http_handler.goindex e4f15878bd..6d7c1a2540 100644--- a/pkg/query-service/app/http_handler.go+++ b/pkg/query-service/app/http_handler.go@@ -27,7 +27,6 @@ import ("github.com/prometheus/prometheus/promql"- "github.com/SigNoz/signoz/pkg/alertmanager"errorsV2 "github.com/SigNoz/signoz/pkg/errors""github.com/SigNoz/signoz/pkg/http/middleware""github.com/SigNoz/signoz/pkg/http/render"@@ -140,8 +139,6 @@ type APIHandler struct {pvcsRepo *inframetrics.PvcsRepo- AlertmanagerAPI *alertmanager.API-LicensingAPI licensing.APIQueryParserAPI *queryparser.API@@ -168,8 +165,6 @@ type APIHandlerOpts struct {// Flux IntervalFluxInterval time.Duration- AlertmanagerAPI *alertmanager.API-LicensingAPI licensing.APIQueryParserAPI *queryparser.API@@ -230,7 +225,6 @@ func NewAPIHandler(opts APIHandlerOpts, config signoz.Config) (*APIHandler, errostatefulsetsRepo: statefulsetsRepo,jobsRepo: jobsRepo,pvcsRepo: pvcsRepo,- AlertmanagerAPI: opts.AlertmanagerAPI,LicensingAPI: opts.LicensingAPI,Signoz: opts.Signoz,QueryParserAPI: opts.QueryParserAPI,@@ -502,21 +496,6 @@ func (aH *APIHandler) Respond(w http.ResponseWriter, data interface{}) {func (aH *APIHandler) RegisterRoutes(router *mux.Router, am *middleware.AuthZ) {router.HandleFunc("/api/v1/query_range", am.ViewAccess(aH.queryRangeMetrics)).Methods(http.MethodGet)router.HandleFunc("/api/v1/query", am.ViewAccess(aH.queryMetrics)).Methods(http.MethodGet)- router.HandleFunc("/api/v1/channels", am.ViewAccess(aH.AlertmanagerAPI.ListChannels)).Methods(http.MethodGet)- router.HandleFunc("/api/v1/channels/{id}", am.ViewAccess(aH.AlertmanagerAPI.GetChannelByID)).Methods(http.MethodGet)- router.HandleFunc("/api/v1/channels/{id}", am.AdminAccess(aH.AlertmanagerAPI.UpdateChannelByID)).Methods(http.MethodPut)- router.HandleFunc("/api/v1/channels/{id}", am.AdminAccess(aH.AlertmanagerAPI.DeleteChannelByID)).Methods(http.MethodDelete)- router.HandleFunc("/api/v1/channels", am.EditAccess(aH.AlertmanagerAPI.CreateChannel)).Methods(http.MethodPost)- router.HandleFunc("/api/v1/testChannel", am.EditAccess(aH.AlertmanagerAPI.TestReceiver)).Methods(http.MethodPost)-- router.HandleFunc("/api/v1/route_policies", am.ViewAccess(aH.AlertmanagerAPI.GetAllRoutePolicies)).Methods(http.MethodGet)- router.HandleFunc("/api/v1/route_policies/{id}", am.ViewAccess(aH.AlertmanagerAPI.GetRoutePolicyByID)).Methods(http.MethodGet)- router.HandleFunc("/api/v1/route_policies", am.AdminAccess(aH.AlertmanagerAPI.CreateRoutePolicy)).Methods(http.MethodPost)- router.HandleFunc("/api/v1/route_policies/{id}", am.AdminAccess(aH.AlertmanagerAPI.DeleteRoutePolicyByID)).Methods(http.MethodDelete)- router.HandleFunc("/api/v1/route_policies/{id}", am.AdminAccess(aH.AlertmanagerAPI.UpdateRoutePolicy)).Methods(http.MethodPut)-- router.HandleFunc("/api/v1/alerts", am.ViewAccess(aH.AlertmanagerAPI.GetAlerts)).Methods(http.MethodGet)-router.HandleFunc("/api/v1/rules", am.ViewAccess(aH.listRules)).Methods(http.MethodGet)router.HandleFunc("/api/v1/rules/{id}", am.ViewAccess(aH.getRule)).Methods(http.MethodGet)router.HandleFunc("/api/v1/rules", am.EditAccess(aH.createRule)).Methods(http.MethodPost)diff --git a/pkg/query-service/app/server.go b/pkg/query-service/app/server.goindex f4663ff658..53d3a59ef4 100644--- a/pkg/query-service/app/server.go+++ b/pkg/query-service/app/server.go@@ -136,7 +136,6 @@ func NewServer(config signoz.Config, signoz *signoz.SigNoz) (*Server, error) {CloudIntegrationsController: cloudIntegrationsController,LogsParsingPipelineController: logParsingPipelineController,FluxInterval: config.Querier.FluxInterval,- AlertmanagerAPI: alertmanager.NewAPI(signoz.Alertmanager),LicensingAPI: nooplicensing.NewLicenseAPI(),Signoz: signoz,QueryParserAPI: queryparser.NewAPI(signoz.Instrumentation.ToProviderSettings(), signoz.QueryParser),diff --git a/pkg/signoz/handler.go b/pkg/signoz/handler.goindex 46bc13e872..c63c62452d 100644--- a/pkg/signoz/handler.go+++ b/pkg/signoz/handler.go@@ -1,6 +1,8 @@package signozimport (+ "github.com/SigNoz/signoz/pkg/alertmanager"+ "github.com/SigNoz/signoz/pkg/alertmanager/signozalertmanager""github.com/SigNoz/signoz/pkg/analytics""github.com/SigNoz/signoz/pkg/authz""github.com/SigNoz/signoz/pkg/authz/signozauthzapi"@@ -62,6 +64,7 @@ type Handlers struct {RegistryHandler factory.HandlerCloudIntegrationHandler cloudintegration.HandlerRuleStateHistory rulestatehistory.Handler+ AlertmanagerHandler alertmanager.Handler}func NewHandlers(@@ -77,6 +80,7 @@ func NewHandlers(authz authz.AuthZ,zeusService zeus.Zeus,registryHandler factory.Handler,+ alertmanagerService alertmanager.Alertmanager,) Handlers {return Handlers{SavedView: implsavedview.NewHandler(modules.SavedView),@@ -99,5 +103,6 @@ func NewHandlers(RegistryHandler: registryHandler,RuleStateHistory: implrulestatehistory.NewHandler(modules.RuleStateHistory),CloudIntegrationHandler: implcloudintegration.NewHandler(modules.CloudIntegration),+ AlertmanagerHandler: signozalertmanager.NewHandler(alertmanagerService),}}diff --git a/pkg/signoz/handler_test.go b/pkg/signoz/handler_test.goindex 2f734dceca..e5fd925fe5 100644--- a/pkg/signoz/handler_test.go+++ b/pkg/signoz/handler_test.go@@ -56,7 +56,7 @@ func TestNewHandlers(t *testing.T) {querierHandler := querier.NewHandler(providerSettings, nil, nil)registryHandler := factory.NewHandler(nil)- handlers := NewHandlers(modules, providerSettings, nil, querierHandler, nil, nil, nil, nil, nil, nil, nil, registryHandler)+ handlers := NewHandlers(modules, providerSettings, nil, querierHandler, nil, nil, nil, nil, nil, nil, nil, registryHandler, alertmanager)reflectVal := reflect.ValueOf(handlers)for i := 0; i < reflectVal.NumField(); i++ {f := reflectVal.Field(i)diff --git a/pkg/signoz/openapi.go b/pkg/signoz/openapi.goindex 51209a760d..9990080c29 100644--- a/pkg/signoz/openapi.go+++ b/pkg/signoz/openapi.go@@ -7,6 +7,7 @@ import ("os""reflect"+ "github.com/SigNoz/signoz/pkg/alertmanager""github.com/SigNoz/signoz/pkg/apiserver""github.com/SigNoz/signoz/pkg/apiserver/signozapiserver""github.com/SigNoz/signoz/pkg/authz"@@ -69,6 +70,7 @@ func NewOpenAPI(ctx context.Context, instrumentation instrumentation.Instrumentastruct{ factory.Handler }{},struct{ cloudintegration.Handler }{},struct{ rulestatehistory.Handler }{},+ struct{ alertmanager.Handler }{},).New(ctx, instrumentation.ToProviderSettings(), apiserver.Config{})if err != nil {return nil, errdiff --git a/pkg/signoz/provider.go b/pkg/signoz/provider.goindex 950107cb72..2280793c31 100644--- a/pkg/signoz/provider.go+++ b/pkg/signoz/provider.go@@ -288,6 +288,7 @@ func NewAPIServerProviderFactories(orgGetter organization.Getter, authz authz.Auhandlers.RegistryHandler,handlers.CloudIntegrationHandler,handlers.RuleStateHistory,+ handlers.AlertmanagerHandler,),)}diff --git a/pkg/signoz/signoz.go b/pkg/signoz/signoz.goindex 4b0102e96d..fd1adf7899 100644--- a/pkg/signoz/signoz.go+++ b/pkg/signoz/signoz.go@@ -500,7 +500,7 @@ func New(// Initialize all handlers for the modulesregistryHandler := factory.NewHandler(registry)- handlers := NewHandlers(modules, providerSettings, analytics, querierHandler, licensing, global, flagger, gateway, telemetryMetadataStore, authz, zeus, registryHandler)+ handlers := NewHandlers(modules, providerSettings, analytics, querierHandler, licensing, global, flagger, gateway, telemetryMetadataStore, authz, zeus, registryHandler, alertmanager)// Initialize the API server (after registry so it can access service health)apiserverInstance, err := factory.NewProviderFromNamedMap(diff --git a/pkg/types/alertmanagertypes/channel.go b/pkg/types/alertmanagertypes/channel.goindex 7f15c4d782..a8c5079e1e 100644--- a/pkg/types/alertmanagertypes/channel.go+++ b/pkg/types/alertmanagertypes/channel.go@@ -34,10 +34,10 @@ type Channel struct {types.Identifiabletypes.TimeAuditable- Name string `json:"name" bun:"name"`- Type string `json:"type" bun:"type"`- Data string `json:"data" bun:"data"`- OrgID string `json:"org_id" bun:"org_id"`+ Name string `json:"name" required:"true" bun:"name"`+ Type string `json:"type" required:"true" bun:"type"`+ Data string `json:"data" required:"true" bun:"data"`+ OrgID string `json:"orgId" required:"true" bun:"org_id"`}// NewChannelFromReceiver creates a new Channel from a Receiver.diff --git a/pkg/types/alertmanagertypes/expressionroute.go b/pkg/types/alertmanagertypes/expressionroute.goindex 45f51aa6e2..d6d0bb8f0e 100644--- a/pkg/types/alertmanagertypes/expressionroute.go+++ b/pkg/types/alertmanagertypes/expressionroute.go@@ -12,12 +12,12 @@ import ()type PostableRoutePolicy struct {- Expression string `json:"expression"`+ Expression string `json:"expression" required:"true"`ExpressionKind ExpressionKind `json:"kind"`- Channels []string `json:"channels"`- Name string `json:"name"`+ Channels []string `json:"channels" required:"true"`+ Name string `json:"name" required:"true"`Description string `json:"description"`- Tags []string `json:"tags,omitempty"`+ Tags []string `json:"tags,omitempty" nullable:"true"`}func (p *PostableRoutePolicy) Validate() error {@@ -53,15 +53,13 @@ func (p *PostableRoutePolicy) Validate() error {}type GettableRoutePolicy struct {- PostableRoutePolicy // Embedded+ PostableRoutePolicy- ID string `json:"id"`-- // Audit fields- CreatedAt *time.Time `json:"createdAt"`- UpdatedAt *time.Time `json:"updatedAt"`- CreatedBy *string `json:"createdBy"`- UpdatedBy *string `json:"updatedBy"`+ ID string `json:"id" required:"true"`+ CreatedAt time.Time `json:"createdAt" required:"true"`+ UpdatedAt time.Time `json:"updatedAt" required:"true"`+ CreatedBy *string `json:"createdBy" nullable:"true"`+ UpdatedBy *string `json:"updatedBy" nullable:"true"`}type ExpressionKind struct {@@ -73,6 +71,13 @@ var (PolicyBasedExpression = ExpressionKind{valuer.NewString("policy")})+func (ExpressionKind) Enum() []any {+ return []any{+ RuleBasedExpression,+ PolicyBasedExpression,+ }+}+// RoutePolicy represents the database model for expression routes.type RoutePolicy struct {bun.BaseModel `bun:"table:route_policy"`