diff --git a/http/swagger.yml b/http/swagger.yml index ebe173f6bd6..605d8a5662e 100644 --- a/http/swagger.yml +++ b/http/swagger.yml @@ -9208,15 +9208,15 @@ components: type: string description: type: string - agent: + config: + type: string + metadata: type: object properties: - collectionInterval: - type: integer - plugins: - type: array - items: - $ref: "#/components/schemas/TelegrafRequestPlugin" + buckets: + type: array + items: + type: string orgID: type: string TelegrafRequestPlugin: diff --git a/http/telegraf.go b/http/telegraf.go index 25ade8cefe7..a9f18257df5 100644 --- a/http/telegraf.go +++ b/http/telegraf.go @@ -57,7 +57,7 @@ type TelegrafHandler struct { } const ( - prefixTelegraf = "/api/v2/telegrafs" + prefixTelegraf = "/api/v2/telegrafs" telegrafsIDPath = "/api/v2/telegrafs/:id" telegrafsIDMembersPath = "/api/v2/telegrafs/:id/members" telegrafsIDMembersIDPath = "/api/v2/telegrafs/:id/members/:userID" diff --git a/storage/reads/datatypes/storage_common.pb.go b/storage/reads/datatypes/storage_common.pb.go index f963f5bcc7f..5f16e9bcc73 100644 --- a/storage/reads/datatypes/storage_common.pb.go +++ b/storage/reads/datatypes/storage_common.pb.go @@ -2222,7 +2222,7 @@ func (m *CapabilitiesResponse) MarshalTo(dAtA []byte) (int, error) { var l int _ = l if len(m.Caps) > 0 { - for k, _ := range m.Caps { + for k := range m.Caps { dAtA[i] = 0xa i++ v := m.Caps[k] diff --git a/ui/src/dashboards/actions/index.ts b/ui/src/dashboards/actions/index.ts index 38ae1335673..79da1cc1e86 100644 --- a/ui/src/dashboards/actions/index.ts +++ b/ui/src/dashboards/actions/index.ts @@ -60,7 +60,7 @@ import {DEFAULT_DASHBOARD_NAME} from 'src/dashboards/constants/index' // Types import {RemoteDataState} from 'src/types' -import {CreateCell, ILabel} from '@influxdata/influx' +import {CreateCell, Label} from 'src/client/generatedRoutes' import { Dashboard, NewView, @@ -141,7 +141,7 @@ interface AddDashboardLabelsAction { type: ActionTypes.AddDashboardLabels payload: { dashboardID: string - labels: ILabel[] + labels: Label[] } } @@ -149,7 +149,7 @@ interface RemoveDashboardLabelsAction { type: ActionTypes.RemoveDashboardLabels payload: { dashboardID: string - labels: ILabel[] + labels: Label[] } } @@ -215,7 +215,7 @@ export const removeCell = ( export const addDashboardLabels = ( dashboardID: string, - labels: ILabel[] + labels: Label[] ): AddDashboardLabelsAction => ({ type: ActionTypes.AddDashboardLabels, payload: {dashboardID, labels}, @@ -223,7 +223,7 @@ export const addDashboardLabels = ( export const removeDashboardLabels = ( dashboardID: string, - labels: ILabel[] + labels: Label[] ): RemoveDashboardLabelsAction => ({ type: ActionTypes.RemoveDashboardLabels, payload: {dashboardID, labels}, @@ -527,7 +527,7 @@ export const copyDashboardCellAsync = (dashboard: Dashboard, cell: Cell) => ( export const addDashboardLabelsAsync = ( dashboardID: string, - labels: ILabel[] + labels: Label[] ) => async (dispatch: Dispatch) => { try { const newLabels = await client.dashboards.addLabels( @@ -544,7 +544,7 @@ export const addDashboardLabelsAsync = ( export const removeDashboardLabelsAsync = ( dashboardID: string, - labels: ILabel[] + labels: Label[] ) => async (dispatch: Dispatch) => { try { await client.dashboards.removeLabels(dashboardID, labels.map(l => l.id)) diff --git a/ui/src/telegrafs/actions/index.ts b/ui/src/telegrafs/actions/index.ts index 6d92fe5b7ac..0272a5b9d7e 100644 --- a/ui/src/telegrafs/actions/index.ts +++ b/ui/src/telegrafs/actions/index.ts @@ -3,7 +3,8 @@ import {client} from 'src/utils/api' // Types import {RemoteDataState, GetState} from 'src/types' -import {ITelegraf as Telegraf, ILabel as Label} from '@influxdata/influx' +import {Telegraf} from 'src/client/generatedRoutes' +import {ILabel as Label} from '@influxdata/influx' import {Dispatch, ThunkAction} from 'redux-thunk' // Actions diff --git a/ui/src/telegrafs/components/CollectorCard.tsx b/ui/src/telegrafs/components/CollectorCard.tsx index 696536b676a..cddd05124c2 100644 --- a/ui/src/telegrafs/components/CollectorCard.tsx +++ b/ui/src/telegrafs/components/CollectorCard.tsx @@ -24,7 +24,8 @@ import {DEFAULT_COLLECTOR_NAME} from 'src/dashboards/constants' // Types import {AppState, Organization} from 'src/types' -import {ILabel, ITelegraf as Telegraf} from '@influxdata/influx' +import {Telegraf} from 'src/client/generatedRoutes' +import {ILabel} from '@influxdata/influx' interface OwnProps { collector: Telegraf @@ -75,7 +76,7 @@ class CollectorRow extends PureComponent { labels={this.labels} metaData={[ - {/* todo(glinton): verify what sets this. It seems like it is using the 'config' section of 'influxdb_v2' output?? */} + {} Bucket: {collector.metadata.buckets.join(", ")} , <> diff --git a/ui/src/telegrafs/components/CollectorList.tsx b/ui/src/telegrafs/components/CollectorList.tsx index b5fe0eff6b4..bec60877f23 100644 --- a/ui/src/telegrafs/components/CollectorList.tsx +++ b/ui/src/telegrafs/components/CollectorList.tsx @@ -9,7 +9,7 @@ import {ResourceList} from '@influxdata/clockface' import CollectorRow from 'src/telegrafs/components/CollectorCard' // Types -import {ITelegraf as Telegraf} from '@influxdata/influx' +import {Telegraf} from 'src/client/generatedRoutes' import {Sort} from '@influxdata/clockface' import {SortTypes, getSortedResources} from 'src/shared/utils/sort' import {AppState} from 'src/types' diff --git a/ui/src/telegrafs/components/Collectors.tsx b/ui/src/telegrafs/components/Collectors.tsx index 372534f7984..66d200ec587 100644 --- a/ui/src/telegrafs/components/Collectors.tsx +++ b/ui/src/telegrafs/components/Collectors.tsx @@ -32,7 +32,8 @@ import {updateTelegraf, deleteTelegraf} from 'src/telegrafs/actions' import {ErrorHandling} from 'src/shared/decorators/errors' // Types -import {ITelegraf as Telegraf} from '@influxdata/influx' +import {Telegraf} from 'src/client/generatedRoutes' // from `import {ITelegraf as Telegraf} from '@influxdata/influx'` + import {OverlayState, AppState, Bucket} from 'src/types' import { setDataLoadersType, diff --git a/ui/src/telegrafs/components/TelegrafConfigOverlay.tsx b/ui/src/telegrafs/components/TelegrafConfigOverlay.tsx index 074bf4ad7d8..9ae37641123 100644 --- a/ui/src/telegrafs/components/TelegrafConfigOverlay.tsx +++ b/ui/src/telegrafs/components/TelegrafConfigOverlay.tsx @@ -21,7 +21,7 @@ import {downloadTextFile} from 'src/shared/utils/download' // Types import {AppState} from 'src/types' -import {ITelegraf as Telegraf} from '@influxdata/influx' +import {Telegraf} from 'src/client/generatedRoutes' interface OwnProps { onClose: () => void diff --git a/ui/src/telegrafs/reducers/index.ts b/ui/src/telegrafs/reducers/index.ts index cad818a8581..afde2fb84b9 100644 --- a/ui/src/telegrafs/reducers/index.ts +++ b/ui/src/telegrafs/reducers/index.ts @@ -4,7 +4,7 @@ import {produce} from 'immer' // Types import {RemoteDataState} from 'src/types' import {Action} from 'src/telegrafs/actions' -import {ITelegraf as Telegraf} from '@influxdata/influx' +import {Telegraf} from 'src/client/generatedRoutes' const initialState = (): TelegrafsState => ({ status: RemoteDataState.NotStarted,