mirror of
https://github.com/SigNoz/signoz.git
synced 2026-04-01 18:10:21 +01:00
Compare commits
61 Commits
fix/array-
...
feat/cloud
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42300bd0a0 | ||
|
|
6e52f2c8f0 | ||
|
|
d9f8a4ae5a | ||
|
|
eefe3edffd | ||
|
|
2051861a03 | ||
|
|
4b01a40fb9 | ||
|
|
2d8a00bf18 | ||
|
|
f1b26b310f | ||
|
|
2c438b6c32 | ||
|
|
1814c2d13c | ||
|
|
e6cd771f11 | ||
|
|
6b94f87ca0 | ||
|
|
bf315253ae | ||
|
|
668ff7bc39 | ||
|
|
07f2aa52fd | ||
|
|
3416b3ad55 | ||
|
|
d6caa4f2c7 | ||
|
|
f86371566d | ||
|
|
9115803084 | ||
|
|
0c14d8f966 | ||
|
|
7afb461af8 | ||
|
|
a21fbb4ee0 | ||
|
|
0369842f3d | ||
|
|
59cd96562a | ||
|
|
cc4475cab7 | ||
|
|
ac8c648420 | ||
|
|
bede6be4b8 | ||
|
|
dd3d60e6df | ||
|
|
538ab686d2 | ||
|
|
936a325cb9 | ||
|
|
c6cdcd0143 | ||
|
|
cd9211d718 | ||
|
|
0601c28782 | ||
|
|
580610dbfa | ||
|
|
2d2aa02a81 | ||
|
|
dd9723ad13 | ||
|
|
3651469416 | ||
|
|
febce75734 | ||
|
|
e1616f3487 | ||
|
|
4b94287ac7 | ||
|
|
1575c7c54c | ||
|
|
8def3f835b | ||
|
|
11ed15f4c5 | ||
|
|
f47877cca9 | ||
|
|
bb2b9215ba | ||
|
|
3111904223 | ||
|
|
003e2c30d8 | ||
|
|
00fe516d10 | ||
|
|
0305f4f7db | ||
|
|
c60019a6dc | ||
|
|
acde2a37fa | ||
|
|
945241a52a | ||
|
|
e967f80c86 | ||
|
|
a09dc325de | ||
|
|
379b4f7fc4 | ||
|
|
5e536ae077 | ||
|
|
234585e642 | ||
|
|
2cc14f1ad4 | ||
|
|
dc4ed4d239 | ||
|
|
7281c36873 | ||
|
|
40288776e8 |
@@ -342,6 +342,397 @@ components:
|
|||||||
config:
|
config:
|
||||||
$ref: '#/components/schemas/AuthtypesAuthDomainConfig'
|
$ref: '#/components/schemas/AuthtypesAuthDomainConfig'
|
||||||
type: object
|
type: object
|
||||||
|
CloudintegrationtypesAWSAccountConfig:
|
||||||
|
properties:
|
||||||
|
regions:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- regions
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAWSCollectionStrategy:
|
||||||
|
properties:
|
||||||
|
aws_logs:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAWSLogsStrategy'
|
||||||
|
aws_metrics:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAWSMetricsStrategy'
|
||||||
|
s3_buckets:
|
||||||
|
additionalProperties:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAWSConnectionArtifact:
|
||||||
|
properties:
|
||||||
|
connectionURL:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- connectionURL
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAWSConnectionArtifactRequest:
|
||||||
|
properties:
|
||||||
|
deploymentRegion:
|
||||||
|
type: string
|
||||||
|
regions:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- deploymentRegion
|
||||||
|
- regions
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAWSIntegrationConfig:
|
||||||
|
properties:
|
||||||
|
enabledRegions:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
telemetry:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAWSCollectionStrategy'
|
||||||
|
required:
|
||||||
|
- enabledRegions
|
||||||
|
- telemetry
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAWSLogsStrategy:
|
||||||
|
properties:
|
||||||
|
cloudwatch_logs_subscriptions:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
filter_pattern:
|
||||||
|
type: string
|
||||||
|
log_group_name_prefix:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
nullable: true
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAWSMetricsStrategy:
|
||||||
|
properties:
|
||||||
|
cloudwatch_metric_stream_filters:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
MetricNames:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
Namespace:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
nullable: true
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAWSServiceConfig:
|
||||||
|
properties:
|
||||||
|
logs:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAWSServiceLogsConfig'
|
||||||
|
metrics:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAWSServiceMetricsConfig'
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAWSServiceLogsConfig:
|
||||||
|
properties:
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
s3_buckets:
|
||||||
|
additionalProperties:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAWSServiceMetricsConfig:
|
||||||
|
properties:
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAccount:
|
||||||
|
properties:
|
||||||
|
agentReport:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAgentReport'
|
||||||
|
config:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAccountConfig'
|
||||||
|
createdAt:
|
||||||
|
format: date-time
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
orgId:
|
||||||
|
type: string
|
||||||
|
provider:
|
||||||
|
type: string
|
||||||
|
providerAccountId:
|
||||||
|
nullable: true
|
||||||
|
type: string
|
||||||
|
removedAt:
|
||||||
|
format: date-time
|
||||||
|
nullable: true
|
||||||
|
type: string
|
||||||
|
updatedAt:
|
||||||
|
format: date-time
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
- providerAccountId
|
||||||
|
- provider
|
||||||
|
- removedAt
|
||||||
|
- agentReport
|
||||||
|
- orgId
|
||||||
|
- config
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAccountConfig:
|
||||||
|
properties:
|
||||||
|
aws:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAWSAccountConfig'
|
||||||
|
required:
|
||||||
|
- aws
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAgentReport:
|
||||||
|
nullable: true
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
additionalProperties: {}
|
||||||
|
nullable: true
|
||||||
|
type: object
|
||||||
|
timestampMillis:
|
||||||
|
format: int64
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- timestampMillis
|
||||||
|
- data
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesAssets:
|
||||||
|
properties:
|
||||||
|
dashboards:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesDashboard'
|
||||||
|
nullable: true
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesCollectedLogAttribute:
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
path:
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesCollectedMetric:
|
||||||
|
properties:
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
unit:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesCollectionStrategy:
|
||||||
|
properties:
|
||||||
|
aws:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAWSCollectionStrategy'
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesConnectionArtifact:
|
||||||
|
properties:
|
||||||
|
aws:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAWSConnectionArtifact'
|
||||||
|
required:
|
||||||
|
- aws
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesConnectionArtifactRequest:
|
||||||
|
properties:
|
||||||
|
aws:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAWSConnectionArtifactRequest'
|
||||||
|
required:
|
||||||
|
- aws
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesDashboard:
|
||||||
|
properties:
|
||||||
|
definition:
|
||||||
|
$ref: '#/components/schemas/DashboardtypesStorableDashboardData'
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesDataCollected:
|
||||||
|
properties:
|
||||||
|
logs:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesCollectedLogAttribute'
|
||||||
|
nullable: true
|
||||||
|
type: array
|
||||||
|
metrics:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesCollectedMetric'
|
||||||
|
nullable: true
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesGettableAccounts:
|
||||||
|
properties:
|
||||||
|
accounts:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAccount'
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- accounts
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesGettableAgentCheckInResponse:
|
||||||
|
properties:
|
||||||
|
account_id:
|
||||||
|
type: string
|
||||||
|
cloud_account_id:
|
||||||
|
type: string
|
||||||
|
cloudIntegrationId:
|
||||||
|
type: string
|
||||||
|
integration_config:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesIntegrationConfig'
|
||||||
|
integrationConfig:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesProviderIntegrationConfig'
|
||||||
|
providerAccountId:
|
||||||
|
type: string
|
||||||
|
removed_at:
|
||||||
|
format: date-time
|
||||||
|
nullable: true
|
||||||
|
type: string
|
||||||
|
removedAt:
|
||||||
|
format: date-time
|
||||||
|
nullable: true
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- account_id
|
||||||
|
- cloud_account_id
|
||||||
|
- integration_config
|
||||||
|
- removed_at
|
||||||
|
- cloudIntegrationId
|
||||||
|
- providerAccountId
|
||||||
|
- integrationConfig
|
||||||
|
- removedAt
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesGettableServicesMetadata:
|
||||||
|
properties:
|
||||||
|
services:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesServiceMetadata'
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- services
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesIntegrationConfig:
|
||||||
|
nullable: true
|
||||||
|
properties:
|
||||||
|
enabledRegions:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
telemetry:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAWSCollectionStrategy'
|
||||||
|
required:
|
||||||
|
- enabledRegions
|
||||||
|
- telemetry
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesPostableAgentCheckInRequest:
|
||||||
|
properties:
|
||||||
|
account_id:
|
||||||
|
type: string
|
||||||
|
cloud_account_id:
|
||||||
|
type: string
|
||||||
|
cloudIntegrationId:
|
||||||
|
type: string
|
||||||
|
data:
|
||||||
|
additionalProperties: {}
|
||||||
|
nullable: true
|
||||||
|
type: object
|
||||||
|
providerAccountId:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- data
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesProviderIntegrationConfig:
|
||||||
|
properties:
|
||||||
|
aws:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAWSIntegrationConfig'
|
||||||
|
required:
|
||||||
|
- aws
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesService:
|
||||||
|
properties:
|
||||||
|
assets:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAssets'
|
||||||
|
dataCollected:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesDataCollected'
|
||||||
|
icon:
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
overview:
|
||||||
|
type: string
|
||||||
|
serviceConfig:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesServiceConfig'
|
||||||
|
supported_signals:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesSupportedSignals'
|
||||||
|
telemetryCollectionStrategy:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesCollectionStrategy'
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
- title
|
||||||
|
- icon
|
||||||
|
- overview
|
||||||
|
- assets
|
||||||
|
- supported_signals
|
||||||
|
- dataCollected
|
||||||
|
- telemetryCollectionStrategy
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesServiceConfig:
|
||||||
|
properties:
|
||||||
|
aws:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAWSServiceConfig'
|
||||||
|
required:
|
||||||
|
- aws
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesServiceMetadata:
|
||||||
|
properties:
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
icon:
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
- title
|
||||||
|
- icon
|
||||||
|
- enabled
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesSupportedSignals:
|
||||||
|
properties:
|
||||||
|
logs:
|
||||||
|
type: boolean
|
||||||
|
metrics:
|
||||||
|
type: boolean
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesUpdatableAccount:
|
||||||
|
properties:
|
||||||
|
config:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAccountConfig'
|
||||||
|
required:
|
||||||
|
- config
|
||||||
|
type: object
|
||||||
|
CloudintegrationtypesUpdatableService:
|
||||||
|
properties:
|
||||||
|
config:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesServiceConfig'
|
||||||
|
required:
|
||||||
|
- config
|
||||||
|
type: object
|
||||||
DashboardtypesDashboard:
|
DashboardtypesDashboard:
|
||||||
properties:
|
properties:
|
||||||
createdAt:
|
createdAt:
|
||||||
@@ -2472,6 +2863,552 @@ paths:
|
|||||||
summary: Change password
|
summary: Change password
|
||||||
tags:
|
tags:
|
||||||
- users
|
- users
|
||||||
|
/api/v1/cloud-integrations/{cloud_provider}/agent-check-in:
|
||||||
|
post:
|
||||||
|
deprecated: true
|
||||||
|
description: '[Deprecated] This endpoint is called by the deployed agent to
|
||||||
|
check in'
|
||||||
|
operationId: AgentCheckInDeprecated
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: cloud_provider
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesPostableAgentCheckInRequest'
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesGettableAgentCheckInResponse'
|
||||||
|
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: Agent check-in
|
||||||
|
tags:
|
||||||
|
- cloudintegration
|
||||||
|
/api/v1/cloud_integrations/{cloud_provider}/accounts:
|
||||||
|
get:
|
||||||
|
deprecated: false
|
||||||
|
description: This endpoint lists the accounts for the specified cloud provider
|
||||||
|
operationId: ListAccounts
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: cloud_provider
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesGettableAccounts'
|
||||||
|
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: List accounts
|
||||||
|
tags:
|
||||||
|
- cloudintegration
|
||||||
|
/api/v1/cloud_integrations/{cloud_provider}/accounts/{id}:
|
||||||
|
delete:
|
||||||
|
deprecated: false
|
||||||
|
description: This endpoint disconnects an account for the specified cloud provider
|
||||||
|
operationId: DisconnectAccount
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: cloud_provider
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- 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
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/RenderErrorResponse'
|
||||||
|
description: Internal Server Error
|
||||||
|
security:
|
||||||
|
- api_key:
|
||||||
|
- ADMIN
|
||||||
|
- tokenizer:
|
||||||
|
- ADMIN
|
||||||
|
summary: Disconnect account
|
||||||
|
tags:
|
||||||
|
- cloudintegration
|
||||||
|
get:
|
||||||
|
deprecated: false
|
||||||
|
description: This endpoint gets an account for the specified cloud provider
|
||||||
|
operationId: GetAccount
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: cloud_provider
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesAccount'
|
||||||
|
status:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- status
|
||||||
|
- data
|
||||||
|
type: object
|
||||||
|
description: OK
|
||||||
|
"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: Get account
|
||||||
|
tags:
|
||||||
|
- cloudintegration
|
||||||
|
put:
|
||||||
|
deprecated: false
|
||||||
|
description: This endpoint updates an account for the specified cloud provider
|
||||||
|
operationId: UpdateAccount
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: cloud_provider
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesUpdatableAccount'
|
||||||
|
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
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/RenderErrorResponse'
|
||||||
|
description: Internal Server Error
|
||||||
|
security:
|
||||||
|
- api_key:
|
||||||
|
- ADMIN
|
||||||
|
- tokenizer:
|
||||||
|
- ADMIN
|
||||||
|
summary: Update account
|
||||||
|
tags:
|
||||||
|
- cloudintegration
|
||||||
|
/api/v1/cloud_integrations/{cloud_provider}/accounts/check_in:
|
||||||
|
post:
|
||||||
|
deprecated: false
|
||||||
|
description: This endpoint is called by the deployed agent to check in
|
||||||
|
operationId: AgentCheckIn
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: cloud_provider
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesPostableAgentCheckInRequest'
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesGettableAgentCheckInResponse'
|
||||||
|
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: Agent check-in
|
||||||
|
tags:
|
||||||
|
- cloudintegration
|
||||||
|
/api/v1/cloud_integrations/{cloud_provider}/accounts/connection_artifact:
|
||||||
|
post:
|
||||||
|
deprecated: false
|
||||||
|
description: This endpoint returns a connection artifact for the specified cloud
|
||||||
|
provider and creates new cloud integration account
|
||||||
|
operationId: GetConnectionArtifact
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: cloud_provider
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesConnectionArtifactRequest'
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesConnectionArtifact'
|
||||||
|
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 connection artifact
|
||||||
|
tags:
|
||||||
|
- cloudintegration
|
||||||
|
/api/v1/cloud_integrations/{cloud_provider}/services:
|
||||||
|
get:
|
||||||
|
deprecated: false
|
||||||
|
description: This endpoint lists the services metadata for the specified cloud
|
||||||
|
provider
|
||||||
|
operationId: ListServicesMetadata
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: cloud_provider
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesGettableServicesMetadata'
|
||||||
|
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: List services metadata
|
||||||
|
tags:
|
||||||
|
- cloudintegration
|
||||||
|
/api/v1/cloud_integrations/{cloud_provider}/services/{service_id}:
|
||||||
|
get:
|
||||||
|
deprecated: false
|
||||||
|
description: This endpoint gets a service for the specified cloud provider
|
||||||
|
operationId: GetService
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: cloud_provider
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: service_id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesService'
|
||||||
|
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 service
|
||||||
|
tags:
|
||||||
|
- cloudintegration
|
||||||
|
put:
|
||||||
|
deprecated: false
|
||||||
|
description: This endpoint updates a service for the specified cloud provider
|
||||||
|
operationId: UpdateService
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: cloud_provider
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: service_id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/CloudintegrationtypesUpdatableService'
|
||||||
|
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
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/RenderErrorResponse'
|
||||||
|
description: Internal Server Error
|
||||||
|
security:
|
||||||
|
- api_key:
|
||||||
|
- ADMIN
|
||||||
|
- tokenizer:
|
||||||
|
- ADMIN
|
||||||
|
summary: Update service
|
||||||
|
tags:
|
||||||
|
- cloudintegration
|
||||||
/api/v1/complete/google:
|
/api/v1/complete/google:
|
||||||
get:
|
get:
|
||||||
deprecated: false
|
deprecated: false
|
||||||
|
|||||||
216
pkg/apiserver/signozapiserver/cloudintegration.go
Normal file
216
pkg/apiserver/signozapiserver/cloudintegration.go
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
package signozapiserver
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/SigNoz/signoz/pkg/http/handler"
|
||||||
|
"github.com/SigNoz/signoz/pkg/types"
|
||||||
|
citypes "github.com/SigNoz/signoz/pkg/types/cloudintegrationtypes"
|
||||||
|
"github.com/gorilla/mux"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (provider *provider) addCloudIntegrationRoutes(router *mux.Router) error {
|
||||||
|
if err := router.Handle("/api/v1/cloud_integrations/{cloud_provider}/accounts/connection_artifact", handler.New(
|
||||||
|
provider.authZ.AdminAccess(provider.cloudIntegrationHandler.GetConnectionArtifact),
|
||||||
|
handler.OpenAPIDef{
|
||||||
|
ID: "GetConnectionArtifact",
|
||||||
|
Tags: []string{"cloudintegration"},
|
||||||
|
Summary: "Get connection artifact",
|
||||||
|
Description: "This endpoint returns a connection artifact for the specified cloud provider and creates new cloud integration account",
|
||||||
|
Request: new(citypes.PostableConnectionArtifact),
|
||||||
|
RequestContentType: "application/json",
|
||||||
|
Response: new(citypes.GettableConnectionArtifact),
|
||||||
|
ResponseContentType: "application/json",
|
||||||
|
SuccessStatusCode: http.StatusOK,
|
||||||
|
ErrorStatusCodes: []int{},
|
||||||
|
Deprecated: false,
|
||||||
|
SecuritySchemes: newSecuritySchemes(types.RoleAdmin),
|
||||||
|
},
|
||||||
|
)).Methods(http.MethodPost).GetError(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := router.Handle("/api/v1/cloud_integrations/{cloud_provider}/accounts", handler.New(
|
||||||
|
provider.authZ.AdminAccess(provider.cloudIntegrationHandler.ListAccounts),
|
||||||
|
handler.OpenAPIDef{
|
||||||
|
ID: "ListAccounts",
|
||||||
|
Tags: []string{"cloudintegration"},
|
||||||
|
Summary: "List accounts",
|
||||||
|
Description: "This endpoint lists the accounts for the specified cloud provider",
|
||||||
|
Request: nil,
|
||||||
|
RequestContentType: "",
|
||||||
|
Response: new(citypes.GettableAccounts),
|
||||||
|
ResponseContentType: "application/json",
|
||||||
|
SuccessStatusCode: http.StatusOK,
|
||||||
|
ErrorStatusCodes: []int{},
|
||||||
|
Deprecated: false,
|
||||||
|
SecuritySchemes: newSecuritySchemes(types.RoleAdmin),
|
||||||
|
},
|
||||||
|
)).Methods(http.MethodGet).GetError(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := router.Handle("/api/v1/cloud_integrations/{cloud_provider}/accounts/{id}", handler.New(
|
||||||
|
provider.authZ.AdminAccess(provider.cloudIntegrationHandler.GetAccount),
|
||||||
|
handler.OpenAPIDef{
|
||||||
|
ID: "GetAccount",
|
||||||
|
Tags: []string{"cloudintegration"},
|
||||||
|
Summary: "Get account",
|
||||||
|
Description: "This endpoint gets an account for the specified cloud provider",
|
||||||
|
Request: nil,
|
||||||
|
RequestContentType: "",
|
||||||
|
Response: new(citypes.GettableAccount),
|
||||||
|
ResponseContentType: "application/json",
|
||||||
|
SuccessStatusCode: http.StatusOK,
|
||||||
|
ErrorStatusCodes: []int{http.StatusBadRequest, http.StatusNotFound},
|
||||||
|
Deprecated: false,
|
||||||
|
SecuritySchemes: newSecuritySchemes(types.RoleAdmin),
|
||||||
|
},
|
||||||
|
)).Methods(http.MethodGet).GetError(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := router.Handle("/api/v1/cloud_integrations/{cloud_provider}/accounts/{id}", handler.New(
|
||||||
|
provider.authZ.AdminAccess(provider.cloudIntegrationHandler.UpdateAccount),
|
||||||
|
handler.OpenAPIDef{
|
||||||
|
ID: "UpdateAccount",
|
||||||
|
Tags: []string{"cloudintegration"},
|
||||||
|
Summary: "Update account",
|
||||||
|
Description: "This endpoint updates an account for the specified cloud provider",
|
||||||
|
Request: new(citypes.UpdatableAccount),
|
||||||
|
RequestContentType: "application/json",
|
||||||
|
Response: nil,
|
||||||
|
ResponseContentType: "",
|
||||||
|
SuccessStatusCode: http.StatusNoContent,
|
||||||
|
ErrorStatusCodes: []int{},
|
||||||
|
Deprecated: false,
|
||||||
|
SecuritySchemes: newSecuritySchemes(types.RoleAdmin),
|
||||||
|
},
|
||||||
|
)).Methods(http.MethodPut).GetError(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := router.Handle("/api/v1/cloud_integrations/{cloud_provider}/accounts/{id}", handler.New(
|
||||||
|
provider.authZ.AdminAccess(provider.cloudIntegrationHandler.DisconnectAccount),
|
||||||
|
handler.OpenAPIDef{
|
||||||
|
ID: "DisconnectAccount",
|
||||||
|
Tags: []string{"cloudintegration"},
|
||||||
|
Summary: "Disconnect account",
|
||||||
|
Description: "This endpoint disconnects an account for the specified cloud provider",
|
||||||
|
Request: nil,
|
||||||
|
RequestContentType: "",
|
||||||
|
Response: nil,
|
||||||
|
ResponseContentType: "",
|
||||||
|
SuccessStatusCode: http.StatusNoContent,
|
||||||
|
ErrorStatusCodes: []int{},
|
||||||
|
Deprecated: false,
|
||||||
|
SecuritySchemes: newSecuritySchemes(types.RoleAdmin),
|
||||||
|
},
|
||||||
|
)).Methods(http.MethodDelete).GetError(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := router.Handle("/api/v1/cloud_integrations/{cloud_provider}/services", handler.New(
|
||||||
|
provider.authZ.AdminAccess(provider.cloudIntegrationHandler.ListServicesMetadata),
|
||||||
|
handler.OpenAPIDef{
|
||||||
|
ID: "ListServicesMetadata",
|
||||||
|
Tags: []string{"cloudintegration"},
|
||||||
|
Summary: "List services metadata",
|
||||||
|
Description: "This endpoint lists the services metadata for the specified cloud provider",
|
||||||
|
Request: nil,
|
||||||
|
RequestContentType: "",
|
||||||
|
Response: new(citypes.GettableServicesMetadata),
|
||||||
|
ResponseContentType: "application/json",
|
||||||
|
SuccessStatusCode: http.StatusOK,
|
||||||
|
ErrorStatusCodes: []int{},
|
||||||
|
Deprecated: false,
|
||||||
|
SecuritySchemes: newSecuritySchemes(types.RoleAdmin),
|
||||||
|
},
|
||||||
|
)).Methods(http.MethodGet).GetError(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := router.Handle("/api/v1/cloud_integrations/{cloud_provider}/services/{service_id}", handler.New(
|
||||||
|
provider.authZ.AdminAccess(provider.cloudIntegrationHandler.GetService),
|
||||||
|
handler.OpenAPIDef{
|
||||||
|
ID: "GetService",
|
||||||
|
Tags: []string{"cloudintegration"},
|
||||||
|
Summary: "Get service",
|
||||||
|
Description: "This endpoint gets a service for the specified cloud provider",
|
||||||
|
Request: nil,
|
||||||
|
RequestContentType: "",
|
||||||
|
Response: new(citypes.GettableService),
|
||||||
|
ResponseContentType: "application/json",
|
||||||
|
SuccessStatusCode: http.StatusOK,
|
||||||
|
ErrorStatusCodes: []int{},
|
||||||
|
Deprecated: false,
|
||||||
|
SecuritySchemes: newSecuritySchemes(types.RoleAdmin),
|
||||||
|
},
|
||||||
|
)).Methods(http.MethodGet).GetError(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := router.Handle("/api/v1/cloud_integrations/{cloud_provider}/services/{service_id}", handler.New(
|
||||||
|
provider.authZ.AdminAccess(provider.cloudIntegrationHandler.UpdateService),
|
||||||
|
handler.OpenAPIDef{
|
||||||
|
ID: "UpdateService",
|
||||||
|
Tags: []string{"cloudintegration"},
|
||||||
|
Summary: "Update service",
|
||||||
|
Description: "This endpoint updates a service for the specified cloud provider",
|
||||||
|
Request: new(citypes.UpdatableService),
|
||||||
|
RequestContentType: "application/json",
|
||||||
|
Response: nil,
|
||||||
|
ResponseContentType: "",
|
||||||
|
SuccessStatusCode: http.StatusNoContent,
|
||||||
|
ErrorStatusCodes: []int{},
|
||||||
|
Deprecated: false,
|
||||||
|
SecuritySchemes: newSecuritySchemes(types.RoleAdmin),
|
||||||
|
},
|
||||||
|
)).Methods(http.MethodPut).GetError(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Agent check-in endpoint is kept same as older one to maintain backward compatibility with already deployed agents.
|
||||||
|
// In the future, this endpoint will be deprecated and a new endpoint will be introduced for consistency with above endpoints.
|
||||||
|
if err := router.Handle("/api/v1/cloud-integrations/{cloud_provider}/agent-check-in", handler.New(
|
||||||
|
provider.authZ.ViewAccess(provider.cloudIntegrationHandler.AgentCheckIn),
|
||||||
|
handler.OpenAPIDef{
|
||||||
|
ID: "AgentCheckInDeprecated",
|
||||||
|
Tags: []string{"cloudintegration"},
|
||||||
|
Summary: "Agent check-in",
|
||||||
|
Description: "[Deprecated] This endpoint is called by the deployed agent to check in",
|
||||||
|
Request: new(citypes.PostableAgentCheckInRequest),
|
||||||
|
RequestContentType: "application/json",
|
||||||
|
Response: new(citypes.GettableAgentCheckInResponse),
|
||||||
|
ResponseContentType: "application/json",
|
||||||
|
SuccessStatusCode: http.StatusOK,
|
||||||
|
ErrorStatusCodes: []int{},
|
||||||
|
Deprecated: true, // this endpoint will be deprecated in future
|
||||||
|
SecuritySchemes: newSecuritySchemes(types.RoleViewer), // agent role is viewer
|
||||||
|
},
|
||||||
|
)).Methods(http.MethodPost).GetError(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := router.Handle("/api/v1/cloud_integrations/{cloud_provider}/accounts/check_in", handler.New(
|
||||||
|
provider.authZ.ViewAccess(provider.cloudIntegrationHandler.AgentCheckIn),
|
||||||
|
handler.OpenAPIDef{
|
||||||
|
ID: "AgentCheckIn",
|
||||||
|
Tags: []string{"cloudintegration"},
|
||||||
|
Summary: "Agent check-in",
|
||||||
|
Description: "This endpoint is called by the deployed agent to check in",
|
||||||
|
Request: new(citypes.PostableAgentCheckInRequest),
|
||||||
|
RequestContentType: "application/json",
|
||||||
|
Response: new(citypes.GettableAgentCheckInResponse),
|
||||||
|
ResponseContentType: "application/json",
|
||||||
|
SuccessStatusCode: http.StatusOK,
|
||||||
|
ErrorStatusCodes: []int{},
|
||||||
|
Deprecated: false,
|
||||||
|
SecuritySchemes: newSecuritySchemes(types.RoleViewer), // agent role is viewer
|
||||||
|
},
|
||||||
|
)).Methods(http.MethodPost).GetError(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/SigNoz/signoz/pkg/http/handler"
|
"github.com/SigNoz/signoz/pkg/http/handler"
|
||||||
"github.com/SigNoz/signoz/pkg/http/middleware"
|
"github.com/SigNoz/signoz/pkg/http/middleware"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/authdomain"
|
"github.com/SigNoz/signoz/pkg/modules/authdomain"
|
||||||
|
"github.com/SigNoz/signoz/pkg/modules/cloudintegration"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/dashboard"
|
"github.com/SigNoz/signoz/pkg/modules/dashboard"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/fields"
|
"github.com/SigNoz/signoz/pkg/modules/fields"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/metricsexplorer"
|
"github.com/SigNoz/signoz/pkg/modules/metricsexplorer"
|
||||||
@@ -50,6 +51,8 @@ type provider struct {
|
|||||||
zeusHandler zeus.Handler
|
zeusHandler zeus.Handler
|
||||||
querierHandler querier.Handler
|
querierHandler querier.Handler
|
||||||
serviceAccountHandler serviceaccount.Handler
|
serviceAccountHandler serviceaccount.Handler
|
||||||
|
// TODO: wire up later
|
||||||
|
cloudIntegrationHandler cloudintegration.Handler //nolint:unused
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewFactory(
|
func NewFactory(
|
||||||
@@ -72,6 +75,7 @@ func NewFactory(
|
|||||||
zeusHandler zeus.Handler,
|
zeusHandler zeus.Handler,
|
||||||
querierHandler querier.Handler,
|
querierHandler querier.Handler,
|
||||||
serviceAccountHandler serviceaccount.Handler,
|
serviceAccountHandler serviceaccount.Handler,
|
||||||
|
cloudIntegrationHandler cloudintegration.Handler,
|
||||||
) factory.ProviderFactory[apiserver.APIServer, apiserver.Config] {
|
) 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 factory.NewProviderFactory(factory.MustNewName("signoz"), func(ctx context.Context, providerSettings factory.ProviderSettings, config apiserver.Config) (apiserver.APIServer, error) {
|
||||||
return newProvider(
|
return newProvider(
|
||||||
@@ -97,6 +101,7 @@ func NewFactory(
|
|||||||
zeusHandler,
|
zeusHandler,
|
||||||
querierHandler,
|
querierHandler,
|
||||||
serviceAccountHandler,
|
serviceAccountHandler,
|
||||||
|
cloudIntegrationHandler,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -124,31 +129,33 @@ func newProvider(
|
|||||||
zeusHandler zeus.Handler,
|
zeusHandler zeus.Handler,
|
||||||
querierHandler querier.Handler,
|
querierHandler querier.Handler,
|
||||||
serviceAccountHandler serviceaccount.Handler,
|
serviceAccountHandler serviceaccount.Handler,
|
||||||
|
cloudIntegrationHandler cloudintegration.Handler,
|
||||||
) (apiserver.APIServer, error) {
|
) (apiserver.APIServer, error) {
|
||||||
settings := factory.NewScopedProviderSettings(providerSettings, "github.com/SigNoz/signoz/pkg/apiserver/signozapiserver")
|
settings := factory.NewScopedProviderSettings(providerSettings, "github.com/SigNoz/signoz/pkg/apiserver/signozapiserver")
|
||||||
router := mux.NewRouter().UseEncodedPath()
|
router := mux.NewRouter().UseEncodedPath()
|
||||||
|
|
||||||
provider := &provider{
|
provider := &provider{
|
||||||
config: config,
|
config: config,
|
||||||
settings: settings,
|
settings: settings,
|
||||||
router: router,
|
router: router,
|
||||||
orgHandler: orgHandler,
|
orgHandler: orgHandler,
|
||||||
userHandler: userHandler,
|
userHandler: userHandler,
|
||||||
sessionHandler: sessionHandler,
|
sessionHandler: sessionHandler,
|
||||||
authDomainHandler: authDomainHandler,
|
authDomainHandler: authDomainHandler,
|
||||||
preferenceHandler: preferenceHandler,
|
preferenceHandler: preferenceHandler,
|
||||||
globalHandler: globalHandler,
|
globalHandler: globalHandler,
|
||||||
promoteHandler: promoteHandler,
|
promoteHandler: promoteHandler,
|
||||||
flaggerHandler: flaggerHandler,
|
flaggerHandler: flaggerHandler,
|
||||||
dashboardModule: dashboardModule,
|
dashboardModule: dashboardModule,
|
||||||
dashboardHandler: dashboardHandler,
|
dashboardHandler: dashboardHandler,
|
||||||
metricsExplorerHandler: metricsExplorerHandler,
|
metricsExplorerHandler: metricsExplorerHandler,
|
||||||
gatewayHandler: gatewayHandler,
|
gatewayHandler: gatewayHandler,
|
||||||
fieldsHandler: fieldsHandler,
|
fieldsHandler: fieldsHandler,
|
||||||
authzHandler: authzHandler,
|
authzHandler: authzHandler,
|
||||||
zeusHandler: zeusHandler,
|
zeusHandler: zeusHandler,
|
||||||
querierHandler: querierHandler,
|
querierHandler: querierHandler,
|
||||||
serviceAccountHandler: serviceAccountHandler,
|
serviceAccountHandler: serviceAccountHandler,
|
||||||
|
cloudIntegrationHandler: cloudIntegrationHandler,
|
||||||
}
|
}
|
||||||
|
|
||||||
provider.authZ = middleware.NewAuthZ(settings.Logger(), orgGetter, authz)
|
provider.authZ = middleware.NewAuthZ(settings.Logger(), orgGetter, authz)
|
||||||
@@ -233,6 +240,10 @@ func (provider *provider) AddToRouter(router *mux.Router) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := provider.addCloudIntegrationRoutes(router); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ type Module interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Handler interface {
|
type Handler interface {
|
||||||
|
// GetConnectionArtifact creates a new cloud integration account and returns the connection artifact
|
||||||
GetConnectionArtifact(http.ResponseWriter, *http.Request)
|
GetConnectionArtifact(http.ResponseWriter, *http.Request)
|
||||||
ListAccounts(http.ResponseWriter, *http.Request)
|
ListAccounts(http.ResponseWriter, *http.Request)
|
||||||
GetAccount(http.ResponseWriter, *http.Request)
|
GetAccount(http.ResponseWriter, *http.Request)
|
||||||
|
|||||||
58
pkg/modules/cloudintegration/implcloudintegration/handler.go
Normal file
58
pkg/modules/cloudintegration/implcloudintegration/handler.go
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
package implcloudintegration
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/SigNoz/signoz/pkg/modules/cloudintegration"
|
||||||
|
)
|
||||||
|
|
||||||
|
type handler struct{}
|
||||||
|
|
||||||
|
func NewHandler() cloudintegration.Handler {
|
||||||
|
return &handler{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h handler) GetConnectionArtifact(writer http.ResponseWriter, request *http.Request) {
|
||||||
|
// TODO implement me
|
||||||
|
panic("implement me")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h handler) ListAccounts(writer http.ResponseWriter, request *http.Request) {
|
||||||
|
// TODO implement me
|
||||||
|
panic("implement me")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h handler) GetAccount(writer http.ResponseWriter, request *http.Request) {
|
||||||
|
// TODO implement me
|
||||||
|
panic("implement me")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h handler) UpdateAccount(writer http.ResponseWriter, request *http.Request) {
|
||||||
|
// TODO implement me
|
||||||
|
panic("implement me")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h handler) DisconnectAccount(writer http.ResponseWriter, request *http.Request) {
|
||||||
|
// TODO implement me
|
||||||
|
panic("implement me")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h handler) ListServicesMetadata(writer http.ResponseWriter, request *http.Request) {
|
||||||
|
// TODO implement me
|
||||||
|
panic("implement me")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h handler) GetService(writer http.ResponseWriter, request *http.Request) {
|
||||||
|
// TODO implement me
|
||||||
|
panic("implement me")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h handler) UpdateService(writer http.ResponseWriter, request *http.Request) {
|
||||||
|
// TODO implement me
|
||||||
|
panic("implement me")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h handler) AgentCheckIn(writer http.ResponseWriter, request *http.Request) {
|
||||||
|
// TODO implement me
|
||||||
|
panic("implement me")
|
||||||
|
}
|
||||||
@@ -12,6 +12,8 @@ import (
|
|||||||
"github.com/SigNoz/signoz/pkg/licensing"
|
"github.com/SigNoz/signoz/pkg/licensing"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/apdex"
|
"github.com/SigNoz/signoz/pkg/modules/apdex"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/apdex/implapdex"
|
"github.com/SigNoz/signoz/pkg/modules/apdex/implapdex"
|
||||||
|
"github.com/SigNoz/signoz/pkg/modules/cloudintegration"
|
||||||
|
"github.com/SigNoz/signoz/pkg/modules/cloudintegration/implcloudintegration"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/dashboard"
|
"github.com/SigNoz/signoz/pkg/modules/dashboard"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/dashboard/impldashboard"
|
"github.com/SigNoz/signoz/pkg/modules/dashboard/impldashboard"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/fields"
|
"github.com/SigNoz/signoz/pkg/modules/fields"
|
||||||
@@ -38,23 +40,24 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Handlers struct {
|
type Handlers struct {
|
||||||
SavedView savedview.Handler
|
SavedView savedview.Handler
|
||||||
Apdex apdex.Handler
|
Apdex apdex.Handler
|
||||||
Dashboard dashboard.Handler
|
Dashboard dashboard.Handler
|
||||||
QuickFilter quickfilter.Handler
|
QuickFilter quickfilter.Handler
|
||||||
TraceFunnel tracefunnel.Handler
|
TraceFunnel tracefunnel.Handler
|
||||||
RawDataExport rawdataexport.Handler
|
RawDataExport rawdataexport.Handler
|
||||||
SpanPercentile spanpercentile.Handler
|
SpanPercentile spanpercentile.Handler
|
||||||
Services services.Handler
|
Services services.Handler
|
||||||
MetricsExplorer metricsexplorer.Handler
|
MetricsExplorer metricsexplorer.Handler
|
||||||
Global global.Handler
|
Global global.Handler
|
||||||
FlaggerHandler flagger.Handler
|
FlaggerHandler flagger.Handler
|
||||||
GatewayHandler gateway.Handler
|
GatewayHandler gateway.Handler
|
||||||
Fields fields.Handler
|
Fields fields.Handler
|
||||||
AuthzHandler authz.Handler
|
AuthzHandler authz.Handler
|
||||||
ZeusHandler zeus.Handler
|
ZeusHandler zeus.Handler
|
||||||
QuerierHandler querier.Handler
|
QuerierHandler querier.Handler
|
||||||
ServiceAccountHandler serviceaccount.Handler
|
ServiceAccountHandler serviceaccount.Handler
|
||||||
|
CloudIntegrationHandler cloudintegration.Handler
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHandlers(
|
func NewHandlers(
|
||||||
@@ -71,22 +74,23 @@ func NewHandlers(
|
|||||||
zeusService zeus.Zeus,
|
zeusService zeus.Zeus,
|
||||||
) Handlers {
|
) Handlers {
|
||||||
return Handlers{
|
return Handlers{
|
||||||
SavedView: implsavedview.NewHandler(modules.SavedView),
|
SavedView: implsavedview.NewHandler(modules.SavedView),
|
||||||
Apdex: implapdex.NewHandler(modules.Apdex),
|
Apdex: implapdex.NewHandler(modules.Apdex),
|
||||||
Dashboard: impldashboard.NewHandler(modules.Dashboard, providerSettings),
|
Dashboard: impldashboard.NewHandler(modules.Dashboard, providerSettings),
|
||||||
QuickFilter: implquickfilter.NewHandler(modules.QuickFilter),
|
QuickFilter: implquickfilter.NewHandler(modules.QuickFilter),
|
||||||
TraceFunnel: impltracefunnel.NewHandler(modules.TraceFunnel),
|
TraceFunnel: impltracefunnel.NewHandler(modules.TraceFunnel),
|
||||||
RawDataExport: implrawdataexport.NewHandler(modules.RawDataExport),
|
RawDataExport: implrawdataexport.NewHandler(modules.RawDataExport),
|
||||||
Services: implservices.NewHandler(modules.Services),
|
Services: implservices.NewHandler(modules.Services),
|
||||||
MetricsExplorer: implmetricsexplorer.NewHandler(modules.MetricsExplorer),
|
MetricsExplorer: implmetricsexplorer.NewHandler(modules.MetricsExplorer),
|
||||||
SpanPercentile: implspanpercentile.NewHandler(modules.SpanPercentile),
|
SpanPercentile: implspanpercentile.NewHandler(modules.SpanPercentile),
|
||||||
Global: signozglobal.NewHandler(global),
|
Global: signozglobal.NewHandler(global),
|
||||||
FlaggerHandler: flagger.NewHandler(flaggerService),
|
FlaggerHandler: flagger.NewHandler(flaggerService),
|
||||||
GatewayHandler: gateway.NewHandler(gatewayService),
|
GatewayHandler: gateway.NewHandler(gatewayService),
|
||||||
Fields: implfields.NewHandler(providerSettings, telemetryMetadataStore),
|
Fields: implfields.NewHandler(providerSettings, telemetryMetadataStore),
|
||||||
AuthzHandler: signozauthzapi.NewHandler(authz),
|
AuthzHandler: signozauthzapi.NewHandler(authz),
|
||||||
ZeusHandler: zeus.NewHandler(zeusService, licensing),
|
ZeusHandler: zeus.NewHandler(zeusService, licensing),
|
||||||
QuerierHandler: querierHandler,
|
QuerierHandler: querierHandler,
|
||||||
ServiceAccountHandler: implserviceaccount.NewHandler(modules.ServiceAccount),
|
ServiceAccountHandler: implserviceaccount.NewHandler(modules.ServiceAccount),
|
||||||
|
CloudIntegrationHandler: implcloudintegration.NewHandler(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import (
|
|||||||
"github.com/SigNoz/signoz/pkg/http/handler"
|
"github.com/SigNoz/signoz/pkg/http/handler"
|
||||||
"github.com/SigNoz/signoz/pkg/instrumentation"
|
"github.com/SigNoz/signoz/pkg/instrumentation"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/authdomain"
|
"github.com/SigNoz/signoz/pkg/modules/authdomain"
|
||||||
|
"github.com/SigNoz/signoz/pkg/modules/cloudintegration"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/dashboard"
|
"github.com/SigNoz/signoz/pkg/modules/dashboard"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/fields"
|
"github.com/SigNoz/signoz/pkg/modules/fields"
|
||||||
"github.com/SigNoz/signoz/pkg/modules/metricsexplorer"
|
"github.com/SigNoz/signoz/pkg/modules/metricsexplorer"
|
||||||
@@ -61,6 +62,7 @@ func NewOpenAPI(ctx context.Context, instrumentation instrumentation.Instrumenta
|
|||||||
struct{ zeus.Handler }{},
|
struct{ zeus.Handler }{},
|
||||||
struct{ querier.Handler }{},
|
struct{ querier.Handler }{},
|
||||||
struct{ serviceaccount.Handler }{},
|
struct{ serviceaccount.Handler }{},
|
||||||
|
struct{ cloudintegration.Handler }{},
|
||||||
).New(ctx, instrumentation.ToProviderSettings(), apiserver.Config{})
|
).New(ctx, instrumentation.ToProviderSettings(), apiserver.Config{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@@ -277,6 +277,7 @@ func NewAPIServerProviderFactories(orgGetter organization.Getter, authz authz.Au
|
|||||||
handlers.ZeusHandler,
|
handlers.ZeusHandler,
|
||||||
handlers.QuerierHandler,
|
handlers.QuerierHandler,
|
||||||
handlers.ServiceAccountHandler,
|
handlers.ServiceAccountHandler,
|
||||||
|
handlers.CloudIntegrationHandler,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,34 +10,35 @@ import (
|
|||||||
type Account struct {
|
type Account struct {
|
||||||
types.Identifiable
|
types.Identifiable
|
||||||
types.TimeAuditable
|
types.TimeAuditable
|
||||||
ProviderAccountId *string `json:"providerAccountID,omitempty"`
|
ProviderAccountID *string `json:"providerAccountId" required:"true" nullable:"true"`
|
||||||
Provider CloudProviderType `json:"provider"`
|
Provider CloudProviderType `json:"provider" required:"true"`
|
||||||
RemovedAt *time.Time `json:"removedAt,omitempty"`
|
RemovedAt *time.Time `json:"removedAt,omitempty" required:"true" nullable:"true"`
|
||||||
AgentReport *AgentReport `json:"agentReport,omitempty"`
|
AgentReport *AgentReport `json:"agentReport,omitempty" required:"true" nullable:"true"`
|
||||||
OrgID valuer.UUID `json:"orgID"`
|
OrgID valuer.UUID `json:"orgId" required:"true"`
|
||||||
Config *AccountConfig `json:"config,omitempty"`
|
Config *AccountConfig `json:"config,omitempty" required:"true" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AgentReport represents heartbeats sent by the agent.
|
// AgentReport represents heartbeats sent by the agent.
|
||||||
type AgentReport struct {
|
type AgentReport struct {
|
||||||
TimestampMillis int64 `json:"timestampMillis"`
|
TimestampMillis int64 `json:"timestampMillis" required:"true"`
|
||||||
Data map[string]any `json:"data"`
|
Data map[string]any `json:"data" required:"true" nullable:"true"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type AccountConfig struct {
|
||||||
|
// required till new providers are added
|
||||||
|
AWS *AWSAccountConfig `json:"aws,omitempty" required:"true" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GettableAccounts struct {
|
type GettableAccounts struct {
|
||||||
Accounts []*Account `json:"accounts"`
|
Accounts []*Account `json:"accounts" required:"true" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GettableAccount = Account
|
type GettableAccount = Account
|
||||||
|
|
||||||
type UpdatableAccount struct {
|
type UpdatableAccount struct {
|
||||||
Config *AccountConfig `json:"config"`
|
Config *AccountConfig `json:"config" required:"true" nullable:"false"`
|
||||||
}
|
|
||||||
|
|
||||||
type AccountConfig struct {
|
|
||||||
AWS *AWSAccountConfig `json:"aws,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type AWSAccountConfig struct {
|
type AWSAccountConfig struct {
|
||||||
Regions []string `json:"regions"`
|
Regions []string `json:"regions" required:"true" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,88 +1,74 @@
|
|||||||
package cloudintegrationtypes
|
package cloudintegrationtypes
|
||||||
|
|
||||||
import "github.com/SigNoz/signoz/pkg/types/integrationtypes"
|
import "time"
|
||||||
|
|
||||||
type ConnectionArtifactRequest struct {
|
type ConnectionArtifactRequest struct {
|
||||||
Aws *AWSConnectionArtifactRequest `json:"aws"`
|
// required till new providers are added
|
||||||
|
Aws *AWSConnectionArtifactRequest `json:"aws" required:"true" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AWSConnectionArtifactRequest struct {
|
type AWSConnectionArtifactRequest struct {
|
||||||
DeploymentRegion string `json:"deploymentRegion"`
|
DeploymentRegion string `json:"deploymentRegion" required:"true"`
|
||||||
Regions []string `json:"regions"`
|
Regions []string `json:"regions" required:"true" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PostableConnectionArtifact = ConnectionArtifactRequest
|
type PostableConnectionArtifact = ConnectionArtifactRequest
|
||||||
|
|
||||||
type ConnectionArtifact struct {
|
type ConnectionArtifact struct {
|
||||||
Aws *AWSConnectionArtifact `json:"aws"`
|
// required till new providers are added
|
||||||
|
Aws *AWSConnectionArtifact `json:"aws" required:"true" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AWSConnectionArtifact struct {
|
type AWSConnectionArtifact struct {
|
||||||
ConnectionUrl string `json:"connectionURL"`
|
ConnectionURL string `json:"connectionURL" required:"true"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GettableConnectionArtifact = ConnectionArtifact
|
type GettableConnectionArtifact = ConnectionArtifact
|
||||||
|
|
||||||
type AccountStatus struct {
|
|
||||||
Id string `json:"id"`
|
|
||||||
ProviderAccountId *string `json:"providerAccountID,omitempty"`
|
|
||||||
Status integrationtypes.AccountStatus `json:"status"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GettableAccountStatus = AccountStatus
|
|
||||||
|
|
||||||
type AgentCheckInRequest struct {
|
type AgentCheckInRequest struct {
|
||||||
// older backward compatible fields are mapped to new fields
|
ProviderAccountID string `json:"providerAccountId" required:"false"`
|
||||||
// CloudIntegrationId string `json:"cloudIntegrationId"`
|
CloudIntegrationID string `json:"cloudIntegrationId" required:"false"`
|
||||||
// AccountId string `json:"accountId"`
|
|
||||||
|
|
||||||
// New fields
|
Data map[string]any `json:"data,omitempty" required:"true" nullable:"true"`
|
||||||
ProviderAccountId string `json:"providerAccountId"`
|
|
||||||
CloudAccountId string `json:"cloudAccountId"`
|
|
||||||
|
|
||||||
Data map[string]any `json:"data,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type PostableAgentCheckInRequest struct {
|
type PostableAgentCheckInRequest struct {
|
||||||
AgentCheckInRequest
|
AgentCheckInRequest
|
||||||
// following are backward compatible fields for older running agents
|
// following are backward compatible fields for older running agents
|
||||||
// which gets mapped to new fields in AgentCheckInRequest
|
// which gets mapped to new fields in AgentCheckInRequest
|
||||||
CloudIntegrationId string `json:"cloud_integration_id"`
|
ID string `json:"account_id" required:"false"` // => CloudIntegrationID
|
||||||
CloudAccountId string `json:"cloud_account_id"`
|
AccountID string `json:"cloud_account_id" required:"false"` // => ProviderAccountID
|
||||||
}
|
|
||||||
|
|
||||||
type GettableAgentCheckInResponse struct {
|
|
||||||
AgentCheckInResponse
|
|
||||||
|
|
||||||
// For backward compatibility
|
|
||||||
CloudIntegrationId string `json:"cloud_integration_id"`
|
|
||||||
AccountId string `json:"account_id"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type AgentCheckInResponse struct {
|
type AgentCheckInResponse struct {
|
||||||
// Older fields for backward compatibility are mapped to new fields below
|
CloudIntegrationID string `json:"cloudIntegrationId" required:"true"`
|
||||||
// CloudIntegrationId string `json:"cloud_integration_id"`
|
ProviderAccountID string `json:"providerAccountId" required:"true"`
|
||||||
// AccountId string `json:"account_id"`
|
IntegrationConfig *ProviderIntegrationConfig `json:"integrationConfig" required:"true"`
|
||||||
|
RemovedAt *time.Time `json:"removedAt" required:"true" nullable:"true"`
|
||||||
// New fields
|
|
||||||
ProviderAccountId string `json:"providerAccountId"`
|
|
||||||
CloudAccountId string `json:"cloudAccountId"`
|
|
||||||
|
|
||||||
// IntegrationConfig populates data related to integration that is required for an agent
|
|
||||||
// to start collecting telemetry data
|
|
||||||
// keeping JSON key snake_case for backward compatibility
|
|
||||||
IntegrationConfig *IntegrationConfig `json:"integration_config,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type IntegrationConfig struct {
|
type GettableAgentCheckInResponse struct {
|
||||||
EnabledRegions []string `json:"enabledRegions"` // backward compatible
|
// Older fields for backward compatibility with existing AWS agents
|
||||||
Telemetry *AWSCollectionStrategy `json:"telemetry,omitempty"` // backward compatible
|
AccountID string `json:"account_id" required:"true"`
|
||||||
|
CloudAccountID string `json:"cloud_account_id" required:"true"`
|
||||||
|
OlderIntegrationConfig *IntegrationConfig `json:"integration_config" required:"true" nullable:"true"`
|
||||||
|
OlderRemovedAt *time.Time `json:"removed_at" required:"true" nullable:"true"`
|
||||||
|
|
||||||
// new fields
|
AgentCheckInResponse
|
||||||
AWS *AWSIntegrationConfig `json:"aws,omitempty"`
|
}
|
||||||
|
|
||||||
|
// IntegrationConfig older integration config struct for backward compatibility,
|
||||||
|
// this will be eventually removed once agents are updated to use new struct.
|
||||||
|
type IntegrationConfig struct {
|
||||||
|
EnabledRegions []string `json:"enabledRegions" required:"true" nullable:"false"` // backward compatible
|
||||||
|
Telemetry *AWSCollectionStrategy `json:"telemetry,omitempty" required:"true" nullable:"false"` // backward compatible
|
||||||
|
}
|
||||||
|
|
||||||
|
type ProviderIntegrationConfig struct {
|
||||||
|
AWS *AWSIntegrationConfig `json:"aws,omitempty" required:"true" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AWSIntegrationConfig struct {
|
type AWSIntegrationConfig struct {
|
||||||
EnabledRegions []string `json:"enabledRegions"`
|
EnabledRegions []string `json:"enabledRegions" required:"true" nullable:"false"`
|
||||||
Telemetry *AWSCollectionStrategy `json:"telemetry,omitempty"`
|
Telemetry *AWSCollectionStrategy `json:"telemetry,omitempty" required:"true" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,19 +11,20 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
S3Sync = valuer.NewString("s3sync")
|
|
||||||
// ErrCodeInvalidServiceID is the error code for invalid service id.
|
|
||||||
ErrCodeInvalidServiceID = errors.MustNewCode("invalid_service_id")
|
ErrCodeInvalidServiceID = errors.MustNewCode("invalid_service_id")
|
||||||
)
|
)
|
||||||
|
|
||||||
type ServiceID struct{ valuer.String }
|
|
||||||
|
|
||||||
type CloudIntegrationService struct {
|
type CloudIntegrationService struct {
|
||||||
types.Identifiable
|
types.Identifiable
|
||||||
types.TimeAuditable
|
types.TimeAuditable
|
||||||
Type ServiceID `json:"type"`
|
Type ServiceID `json:"type"`
|
||||||
Config *ServiceConfig `json:"config"`
|
Config *ServiceConfig `json:"config"`
|
||||||
CloudIntegrationID valuer.UUID `json:"cloudIntegrationID"`
|
CloudIntegrationID valuer.UUID `json:"cloudIntegrationId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ServiceConfig struct {
|
||||||
|
// required till new providers are added
|
||||||
|
AWS *AWSServiceConfig `json:"aws,omitempty" required:"true" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServiceMetadata helps to quickly list available services and whether it is enabled or not.
|
// ServiceMetadata helps to quickly list available services and whether it is enabled or not.
|
||||||
@@ -32,26 +33,56 @@ type CloudIntegrationService struct {
|
|||||||
type ServiceMetadata struct {
|
type ServiceMetadata struct {
|
||||||
ServiceDefinitionMetadata
|
ServiceDefinitionMetadata
|
||||||
// if the service is enabled for the account
|
// if the service is enabled for the account
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled" required:"true"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ServiceDefinitionMetadata represents service definition metadata. This is useful for showing service tab in frontend.
|
||||||
|
type ServiceDefinitionMetadata struct {
|
||||||
|
Id string `json:"id" required:"true"`
|
||||||
|
Title string `json:"title" required:"true"`
|
||||||
|
Icon string `json:"icon" required:"true"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GettableServicesMetadata struct {
|
type GettableServicesMetadata struct {
|
||||||
Services []*ServiceMetadata `json:"services"`
|
Services []*ServiceMetadata `json:"services" required:"true" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Service struct {
|
type Service struct {
|
||||||
ServiceDefinition
|
ServiceDefinition
|
||||||
ServiceConfig *ServiceConfig `json:"serviceConfig"`
|
ServiceConfig *ServiceConfig `json:"serviceConfig" required:"false" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GettableService = Service
|
type GettableService = Service
|
||||||
|
|
||||||
type UpdatableService struct {
|
type UpdatableService struct {
|
||||||
Config *ServiceConfig `json:"config"`
|
Config *ServiceConfig `json:"config" required:"true" nullable:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ServiceConfig struct {
|
type ServiceDefinition struct {
|
||||||
AWS *AWSServiceConfig `json:"aws,omitempty"`
|
ServiceDefinitionMetadata
|
||||||
|
Overview string `json:"overview" required:"true"` // markdown
|
||||||
|
Assets Assets `json:"assets" required:"true"`
|
||||||
|
SupportedSignals SupportedSignals `json:"supported_signals" required:"true"`
|
||||||
|
DataCollected DataCollected `json:"dataCollected" required:"true"`
|
||||||
|
Strategy *CollectionStrategy `json:"telemetryCollectionStrategy" required:"true" nullable:"false"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// SupportedSignals for cloud provider's service.
|
||||||
|
type SupportedSignals struct {
|
||||||
|
Logs bool `json:"logs"`
|
||||||
|
Metrics bool `json:"metrics"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DataCollected is curated static list of metrics and logs, this is shown as part of service overview.
|
||||||
|
type DataCollected struct {
|
||||||
|
Logs []CollectedLogAttribute `json:"logs"`
|
||||||
|
Metrics []CollectedMetric `json:"metrics"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// CollectionStrategy is cloud provider specific configuration for signal collection,
|
||||||
|
// this is used by agent to understand the nitty-gritty for collecting telemetry for the cloud provider.
|
||||||
|
type CollectionStrategy struct {
|
||||||
|
AWS *AWSCollectionStrategy `json:"aws,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AWSServiceConfig struct {
|
type AWSServiceConfig struct {
|
||||||
@@ -70,45 +101,11 @@ type AWSServiceMetricsConfig struct {
|
|||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServiceDefinitionMetadata represents service definition metadata. This is useful for showing service tab in frontend.
|
|
||||||
type ServiceDefinitionMetadata struct {
|
|
||||||
Id string `json:"id"`
|
|
||||||
Title string `json:"title"`
|
|
||||||
Icon string `json:"icon"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type ServiceDefinition struct {
|
|
||||||
ServiceDefinitionMetadata
|
|
||||||
Overview string `json:"overview"` // markdown
|
|
||||||
Assets Assets `json:"assets"`
|
|
||||||
SupportedSignals SupportedSignals `json:"supported_signals"`
|
|
||||||
DataCollected DataCollected `json:"dataCollected"`
|
|
||||||
Strategy *CollectionStrategy `json:"telemetryCollectionStrategy"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// CollectionStrategy is cloud provider specific configuration for signal collection,
|
|
||||||
// this is used by agent to understand the nitty-gritty for collecting telemetry for the cloud provider.
|
|
||||||
type CollectionStrategy struct {
|
|
||||||
AWS *AWSCollectionStrategy `json:"aws,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assets represents the collection of dashboards.
|
// Assets represents the collection of dashboards.
|
||||||
type Assets struct {
|
type Assets struct {
|
||||||
Dashboards []Dashboard `json:"dashboards"`
|
Dashboards []Dashboard `json:"dashboards"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportedSignals for cloud provider's service.
|
|
||||||
type SupportedSignals struct {
|
|
||||||
Logs bool `json:"logs"`
|
|
||||||
Metrics bool `json:"metrics"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// DataCollected is curated static list of metrics and logs, this is shown as part of service overview.
|
|
||||||
type DataCollected struct {
|
|
||||||
Logs []CollectedLogAttribute `json:"logs"`
|
|
||||||
Metrics []CollectedMetric `json:"metrics"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// CollectedLogAttribute represents a log attribute that is present in all log entries for a service,
|
// CollectedLogAttribute represents a log attribute that is present in all log entries for a service,
|
||||||
// this is shown as part of service overview.
|
// this is shown as part of service overview.
|
||||||
type CollectedLogAttribute struct {
|
type CollectedLogAttribute struct {
|
||||||
@@ -175,39 +172,6 @@ type Dashboard struct {
|
|||||||
Definition dashboardtypes.StorableDashboardData `json:"definition,omitempty"`
|
Definition dashboardtypes.StorableDashboardData `json:"definition,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportedServices is the map of supported services for each cloud provider.
|
|
||||||
var SupportedServices = map[CloudProviderType][]ServiceID{
|
|
||||||
CloudProviderTypeAWS: {
|
|
||||||
{valuer.NewString("alb")},
|
|
||||||
{valuer.NewString("api-gateway")},
|
|
||||||
{valuer.NewString("dynamodb")},
|
|
||||||
{valuer.NewString("ec2")},
|
|
||||||
{valuer.NewString("ecs")},
|
|
||||||
{valuer.NewString("eks")},
|
|
||||||
{valuer.NewString("elasticache")},
|
|
||||||
{valuer.NewString("lambda")},
|
|
||||||
{valuer.NewString("msk")},
|
|
||||||
{valuer.NewString("rds")},
|
|
||||||
{valuer.NewString("s3sync")},
|
|
||||||
{valuer.NewString("sns")},
|
|
||||||
{valuer.NewString("sqs")},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewServiceID returns a new ServiceID from a string, validated against the supported services for the given cloud provider.
|
|
||||||
func NewServiceID(provider CloudProviderType, service string) (ServiceID, error) {
|
|
||||||
services, ok := SupportedServices[provider]
|
|
||||||
if !ok {
|
|
||||||
return ServiceID{}, errors.NewInvalidInputf(ErrCodeInvalidServiceID, "no services defined for cloud provider: %s", provider)
|
|
||||||
}
|
|
||||||
for _, s := range services {
|
|
||||||
if s.StringValue() == service {
|
|
||||||
return s, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ServiceID{}, errors.NewInvalidInputf(ErrCodeInvalidServiceID, "invalid service id %q for cloud provider %s", service, provider)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UTILS
|
// UTILS
|
||||||
|
|
||||||
// GetCloudIntegrationDashboardID returns the dashboard id for a cloud integration, given the cloud provider, service id, and dashboard id.
|
// GetCloudIntegrationDashboardID returns the dashboard id for a cloud integration, given the cloud provider, service id, and dashboard id.
|
||||||
|
|||||||
75
pkg/types/cloudintegrationtypes/serviceid.go
Normal file
75
pkg/types/cloudintegrationtypes/serviceid.go
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
package cloudintegrationtypes
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/SigNoz/signoz/pkg/errors"
|
||||||
|
"github.com/SigNoz/signoz/pkg/valuer"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ServiceID struct{ valuer.String }
|
||||||
|
|
||||||
|
var (
|
||||||
|
AWSServiceALB = ServiceID{valuer.NewString("alb")}
|
||||||
|
AWSServiceAPIGateway = ServiceID{valuer.NewString("api-gateway")}
|
||||||
|
AWSServiceDynamoDB = ServiceID{valuer.NewString("dynamodb")}
|
||||||
|
AWSServiceEC2 = ServiceID{valuer.NewString("ec2")}
|
||||||
|
AWSServiceECS = ServiceID{valuer.NewString("ecs")}
|
||||||
|
AWSServiceEKS = ServiceID{valuer.NewString("eks")}
|
||||||
|
AWSServiceElastiCache = ServiceID{valuer.NewString("elasticache")}
|
||||||
|
AWSServiceLambda = ServiceID{valuer.NewString("lambda")}
|
||||||
|
AWSServiceMSK = ServiceID{valuer.NewString("msk")}
|
||||||
|
AWSServiceRDS = ServiceID{valuer.NewString("rds")}
|
||||||
|
AWSServiceS3Sync = ServiceID{valuer.NewString("s3sync")}
|
||||||
|
AWSServiceSNS = ServiceID{valuer.NewString("sns")}
|
||||||
|
AWSServiceSQS = ServiceID{valuer.NewString("sqs")}
|
||||||
|
)
|
||||||
|
|
||||||
|
func (ServiceID) Enum() []any {
|
||||||
|
return []any{
|
||||||
|
AWSServiceALB,
|
||||||
|
AWSServiceAPIGateway,
|
||||||
|
AWSServiceDynamoDB,
|
||||||
|
AWSServiceEC2,
|
||||||
|
AWSServiceECS,
|
||||||
|
AWSServiceEKS,
|
||||||
|
AWSServiceElastiCache,
|
||||||
|
AWSServiceLambda,
|
||||||
|
AWSServiceMSK,
|
||||||
|
AWSServiceRDS,
|
||||||
|
AWSServiceS3Sync,
|
||||||
|
AWSServiceSNS,
|
||||||
|
AWSServiceSQS,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SupportedServices is the map of supported services for each cloud provider.
|
||||||
|
var SupportedServices = map[CloudProviderType][]ServiceID{
|
||||||
|
CloudProviderTypeAWS: {
|
||||||
|
AWSServiceALB,
|
||||||
|
AWSServiceAPIGateway,
|
||||||
|
AWSServiceDynamoDB,
|
||||||
|
AWSServiceEC2,
|
||||||
|
AWSServiceECS,
|
||||||
|
AWSServiceEKS,
|
||||||
|
AWSServiceElastiCache,
|
||||||
|
AWSServiceLambda,
|
||||||
|
AWSServiceMSK,
|
||||||
|
AWSServiceRDS,
|
||||||
|
AWSServiceS3Sync,
|
||||||
|
AWSServiceSNS,
|
||||||
|
AWSServiceSQS,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewServiceID returns a new ServiceID from a string, validated against the supported services for the given cloud provider.
|
||||||
|
func NewServiceID(provider CloudProviderType, service string) (ServiceID, error) {
|
||||||
|
services, ok := SupportedServices[provider]
|
||||||
|
if !ok {
|
||||||
|
return ServiceID{}, errors.NewInvalidInputf(ErrCodeInvalidServiceID, "no services defined for cloud provider: %s", provider)
|
||||||
|
}
|
||||||
|
for _, s := range services {
|
||||||
|
if s.StringValue() == service {
|
||||||
|
return s, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ServiceID{}, errors.NewInvalidInputf(ErrCodeInvalidServiceID, "invalid service id %q for cloud provider %s", service, provider)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user