add retention policy name to bucket
parent
ffe645d6e2
commit
fc382defb8
11
bucket.go
11
bucket.go
|
@ -7,11 +7,12 @@ import (
|
|||
|
||||
// Bucket is a bucket. 🎉
|
||||
type Bucket struct {
|
||||
ID ID `json:"id,omitempty"`
|
||||
OrganizationID ID `json:"organizationID,omitempty"`
|
||||
Organization string `json:"organization,omitempty"`
|
||||
Name string `json:"name"`
|
||||
RetentionPeriod time.Duration `json:"retentionPeriod"`
|
||||
ID ID `json:"id,omitempty"`
|
||||
OrganizationID ID `json:"organizationID,omitempty"`
|
||||
Organization string `json:"organization,omitempty"`
|
||||
Name string `json:"name"`
|
||||
RetentionPolicyName string `json:"rp,omitempty"` // This to support v1 sources
|
||||
RetentionPeriod time.Duration `json:"retentionPeriod"`
|
||||
}
|
||||
|
||||
// BucketService represents a service for managing bucket data.
|
||||
|
|
|
@ -114,14 +114,16 @@ const tagsetFilter = (filter: SchemaFilter[]): string => {
|
|||
return `|> filter(fn: (r) => ${predicates.join(' and ')} )`
|
||||
}
|
||||
|
||||
const metaQuery = async (source: Source, script: string) => {
|
||||
const metaQuery = async (source: Source, query: string) => {
|
||||
const url = source.links.query
|
||||
const type = "flux"
|
||||
try {
|
||||
const response = await AJAX({
|
||||
method: 'POST',
|
||||
url,
|
||||
data: {
|
||||
script,
|
||||
type,
|
||||
query,
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
@ -45,8 +45,9 @@ func (s *BucketService) FindBuckets(ctx context.Context, filter platform.BucketF
|
|||
}
|
||||
b := &platform.Bucket{
|
||||
// TODO(desa): what to do about IDs?
|
||||
RetentionPeriod: d,
|
||||
Name: fmt.Sprintf("%v.%v", db.Name, rp.Name),
|
||||
RetentionPeriod: d,
|
||||
Name: db.Name,
|
||||
RetentionPolicyName: rp.Name,
|
||||
}
|
||||
|
||||
bs = append(bs, b)
|
||||
|
|
Loading…
Reference in New Issue