Git Product home page Git Product logo

public-api's Introduction

public-api's People

Contributors

amistrn avatar amosd92-zz avatar asafm avatar boofinka avatar danmelman avatar imnotashrimp avatar jkowall avatar marinarazumovsky avatar metormaon avatar nasis avatar noniperi avatar roiravhon avatar schwin007 avatar shlomialfasi avatar yoliinyk avatar yyyogev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

public-api's Issues

alert api

The alert api doesn't seem to work on my account. It doesn't mention in the readme that i need a special licence.

I've tried the following uris, they all return 404

https://app-eu.logz.io/v1/alerts
https://app-eu.logz.io/alerts    <- path from swagger file

Interestingly /triggers/alerts works but the data structure is not the same as the swagger file

[
    {
        "id": 123,
        "name": "Test errors",
        "description": "",
        "enabled": true,
        "search": {
            "queryString": "(level:\"ERROR\" OR level:\"FATAL\") AND environment:test",
            "filter": "{\"bool\":{\"must\":[],\"must_not\":[]}}",
            "groupBy": [],
            "periodInMinutes": 5,
            "source": {
                "allTimelessIndices": false,
                "timelessIndices": [],
                "allSubAccounts": true,
                "subAccountsIds": []
            },
            "metricsAggregations": []
        },
        "triggerOn": {
            "type": "CONDITION",
            "aggregation": {
                "aggregationType": "NONE",
                "fieldToAggregateOn": null
            },
            "comparisonOperator": "GREATER_THAN",
            "threshold": 0,
            "severities": [
                {
                    "severity": "MEDIUM",
                    "threshold": 0
                }
            ]
        },
        "output": {
            "format": {
                "type": "TABLE",
                "sortBy": null,
                "sortOrder": "DESC",
                "fieldsConfig": "[{\"name\":\"stack\",\"data\":\"\"},{\"name\":\"level\",\"data\":\"\"},{\"name\":\"service_name\",\"data\":\"\"},{\"name\":\"message\",\"data\":\"\"}]"
            },
            "target": {
                "severity": "MEDIUM",
                "emailNotifications": "{\"notifications\":[]}",
                "notificationEndpoints": [
                    {
                        "id": 123,
                        "accountId": xx,
                        "type": "HTTP",
                        "templateName": "Slack",
                        "description": null,
                        "title": "Test errors",
                        "createdDate": 1500299065000,
                        "modifiedDate": 1516189356000,
                        "params": {
                            "url": "https://hooks.slack.com/services/xxx",
                            "method": "POST",
                            "headers": null,
                            "bodyTemplate": {
                                "icon_url": "https://s3.amazonaws.com/logzio-static-content-cdn/logzio-logo.png",
                                "username": "Logz.io Alerts",
                                "attachments": [
                                    {
                                        "author_name": "{{&alert_severity}} severity",
                                        "author_icon": "https://s3.amazonaws.com/logzio-static-content-cdn/slack/{{&alert_severity_img}}.png",
                                        "fallback": "{{&alert_severity}}: {{&alert_title}}",
                                        "title": "{{&alert_title}}",
                                        "title_link": "{{&alert_app_url}}#/dashboard/alerts/definitions?switchToAccountId={{&account_id}}",
                                        "pretext": "An alert has been triggered due to an event in your {{&account_name}} account.",
                                        "text": "{{&alert_description}}",
                                        "footer": "{{&alert_timeframe_start}} to {{&alert_timeframe_end}} (UTC)",
                                        "color": "#008ab1"
                                    },
                                    {
                                        "color": "#008ab1",
                                        "fields": [
                                            {
                                                "title": "{{^alert_event_image}}Alert event samples{{/alert_event_image}}",
                                                "value": "{{^alert_event_image}}{{^alert_event_samples}}No event samples available{{/alert_event_samples}}{{&alert_event_samples}}{{/alert_event_image}}",
                                                "short": false
                                            }
                                        ],
                                        "image_url": "{{&alert_event_image}}"
                                    },
                                    {
                                        "fields": [
                                            {
                                                "value": "{{#alert_event_html}}<{{&alert_event_html}}|Open full view>{{/alert_event_html}}",
                                                "short": false
                                            },
                                            {
                                                "value": "<{{&alert_app_url}}#/dashboard/alerts/view-alert-in-kibana?eventTimestamp={{&alert_event_timestamp}}&timeRangeInMinutes={{&alert_time_range_in_millis}}&alertDefinitionId={{&alert_definition_id}}&switchToAccountId={{&account_id}}|View in Kibana>",
                                                "short": false
                                            }
                                        ],
                                        "color": "#008ab1"
                                    }
                                ]
                            }
                        },
                        "internal_type": "HTTP"
                    }
                ],
                "suppressNotificationInMinutes": 60,
                "timelessIndex": null
            }
        },
        "lastUpdatedOn": null
    },
]

