Commit Graph

1390 Commits (e9689b7269bc219bd75a1d3a51770de257b2c8e8)

Author SHA1 Message Date
Johnny Steenbergen d08ebf8658 feat(pkger): improve error handling for parser 2019-11-14 08:32:52 -08:00
Alirie Gray f0ecc0e89d
refactor(tasks): use go Time for Task CreatedAt, UpdatedAt, LatestCompleted, Offset (#15672) 2019-11-12 17:13:56 -08:00
Johnny Steenbergen f6dbfec346 feat: import jsteenb2/testttp directly into pkg 2019-11-12 14:14:40 -08:00
Johnny Steenbergen b58e7947b1 feat(pkger): add support for exporting resource associations
also adds some extra user friendliness. it sorts the pkg created via an
export by resource kinds. It also titles the kinds to make them match the
documentation even though the kind is case insensitive. Easier to read this
way.
2019-11-11 08:51:54 -08:00
Johnny Steenbergen a64b976561 feat(pkger): add export functonality to pkger for existing buckets/labels/dashboards
no associations included at this time. Also fixes http response to be just
the pkg without the envelope. Having that envelope makes the API icky to
work with from any shell script or just saving it to file. This feels more
organic to just drop that envelope.
2019-11-08 16:55:24 -08:00
Ariel Salem 888ce50ef8
fix(http/links): Added query links to checks and notificationRules response, updated swagger.yml (#15807) 2019-11-08 08:23:38 -08:00
Ariel Salem 5ba9142f2f
fix(flakey-test): refactored getSortedBucketNames for more consistency and predictability. Finished DWP API functionality (#15802)
* fix(flakey-test): refactored getSortedBucketNames for more consistency and predictability. Finished DWP API functionality

* fix(FilterRow): removed unnecessary FeatureFlag from component

* chore: updated yml and tests to reflect API changes
2019-11-07 16:19:42 -08:00
Johnny Steenbergen 5eb29e9ed9 feat(pkger): add label associations to variables 2019-11-07 12:33:20 -08:00
Johnny Steenbergen b4b337e414 chore(http): provide mountable router for registering routes on APIHandler 2019-11-07 09:44:24 -08:00
Johnny Steenbergen 2090afa5fd chore(pkger): move pkger http server to http pkg 2019-11-07 09:44:24 -08:00
Johnny Steenbergen 2902638c8a feat(pkger): add pgker http server to the api handler 2019-11-07 09:44:24 -08:00
Ariel Salem 3ba8eaac3e
feat(createdAt): Added createdat and updatedAt to Authorization (#15784)
* feat(auth): add createdAt and updatedAt to authorization

Co-Authored-By: Ariel <ariel.salem1989@gmail.com>

* feat(auth): passing createAuth tests

* test: ensured that createdAt and updatedAt are valid on authorizations
2019-11-07 06:46:30 -08:00
Lyon Hill bb6aa1df3b
feat(task): Add a latestScheduled field for tasks (#15785)
Previously we overwrote the tasks existing latestCompleted to be used for latestCompleted as well as latestScheduled.
For obvious reasons this is confusing and missleading. I believe by seperating the two fields we can have a clear seperation
of concerns.
2019-11-06 15:10:52 -07:00
Deary Hudson III 81965f0b33
feat(kv): unique variable names (#15695)
* feat(kv): unique variable names

- adds system bucket for creating an index of unique variable names
- adds tests
- deleted unit tests for dead code
- removed a test runner for the variable service from http
2019-11-04 14:28:21 -06:00
Johnny Steenbergen eea44f6c72 feat(pkger): add dashboard support to pkger
included is the base for dashboards and association of labels with
dashboards.
2019-11-01 12:20:54 -07:00
Johnny Steenbergen fb5f00e05b chore(http): add missing client methods for label/buckets GET reqs 2019-11-01 11:59:09 -07:00
Deary Hudson 220309e498 feat(pkger): adds label support 2019-11-01 11:59:09 -07:00
Brandon Farmer ce3e2969ae
Merge pull request #15646 from influxdata/system-bucket-deletion
feat(influxdb): Prevent the deletion of system buckets
2019-10-30 16:02:00 -07:00
Brandon Farmer b5744f1fe1 fix(swagger): Fixes conflicting label types 2019-10-30 15:31:37 -07:00
Brandon Farmer e473394e7d feat(influxdb): prevent users from rename system buckets 2019-10-30 12:53:43 -07:00
Gavin Cabbage 75147d014c
feat(tasks): expose lastRunStatus and lastRunError in task API 2019-10-30 14:00:22 -04:00
kelwang 5403e8aaa6
Merge pull request #15607 from influxdata/cli_delete_predicate
feat(cmd/influx): add cli delete predicate
2019-10-29 12:10:20 -04:00
Kelvin Wang 27d15deadb feat(cmd/influx): add cli delete predicate 2019-10-28 11:46:01 -04:00
Gavin Cabbage 6fb8a67ff8
fix(api): change task ID runs success status from 200 to 201 2019-10-26 00:16:48 -04:00
Kelvin Wang 4615a01338 fix(kv): use urm filter to search endpoints 2019-10-24 13:28:34 -04:00
Kelvin Wang 81283b1ac2 fix(kv): find checks by urm 2019-10-24 12:29:48 -04:00
Brandon Farmer 88bf178802 feat(influxdb): Add labels create endpoints
- Notification Rules
- Notification Endpoints
- Checks

Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
2019-10-23 09:53:50 -07:00
Alirie Gray a8f5e5ba19
fix(tasks): create API facing interface for task runs (#15539) 2019-10-22 15:35:47 -07:00
Brandon Farmer ea82dc3470 fix(tasks): tasks look up system bucket id 2019-10-21 14:48:47 -07:00
Brandon Farmer b343250390 fix(influxdb): fixes broken tests from system bucket changes 2019-10-21 14:48:47 -07:00
Brandon Farmer 2e0749b3ba feat(influxdb): Add system buckets on org creation
* Only allow users to create user buckets
* Only accept bucket creation parameters on post
2019-10-21 14:48:47 -07:00
Deary Hudson III c04249ec78
fix(http): /api/v2/orgs/:id/owners|members to 404 (#15504)
ensures that the endpoints:
  * /api/v2/orgs/:id/owners
  * /api/v2/orgs/:id/members
404 when the organization resource does not exist
2019-10-21 16:37:30 -05:00
Kelvin Wang e1d246a19d fix(predicate): remove unsupported operator parsing 2019-10-18 15:16:21 -04:00
Kelvin Wang 2837d4ec08 fix(predicate): add string parser 2019-10-18 12:02:53 -04:00
Jade McGough fcc06d4291 feat(http): add predicate endpoint 2019-10-18 12:02:53 -04:00
Kelvin Wang 62f4042853 feat(influxdb): add predicate package 2019-10-18 12:02:52 -04:00
Alirie Gray 552168d3ae
refactor(tasks): use Go time objects for timestamps on task Runs (#15406) 2019-10-17 17:23:45 -07:00
George b3b2f52d57
chore(gateway): log error on unauthorized attempt (#15452) 2019-10-17 17:57:01 +01:00
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
Michael Desa 0da82319a8
feat(notification/check/threshold): add createEmpty false to aggregateWindow 2019-08-29 18:36:18 -04:00
Kelvin Wang 7a677e9532 fix(http): fix notfication endpoint secret store 2019-08-28 16:02:17 -04:00
Jade McGough 2fa1ca3f49
feat: add metadata for system buckets when org is created (#14741)
feat: add metadata for system buckets when org is created
2019-08-28 12:50:23 -07:00
Jade McGough cd2e29cbcb
feat(swagger): notification rule tag filtering (#14793)
feat(swagger): notification rule tag filtering
2019-08-28 09:25:54 -07:00
Michael Desa 02bda26866
feat(deadman): add staleTime duration to deadman check
fix(deadman): change timeSince to a duration string instead of int
2019-08-28 10:16:38 -04:00
Deniz Kusefoglu 8766243470
Rule Check Endpoint polish (#14817)
* Make endpoint description field normal sized

* Add password type to secret inputs

* de-snarkify and remove defaults from new-endpoint-draft

* Make new tag rules unique

* Remove hardcoded fields in initRuleDraft

* Add tag rule make statusRule is equal to level

* Status rule can be "is equal to"

* Remove cron option from rule

* Add the text lastupdated to cards

* Fix offset and every copy

* Improve Tags in checks

* Move threshold deadman selector to conditions card

* Filter empty tag rules on notification rules

* Make dismiss button gray

* Fix review comments

* remove irrelevant tests

* Fix missing url field from http rule
2019-08-27 19:35:20 -07:00
Michael Desa b26ed76d6a
fix(notification/check): ensure cloud integration works
fix(notification/check): include tags in check object in generated flux

Closes https://github.com/influxdata/influxdb/issues/14769

fix(notification/check): use selected field in threshold functions

Closes https://github.com/influxdata/influxdb/issues/14776

fix(testing): add selected field for check tests

fix(check): use real flux for threshold check

feat(notification/check): generate flux for deadman checks

chore(endpoint): rename webhook endpoint to http endpoint

fix(notification/rule): fetch url for flux script off of endpoint

fix(notification/rule): clean up slack and http rules

fix(notification/rule): change MessageTemp to MessageTemplate

fix(rules): pass endpoint in to rule during create

fix(ui): rename webhook to http

feat(notification/check): namespace deadman under alerts

fix(notification/check): nest tags under tags key in data object in flux

wip

feat(kv): log error if urm cannot be deleted for notification rule

fix(notification/rule): remove name from notify call in slack rule

chore(ui/cypress/e2e): skip rule create test
2019-08-27 15:02:53 -04:00
Michael Desa add4bcb873
fix(http): remove non-txn task Create/Update/Delete for nofitication rules 2019-08-26 07:55:43 -04:00
Michael Desa df628f21de
fix(http): remove non-txn task Create/Update/Delete for checks 2019-08-26 07:55:43 -04:00
Jakub Bednář 2e746d8179
docs(http): update suggestions swagger definition to reflect reality (#14725) 2019-08-26 08:12:39 +02:00
Jakub Bednář 094d8e3174
docs(http): update swagger for easily use in clients (#14724)
* added missing Permission types: notificationRules, notificationEndpoints, checks
* Authorization links use Link as a type
* Run's logs are readonly
* TaskCreateRequest and TaskUpdateRequest has description property to update Task description
2019-08-26 08:11:52 +02:00
Deniz Kusefoglu 0bee8ac0eb
Feat/monitoring labels (#14751)
* add labels to alerting swagger

* Add labels to checks

* Add labels to rules

* Add labels to endpoints

* Fix endpoint swagger bugs

* Update endpoint swagger to reflect reality

* Add endpoint delete and update to cards

* add equality

* Add rule patch

* Update endpoint should put

* Update http/swagger.yml

Co-Authored-By: Christopher Henn <chris@chrishenn.net>

* Apply suggestions from code review

Co-Authored-By: Christopher Henn <chris@chrishenn.net>

* fix updateEndpoint
2019-08-22 16:22:01 -07:00
Kelvin Wang 4a7679b693 feat(http): checks query endpoint 2019-08-22 14:40:42 -04:00
docmerlin (j. Emrys Landivar) 19fe098888 chore(ci): update go-tools 2019-08-22 10:55:05 -05:00
Michael Desa c433f50cec
chore(alerts_notifications): add misc changes to alerts ui for demo
Create view with checkID in NewVEO

fix ruleToDraftRule bug

Fix no thresholds error

Get correct view status for rendering cell

Fix editVEO flow

Add notification endpoint ID to initRule

Remove task type from check and notification rule

mock generate AST

use check query in EditCheckEO

wip

Create default http notification endpoint

Co-authored-by: Michael Desa <mjdesa@gmail.com>

Dont save view if no dashboardID in saveCheck

Execute queries in editCheckEO

Fix check remove bug

Disable Advanced view and multiple queries in check builder

Disable alerting button if draftQuery is not alertable

chore(kv/check): remove createCheckTask from KV as the result of #14728
2019-08-21 17:28:49 -04:00
kelwang 99cebbbdc1
Merge pull request #14714 from influxdata/create_task_in_stack
chore(http): split taskservice from check and notification
2019-08-20 11:20:15 -04:00
Lyon Hill 0b247cce5b
feat(task): Remove token's from task structures (#14712)
* feat(task): Remove token's from task structures

We had previously removed token's from the task api but left the token in place in several locations in the stack.
Now we can cleanly remove the extra tokens.
2019-08-20 08:42:40 -06:00
Kelvin Wang 03f6214d0e chore(http): split taskservice from check and notification 2019-08-19 18:56:17 -04:00
Andrew Watkins 286d57b0ba
feat(notifications): create notification endpoint overlay (#14693)
* chore: update swagger definitions

* feat(endpoints): introducer endpoint overlay

* wip: change endpoint type

* feat(endpoint): add inputs for supported endpoint types

* wip: connect create endpoint to API

* feat: implement create endpoint

* alerts(e2e): add createEndpoint command

* chore: update swagger
2019-08-19 10:57:20 -07:00
Michael Desa ed853290a3
Merge pull request #14695 from influxdata/feat/notification-flux
feat(notifiction_rule): create notification rule task
2019-08-19 07:51:18 -04:00
Michael Desa 8e56c36737
feat(notification_rule): create notification rule task
feat(notification_rule): generate base flux for notification rule

wip: saving state

fix(notification/endpoint): add comment about weird requirements

feat(notification_rule): create notification rule task
2019-08-16 15:43:15 -04:00
Alirie Gray 28089fdb59 feat(tasks): add ability to find tasks by name 2019-08-16 12:07:11 -07:00
Michael Desa a2a9eb5e49
feat(check): pass ownerID to task on create 2019-08-16 07:12:28 -04:00
Kelvin Wang bbb4fbc50d fix(notification/check): remove authorizationID 2019-08-16 00:00:55 -04:00
Kelvin Wang c5100f3eae feat(http): add notification endpoint 2019-08-15 21:56:21 -04:00
Lyon Hill a8d7870689
feat(task): impersonate user on task execution (#14675)
* feat(task): impersonate user on task execution

Passing tokens to tasks is cumbersome and we needed a way to more easily create tasks. With this change we no longer need a token on task create. We take the user that created the task and pass that in as the "owner". As far as the task is concerned the owner is the source of permissions.

This is done by adding an additional field on task create that is OwnerID. We will no longer respect the token passed in and it will be deprecated soon.

Things to do still:
Task updates need to allow for owners to be set.
2019-08-15 18:31:52 -06:00
kelwang d01b91667d
Merge pull request #14679 from influxdata/notification_auth_id
fix(notification/rule): remove authID requirement
2019-08-15 19:54:18 -04:00
Kelvin Wang f3dcdee504 fix(notification/rule): remove authID requirement 2019-08-15 19:31:45 -04:00
Christopher Henn 33a5d8ff5d feat(ui): integrate notification rule overlays with API 2019-08-15 16:24:52 -07:00
Kelvin Wang f688697ca6 fix(notification/check): convert threshold type 2019-08-15 16:53:46 -04:00
Deniz Kusefoglu e1508ac2e1
feat(checks): add first pass at creating tasks from checks
First pass at flux AST generation from check

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>

fix(notification/check): format call expression

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>

fix(notification/check): cleanup CheckDefinition

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>

fix(notification/check): clean up threshold functions

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>

fix(notification/check): clean up message function

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>

fix(notification/check): misc fixes

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>

fix(notification/check): remove dead code

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>

fix(notification/check): move threshold flux generation to check pkg

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>

fix(notification/check): move base ast generation to its own package

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>

fix(notification/check): add comment for GenerateFluxAST

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>

docs(notification/flux): add comments to each exported function

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>

feat(notification/check): add tests for GenerateFlux

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>

feat(notification/check): add task options to generated flux

fix(notification/check): use flux compatible duration type

test(notification/check): add task option to task definition

test(http): use check Duration in checks http handlers

feat(check): add TaskID to checks base

fix(notification/check): hack around issue with formatting ast package
wtih multiple files

test(check): create task when check is created

A lot of little changes had to happen as a result of this. This change
was rather painful.

feat(checks): add update and delete of task for check

fix(notifications/check): hack around the alerts package not being
available

test(kv): temporarily skip check tests while we merge the pr above
2019-08-15 15:07:09 -04:00
Michael Desa c355e62a27
Revert "feat(notification/check): convert threshold type" 2019-08-15 13:53:44 -04:00
Kelvin Wang d8a88e1865 feat(notification/check): convert threshold type 2019-08-15 12:11:22 -04:00
Russ Savage 8a5d0e6230
feat(templates): adding new templates, removing calls to create templates (#14631)
* adding new templates; removing calls to create templates

* fixing quickstart dashboard creation

* Type dashboard template

* bump templates repo version

* add templateID to template meta in swagger

* Add templateID to document meta type in UI

* add templateID to telegrafPlugin and telegrafplugin info types

* Instantiate templates from static templates

* Get tests to pass

* Fix type conflicts

* Bump templates version

* update changelog
2019-08-14 11:01:19 -07:00
Deniz Kusefoglu 17c40a75de
Visualize check view with check plot (#14599)
* Use CheckPlot to visualize check view

* Revert to add threshold types

* Disable view type dropdown in checkView

* Add proper equality

* Add errors in default cases
2019-08-08 12:25:58 -07:00
Jonathan A. Sternberg cb9d8eafe7
fix(http): use the content type header to determine how to parse http errors (#14596)
This will only attempt to parse an error as JSON if it has the content
type `application/json` so that it stops trying to parse the result as
JSON when it isn't JSON.

While the real error message is included, the addition of the "could not
parse json" makes it very confusing to read and distracts from the real
issue.
2019-08-08 14:23:43 -05:00
Andrew Watkins 7d9ec64eec
build(client): generate client on each build (#14591)
* chore: add new types for NotiicationRules

* build(client): remove client and build each build

* chore: update gitignore to exclude generated client

* fix: allow client dir to be empty

* docs: add README to client dir

* fix(build): add autogen client to eslintignore

* build: gen client for ci js tests
2019-08-07 13:42:35 -07:00
Lyon Hill e922c8a26f
feat(task): add task types (#14567) 2019-08-06 10:27:52 -06:00
zhulongcheng 17de20e80f fix(task): check ErrTaskNotFound err (#14489) 2019-08-06 10:17:30 -06:00
Jakub Bednář b6b5befad7
fix(http): The org parameter takes either the ID or Name interchangeably (#14540) 2019-08-06 06:20:26 +02:00
Deniz Kusefoglu bca1af25a9
feat: alerting - Add alert builder (#14550)
* Add check saving flows and change activeTab type

* Add first pass at alertBuilder

* Change TimeMachineEnum type

* Add xy view properties to checks, and convert to and from check View type

* Add Column Header to checks column

* Add change current check type action

* Access view type through properties

* Load xy view options for check view

* Add orgID to check in createCheck

* Clear current check on close CheckEO

* Create Check Alerting Button

* Create check view on edit and new check EO

* Fix edit check eo action bug

* Update threshold types

* When switch schedule from every to cron change the inputs that are visible

* save Current Check from VEO if view type is check

* Add description component to checks

* TimeMachineIDs to TimeMachineID

* Remove bracketed object decleration

* Remove as Threshold type

* Use ViewType instead of typeof

* Create CheckType type

* Remove time machine reducer tests

* Remove check view properties that come from xyView

* Fix EditCheck hooks

* Move status calculations to body of function

* Update redux store when performing check CRUD

* Create add and remove check actions in timeMachine

* Remove trailing space
2019-08-05 17:38:49 -07:00
Christopher Henn 5104cc1f11 fix(ui): handle rate limited and error Flux responses 2019-08-02 13:50:22 -07:00
Jade McGough 5d826961db feat(http): add checks http handler 2019-07-31 19:00:26 -04:00
George b2fe0d1d63
fix(tasks): surface flux errors on pre-auth check (#14492) 2019-07-31 11:46:28 +02:00
Christopher Henn 1250be5f80 refactor(ui): inline API type generation
Part of #14482
2019-07-30 09:35:05 -07:00
Deniz Kusefoglu bbc37b4c68
feat: Alerting add alert builder veo state (#14499)
* Define new check, edit check and check view routes with VEO

Co-authored-by: Michael Desa <mjdesa@gmail.com>

* Add task status to other task types

* Put editAlerting route behind feature flag

* add action and reducer for update current check

* Add init edit and new check editor overlay

* Split VEO in to two for new and edit view

* get edit and new CheckEO's ready

* Create getViewForTimeMachine action

* current check should be a partial check

* Fix view typing

* Fix linter errors

* Fix equality

* Catch save VEO errors
2019-07-29 15:54:35 -07:00
Chris Goller 837a410bea
feat(http): gzip compress the query CSV response. (#14495)
If client requests with Accept-Encoding: gzip, then
compress response and return with Content-Encoding: gzip.

This increases the server-side load by about 12%, but saves network bandwidth.

benchmark                     old ns/op     new ns/op     delta
Benchmark_Query_no_gzip-4     123609        137885        +11.55%

benchmark                     old allocs     new allocs     delta
Benchmark_Query_no_gzip-4     149            150            +0.67%

benchmark                     old bytes     new bytes     delta
Benchmark_Query_no_gzip-4     14297         15205         +6.35%
2019-07-29 14:47:55 -05:00
zhulongcheng ce4d5a9852 feat(http): patch notification rule 2019-07-28 22:08:23 +08:00
zhulongcheng 41a8174dca docs(http): patch notification rule
/notificationRules/{ruleID}
2019-07-28 22:04:04 +08:00
Alirie Gray 7b96bd95f0 test(tasks): fix cypress tests for task creation with token 2019-07-26 09:51:33 -07:00
Alirie Gray c04f3a2b30 chore(tasks): remove old auth code and allow only token auth 2019-07-26 09:51:32 -07:00
Kelvin Wang dcda49d1d0 feat(http): add notification rule handler 2019-07-25 15:15:35 -04:00
Kelvin Wang de7f5dd8e0 fix(http): replace patch n rule to put 2019-07-25 15:15:35 -04:00
Deniz Kusefoglu 613aef698f
Add alerting cards (#14429)
* bump to client 0.5.3

* export Query type from client and create alerting mock

* Bump client to 0.5.5

* Merge all status enums to one type

* Fix threshold visualization types

* Add extra underscore to notification rules

* Use check view type from client

* Add description field to checks, notificationrules and endpoints

* Add init check cards

* Add check card actions

* Correct component name

* Add check card context and toggle

* Add id to notification rule base

* Add notification rule cards

* add checks reducer tests

* user immer for checks reducer

* add tests and immer to notification rule reducer
2019-07-24 00:34:42 -07:00
Jorge Landivar 47cd6df834 fix(http): task runs and logs no longer use task token (#14416)
* fix(http): task runs and logs no longer use task token

* test(http): skip session tests

These tests are not using checking authorization correctly.
2019-07-23 10:31:39 -05:00
Jorge Landivar 9dd27067e8
Merge pull request #14009 from influxdata/cancel-runs-schema
chore(tasks): add swagger for canceling task runs
2019-07-23 02:55:06 -05:00
Deniz Kusefoglu e399e656ce
Fix aggregate window: change name parameter to period (#14407) 2019-07-22 13:39:31 -07:00
Jonathan A. Sternberg 47b032464f
refactor(query): handle flux errors in the query controller instead of http (#14368)
If we handle the flux errors in the query controller, it makes it so we
are handling the errors in the location where the happen rather than at
a layer further up the stack.

This should simplify it so the errors are handled in this single
location instead.
2019-07-18 11:43:15 -05:00
Deniz Kusefoglu 6e77b64da9
Fix dashboard query swagger definition to reflect reality (#14370) 2019-07-17 19:23:51 -07:00
Deniz Kusefoglu cd4b048ac7
Fix alert types and discriminators (#14358)
* Add discriminator and enum to check types

* Add threshold discriminators and type enum

* Add notification rule discriminators and type enum

* Remove description field

* Fix reference to threshold base

* Move types to ViewBase type from each View Property

* Fix view properties

* Add monotonex to swagger options

* Add empty to view types

* remove whitespace
2019-07-17 11:15:01 -07:00
kelwang 99bfd05820
Merge pull request #14339 from influxdata/add_debug_log
feat(http): add auth debug log
2019-07-15 17:08:41 -04:00
Deniz Kusefoglu b03e887c37
Fix alerts swagger (#14348)
* Convert operators to strings

* Change queries to query

* fix Check types

* fix notification rules

* fix notification endpoints
2019-07-15 14:07:22 -07:00
Alirie Gray c7f09d6a56
chore(tasks): use pointers for task errors (#14343) 2019-07-15 13:57:51 -07:00
kelwang d45bd1bb83
Merge pull request #14344 from influxdata/auth_create_user_fix
fix(http): fixed auth userid overwrite
2019-07-15 14:19:34 -04:00
Kelvin Wang b4eb32c222 fix(http): fixed auth userid overwrite 2019-07-15 14:06:02 -04:00
Jonathan A. Sternberg 63aeff31b1
feat(http): handle flux errors that are returned from the query service (#14338)
Flux errors that are returned from the query service will be adapted to
an influxdb.Error and then will be written to HTTP correctly.
2019-07-15 12:50:53 -05:00
Kelvin Wang f55cf4c8b3 feat(http): add auth debug log 2019-07-15 12:09:59 -04:00
Deniz Kusefoglu e9081d68a4
WIP Add alerts and notification swagger definitions (#14324)
* Rename check schema to healthcheck

* add alert schema and endpoints

* Add checkView as a view type


Co-Authored-By: Jade McGough <jademcgough@users.noreply.github.com>
2019-07-12 14:34:36 -07:00
Kelvin Wang 1681e3b801 fix(http): use the original error code 2019-07-05 12:34:00 -04:00
Kelvin Wang 0b03ce0e0b fix(http): query handler conflict 2019-06-27 19:16:54 -04:00
kelwang c4fd4d7986
Merge pull request #14213 from influxdata/error_encode_interface
Error encode interface
2019-06-27 18:03:59 -04:00
Christopher M. Wolff cc5afac422
fix(http): add org ID to flux handler (#14225) 2019-06-27 14:33:22 -07:00
Kelvin Wang 9ecada4dce feat(http): convert errorEncode to use interface 2019-06-26 21:41:01 -04:00
Luke Morris 701501d00d feat(http/me): oauthID could in theory be updated 2019-06-26 14:42:29 -07:00
Palak Bhojani b67ea62562 Add oauthID to the user interface instead of session 2019-06-26 11:45:34 -07:00
Luke Morris 1c3b92dacb feat(http/me): name type according to semantics 2019-06-26 11:45:34 -07:00
Luke Morris 03f6d0e521 feat(http/me): name function according to semantics 2019-06-26 11:45:34 -07:00
Luke Morris 225586f83f feat(me): return oauth id with user object 2019-06-26 11:45:34 -07:00
Chris Goller 14e7daa6e4
fix client tracing propagation from doubly recording (#14204)
Closes #14203

* chore(vendor): update to opentracing 1.1.0

* fix(http): finish client span

* fix(http): remove extra span injection
2019-06-26 00:48:15 -05:00
lisale0 1d6a0c5a3c fix pr 2019-06-21 11:55:28 -07:00
lisale0 6206b905a4 set va directly and remove comment 2019-06-20 16:30:25 -07:00
lisale0 63bc965606 fix findvar test 2019-06-20 16:25:38 -07:00
lisale0 8c045ad08a gofmt 2019-06-20 16:25:38 -07:00
lisale0 3d18984c70 fix tests 2019-06-20 16:25:38 -07:00
lisale0 2187bf345b fixed bolt and inmem tests 2019-06-20 16:25:38 -07:00
Jade McGough 2cd14c7cdb fix failures in variable http testing 2019-06-20 16:25:38 -07:00
lisale0 3330d38984 feat(http): adding createdAt variable 2019-06-20 16:25:38 -07:00
Adam e4fbaa61e3 Merge remote-tracking branch 'origin/master' into flux-staging 2019-06-18 16:14:00 -04:00
Christopher Wolff 67236ea887 refactor(http): make http.Query use FluxCompiler when query is passed as text 2019-06-18 11:45:17 -07:00
Alirie Gray 66157c9d44 chore(tasks): consolidate task errors into task_errors.go 2019-06-17 16:03:18 -07:00
kelwang 869b29da18
Merge pull request #14071 from zhulongcheng/rename-OrgID
fix(http): rename OrgID to orgID
2019-06-13 12:16:24 -04:00
Alirie Gray 0ae2d318b1 chore(tasks): update run limits in swagger and FindRuns 2019-06-12 14:48:32 -07:00
Lyon Hill b7078f5510
fix(task): Ensure tasks clean up user resource maps (#14109)
* fix(task): Ensure tasks clean up user resource maps
fixes #14108
2019-06-11 10:28:09 -06:00
Christopher Wolff 950d84fee4 chore: skip flaky test
https://github.com/influxdata/influxdb/issues/14108
2019-06-11 08:41:13 -07:00
Alirie Gray 04a427e99e feat(tasks): add runID to Log struct 2019-06-06 11:24:38 -07:00
Lyon Hill ab79b68840
fix(task): Remove older unused task store code. (#14068)
* fix(task): Remove older unused task store code.
2019-06-06 10:05:27 -06:00
zhulongcheng 5f1e070a73 fix(http): rename OrgID to orgID 2019-06-06 22:12:32 +08:00
Kelvin Wang 18a0f3f542 fix(influxdb): rename telegraf orgID 2019-06-03 16:20:53 -04:00
docmerlin (j. Emrys Landivar) 15bacd4e60 chore(tasks): add swagger for canceling task runs 2019-05-29 11:28:20 -05:00
kelwang cccdae2421
Merge pull request #13977 from influxdata/org_audit_log
feat(influxdb): add org create and update time
2019-05-28 16:51:18 -07:00
Jade McGough 278da443e6
fix(http): remove accept header from query request swagger (#13625) 2019-05-28 14:44:27 -07:00
Jorge Landivar e6ae9f6231
Fix path: 2019-05-28 16:26:49 -05:00
Jorge Landivar ecd9200302
chore(swagger): fix a few swagger typos 2019-05-28 16:12:44 -05:00
docmerlin (j. Emrys Landivar) 935640cf99 chore(swagger): update swagger to include operationId 2019-05-28 09:24:04 -05:00
Jade McGough 062c02ff8d chore(swagger): split view properties by type 2019-05-24 16:27:56 -07:00
Kelvin Wang b8c2cd6c05 feat(influxdb): add org create and update time 2019-05-20 17:36:29 -07:00
Brandon Farmer ba148f3461 Fix Task schema error, currently preventing client generation 2019-05-20 10:19:11 -07:00
kelwang b4a55d500a
Merge pull request #13889 from zhulongcheng/id-decode-err
fix(influxdb): use influxdb.Error in ID.Decode
2019-05-19 13:55:21 -04:00
Alirie Gray 576da8f9d2 fix(swagger): add log property to task runs endpoint docs 2019-05-17 14:08:10 -07:00
Kelvin Wang 57ceb9e275 feat(influxdb): bucket created and updated time 2019-05-17 11:49:10 -04:00
kelwang 4bbfa8c6f4
Merge pull request #13552 from influxdata/kv_log_time
feat(http): add audit log
2019-05-16 11:10:56 -04:00
Kelvin Wang f75f27c0bd feat(http): add audit log 2019-05-16 10:57:28 -04:00