Skip to content

Commit

Permalink
Merge branch 'master' into feat/default-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
sranka authored Jun 19, 2020
2 parents 0f9ebbe + eede991 commit f2a54f1
Show file tree
Hide file tree
Showing 5 changed files with 674 additions and 1,192 deletions.
26 changes: 0 additions & 26 deletions api/buckets.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ type BucketsApi interface {
RemoveOwner(ctx context.Context, bucket *domain.Bucket, user *domain.User) error
// RemoveOwner removes a member with id memberId from a bucket with bucketId.
RemoveOwnerWithId(ctx context.Context, bucketId, memberId string) error
// GetLogs returns operation log entries for a bucket, with the specified paging. Empty pagingOptions means the default paging (first 20 results).
GetLogs(ctx context.Context, bucket *domain.Bucket, pagingOptions ...PagingOption) (*[]domain.OperationLog, error)
//GetLogsWithId returns operation log entries for bucket with id bucketId, with the specified paging. Empty pagingOptions means the default paging (first 20 results).
GetLogsWithId(ctx context.Context, bucketId string, pagingOptions ...PagingOption) (*[]domain.OperationLog, error)
}

type bucketsApiImpl struct {
Expand Down Expand Up @@ -298,25 +294,3 @@ func (b *bucketsApiImpl) RemoveOwnerWithId(ctx context.Context, bucketId, member
}
return nil
}

func (b *bucketsApiImpl) GetLogs(ctx context.Context, bucket *domain.Bucket, pagingOptions ...PagingOption) (*[]domain.OperationLog, error) {
return b.GetLogsWithId(ctx, *bucket.Id, pagingOptions...)
}

func (b *bucketsApiImpl) GetLogsWithId(ctx context.Context, bucketId string, pagingOptions ...PagingOption) (*[]domain.OperationLog, error) {
params := &domain.GetBucketsIDLogsParams{}
options := defaultPaging()
for _, opt := range pagingOptions {
opt(options)
}
params.Limit = &options.limit
params.Offset = &options.offset
response, err := b.apiClient.GetBucketsIDLogsWithResponse(ctx, bucketId, params)
if err != nil {
return nil, err
}
if response.JSONDefault != nil {
return nil, domain.DomainErrorToError(response.JSONDefault, response.StatusCode())
}
return response.JSON200.Logs, nil
}
6 changes: 0 additions & 6 deletions client_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,6 @@ func TestBuckets(t *testing.T) {
err = bucketsApi.RemoveOwnerWithId(ctx, "000000000000000", *userOwner.Id)
assert.NotNil(t, err)

// No logs returned https://github.com/influxdata/influxdb/issues/18048
//logs, err := bucketsApi.GetLogs(ctx, b)
//require.Nil(t, err, err)
//require.NotNil(t, logs)
//assert.Len(t, *logs, 0)

// Test members
userMember, err := client.UsersApi().CreateUserWithName(ctx, "bucket-member")
require.Nil(t, err, err)
Expand Down
Loading

0 comments on commit f2a54f1

Please sign in to comment.