=begin #Datadog API V2 Collection #Collection of all Datadog Public endpoints. The version of the OpenAPI document: 1.0 Contact: support@datadoghq.com Generated by: https://openapi-generator.tech Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2020-Present Datadog, Inc. =end require 'spec_helper' require 'json' # Unit tests for DatadogAPIClient::V2::LogsAPI # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'LogsAPI' do before do # run before each test @api_instance = DatadogAPIClient::V2::LogsAPI.new end after do # run after each test end describe 'test an instance of LogsAPI' do it 'should create an instance of LogsAPI' do expect(@api_instance).to be_instance_of(DatadogAPIClient::V2::LogsAPI) end end # unit tests for aggregate_logs # Aggregate events # The API endpoint to aggregate events into buckets and compute metrics and timeseries. # @param body # @param [Hash] opts the optional parameters # @return [LogsAggregateResponse] describe 'aggregate_logs test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for list_logs # Search logs # List endpoint returns logs that match a log search query. [Results are paginated][1]. Use this endpoint to build complex logs filtering and search. **If you are considering archiving logs for your organization, consider use of the Datadog archive capabilities instead of the log list API. See [Datadog Logs Archive documentation][2].** [1]: /logs/guide/collect-multiple-logs-with-pagination [2]: https://docs.datadoghq.com/logs/archives # @param [Hash] opts the optional parameters # @option opts [LogsListRequest] :body # @return [LogsListResponse] describe 'list_logs test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for list_logs_get # Get a list of logs # List endpoint returns logs that match a log search query. [Results are paginated][1]. Use this endpoint to see your latest logs. **If you are considering archiving logs for your organization, consider use of the Datadog archive capabilities instead of the log list API. See [Datadog Logs Archive documentation][2].** [1]: /logs/guide/collect-multiple-logs-with-pagination [2]: https://docs.datadoghq.com/logs/archives # @param [Hash] opts the optional parameters # @option opts [String] :filter_query Search query following logs syntax. # @option opts [String] :filter_index For customers with multiple indexes, the indexes to search Defaults to '*' which means all indexes # @option opts [Time] :filter_from Minimum timestamp for requested logs. # @option opts [Time] :filter_to Maximum timestamp for requested logs. # @option opts [LogsSort] :sort Order of logs in results. # @option opts [String] :page_cursor List following results with a cursor provided in the previous query. # @option opts [Integer] :page_limit Maximum number of logs in the response. # @return [LogsListResponse] describe 'list_logs_get test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for submit_log # Send logs # Send your logs to your Datadog platform over HTTP. Limits per HTTP request are: - Maximum content size per payload (uncompressed): 5MB - Maximum size for a single log: 1MB - Maximum array size if sending multiple logs in an array: 1000 entries Any log exceeding 1MB is accepted and truncated by Datadog: - For a single log request, the API truncates the log at 1MB and returns a 2xx. - For a multi-logs request, the API processes all logs, truncates only logs larger than 1MB, and returns a 2xx. Datadog recommends sending your logs compressed. Add the `Content-Encoding: gzip` header to the request when sending compressed logs. The status codes answered by the HTTP API are: - 202: Accepted: the request has been accepted for processing - 400: Bad request (likely an issue in the payload formatting) - 401: Unauthorized (likely a missing API Key) - 403: Permission issue (likely using an invalid API Key) - 408: Request Timeout, request should be retried after some time - 413: Payload too large (batch is above 5MB uncompressed) - 429: Too Many Requests, request should be retried after some time - 500: Internal Server Error, the server encountered an unexpected condition that prevented it from fulfilling the request, request should be retried after some time - 503: Service Unavailable, the server is not ready to handle the request probably because it is overloaded, request should be retried after some time # @param body Log to send (JSON format). # @param [Hash] opts the optional parameters # @option opts [ContentEncoding] :content_encoding HTTP header used to compress the media-type. # @option opts [String] :ddtags Log tags can be passed as query parameters with `text/plain` content type. # @return [Object] describe 'submit_log test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end end