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 diff --git a/data_streaming.yml b/data_streaming.yaml similarity index 81% rename from data_streaming.yml rename to data_streaming.yaml index bc064d0a..7ed98ee8 100644 --- a/data_streaming.yml +++ 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: @@ -34,6 +39,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DataStreamingResponseWithResults' + '400': description: Bad Request '401': @@ -53,9 +59,6 @@ paths: tags: - Data Streaming summary: Create a new data streaming - description: | - - operationId: CreateNewDataStreaming requestBody: @@ -63,10 +66,11 @@ 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/CustomDataStreamingPostBody' + responses: '201': description: Created successfully @@ -76,7 +80,6 @@ paths: oneOf: - $ref: '#/components/schemas/CreateDataStreamingResponse' - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' - '400': description: Bad Request '401': @@ -113,6 +116,8 @@ paths: schema: format: int64 type: integer + minimum: 1 + exclusiveMinimum: true - in: query name: selected required: false @@ -147,13 +152,15 @@ 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 name: data_streaming_id schema: type: integer + minimum: 1 + exclusiveMinimum: true responses: '200': description: Successful operation @@ -183,24 +190,25 @@ 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 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/DataStreamingPostBody' + # oneOf: + # - $ref: '#/components/schemas/DataStreamingPostBody' + # - $ref: '#/components/schemas/CustomDataStreamingPostBody' responses: '200': description: Successful operation @@ -210,7 +218,6 @@ paths: oneOf: - $ref: '#/components/schemas/CreateDataStreamingResponse' - $ref: '#/components/schemas/CreateCustomDataStreamingResponse' - '400': description: Bad Request '401': @@ -235,24 +242,26 @@ 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 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/CustomDataStreamingPostBody' + responses: '200': description: Successful operation @@ -285,13 +294,15 @@ 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 name: data_streaming_id schema: type: integer + minimum: 1 + exclusiveMinimum: true responses: '204': @@ -320,7 +331,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 @@ -349,13 +360,14 @@ 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 name: template_id schema: type: integer + minimum: 1 responses: '200': description: Successful operation @@ -384,6 +396,7 @@ components: properties: name: type: string + example: "Data Stream Name" template_id: type: integer @@ -400,6 +413,7 @@ components: * `86` - Edge Functions Event Collector * `184` - Edge Applications + WAF Event Collector * `251` - Activity History Collector + example: 2 data_source: type: string @@ -411,25 +425,38 @@ 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: string - format: json + type: object + oneOf: + - $ref: '#/components/schemas/Endpoint_Standard' + - $ref: '#/components/schemas/Endpoint_Kafka' + - $ref: '#/components/schemas/Endpoint_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 } - `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" } @@ -439,6 +466,7 @@ components: items: type: integer minItems: 1 + example: [1234, 5678] description: > Note: * Field not used with the rtm_activity data source. @@ -449,6 +477,7 @@ components: type: boolean nullable: true default: false + example: false description: > Note: * Field not used with the rtm_activity data source. @@ -460,68 +489,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: @@ -562,6 +535,8 @@ components: $ref: '#/components/schemas/PostDataStreamingResponse' schema_version: type: number + minimum: 0 + CreateCustomDataStreamingResponse: type: object @@ -572,6 +547,7 @@ components: $ref: '#/components/schemas/PostCustomDataStreamingResponse' schema_version: type: number + minimum: 0 PostDataStreamingResponse: @@ -579,7 +555,8 @@ components: properties: id: type: integer - + minimum: 0 + name: type: string @@ -613,20 +590,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_Standard' + - $ref: '#/components/schemas/Endpoint_Kafka' + - $ref: '#/components/schemas/Endpoint_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 @@ -643,7 +619,8 @@ components: properties: id: type: integer - + minimum: 0 + name: type: string @@ -669,8 +646,19 @@ components: type: boolean endpoint: - type: string - format: json + type: object + oneOf: + - $ref: '#/components/schemas/Endpoint_Standard' + - $ref: '#/components/schemas/Endpoint_Kafka' + - $ref: '#/components/schemas/Endpoint_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 @@ -679,7 +667,8 @@ components: Note: * Field not used with the rtm_activity data source. - Endpoint_Default: + + Endpoint_Standard: type: object properties: endpoint_type: @@ -688,22 +677,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 + 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 @@ -713,12 +708,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: @@ -726,19 +724,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 @@ -748,15 +753,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 @@ -767,8 +777,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 @@ -778,12 +790,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 @@ -794,8 +810,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 @@ -806,6 +824,7 @@ components: url: type: string format: uri + example: "http://137.15.824.10:14440" Endpoint_Azure_Monitor: type: object @@ -815,13 +834,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 @@ -831,11 +854,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 @@ -846,8 +872,10 @@ components: url: type: string format: uri + example: "https://inputs.splunk-client.splunkcloud.com:1337/services/collector" api_key: type: string + example: "MYAPIKEY" DataStreamingResponseWithResults: @@ -863,16 +891,26 @@ components: - $ref: '#/components/schemas/DataStreamingResponseGetResultTypeCustom' schema_version: type: number + minimum: 0 + + DataStreamingResponseGetResultTypeDatadogDTS: type: object properties: id: type: integer + minimum: 0 name: type: string template_id: type: integer + enum: + - 2 + - 4 + - 86 + - 184 + - 251 data_source: type: string active: @@ -898,10 +936,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: @@ -928,54 +973,32 @@ 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: 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 - 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 properties: id: type: integer + minimum: 0 name: type: string data_source: @@ -998,6 +1021,7 @@ components: type: integer schema_version: type: number + minimum: 0 links: $ref: '#/components/schemas/DataStreamingsDomainResponseLinks' results: @@ -1020,6 +1044,7 @@ components: properties: domain_id: type: integer + minimum: 0 name: type: string selected: @@ -1033,6 +1058,7 @@ components: $ref: '#/components/schemas/DataStreamingResponseGetResultTypeKafka' schema_version: type: number + minimum: 0 TemplateResults: @@ -1044,6 +1070,7 @@ components: $ref: '#/components/schemas/Template' schema_version: type: number + minimum: 0 TemplateResultById: type: object @@ -1052,12 +1079,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: