Commit Graph

1202 Commits (d43bfaab7ddae86dbb72cf874bc1d589e73f4dd9)

Author SHA1 Message Date
kelwang 3f168b109d
Merge pull request #15117 from influxdata/clientURL_optional
fix(notification/endpoint): pagerduty clientURL should be optional
2019-10-15 13:11:50 -04:00
Lyon Hill 3c6779f011
feat(task): Allow tasks to run more isolated from other task systems (#15384)
* feat(task): Allow tasks to run more isolated from other task systems

To allow the task internal system to be used for user created tasks as well
as checks, notification and other future additions we needed to take 2 actions:

1 - We need to use type as a first class citizen, meaning that task's have a type
and each system that will be creating tasks will set the task type through the api.
This is a change to the previous assumption that any user could set task types. This change
will allow us to have other service's white label the task service for their own purposes and not
have to worry about colissions between the types.

2 - We needed to allow other systems to add data specific to the problem they are trying to solve.
For this purpose adding a `metadata` field to the internal task system which should allow other systems to
use the task service.

These changes will allow us in the future to allow for the current check's and notifications implementations
to create a task with meta data instead of creating a check object and a task object in the database.
By allowing this new behavior checks, notifications, and user task's can all follow the same pattern:

Field an api request in a system specific http endpoint, use a small translation to the `TaskService` function call,
translate the results to what the api expects for this system, and return results.

* fix(task): undo additional check for ownerID because check is not ready
2019-10-11 08:53:38 -06:00
kelwang 072270d7d8
Merge pull request #15372 from influxdata/cli_list_org_members
fix(cmd/influx): fix list org members
2019-10-10 12:10:25 -04:00
Kelvin Wang c96fe7ed6e fix(cmd/influx): fix list org members 2019-10-10 11:57:03 -04:00
Johnny Steenbergen dbe0103d92 fix(logging): blacklist endpoints with sensitive data from logging body 2019-10-09 13:17:24 -07:00
Johnny Steenbergen 5a546d5827
Merge pull request #15335 from influxdata/2939/add_logging_to_gateway
2939/add logging to gateway
2019-10-07 14:49:36 -07:00
Johnny Steenbergen 9d5392cfd9 fix(logging): add debug logging for all http requests 2019-10-07 14:19:21 -07:00
Jakub Bednář ea9cf13af6
fix(notification/rule): fixed http NotificationRule (#15245)
* Fixed handler path for a list of all labels for a notification rule
* Fixed filtering NotificationRules by limit and offset
2019-10-07 09:36:55 +02:00
George 9f5390e449
feat(auth): add jwt support in auth middleware (#15152) 2019-09-27 12:12:41 +01:00
Jakub Bednář 732c0cc28d
fix(http): update NotificationRuleBase and NotificationRule schema to reflect reality (#15244)
* NotificationRuleBase: the endpointID should be required and editable, there is missing a links property
 * NotificationRule: add discriminator
 * add a missing TraceSpan parameter into a GetNotificationRules and GetChecks
2019-09-26 12:07:44 +02:00
Jakub Bednář 95d6301458
fix(http): add a discriminator for a Threshold schema, add links into CheckBase schema (#15198) 2019-09-26 11:09:59 +02:00
Michael Desa ca937eaf11
fix(http): lookup task before clearing it's id from the notification rule 2019-09-25 16:33:05 -04:00
Johnny Steenbergen 4da248ec30
Merge pull request #15275 from influxdata/task/15258_remove_senstive_data_logging
chore(http): remove logging of senstive data
2019-09-25 10:13:10 -07:00
Johnny Steenbergen fc955c5abe chore(http): remove logging of senstive data
after discussion with team, dropping the request logging was decided on.
2019-09-25 09:49:09 -07:00
Jakub Bednář ff2747a728
fix(http/check): fix handler path for a list of all labels for a check (#15216) 2019-09-25 09:07:24 +02:00
Jakub Bednář d23b1f9904
fix(http): add discriminator for Check schema (#15178) 2019-09-25 08:50:09 +02:00
Brandon Farmer f61fe82708 fix(influxdb): Always return user status 2019-09-24 15:19:16 -07:00
Michael Desa d48b28e533
fix(http): prevent writing to http request multiple times
Closes https://github.com/influxdata/influxdb/issues/15260

Additionally, we look up a task before clearing the taskID from the
check.
2019-09-24 15:48:36 -04:00
Kelvin Wang 4aa6df1c34 fix(cmd/influx): org add/remove members 2019-09-24 13:26:18 -04:00
kelwang c3127c8cdd
Merge pull request #15179 from bednar/check-cron
fix(alerts): remove the cron option from checks/rules
2019-09-23 21:28:02 -04:00
kelwang 236e8c14ee
Merge pull request #15150 from bednar/flux-paren-expression
fix(http): add ParenExpression
2019-09-23 21:26:57 -04:00
Jakub Bednář 9f0d9f6ecb fix(http): fix NotificationEndpoint: (#15148)
* Add TraceSpan parameter to GetNotificationEndpoints operation
* Fixed handler path for a list of all labels for a notification endpoint
* Fixed filter NotificationEndpoints by limit and offset
2019-09-23 15:55:37 -07:00
Brandon Farmer d83fabeabc feat(influxdb): user disabling 2019-09-23 11:57:16 -07:00
Jakub Bednar 8089b9c7ea fix(http): fix capitalization 2019-09-23 10:30:20 +02:00
Jakub Bednar 83997a7345 fix(http): add ParenExpression 2019-09-23 10:29:09 +02:00
Jakub Bednar 265bc7bf2a fix(alerts): remove the cron option from checks/rules 2019-09-23 10:20:22 +02:00
Scott Anderson c24710a00d
chore(swagger): general cleanup of swagger.yml (#15223) 2019-09-21 10:15:42 -06:00
Jonathan A. Sternberg cbd04f2884
refactor: http error serialization matches the new error schema (#15196)
The http error schema has been changed to simplify the outward facing
API. The `op` and `error` attributes have been dropped because they
confused people. The `error` attribute will likely be readded in some
form in the future, but only as additional context and will not be
required or even suggested for the UI to use.

Errors are now output differently both when they are serialized to JSON
and when they are output as strings. The `op` is no longer used if it is
present. It will only appear as an optional attribute if at all. The
`message` attribute for an error is always output and it will be the
prefix for any nested error. When this is serialized to JSON, the
message is automatically flattened so a nested error such as:

    influxdb.Error{
        Msg: errors.New("something bad happened"),
        Err: io.EOF,
    }

This would be written to the message as:

    something bad happened: EOF

This matches a developers expectations much more easily as most
programmers assume that wrapping an error will act as a prefix for the
inner error.

This is flattened when written out to HTTP in order to make this logic
immaterial to a frontend developer.

The code is still present and plays an important role in categorizing
the error type. On the other hand, the code will not be output as part
of the message as it commonly plays a redundant and confusing role when
humans read it. The human readable message usually gives more context
and a message like with the code acting as a prefix is generally not
desired. But, the code plays a very important role in helping to
identify categories of errors and so it is very important as part of the
return response.
2019-09-19 10:06:47 -05:00
Jonathan A. Sternberg ff7d13a10a
docs(http): fix the documentation for the query swagger endpoint (#15181)
The `/query` swagger endpoint now specifies that error messages are
returned as the standard JSON schema. The standard JSON schema has also
been changed slightly so that only `code` and `message` are documented
and the intention is that we will flatten the message from an
`influxdb.Error` before we encode the JSON.
2019-09-18 18:31:12 -05:00
Chris Goller 5b4c0db4a0
test(http): add unit tests for /api/v2/write (#15128)
test(http): add unit tests for /api/v2/write
2019-09-12 13:57:06 -05:00
Chris Goller 1d14ba1d1c
feat(http): add validation checks to PUT requests (#15096)
feat(http): add validation checks to PUT requests
2019-09-12 13:42:37 -05:00
Chris Goller bb72fdeae0 test(http): add unit tests for /api/v2/write
We have been tracking down odd error messages when writing data and
found the problem to be internal server errors when writing empty
bodies.

I added fairly comprehensive test coverage for /api/v2/write as well
as simplify and clarify the error messages.
2019-09-12 13:39:24 -05:00
kelwang 63c5311494
Merge pull request #15111 from bednar/notification-endpoint
docs(http): update NotificationEndpoint swagger definition to reflect reality
2019-09-12 11:09:17 -04:00
Kelvin Wang aed8035472 fix(notification/endpoint): pagerduty clientURL should be optional 2019-09-11 15:26:50 -04:00
kelwang f9b8ae32a5
Merge pull request #15010 from influxdata/invalid_post_bucket_request
fix(http): post bucket validation.
2019-09-11 09:54:01 -04:00
Jakub Bednar a8ad9e2615 docs(http): update NotificationEndpoint swagger definition to reflect reality 2019-09-11 11:53:44 +02:00
Chris Goller 280b78e45d feat(http): add validation checks to PUT requests
It was possible to create checks with invalid data causing
odd internal errors to return from the layers far down below.

Likely, we need to add more checks to the validation, but, I have
not thoroughly checked.
2019-09-10 09:29:04 -05:00
Michael Desa 515df68a83
fix(http): add return after returning system bucket errror 2019-09-10 09:47:44 -04:00
Michael Desa ea1b7bec09
fix(pagerduty/rule): change url to clientURL for pagerduty endpoint/rule
Closes https://github.com/influxdata/influxdb/issues/15042

Previously, there was an optional URL provided for the pagerduty
endpoint. However, the pagerduty API url does not change and as a result
it should not have been a parameter. The Pagerduty API does require a
`clientURL` that is presented in the pagerduty UI when an alert is
triggered. Currently that value will default to the alerts history page
for the organization.
2019-09-09 19:09:35 -04:00
Chris Goller 623224614e feat(kv): random ids without comma, space, backslash for org and bucket
At times snowflake id generation would create org and bucket IDs with
characters that had special meaning for the storage engine.

The storage engine concats the org and bucket bytes together into a
single 128 bit value.  That value is used in the old measurement
section.  Measurement was transformed into the tag, _measurement.

However, certain properties of the older measurement data location
are still required for the org/bucket bytes.  We cannot have
commas, spaces, nor backslashes.

This PR puts a specific ID generator in place during the creation of
orgs and buckets.  The IDs are just random numbers but with each
of the restricted chars incremented by one.  While this changes the
entropy distribution somewhat, it does not matter too much for our
purposes.

... because now org and bucket ids are checked for previous existence
transactionally in the key-value stores.  If the ID does already exist
then we try to generate a new key up to 100 times.
2019-09-08 01:50:05 -05:00
Jade McGough c1cd152363
feat(http): Add bucket types (#15045) 2019-09-06 17:52:54 -07:00
Kelvin Wang d08122124f feat(notification/endpoint): add headers to http endpoint 2019-09-06 12:38:42 -04:00
Kelvin Wang db33f4bd24 fix(http): post bucket validation. 2019-09-06 11:24:52 -04:00
Russ Savage 225f426e08
fix(slack): remove option for token in UI (#14998)
* fix(slack): remove option for token in UI

* fix(slack): fix linting

* fix(slack): updating tests

* fix(slack): updating go tests

* fix(slack): fixing js test
2019-09-05 22:28:35 -07:00
Jade McGough 6e6e7fef9b
feat(http): block writes to system buckets (#14920) 2019-09-05 11:22:18 -07:00
Kelvin Wang f1675a33d5 fix(http): fix check update swagger 2019-09-05 13:58:35 -04:00
Kelvin Wang a83f8dd205 feat(http): add rule query endpoint 2019-09-05 10:22:07 -04:00
Jade McGough d147874c1e
fix(kv): mock system buckets (#14884) 2019-08-30 12:47:06 -07:00
Michael Desa bc77f94024
fix(notification/check): rename _check_type to _type in check object in flux
Previously we passed a property called _check_type instead of just passing a property called _type.
2019-08-30 10:54:16 -04:00
Deniz Kusefoglu 9450149561
Add Any to rule levels (#14866)
* WIP

* Fix UI linter errors from swagger changes to Level Rule

* Prevent same level selection on changes from

* Remove unused get

* Fix prettier error

* chore(notification/rule): change level rule to check level for rules
2019-08-29 17:46:00 -07:00