Commit Graph

154 Commits (ba5dc411df19a3817b0bace15e3e1f05a06cec7c)

Author SHA1 Message Date
Michael Desa 9cccf32452
fix(kv): Create/Update/Delete check tasks in transaction 2019-08-26 07:55:43 -04:00
Lyon Hill cce5ed74ea
fix(task): fix failover function for task auth to not fail (#14789)
If a task is created and the auth associated is removed
lookup of tasks currently fail. This is bad behavior.
We should expect to be able to at least see and delete task's that
have old auth.
2019-08-23 16:52:55 -06:00
Lyon Hill 0778f90cfc
fix(task): Remove unnecessary auth lookups (#14733)
* fix(task): Remove unnecessary auth lookups

Currently we look up task authorization for all task lookups even if we are only
looking up the task for internal use's. We can keep the same interface but cutdown
on the amount of lookups we do by using seperate internal functions for task lookup
and task with id lookup
2019-08-21 15:56:33 -06:00
Jade McGough 4523064b6d
fix(kv): check createdat and updatedat should be identical (#14699) 2019-08-20 14:16:40 -07: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
Michael Desa bef3de49fa
fix(notification/rule): remove println and add json struct tag for http 2019-08-19 11:57:59 -04: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
Kelvin Wang bbb4fbc50d fix(notification/check): remove authorizationID 2019-08-16 00:00:55 -04:00
Kelvin Wang 43fa754087 fix(kv): fix extra \x00 secret decoding 2019-08-15 21:56:20 -04:00
Kelvin Wang 61628671ed feat(kv): add notification endpoint
Co-authored-by: Jade McGough <jade@thezets.com>
2019-08-15 21:56:18 -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
Kelvin Wang f3dcdee504 fix(notification/rule): remove authID requirement 2019-08-15 19:31:45 -04:00
Lyon Hill f4fb6a1753
fix(task): Unify task scheduling across create and query (#14668)
Current behavior is that the first execution of a task happens based on the create time
of the task when using a 'every' schedule. If you create a task at 12:02 and want
the task to run every 15m. The first execution would happen at 12:17, and the 2nd would happen
at 12:30.

To fix this behavior I refactored the kv task to give a single source of knowledge.
We now have one function for finding exactly what the last scheduled task was.
We also now have a single method that calculates when the next schedule is due.
By unifying the logic it should always work the same way weather your asking when to run
or when creating a task.
2019-08-15 15:28:35 -06: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
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
Jade McGough 0e5091ed21 feat(kv): add check kv 2019-07-31 18:52:13 -04:00
kelwang ab241b1332
Merge pull request #11741 from influxdata/task-members
fix: task members endpoints
2019-07-29 11:30:06 -04:00
Jade McGough 254680f094 fix(kv): add task organization ID lookup 2019-07-28 22:07:03 -07:00
zhulongcheng ce4d5a9852 feat(http): patch notification rule 2019-07-28 22:08:23 +08: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 aaa84617d8 feat(kv): add notification rule kv 2019-07-25 15:15:35 -04:00
Alirie Gray a73d9a2b77
refactor(tasks): remove Checker from KV Service struct (#14367) 2019-07-17 15:21:16 -07:00
Alirie Gray 2202b61032
feat(tasks): add health check to kv service (#14364) 2019-07-17 11:24:50 -07:00
Alirie Gray c7f09d6a56
chore(tasks): use pointers for task errors (#14343) 2019-07-15 13:57:51 -07:00
Lyon Hill c8becfd4a2
feat(task): Create a new task executor for the new modular scheduler (#14252)
* feat(task): create new executor for modular scheduler
2019-07-08 08:13:29 -06: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
Alirie Gray 66157c9d44 chore(tasks): consolidate task errors into task_errors.go 2019-06-17 16:03:18 -07:00
Lyon Hill 411d904b64
fix(task): bug when urm's are left in the database for task lookup (#14141)
* fix(task): allow us to skip tasks with crufty maps
2019-06-14 16:21:38 -06: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
Alirie Gray 04a427e99e feat(tasks): add runID to Log struct 2019-06-06 11:24:38 -07:00
Kelvin Wang 18a0f3f542 fix(influxdb): rename telegraf orgID 2019-06-03 16:20:53 -04:00
Kelvin Wang b8c2cd6c05 feat(influxdb): add org create and update time 2019-05-20 17:36:29 -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
Kelvin Wang b18fa5b5b5 fix(kv): updatedAt should be updated as well 2019-05-18 23:36:48 -04:00
kelwang 7683fbc662
Merge pull request #13954 from influxdata/bucket_audit_log
feat(influxdb): bucket created and updated time
2019-05-17 14:20:19 -04:00
kelwang 497a813044
Merge pull request #13629 from zhulongcheng/upd-org-desc
feat(http): update org description
2019-05-17 12:36:45 -04:00
Kelvin Wang 57ceb9e275 feat(influxdb): bucket created and updated time 2019-05-17 11:49:10 -04:00
Kelvin Wang 4408d0c82d fix(kv): due to merged conflict 2019-05-16 11:30:36 -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
zhulongcheng 8d5c7d33a7 feat(http): update org description 2019-05-16 22:33:14 +08:00
Iris Scholten 2e26f23f9e
feat(authentication): Add cli args for specifying session length and renewal (#13924)
Co-authored-by: Jade McGough <jade@influxdata.com>

* Add session renew option to launcher and use in middlewhere
* pass session options to services
* Update SessionAutoRenew to SessionRenewDisabled
* Add test for service constructor defaults
* Update changelog
2019-05-15 10:16:47 -07:00
zhulongcheng 3c1e9ee5f3 fix(influxdb): use influxdb.Error in ID.Decode 2019-05-15 22:53:31 +08:00
Jade McGough c6a0bf93a7
Merge pull request #13661 from influxdata/no_filter_parameters_provided
fix(influxdb): invalid filter error
2019-05-09 15:14:54 -07:00
Alirie Gray 77934b01c6 feat(tasks): add description field to tasks 2019-05-08 13:39:09 -07:00
Lyon Hill e4b69914c9
feat(task): Track queue duration (#13805)
* feat(task): Track queue duration
Track the time it takes for a task to go from it's dueAt time until it actually starts
2019-05-07 10:03:30 -06:00
Chris Goller 510f7bb057 fix(task): lookup fully hydrated task after creation (#13709)
* fix(task): lookup fully hydrated task after creation

* ci(circle): save go race and litmus test results artifact
2019-05-01 14:54:27 -06:00
Kelvin Wang ea54e2c2c8 fix(kv): fix empty org name 2019-04-26 18:16:28 -04:00
Kelvin Wang 2021321186 fix(influxdb): invalid filter error 2019-04-26 12:22:42 -04:00
Kelvin Wang 717fcc44b3 feat(influxdb): add scraper filter 2019-04-25 11:33:34 -04:00
Kelvin Wang 76cc27751b feat(influxdb): add bucket desc 2019-04-24 11:20:05 -04:00
Kelvin Wang 7a72c363f2 remove org from bucket 2019-04-22 18:39:05 -04:00
Kelvin Wang 9d44ac3635 rename bucket organization to org 2019-04-22 18:39:01 -04:00
Lyon Hill 5b8c4ea0e8
fix task limit in kv and add tests Also fix a minor race condition in task scheduler (#13538)
* fix task limit in kv and add tests Also fix a minor race condition in task scheduler

* update comment
2019-04-22 13:09:19 -06:00
Lyon Hill 726fbefe9a
Integrate the new changes to tasks (#13473)
* Integrat the new changes to tasks
2019-04-19 08:37:59 -06:00
Lyon Hill 9a41cc46e4
Create an analytical storage middleware layer (#13418)
* Create an analytical storage middleware layer
2019-04-17 08:41:05 -06:00
Jade McGough 5a1ae7c704 Revert "fix(http): remove view ID"
This reverts commit 1c6bdb6c3e.
2019-04-15 15:00:40 -07:00
zhulongcheng d5917878d0 feat(http): find auths by org 2019-04-14 18:06:19 +08:00
zhulongcheng 1c6bdb6c3e fix(http): remove view ID 2019-04-14 12:31:35 +08:00
zhulongcheng 30c86649f7 fix(http): return an empty list of labels if not found 2019-04-12 21:39:46 +08:00
Jade McGough cfd521b47a fix label tests 2019-04-12 01:29:49 -07:00
Jade McGough 2f1e9ddc29 fix label filter logic 2019-04-12 01:29:42 -07:00
Jade McGough 81e6a7116b feat(http): filter label response by organization 2019-04-12 01:29:32 -07:00
Kelvin Wang 92e82884a6 feat(http): accept label id for template post 2019-04-11 13:16:39 -04:00
kelwang 67bf2f54ac
Merge pull request #13052 from influxdata/auth_update_interface
fix(influxdb): updated auth shall return
2019-04-11 11:24:02 -04:00
Lyon Hill c29e77e6e4
build kv based TaskService (#13228)
* chore(tasks): task kv

* WIP

* get the kv task service complete and passing test
2019-04-09 16:52:54 -06:00
Kelvin Wang 8a825a8f9f feat(influxdb): get docs by org id 2019-04-04 12:51:30 -04:00
Kelvin Wang 054ce89dc5 fix(kv): fix bucket not found by name 2019-04-02 15:10:56 -04:00
Kelvin Wang 712010d013 if(influxdb): updated auth shall return 2019-04-01 12:56:29 -04:00
Kelvin Wang a2c0bdbe77 feat(kv): add new update 2019-03-28 11:46:41 -04:00
Kelvin Wang 6cde9a8c60 fix(http): fix doc label not found error 2019-03-27 13:00:07 -04:00
kelwang 0b2a09a5e2
Merge pull request #12868 from influxdata/document_id_not_found
fix(http): fix template not found error
2019-03-27 11:36:08 -04:00
Michael Desa 0fd01ffebd
fix(kv): add labels when creating/updating documents 2019-03-26 14:53:35 -07:00
Kelvin Wang dac4167875 fix(http): fix template not found error 2019-03-26 16:03:31 -04:00
Jade McGough 2b7ec27960 feat(kv/label): create/delete user resource mappings for labels 2019-03-19 06:15:19 -07:00
Jade McGough b2775ef9da feat(labels): allow label names to be updated 2019-03-15 16:24:23 -07:00
Michael Desa afcfb10859
Merge pull request #12459 from influxdata/fix/orphaned-buckets
fix(kv): deleted organizations leave orphaned buckets
2019-03-08 11:28:10 -08:00
kelwang e78b34b799
Merge pull request #12456 from influxdata/bucket_update_issue
fix(kv): fix bucket update issue
2019-03-08 13:44:04 -05:00
Michael Desa a3245886a4
fix(kv): deleted organizations leave orphaned buckets 2019-03-08 10:35:39 -08:00
Russ Savage 83614f94d7
Minor text updates for password error and default scraper name (#12448)
* updating password length message
* updating default scraper name
* updating password error in a few more places; fixed tests
2019-03-08 09:12:59 -08:00
Kelvin Wang fb6e3b3a5f fix(kv): fix bucket update issue 2019-03-08 11:36:05 -05:00
Jacob Marble e2608ba50c fixes after rebase 2019-03-07 12:12:31 -07:00
Jacob Marble 603a1f26e0 use tracing.StartSpanFromContext 2019-03-07 12:12:31 -07:00
Jacob Marble 9541e861a3 goimports -w -local github.com/influxdata/influxdb 2019-03-07 12:12:31 -07:00
Jacob Marble 92fa813c45 add spans to multiple services 2019-03-07 12:12:31 -07:00
Michael Desa c143694c4e
fix(kv): grant user union of their tokens and urms perms 2019-03-07 08:42:21 -08:00
Michael Desa 2687b7fd61
feat(influxdb): add support for templates
feat(influxdb): add generic store for documents

feat(influxdb): support authorizations in document store

feat(influxdb): support orgs in user resource mapping

feat(influxdb): add read-only included field on documents

feat(influxdb): add labels support to documents service

fix(influxdb): rename data field to content on documents

feat(influxdb): add with org id options for document store

feat(http): add templates swagger

feat(influxdb): add documentation to document options

doc(kv): add documentation for kv document store

test(kv): pull document tests in to the testing package

fix(http): fix swagger specification of templates endpoints
2019-03-06 13:18:31 -08:00
Kelvin Wang 2fa517c19c fix(testing): update bucket update uniqueness 2019-03-06 10:17:56 -05:00
Chris Goller 8a104eba28
Merge pull request #12102 from zhulongcheng/empty-op-log
fix(http): return an empty list of operation logs if not found
2019-02-25 11:49:01 -06:00
Michael Desa 65be548a58
feat(kv): make user owner of org/dashboard on create 2019-02-22 14:04:01 -05:00
zhulongcheng ad1bab1a3c fix(http): return an empty list of operation logs if not found 2019-02-22 14:18:13 +08:00
Chris Goller 1ec7b69d85 fix(kv): error org search if neither name nor id is set 2019-02-21 11:18:08 -08:00