Commit Graph

55 Commits (eacc1b0d9cf831fd328eb218f8b09459f68668db)

Author SHA1 Message Date
Brandon Farmer f61fe82708 fix(influxdb): Always return user status 2019-09-24 15:19:16 -07: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
Jade McGough d147874c1e
fix(kv): mock system buckets (#14884) 2019-08-30 12:47:06 -07: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
Kelvin Wang 9ecada4dce feat(http): convert errorEncode to use interface 2019-06-26 21:41:01 -04:00
Kelvin Wang 57ceb9e275 feat(influxdb): bucket created and updated time 2019-05-17 11:49:10 -04:00
Jade McGough c27a96da9a
chore(http): surface unmarshaling failures in tests (#13855) 2019-05-08 12:51:03 -07:00
Kelvin Wang 7a72c363f2 remove org from bucket 2019-04-22 18:39:05 -04:00
kelwang be674622c6
Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
zhulongcheng cacd6a8223 fix(inmem): replace inmem.Service with kv.Service 2019-04-08 15:18:38 +08:00
Chris Goller 831d5110f4 fix(http): update bucket write links to include org/bucket 2019-03-11 13:46:16 -05:00
Chris Goller 83c43e7173 fix(http): log endpoint should be logs 2019-03-11 12:45:25 -05:00
zhulongcheng 111ed7767d docs(http): add members/owners links 2019-03-07 10:56:36 +08:00
zhulongcheng ef308ab9bd feat(http): construct org handler by OrgBackend 2019-02-06 19:18:23 +01:00
zhulongcheng e29f925679 feat(http): construct bucket handler by BucketBackend 2019-02-06 19:18:23 +01:00
Kelvin Wang 79ce30691e update(http): remove kerrors, change the default to be influxdb error 2019-01-25 10:29:26 -08:00
Jade McGough 8a1d7ba1ba
Labels v2 (#11198)
* WIP first-class endpoint for labels

* WIP

* WIP

* add all the boilerplate

* fix boltdb

* fix http label test

* fix test

* WIP

* fix test failures

* reenable all tests

* add failing test for label mappings

* add label mapping bolt bucket

* implement resource -> label mapping fn

* add inmem label mapping

* delete label mappings

* remove unused stuff

* add missing functions

* add POST endpoint for labels

* add GET route for label

* delete label endpoint

* add label patch endpoint

* remove commented code

* add label service to api handler

* update comment

* add FindLabelByID test

* use platform.Error

* change path name

* formatting

* remove label patch from swagger

* avoid potential orphaned mapping bug

* guard against creating label mappings from nonexistent labels

* update swagger

* update swagger

* update swagger

* fix swagger indentation

* update swagger
2019-01-18 11:03:36 -08:00
Michael Desa 460b758f8e test(http): ensure bucket service tests have appropriate services set 2019-01-16 20:09:03 -05:00
Mark Rushakoff d73d73c0d4 chore: rename imports from platform to influxdb
I did this with a dumb editor macro, so some comments changed too.

Also rename root package from platform to influxdb.

In interest of minimizing risk, anyone importing the root package has
now aliased it to "platform" so that no changes beyond imports were
necessary in those files.

Lastly, replace the old platform module to local path /dev/null so that
nobody can accidentally reintroduce a platform dependency while
migrating platform code to influxdb.
2019-01-09 20:51:47 -08:00
Jade McGough 6a2554d6db test json formatting 2019-01-03 16:46:47 -08:00
Jade McGough a80a86c6c2 chore(http): add labels to bucket tests 2019-01-03 16:10:16 -08:00
Jade McGough 815795261d feat(http): add labels to bucket responses 2019-01-03 16:02:02 -08:00
Jade McGough 7562c9a6d2
chore(http): make test diffs more readable (#2203)
* chore(http): make test diffs more readable

* fixes

* add back telegraf output spacing

* whitespace hell

* jsonEqual2 -> jsonEqual
2019-01-03 14:29:22 -08:00
Michael Desa 158be4b599
Merge pull request #1993 from zhulongcheng/fix-user-service
fix(http): pass user service to handler New function
2018-12-21 09:37:42 -05:00
Leonardo Di Donato e66db43f95 chore(http): simplify bucket test
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-12-21 09:56:23 +01:00
zhulongcheng 4e964ecb63 add tests for bucket member 2018-12-17 23:59:30 +08:00
zhulongcheng dcac51377e pass user service to handler New function 2018-12-17 23:59:30 +08:00
zhulongcheng 75ce16b633 make prev/next links omitempty 2018-12-13 00:16:24 +08:00
zhulongcheng 6d27a08208 flatten paging links 2018-12-12 23:25:07 +08:00
zhulongcheng cb8f7a1744 add /buckets endpoint paging links 2018-12-09 23:27:18 +08:00
Jade McGough 8c961e12bb
Labels (#1668)
* feat(platform): add label struct

* feat(platform): add label service interface

* WIP label service

* chore(http): simplify URMapping validation

* WIP label service skeleton

* add new GET labels handler

* feat(http): add POST handler for label service

* feat(http): add label delete handler

* fix json tag

* add happy path testing

* feat(http): add label endpoints to dashboard service

* make fmt

* add label delete handler

* make fmt again :(

* feat(bolt): add label implementation

* wire boltdb implementation of labels

* feat(mock): add mock for label service

* fix tests, add delete test

* add remaining tests, flesh out GET params

* unused code

* remove comments

* add labels endpoints

* clean up labels after deleting a dashboard

* fix issues from code review

* WIP remove type from labels

* feat(http): add label cli functions

* fixes

* make fmt

* feat(http): add labels to tasks and buckets

* feat(bolt): remove labels if their resources are deleted

* remove bolt cleanup for now

* make fmt

* type conversion magic

* feat(inmem): implement label service

* prevent race conditions

* remove labels from inmem if their resources are deleted

* fix race condition

* fix formatting
2018-12-03 08:07:08 -08:00
Jade McGough 873aae3fad
Revert "feat(http): add label service" (#1667)
This reverts commit 70a430c599.
2018-12-03 04:27:27 -08:00
Jade McGough 70a430c599
feat(http): add label service (#1346) 2018-11-30 21:08:35 -08:00
kelwang 6db9acc951
Revert "Revert "convert /buckets endpoint error to platform error "" 2018-11-30 13:27:40 -05:00
kelwang 2a57dc1970
Revert "convert /buckets endpoint error to platform error " 2018-11-29 12:02:32 -05:00
Kelvin Wang 232d9d71e3 fix(http): fix bucket errors 2018-11-29 09:58:56 -05:00
Michael Desa 7227bf8fa2 feat(platform): add operation log for resources
feat(platform): add dashboard operation log interface

feat(bolt): add dashboard operation log to bolt client

feat(platform): add links to dashboard load response

fix(http): update links in json response of dashboards

feat(bolt): add operation logs for each resource

feat(http): add routes for operation logs

feat(cmd/influxd): set operation logs on http api backend
2018-11-02 14:21:14 -04:00
Andrew Watkins f82eeb8338
feat(orgs): update org bucket name and retention rule (#1181)
* Add error handling to spinner

* Fix broken test

* Update retentionPeriod to retentionRules

* fix(http): bucket retention period now empty

Co-authored-by: Chris Goller <goller@gmail.com>

* fix(bucket): remove bucket key from createBucket API

* feat(bucket): update organization buckets

* fix: coerce Bucket type

* chore: create separate components for bucket create / update
2018-10-25 15:23:05 -07:00
Chris Goller a6355c5442 feat(http): buckets now have multiple retention rules 2018-10-23 08:18:31 -05:00
Jade McGough 9180e13093 fix(http): add zero value mock implementation of u/r mapping service 2018-10-16 15:14:16 -07:00
Chris Goller 2bea48f15a refactor(testing): rename MustIDFromString to MustIDBase16 2018-10-11 09:54:19 -05:00
Leonardo Di Donato 3ebc6548e3 fix(bolt/source): insert missing organization IDs
Before was working since 0 ids (eg., organization ID of empty source
istances) were valid ones. Not anymore.
2018-10-11 09:54:18 -05:00
Leonardo Di Donato d54fdd51e0 wip(http): porting to uint64 IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-10-11 09:54:18 -05:00
Leonardo Di Donato 9fa032da28 fix(http): refactoring to support uint64 platform.IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Co-Authored-By: Lorenzo Fontana <lo@linux.com>
2018-10-11 09:54:18 -05:00
Lorenzo Fontana 1a2f606533
Convert everything to /api/v2
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2018-09-28 14:23:21 +02:00
Lorenzo Fontana aa8016feca
Convert tests to v2
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2018-09-28 14:20:31 +02:00
Chris Goller 916b5f49a5 feat(http) add microsecond and nanosecond durations 2018-09-25 15:15:06 -05:00
Chris Goller e936671c67 feat(http): buckets now use duration strings 2018-09-25 13:22:47 -05:00
Chris Goller 31a2ed1fbb feat(testing): add service testing helpers 2018-09-14 21:08:49 -05:00