From f567e3aa8911653f3e3b113ff3d30bea75db9b93 Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Tue, 15 Aug 2023 16:36:36 -0300 Subject: [PATCH 01/13] rename file --- data_streaming.yml => data_streaming.yaml | 179 ++++++++++++++++++++-- 1 file changed, 162 insertions(+), 17 deletions(-) rename data_streaming.yml => data_streaming.yaml (82%) diff --git a/data_streaming.yml b/data_streaming.yaml similarity index 82% rename from data_streaming.yml rename to data_streaming.yaml index bc064d0a..f2682531 100644 --- a/data_streaming.yml +++ b/data_streaming.yaml @@ -34,6 +34,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DataStreamingResponseWithResults' + '400': description: Bad Request '401': @@ -53,9 +54,6 @@ paths: tags: - Data Streaming summary: Create a new data streaming - description: | - - operationId: CreateNewDataStreaming requestBody: @@ -63,10 +61,26 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DataStreamingPostBody' - - $ref: '#/components/schemas/StandardDataStreamingPostBody' - - $ref: '#/components/schemas/CustomDataStreamingPostBody' + $ref: '#/components/schemas/DataStreamingPostBody' + # oneOf: + # - $ref: '#/components/schemas/DataStreamingPostBody' + # - $ref: '#/components/schemas/StandardDataStreamingPostBody' + # - $ref: '#/components/schemas/CustomDataStreamingPostBody' + example: + name: Overwritten DS + template_id: 2 + data_source: http + active: false + endpoint: + endpoint_type: standard + url: http://example.com + log_line_separator: "\n" + payload_format: $dataset + max_size: 1000024 + all_domains: false + domains_ids: [1656613172] + + responses: '201': description: Created successfully @@ -76,7 +90,37 @@ paths: oneOf: - $ref: '#/components/schemas/CreateDataStreamingResponse' - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' - + examples: + KafkaExample: + value: + results: + - id: 1594 + name: "Kafka Connector" + template_id: 2 + data_source: waf + active: true + endpoint: + endpoint_type: kafka + use_tls: false + kafka_topic: "mykafka.dts.topic" + bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" + all_domains: false + schema_version: 3 + CustomExample: + value: + results: + - id: 1596 + name: "DTS - Custom template" + data_source: http + active: true + endpoint: + endpoint_type: datadog + url: "http://mydatadoghost.com" + api_key: "BNIAudh9s8dASJKLhksaidua9i9" + all_domains: false + template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" + schema_version: 3 + '400': description: Bad Request '401': @@ -113,6 +157,8 @@ paths: schema: format: int64 type: integer + minimum: 1 + exclusiveMinimum: true - in: query name: selected required: false @@ -154,6 +200,8 @@ paths: name: data_streaming_id schema: type: integer + minimum: 1 + exclusiveMinimum: true responses: '200': description: Successful operation @@ -190,17 +238,33 @@ paths: name: data_streaming_id schema: type: integer + minimum: 1 + exclusiveMinimum: true requestBody: required: true content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DataStreamingPostBody' - - $ref: '#/components/schemas/StandardDataStreamingPostBody' - - $ref: '#/components/schemas/CustomDataStreamingPostBody' - + $ref: '#/components/schemas/StandardDataStreamingPostBody' + # oneOf: + # - $ref: '#/components/schemas/DataStreamingPostBody' + # - $ref: '#/components/schemas/StandardDataStreamingPostBody' + # - $ref: '#/components/schemas/CustomDataStreamingPostBody' + example: + name: Overwritten DS + template_id: 2 + data_source: http + active: false + endpoint: + endpoint_type: standard + url: http://example.com + log_line_separator: "\n" + payload_format: $dataset + max_size: 1000024 + all_domains: false + domains_ids: [1656613172] + responses: '200': description: Successful operation @@ -210,6 +274,36 @@ paths: oneOf: - $ref: '#/components/schemas/CreateDataStreamingResponse' - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' + examples: + KafkaExample: + value: + results: + - id: 1594 + name: "Kafka Connector" + template_id: 2 + data_source: waf + active: true + endpoint: + endpoint_type: kafka + use_tls: false + kafka_topic: "mykafka.dts.topic" + bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" + all_domains: false + schema_version: 3 + CustomExample: + value: + results: + - id: 1596 + name: "DTS - Custom template" + data_source: http + active: true + endpoint: + endpoint_type: datadog + url: "http://mydatadoghost.com" + api_key: "BNIAudh9s8dASJKLhksaidua9i9" + all_domains: false + template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" + schema_version: 3 '400': description: Bad Request @@ -242,16 +336,27 @@ paths: name: data_streaming_id schema: type: integer + minimum: 1 + exclusiveMinimum: true requestBody: required: true content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DataStreamingPostBody' - - $ref: '#/components/schemas/StandardDataStreamingPostBody' - - $ref: '#/components/schemas/CustomDataStreamingPostBody' + $ref: '#/components/schemas/CustomDataStreamingPostBody' + # oneOf: + # - $ref: '#/components/schemas/DataStreamingPostBody' + # - $ref: '#/components/schemas/StandardDataStreamingPostBody' + # - $ref: '#/components/schemas/CustomDataStreamingPostBody' + example: + name: "DTS - Custom template" + template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" + domain_ids: [1656613172] + endpoint: + endpoint_type: "datadog" + url: "http://mydatadoghost.com" + api_key: "BNIAudh9s8dASJKLhksaidua9i9" responses: '200': @@ -262,6 +367,36 @@ paths: oneOf: - $ref: '#/components/schemas/CreateDataStreamingResponse' - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' + examples: + KafkaExample: + value: + results: + - id: 1594 + name: "Kafka Connector" + template_id: 2 + data_source: waf + active: true + endpoint: + endpoint_type: kafka + use_tls: false + kafka_topic: "mykafka.dts.topic" + bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" + all_domains: false + schema_version: 3 + CustomExample: + value: + results: + - id: 1596 + name: "DTS - Custom template" + data_source: http + active: true + endpoint: + endpoint_type: datadog + url: "http://mydatadoghost.com" + api_key: "BNIAudh9s8dASJKLhksaidua9i9" + all_domains: false + template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" + schema_version: 3 '400': description: Bad Request @@ -292,6 +427,8 @@ paths: name: data_streaming_id schema: type: integer + minimum: 1 + exclusiveMinimum: true responses: '204': @@ -356,6 +493,8 @@ paths: name: template_id schema: type: integer + minimum: 1 + exclusiveMinimum: true responses: '200': description: Successful operation @@ -694,6 +833,8 @@ components: type: string max_size: type: integer + minimum: 1 + exclusiveMinimum: true headers: type: array items: @@ -863,6 +1004,8 @@ components: - $ref: '#/components/schemas/DataStreamingResponseGetResultTypeCustom' schema_version: type: number + + DataStreamingResponseGetResultTypeDatadogDTS: type: object @@ -955,6 +1098,8 @@ components: type: string max_size: type: integer + minimum: 1 + exclusiveMinimum: true headers: $ref: '#/components/schemas/DataStreamingEndpointTypeStandardHeadersExample' From 7017bfde0a383cd4a7925fa81ef11a0041467fa7 Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Tue, 15 Aug 2023 17:12:03 -0300 Subject: [PATCH 02/13] Update data_streaming.yaml --- data_streaming.yaml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/data_streaming.yaml b/data_streaming.yaml index f2682531..9457bcbe 100644 --- a/data_streaming.yaml +++ b/data_streaming.yaml @@ -555,10 +555,21 @@ components: type: boolean nullable: true default: true - + endpoint: - type: string - format: json + type: object + oneOf: + - $ref: '#/components/schemas/Endpoint_Default' + - $ref: '#/components/schemas/Endpoint_Kafka' + - $ref: '#/components/schemas/Endpoinrt_S3' + - $ref: '#/components/schemas/Endpoint_Google_BigQuery' + - $ref: '#/components/schemas/Endpoint_Elasticsearch' + - $ref: '#/components/schemas/Endpoint_AWS_Kinesis_Firehose' + - $ref: '#/components/schemas/Endpoint_Datadog' + - $ref: '#/components/schemas/Endpoint_IBM_QRadar' + - $ref: '#/components/schemas/Endpoint_Azure_Monitor' + - $ref: '#/components/schemas/Endpoint_Azure_Blob_Storage' + - $ref: '#/components/schemas/Endpoint_Splunk' description: > Options' examples: - `Standard HTTP/HTTPS POST` - { "endpoint_type": "standard", "url": "http://example.com", "log_line_separator": "\n", "payload_format": "$dataset", "max_size": 1000024 } @@ -808,8 +819,19 @@ components: type: boolean endpoint: - type: string - format: json + type: object + oneOf: + - $ref: '#/components/schemas/Endpoint_Default' + - $ref: '#/components/schemas/Endpoint_Kafka' + - $ref: '#/components/schemas/Endpoinrt_S3' + - $ref: '#/components/schemas/Endpoint_Google_BigQuery' + - $ref: '#/components/schemas/Endpoint_Elasticsearch' + - $ref: '#/components/schemas/Endpoint_AWS_Kinesis_Firehose' + - $ref: '#/components/schemas/Endpoint_Datadog' + - $ref: '#/components/schemas/Endpoint_IBM_QRadar' + - $ref: '#/components/schemas/Endpoint_Azure_Monitor' + - $ref: '#/components/schemas/Endpoint_Azure_Blob_Storage' + - $ref: '#/components/schemas/Endpoint_Splunk' all_domains: type: boolean From 18bbedb79891e17699af98b6fa613b745b713264 Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Tue, 15 Aug 2023 17:26:35 -0300 Subject: [PATCH 03/13] Update data_streaming.yaml --- data_streaming.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/data_streaming.yaml b/data_streaming.yaml index 9457bcbe..ce4d45ca 100644 --- a/data_streaming.yaml +++ b/data_streaming.yaml @@ -67,16 +67,15 @@ paths: # - $ref: '#/components/schemas/StandardDataStreamingPostBody' # - $ref: '#/components/schemas/CustomDataStreamingPostBody' example: - name: Overwritten DS + name: "Kafka Connector" template_id: 2 - data_source: http - active: false + data_source: waf + active: true endpoint: - endpoint_type: standard - url: http://example.com - log_line_separator: "\n" - payload_format: $dataset - max_size: 1000024 + endpoint_type: kafka + use_tls: false + kafka_topic: "mykafka.dts.topic" + bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" all_domains: false domains_ids: [1656613172] @@ -105,6 +104,7 @@ paths: kafka_topic: "mykafka.dts.topic" bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" all_domains: false + domains_ids: [1656613172] schema_version: 3 CustomExample: value: @@ -382,6 +382,7 @@ paths: kafka_topic: "mykafka.dts.topic" bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" all_domains: false + schema_version: 3 CustomExample: value: From 027b11d31c410e6e44cd606fb2c29fac2a69a70f Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Tue, 15 Aug 2023 17:32:03 -0300 Subject: [PATCH 04/13] Update data_streaming.yaml --- data_streaming.yaml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/data_streaming.yaml b/data_streaming.yaml index ce4d45ca..94464dcb 100644 --- a/data_streaming.yaml +++ b/data_streaming.yaml @@ -764,20 +764,19 @@ components: type: boolean endpoint: - type: array - items: - oneOf: - - $ref: '#/components/schemas/Endpoint_Default' - - $ref: '#/components/schemas/Endpoint_Kafka' - - $ref: '#/components/schemas/Endpoinrt_S3' - - $ref: '#/components/schemas/Endpoint_Google_BigQuery' - - $ref: '#/components/schemas/Endpoint_Elasticsearch' - - $ref: '#/components/schemas/Endpoint_AWS_Kinesis_Firehose' - - $ref: '#/components/schemas/Endpoint_Datadog' - - $ref: '#/components/schemas/Endpoint_IBM_QRadar' - - $ref: '#/components/schemas/Endpoint_Azure_Monitor' - - $ref: '#/components/schemas/Endpoint_Azure_Blob_Storage' - - $ref: '#/components/schemas/Endpoint_Splunk' + type: object + oneOf: + - $ref: '#/components/schemas/Endpoint_Default' + - $ref: '#/components/schemas/Endpoint_Kafka' + - $ref: '#/components/schemas/Endpoinrt_S3' + - $ref: '#/components/schemas/Endpoint_Google_BigQuery' + - $ref: '#/components/schemas/Endpoint_Elasticsearch' + - $ref: '#/components/schemas/Endpoint_AWS_Kinesis_Firehose' + - $ref: '#/components/schemas/Endpoint_Datadog' + - $ref: '#/components/schemas/Endpoint_IBM_QRadar' + - $ref: '#/components/schemas/Endpoint_Azure_Monitor' + - $ref: '#/components/schemas/Endpoint_Azure_Blob_Storage' + - $ref: '#/components/schemas/Endpoint_Splunk' all_domains: type: boolean From 61b7126bb5ebb4c7e9095f66cd286a7515df62b8 Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Wed, 16 Aug 2023 08:23:10 -0300 Subject: [PATCH 05/13] Update data_streaming.yaml --- data_streaming.yaml | 44 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/data_streaming.yaml b/data_streaming.yaml index 94464dcb..d95646c0 100644 --- a/data_streaming.yaml +++ b/data_streaming.yaml @@ -100,11 +100,11 @@ paths: active: true endpoint: endpoint_type: kafka - use_tls: false kafka_topic: "mykafka.dts.topic" bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" + use_tls: false + # domains_ids: [1656613172] all_domains: false - domains_ids: [1656613172] schema_version: 3 CustomExample: value: @@ -382,7 +382,6 @@ paths: kafka_topic: "mykafka.dts.topic" bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" all_domains: false - schema_version: 3 CustomExample: value: @@ -495,7 +494,6 @@ paths: schema: type: integer minimum: 1 - exclusiveMinimum: true responses: '200': description: Successful operation @@ -713,6 +711,8 @@ components: $ref: '#/components/schemas/PostDataStreamingResponse' schema_version: type: number + minimum: 0 + CreateCustomDataStreamingResponse: type: object @@ -723,6 +723,7 @@ components: $ref: '#/components/schemas/PostCustomDataStreamingResponse' schema_version: type: number + minimum: 0 PostDataStreamingResponse: @@ -730,7 +731,8 @@ components: properties: id: type: integer - + minimum: 0 + name: type: string @@ -793,7 +795,8 @@ components: properties: id: type: integer - + minimum: 0 + name: type: string @@ -1026,6 +1029,7 @@ components: - $ref: '#/components/schemas/DataStreamingResponseGetResultTypeCustom' schema_version: type: number + minimum: 0 @@ -1034,10 +1038,17 @@ components: properties: id: type: integer + minimum: 0 name: type: string template_id: type: integer + enum: + - 2 + - 4 + - 86 + - 184 + - 251 data_source: type: string active: @@ -1063,10 +1074,17 @@ components: properties: id: type: integer + minimum: 0 name: type: string template_id: type: integer + enum: + - 2 + - 4 + - 86 + - 184 + - 251 data_source: type: string active: @@ -1093,10 +1111,17 @@ components: properties: id: type: integer + minimum: 0 name: type: string template_id: type: integer + enum: + - 2 + - 4 + - 86 + - 184 + - 251 data_source: type: string active: @@ -1143,6 +1168,7 @@ components: properties: id: type: integer + minimum: 0 name: type: string data_source: @@ -1165,6 +1191,7 @@ components: type: integer schema_version: type: number + minimum: 0 links: $ref: '#/components/schemas/DataStreamingsDomainResponseLinks' results: @@ -1187,6 +1214,7 @@ components: properties: domain_id: type: integer + minimum: 0 name: type: string selected: @@ -1200,6 +1228,7 @@ components: $ref: '#/components/schemas/DataStreamingResponseGetResultTypeKafka' schema_version: type: number + minimum: 0 TemplateResults: @@ -1211,6 +1240,7 @@ components: $ref: '#/components/schemas/Template' schema_version: type: number + minimum: 0 TemplateResultById: type: object @@ -1219,12 +1249,14 @@ components: $ref: '#/components/schemas/Template' schema_version: type: number + minimum: 0 Template: type: object properties: id: type: integer + minimum: 0 name: type: string template_model: From c1cd418dc0822a2ac9e120769bddc952eb206bc9 Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Wed, 16 Aug 2023 08:28:18 -0300 Subject: [PATCH 06/13] Update data_streaming.yaml --- data_streaming.yaml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/data_streaming.yaml b/data_streaming.yaml index d95646c0..b906f91f 100644 --- a/data_streaming.yaml +++ b/data_streaming.yaml @@ -86,9 +86,9 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/CreateDataStreamingResponse' - - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' + # oneOf: + $ref: '#/components/schemas/CreateDataStreamingResponse' + # - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' examples: KafkaExample: value: @@ -106,20 +106,20 @@ paths: # domains_ids: [1656613172] all_domains: false schema_version: 3 - CustomExample: - value: - results: - - id: 1596 - name: "DTS - Custom template" - data_source: http - active: true - endpoint: - endpoint_type: datadog - url: "http://mydatadoghost.com" - api_key: "BNIAudh9s8dASJKLhksaidua9i9" - all_domains: false - template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" - schema_version: 3 + # CustomExample: + # value: + # results: + # - id: 1596 + # name: "DTS - Custom template" + # data_source: http + # active: true + # endpoint: + # endpoint_type: datadog + # url: "http://mydatadoghost.com" + # api_key: "BNIAudh9s8dASJKLhksaidua9i9" + # all_domains: false + # template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" + # schema_version: 3 '400': description: Bad Request From 628ba41abeb4944574fd2dc086534fbab3eb496b Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Wed, 16 Aug 2023 08:29:19 -0300 Subject: [PATCH 07/13] Update .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index feae776c..0b7c0989 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ javascript/ # Environments *env* *ENV* + +#hypothesis +.hypothesis \ No newline at end of file From 8f524390206b376d92a52ff8d4965d2f37706b7d Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Wed, 16 Aug 2023 08:36:02 -0300 Subject: [PATCH 08/13] Update data_streaming.yaml --- data_streaming.yaml | 74 +++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/data_streaming.yaml b/data_streaming.yaml index b906f91f..54898491 100644 --- a/data_streaming.yaml +++ b/data_streaming.yaml @@ -271,9 +271,9 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/CreateDataStreamingResponse' - - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' + # oneOf: + $ref: '#/components/schemas/CreateDataStreamingResponse' + # - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' examples: KafkaExample: value: @@ -285,25 +285,26 @@ paths: active: true endpoint: endpoint_type: kafka - use_tls: false kafka_topic: "mykafka.dts.topic" bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" + use_tls: false + # domains_ids: [1656613172] all_domains: false schema_version: 3 - CustomExample: - value: - results: - - id: 1596 - name: "DTS - Custom template" - data_source: http - active: true - endpoint: - endpoint_type: datadog - url: "http://mydatadoghost.com" - api_key: "BNIAudh9s8dASJKLhksaidua9i9" - all_domains: false - template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" - schema_version: 3 + # CustomExample: + # value: + # results: + # - id: 1596 + # name: "DTS - Custom template" + # data_source: http + # active: true + # endpoint: + # endpoint_type: datadog + # url: "http://mydatadoghost.com" + # api_key: "BNIAudh9s8dASJKLhksaidua9i9" + # all_domains: false + # template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" + # schema_version: 3 '400': description: Bad Request @@ -364,9 +365,9 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/CreateDataStreamingResponse' - - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' + # oneOf: + $ref: '#/components/schemas/CreateDataStreamingResponse' + # - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' examples: KafkaExample: value: @@ -378,25 +379,26 @@ paths: active: true endpoint: endpoint_type: kafka - use_tls: false kafka_topic: "mykafka.dts.topic" bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" + use_tls: false + # domains_ids: [1656613172] all_domains: false schema_version: 3 - CustomExample: - value: - results: - - id: 1596 - name: "DTS - Custom template" - data_source: http - active: true - endpoint: - endpoint_type: datadog - url: "http://mydatadoghost.com" - api_key: "BNIAudh9s8dASJKLhksaidua9i9" - all_domains: false - template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" - schema_version: 3 + # CustomExample: + # value: + # results: + # - id: 1596 + # name: "DTS - Custom template" + # data_source: http + # active: true + # endpoint: + # endpoint_type: datadog + # url: "http://mydatadoghost.com" + # api_key: "BNIAudh9s8dASJKLhksaidua9i9" + # all_domains: false + # template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" + # schema_version: 3 '400': description: Bad Request From a6a599b1ec79154717bafebbbf62fd0bea14fcd8 Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Wed, 16 Aug 2023 10:19:06 -0300 Subject: [PATCH 09/13] Update data_streaming.yaml --- data_streaming.yaml | 173 +++++++++++++++----------------------------- 1 file changed, 58 insertions(+), 115 deletions(-) diff --git a/data_streaming.yaml b/data_streaming.yaml index 54898491..2cc40ddc 100644 --- a/data_streaming.yaml +++ b/data_streaming.yaml @@ -86,41 +86,9 @@ paths: content: application/json: schema: - # oneOf: - $ref: '#/components/schemas/CreateDataStreamingResponse' - # - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' - examples: - KafkaExample: - value: - results: - - id: 1594 - name: "Kafka Connector" - template_id: 2 - data_source: waf - active: true - endpoint: - endpoint_type: kafka - kafka_topic: "mykafka.dts.topic" - bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" - use_tls: false - # domains_ids: [1656613172] - all_domains: false - schema_version: 3 - # CustomExample: - # value: - # results: - # - id: 1596 - # name: "DTS - Custom template" - # data_source: http - # active: true - # endpoint: - # endpoint_type: datadog - # url: "http://mydatadoghost.com" - # api_key: "BNIAudh9s8dASJKLhksaidua9i9" - # all_domains: false - # template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" - # schema_version: 3 - + oneOf: + - $ref: '#/components/schemas/CreateDataStreamingResponse' + - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' '400': description: Bad Request '401': @@ -271,41 +239,9 @@ paths: content: application/json: schema: - # oneOf: - $ref: '#/components/schemas/CreateDataStreamingResponse' - # - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' - examples: - KafkaExample: - value: - results: - - id: 1594 - name: "Kafka Connector" - template_id: 2 - data_source: waf - active: true - endpoint: - endpoint_type: kafka - kafka_topic: "mykafka.dts.topic" - bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" - use_tls: false - # domains_ids: [1656613172] - all_domains: false - schema_version: 3 - # CustomExample: - # value: - # results: - # - id: 1596 - # name: "DTS - Custom template" - # data_source: http - # active: true - # endpoint: - # endpoint_type: datadog - # url: "http://mydatadoghost.com" - # api_key: "BNIAudh9s8dASJKLhksaidua9i9" - # all_domains: false - # template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" - # schema_version: 3 - + oneOf: + - $ref: '#/components/schemas/CreateDataStreamingResponse' + - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' '400': description: Bad Request '401': @@ -365,40 +301,9 @@ paths: content: application/json: schema: - # oneOf: - $ref: '#/components/schemas/CreateDataStreamingResponse' - # - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' - examples: - KafkaExample: - value: - results: - - id: 1594 - name: "Kafka Connector" - template_id: 2 - data_source: waf - active: true - endpoint: - endpoint_type: kafka - kafka_topic: "mykafka.dts.topic" - bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" - use_tls: false - # domains_ids: [1656613172] - all_domains: false - schema_version: 3 - # CustomExample: - # value: - # results: - # - id: 1596 - # name: "DTS - Custom template" - # data_source: http - # active: true - # endpoint: - # endpoint_type: datadog - # url: "http://mydatadoghost.com" - # api_key: "BNIAudh9s8dASJKLhksaidua9i9" - # all_domains: false - # template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" - # schema_version: 3 + oneOf: + - $ref: '#/components/schemas/CreateDataStreamingResponse' + - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' '400': description: Bad Request @@ -562,7 +467,7 @@ components: oneOf: - $ref: '#/components/schemas/Endpoint_Default' - $ref: '#/components/schemas/Endpoint_Kafka' - - $ref: '#/components/schemas/Endpoinrt_S3' + - $ref: '#/components/schemas/Endpoint_S3' - $ref: '#/components/schemas/Endpoint_Google_BigQuery' - $ref: '#/components/schemas/Endpoint_Elasticsearch' - $ref: '#/components/schemas/Endpoint_AWS_Kinesis_Firehose' @@ -577,10 +482,10 @@ components: - `Apache Kafka` - { "endpoint_type": "kafka", "kafka_topic": "example_topic", "bootstrap_servers": "kafka-server.com:9092,kafka-server-2.com:9092", "use_tls":true } - `Simple Storage Service (S3)` - { "endpoint_type": "s3", "access_key": "MYACCESSKEY", "region": "us-east-1", "object_key_prefix": "my_prefix_", "bucket_name": "bucket_example", "content_type": "plain/text", "host_url": "http://aws-host.com", "secret_key": "MYSECRETKEY" } - `Google BigQuery` - { "endpoint_type": "big_query", "dataset_id": "my_dataset", "project_id": "my_project", "table_id": "my_table", "service_account_key": "{ "service_account_key": "key_content" }" } - - `Elasticsearch` - { “endpoint_type”: "elasticsearch", “url”: “http://elasticsearch.com”, “api_key”: “XYZ_API_KEY” } + - `Elasticsearch` - { “endpoint_type": "elasticsearch", “url": “http://elasticsearch.com", “api_key": “XYZ_API_KEY" } - `AWS Kinesis Data Firehose` - { "endpoint_type": "aws_kinesis_firehose", "access_key": "MYACCESSKEY", "stream_name": "my_stream_name", "region": "us-east-1", "secret_key": "MYSECRETKEY" } - `Datadog` - { "endpoint_type": "datadog", "url": "https://http-intake.logs.datadoghq.com/v1/input", "api_key": "MYAPIKEY" } - - `IBM QRadar` - { "endpoint_type": "qradar", "url": "http://137.15.824.10:14440” } + - `IBM QRadar` - { "endpoint_type": "qradar", "url": "http://137.15.824.10:14440" } - `Azure Monitor` - { "endpoint_type": "azure_monitor", "log_type": "myLogType", "shared_key": "mysharedkey", "time_generated_field": "timeGeneratedField", "workspace_id": "anfhw-123sd-466gcs"} - `Azure Blob Storage` - { "endpoint_type": "azure_blob_storage", "storage_account": "mystorageaccount", "container_name": "log_container", "blob_sas_token": "fd56e23e1f12efe" } - `Splunk` - { "endpoint_type": "splunk", "url": "https://inputs.splunk-client.splunkcloud.com:1337/services/collector", "api_key": "MYAPIKEY" } @@ -772,7 +677,7 @@ components: oneOf: - $ref: '#/components/schemas/Endpoint_Default' - $ref: '#/components/schemas/Endpoint_Kafka' - - $ref: '#/components/schemas/Endpoinrt_S3' + - $ref: '#/components/schemas/Endpoint_S3' - $ref: '#/components/schemas/Endpoint_Google_BigQuery' - $ref: '#/components/schemas/Endpoint_Elasticsearch' - $ref: '#/components/schemas/Endpoint_AWS_Kinesis_Firehose' @@ -828,7 +733,7 @@ components: oneOf: - $ref: '#/components/schemas/Endpoint_Default' - $ref: '#/components/schemas/Endpoint_Kafka' - - $ref: '#/components/schemas/Endpoinrt_S3' + - $ref: '#/components/schemas/Endpoint_S3' - $ref: '#/components/schemas/Endpoint_Google_BigQuery' - $ref: '#/components/schemas/Endpoint_Elasticsearch' - $ref: '#/components/schemas/Endpoint_AWS_Kinesis_Firehose' @@ -845,6 +750,7 @@ components: Note: * Field not used with the rtm_activity data source. + Endpoint_Default: type: object properties: @@ -854,24 +760,28 @@ components: url: type: string format: uri + example: http://example.com log_line_separator: type: string + example: "\n" payload_format: type: string + example: "$dataset" max_size: type: integer minimum: 1 - exclusiveMinimum: true + example: 1000024 headers: type: array items: type: object additionalProperties: type: string - example: - additional_header: additional_header_value maximum: 5 - + example: [ + additional_header: "additional_header_value", + additional_header_2: "additional_header_value_2" + ] Endpoint_Kafka: type: object @@ -881,12 +791,15 @@ components: example: "kafka" kafka_topic: type: string + example: "mykafka.dts.topic" bootstrap_servers: type: string + example: "kafka-server.com:9092,kafka-server-2.com:9092" use_tls: type: boolean - - Endpoinrt_S3: + example: false + + Endpoint_S3: type: object properties: endpoint_type: @@ -894,19 +807,26 @@ components: example: "s3" access_key: type: string + example: "MYACCESSKEY" region: type: string + example: "us-east-1" object_key_prefix: type: string + example: "my_prefix_" bucket_name: type: string + example: "bucket_name_example" content_type: type: string + example: "plain/text" host_url: type: string format: uri + example: "http://aws-host.com" secret_key: type: string + example: "MYSECRETKEY" Endpoint_Google_BigQuery: type: object @@ -916,15 +836,20 @@ components: example: "big_query" dataset_id: type: string + example: "my_dataset" project_id: type: string + example: "my_project_id" table_id: type: string + example: "my_table_id" service_account_key: type: object properties: service_account_key: type: string + example: + service_account_key: "key_value" Endpoint_Elasticsearch: type: object @@ -935,8 +860,10 @@ components: url: type: string format: uri + example: "http://elasticsearch.com" api_key: format: string + example: "XYZ_API_KEY" Endpoint_AWS_Kinesis_Firehose: type: object @@ -946,12 +873,16 @@ components: example: "aws_kinesis_firehose" access_key: type: string + example: "MYACCESSKEY" stream_name: type: string + example: "my_stream_name" region: type: string + example: "us-east-1" secret_key: type: string + example: "MYSECRETKEY" Endpoint_Datadog: type: object @@ -962,8 +893,10 @@ components: url: type: string format: uri + example: "https://http-intake.logs.datadoghq.com/v1/input" api_key: format: string + example: "MYAPIKEY" Endpoint_IBM_QRadar: type: object @@ -974,6 +907,7 @@ components: url: type: string format: uri + example: "http://137.15.824.10:14440" Endpoint_Azure_Monitor: type: object @@ -983,13 +917,17 @@ components: example: "azure_monitor" log_type: type: string + example: "myLogType" shared_key: type: string + example: "mysharedkey" time_generated_field: type: string + example: "timeGeneratedField" workspace_id: type: string pattern: '[a-zA-Z0-9]{5}-[a-zA-Z0-9]{5}-[a-zA-Z0-9]{6}' + example: "anfhw-123sd-466gcs" Endpoint_Azure_Blob_Storage: type: object @@ -999,11 +937,14 @@ components: example: "azure_blob_storage" storage_account: type: string + example: "mystorageaccount" container_name: type: string + example: "log_container" blob_sas_token: type: string pattern: '[a-zA-Z0-9]{15}' + example: fd56e23e1f12efe Endpoint_Splunk: type: object @@ -1014,8 +955,10 @@ components: url: type: string format: uri + example: "https://inputs.splunk-client.splunkcloud.com:1337/services/collector" api_key: type: string + example: "MYAPIKEY" DataStreamingResponseWithResults: From a2ad6d124c62c2d223b06cded81bfcf66fd48cb3 Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Wed, 16 Aug 2023 14:52:43 -0300 Subject: [PATCH 10/13] Update data_streaming.yaml --- data_streaming.yaml | 124 +++++--------------------------------------- 1 file changed, 13 insertions(+), 111 deletions(-) diff --git a/data_streaming.yaml b/data_streaming.yaml index 2cc40ddc..baade4a0 100644 --- a/data_streaming.yaml +++ b/data_streaming.yaml @@ -64,21 +64,7 @@ paths: $ref: '#/components/schemas/DataStreamingPostBody' # oneOf: # - $ref: '#/components/schemas/DataStreamingPostBody' - # - $ref: '#/components/schemas/StandardDataStreamingPostBody' # - $ref: '#/components/schemas/CustomDataStreamingPostBody' - example: - name: "Kafka Connector" - template_id: 2 - data_source: waf - active: true - endpoint: - endpoint_type: kafka - use_tls: false - kafka_topic: "mykafka.dts.topic" - bootstrap_servers: "infra.my.net:9094,infra.my.net:9094" - all_domains: false - domains_ids: [1656613172] - responses: '201': @@ -214,10 +200,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StandardDataStreamingPostBody' + $ref: '#/components/schemas/DataStreamingPostBody' # oneOf: # - $ref: '#/components/schemas/DataStreamingPostBody' - # - $ref: '#/components/schemas/StandardDataStreamingPostBody' # - $ref: '#/components/schemas/CustomDataStreamingPostBody' example: name: Overwritten DS @@ -284,7 +269,6 @@ paths: $ref: '#/components/schemas/CustomDataStreamingPostBody' # oneOf: # - $ref: '#/components/schemas/DataStreamingPostBody' - # - $ref: '#/components/schemas/StandardDataStreamingPostBody' # - $ref: '#/components/schemas/CustomDataStreamingPostBody' example: name: "DTS - Custom template" @@ -429,6 +413,7 @@ components: properties: name: type: string + example: "Data Stream Name" template_id: type: integer @@ -445,6 +430,7 @@ components: * `86` - Edge Functions Event Collector * `184` - Edge Applications + WAF Event Collector * `251` - Activity History Collector + example: 2 data_source: type: string @@ -456,16 +442,18 @@ components: * `waf` - WAF Events * `cells_console` - Edge Functions * `rtm_activity` - Activity History + example: "http" active: type: boolean nullable: true default: true + example: true endpoint: type: object oneOf: - - $ref: '#/components/schemas/Endpoint_Default' + - $ref: '#/components/schemas/Endpoint_Standard' - $ref: '#/components/schemas/Endpoint_Kafka' - $ref: '#/components/schemas/Endpoint_S3' - $ref: '#/components/schemas/Endpoint_Google_BigQuery' @@ -495,6 +483,7 @@ components: items: type: integer minItems: 1 + example: [1234, 5678] description: > Note: * Field not used with the rtm_activity data source. @@ -505,6 +494,7 @@ components: type: boolean nullable: true default: false + example: false description: > Note: * Field not used with the rtm_activity data source. @@ -516,68 +506,12 @@ components: nullable: true minimum: 0 maximum: 100 + example: null description: > Note: * `Range` - From 0 to 100. * `To use:` [Contact the sales team](https://www.azion.com/en/contact-sales/) to activate this feature in your account. - StandardDataStreamingPostBody: - type: object - properties: - name: - type: string - - template_id: - type: integer - enum: - - 2 - - 4 - - 86 - - 184 - - 251 - description: > - Options: - * `2` - Edge Applications Event Collector - * `4` - WAF Event Collector - * `86` - Edge Functions Event Collector - * `184` - Edge Applications + WAF Event Collector - * `251` - Activity History Collector - - data_source: - type: string - nullable: true - enum: ["http", "waf", "cells_console", "rtm_activity"] - description: > - Options: - * `http` - Edge Applications (default) - * `waf` - WAF Events - * `cells_console` - Edge Functions - * `rtm_activity` - Activity History - active: - type: boolean - nullable: true - default: true - - endpoint: - $ref: '#/components/schemas/DataStreamingEndpointTypeStandard' - - domains_ids: - type: array - items: - type: integer - minItems: 1 - description: > - Note: - * Field not used with the rtm_activity data source. - - all_domains: - type: boolean - nullable: true - default: false - description: > - Note: - * Field not used with the rtm_activity data source. - CustomDataStreamingPostBody: type: object properties: @@ -675,7 +609,7 @@ components: endpoint: type: object oneOf: - - $ref: '#/components/schemas/Endpoint_Default' + - $ref: '#/components/schemas/Endpoint_Standard' - $ref: '#/components/schemas/Endpoint_Kafka' - $ref: '#/components/schemas/Endpoint_S3' - $ref: '#/components/schemas/Endpoint_Google_BigQuery' @@ -731,7 +665,7 @@ components: endpoint: type: object oneOf: - - $ref: '#/components/schemas/Endpoint_Default' + - $ref: '#/components/schemas/Endpoint_Standard' - $ref: '#/components/schemas/Endpoint_Kafka' - $ref: '#/components/schemas/Endpoint_S3' - $ref: '#/components/schemas/Endpoint_Google_BigQuery' @@ -751,7 +685,7 @@ components: * Field not used with the rtm_activity data source. - Endpoint_Default: + Endpoint_Standard: type: object properties: endpoint_type: @@ -1072,41 +1006,9 @@ components: active: type: boolean endpoint: - $ref: '#/components/schemas/DataStreamingEndpointTypeStandard' + $ref: '#/components/schemas/Endpoint_Standard' all_domains: type: boolean - - DataStreamingEndpointTypeStandard: - type: object - properties: - endpoint_type: - type: string - url: - type: string - format: uri - log_line_separator: - type: string - payload_format: - type: string - max_size: - type: integer - minimum: 1 - exclusiveMinimum: true - headers: - $ref: '#/components/schemas/DataStreamingEndpointTypeStandardHeadersExample' - - DataStreamingEndpointTypeStandardHeadersExample: - type: object - properties: - header-name-1: - type: string - nullable: true - header-name-2: - type: string - nullable: true - header-name-3: - type: string - nullable: true DataStreamingResponseGetResultTypeCustom: type: object From ca63747db32a8008edb443a99508680a030c3ab1 Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Wed, 16 Aug 2023 14:56:58 -0300 Subject: [PATCH 11/13] Update data_streaming.yaml --- data_streaming.yaml | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/data_streaming.yaml b/data_streaming.yaml index baade4a0..00639dd7 100644 --- a/data_streaming.yaml +++ b/data_streaming.yaml @@ -204,20 +204,6 @@ paths: # oneOf: # - $ref: '#/components/schemas/DataStreamingPostBody' # - $ref: '#/components/schemas/CustomDataStreamingPostBody' - example: - name: Overwritten DS - template_id: 2 - data_source: http - active: false - endpoint: - endpoint_type: standard - url: http://example.com - log_line_separator: "\n" - payload_format: $dataset - max_size: 1000024 - all_domains: false - domains_ids: [1656613172] - responses: '200': description: Successful operation @@ -270,15 +256,7 @@ paths: # oneOf: # - $ref: '#/components/schemas/DataStreamingPostBody' # - $ref: '#/components/schemas/CustomDataStreamingPostBody' - example: - name: "DTS - Custom template" - template_model: "{\"custom_template_field\":\"$custom_value\", \"status\":\"$status\"}" - domain_ids: [1656613172] - endpoint: - endpoint_type: "datadog" - url: "http://mydatadoghost.com" - api_key: "BNIAudh9s8dASJKLhksaidua9i9" - + responses: '200': description: Successful operation From fae6b4c4d0cffb0efc5efc01507ea3a5fb70d0ac Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Wed, 16 Aug 2023 15:04:59 -0300 Subject: [PATCH 12/13] Update data_streaming.yaml --- data_streaming.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/data_streaming.yaml b/data_streaming.yaml index 00639dd7..3ba30963 100644 --- a/data_streaming.yaml +++ b/data_streaming.yaml @@ -147,7 +147,7 @@ paths: - Data Streaming summary: Get expecific data streaming by Data Streaming ID description: Use the GET method and add the data streaming's ID to the URI of the request to get more data on a specific data streaming. - operationId: List Data Streaming by ID + operationId: ListDataStreamingById parameters: - in: path required: true @@ -185,7 +185,7 @@ paths: description: | Use the PUT method to overwrite the data streaming. Although you can change a single property using the PUT method, you must pass all fields for the request to be completed. - operationId: Overwrite data streaming by ID + operationId: OverwriteDataStreamingById parameters: - in: path required: true @@ -237,7 +237,7 @@ paths: description: | Use the PATCH method to change only select settings of your data streaming. - operationId: Edit data streaming by ID + operationId: EditDataStreamingById parameters: - in: path required: true @@ -289,7 +289,7 @@ paths: description: | Use the DELETE method to remove a data streaming from your account. - operationId: Delete data streaming by ID + operationId: DeleteDataStreamingById parameters: - in: path required: true @@ -326,7 +326,7 @@ paths: Use the GET method to list all global templates that can be used on Data Streaming operations. **Note:** Customized templates won't be listed. - operationId: List Data Streaming Templates + operationId: ListDataStreamingTemplates responses: '200': description: Successful operation From 1aa7707f7ab6f40c03bd334f315f978afaf2d0ea Mon Sep 17 00:00:00 2001 From: Joice Caroline Felix Date: Wed, 16 Aug 2023 15:12:45 -0300 Subject: [PATCH 13/13] Update data_streaming.yaml --- data_streaming.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data_streaming.yaml b/data_streaming.yaml index 3ba30963..7ed98ee8 100644 --- a/data_streaming.yaml +++ b/data_streaming.yaml @@ -19,6 +19,11 @@ security: - tokenAuth: [] tags: - name: Data Streaming + description: Data Streaming + - name: Data Streaming Domain + description: Data Streaming Domain + - name: Data Streaming Templates + description: Data Streaming Templates paths: /data_streaming/streamings: get: @@ -355,7 +360,7 @@ paths: - Data Streaming Templates summary: Get an global Template info by template ID description: Use the GET method and add the data streaming's ID to the URI of the request to get more data on a specific data streaming global template. - operationId: Get Data Straming Template by ID + operationId: GetDataStramingTemplateById parameters: - in: path required: true