add retention policy name to bucket

pull/10616/head
Michael Desa 2018-08-02 16:55:51 -04:00 committed by Andrew Watkins
parent ffe645d6e2
commit fc382defb8
3 changed files with 13 additions and 9 deletions

View File

@ -11,6 +11,7 @@ type Bucket struct {
OrganizationID ID `json:"organizationID,omitempty"` OrganizationID ID `json:"organizationID,omitempty"`
Organization string `json:"organization,omitempty"` Organization string `json:"organization,omitempty"`
Name string `json:"name"` Name string `json:"name"`
RetentionPolicyName string `json:"rp,omitempty"` // This to support v1 sources
RetentionPeriod time.Duration `json:"retentionPeriod"` RetentionPeriod time.Duration `json:"retentionPeriod"`
} }

View File

@ -114,14 +114,16 @@ const tagsetFilter = (filter: SchemaFilter[]): string => {
return `|> filter(fn: (r) => ${predicates.join(' and ')} )` 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 url = source.links.query
const type = "flux"
try { try {
const response = await AJAX({ const response = await AJAX({
method: 'POST', method: 'POST',
url, url,
data: { data: {
script, type,
query,
}, },
}) })

View File

@ -46,7 +46,8 @@ func (s *BucketService) FindBuckets(ctx context.Context, filter platform.BucketF
b := &platform.Bucket{ b := &platform.Bucket{
// TODO(desa): what to do about IDs? // TODO(desa): what to do about IDs?
RetentionPeriod: d, RetentionPeriod: d,
Name: fmt.Sprintf("%v.%v", db.Name, rp.Name), Name: db.Name,
RetentionPolicyName: rp.Name,
} }
bs = append(bs, b) bs = append(bs, b)