Requests suddenly failing because of CORS header

Request header field X-USER-TOKEN is not allowed by Access-Control-Allow-Headers in preflight response.
This happens when interacting with the API using javascript like so

const headers = {
        'Content-Type': 'application/json;charset=UTF-8',
	'X-USER-TOKEN': USER_TOKEN
};

return fetch(
   'https://api.logz.io/v1/search',
   'post',
   headers,
   body
 );

It was working about a couple of days ago.

api.logz.io/v1/alerts: Account region us-east-1 differs from current server region eu-central-1

Hi, what does the following mean and how can I resolve it?

Cheers, Christian.

curl -v -X GET -H 'X-API-TOKEN: <my.token>' -H 'Content-Type: application/json' https://api.logz.io/v1/alerts/26179
*   Trying 143.204.214.64...
* TCP_NODELAY set
* Connected to api.logz.io (143.204.214.64) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.logz.io
*  start date: May 16 00:00:00 2018 GMT
*  expire date: Jul 14 23:59:59 2020 GMT
*  subjectAltName: host "api.logz.io" matched cert's "*.logz.io"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
> GET /v1/alerts/26179 HTTP/1.1
> Host: api.logz.io
> User-Agent: curl/7.58.0
> Accept: */*
> X-API-TOKEN: <my.token>
> Content-Type: application/json
> 
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Content-Length: 72
< Connection: keep-alive
< Date: Wed, 15 Aug 2018 15:09:33 GMT
< x-amzn-RequestId: 37599f14-a09d-11e8-9d13-218aed5203ba
< x-amz-apigw-id: Lq9HFEasoAMFl5Q=
< X-Amzn-Trace-Id: Root=1-5b74422d-81861b3ce67c2288efbb9d54
< X-Cache: Error from cloudfront
< Via: 1.1 1f5757b46371746e677236d4fc67d364.cloudfront.net (CloudFront)
< X-Amz-Cf-Id: n5S90MxhsU4johMmBsp0cku6JQ2abe-xX2vLS53SCRwx0Lq_931pXQ==
< 
* Connection #0 to host api.logz.io left intact

Add OpenAPI/Swagger spec

In addition to the current document, swagger/OpenAPI spec will be nice - it makes the integration a lot simpler. For example - client code generation.

Alert API / Create / "operation" field swagger - service mismatch

Create alert Swagger doc says:

  • "operation" field is not in the required list

However the actual service says:

  • "Failed to create alert" (in plaintext, not json, response should be in JSON)
    if you don't specify the "operation" field

My request (failing)

{
   "alertNotificationEndpoints": [],
   "description": "",
   "groupByAggregationFields": null,
   "isEnabled": true,
   "notificationEmails": [
     "[email protected]"
   ],
   "query_string": "loglevel:ERROR",
   "searchTimeFrameMinutes": 5,
   "severityThresholdTiers": [],
   "suppressNotificationMinutes": 5,
   "title": "hello",
    "valueAggregationField": null,
    "valueAggregationType": "NONE"
 }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.