Skip to content

Commit 054d13a

Browse files
authored
feat(cockpit): add deleteDatasource endpoint (#1034)
1 parent d025d26 commit 054d13a

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

packages/clients/src/api/cockpit/v1beta1/api.gen.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import type {
5050
Datasource,
5151
DeactivateCockpitRequest,
5252
DeleteContactPointRequest,
53+
DeleteDatasourceRequest,
5354
DeleteGrafanaUserRequest,
5455
DeleteTokenRequest,
5556
DisableManagedAlertsRequest,
@@ -211,6 +212,20 @@ export class API extends ParentAPI {
211212
unmarshalDatasource,
212213
)
213214

215+
/**
216+
* Delete the datasource associated with the specified datasource ID.
217+
*
218+
* @param request - The request {@link DeleteDatasourceRequest}
219+
*/
220+
deleteDatasource = (request: Readonly<DeleteDatasourceRequest>) =>
221+
this.client.fetch<void>({
222+
method: 'DELETE',
223+
path: `/cockpit/v1beta1/datasources/${validatePathParam(
224+
'datasourceId',
225+
request.datasourceId,
226+
)}`,
227+
})
228+
214229
protected pageOfListDatasources = (
215230
request: Readonly<ListDatasourcesRequest> = {},
216231
) =>

packages/clients/src/api/cockpit/v1beta1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export type {
1818
DatasourceType,
1919
DeactivateCockpitRequest,
2020
DeleteContactPointRequest,
21+
DeleteDatasourceRequest,
2122
DeleteGrafanaUserRequest,
2223
DeleteTokenRequest,
2324
DisableManagedAlertsRequest,

packages/clients/src/api/cockpit/v1beta1/types.gen.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,20 @@ export interface ContactPoint {
107107
email?: ContactPointEmail
108108
}
109109

110-
/** Datasource. */
110+
/** Data source. */
111111
export interface Datasource {
112-
/** ID of the datasource. */
112+
/** ID of the data source. */
113113
id: string
114114
/** ID of the Project the Cockpit belongs to. */
115115
projectId: string
116-
/** Datasource name. */
116+
/** Data source name. */
117117
name: string
118-
/** Datasource URL. */
118+
/** Data source URL. */
119119
url: string
120-
/** Datasource type. */
120+
/** Data source type. */
121121
type: DatasourceType
122122
/**
123-
* Specifies that the datasource receives data from Scaleway products and is
123+
* Specifies that the data source receives data from Scaleway products and is
124124
* managed by Scaleway.
125125
*/
126126
isManagedByScaleway: boolean
@@ -206,15 +206,15 @@ export type CreateContactPointRequest = {
206206
contactPoint?: ContactPoint
207207
}
208208

209-
/** Request to create a datasource. */
209+
/** Request to create a data source. */
210210
export type CreateDatasourceRequest = {
211211
/** ID of the Project the Cockpit belongs to. */
212212
projectId?: string
213-
/** Datasource name. */
213+
/** Data source name. */
214214
name: string
215-
/** Datasource type. */
215+
/** Data source type. */
216216
type?: DatasourceType
217-
/** Specifies that the returned output is the default datasource per type. */
217+
/** Specifies that the returned output is the default data source per type. */
218218
isDefault: boolean
219219
}
220220

@@ -250,6 +250,12 @@ export type DeleteContactPointRequest = {
250250
contactPoint?: ContactPoint
251251
}
252252

253+
/** Request to delete a data source. */
254+
export type DeleteDatasourceRequest = {
255+
/** ID of the data source. */
256+
datasourceId: string
257+
}
258+
253259
/** Request to delete a Grafana user. */
254260
export type DeleteGrafanaUserRequest = {
255261
/** ID of the Grafana user. */

0 commit comments

Comments
 (0)