forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FTR] Use importExport for saved_object/basic archive (elastic#100244)
Signed-off-by: Tyler Smalley <[email protected]>
- Loading branch information
Tyler Smalley
authored
Jun 1, 2021
1 parent
eff7765
commit 0f9debe
Showing
43 changed files
with
2,232 additions
and
6,863 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { KbnClientRequester, uriencode } from './kbn_client_requester'; | ||
|
||
interface UpdateBody { | ||
name: string; | ||
description?: string; | ||
disabledFeatures?: string | string[]; | ||
initials?: string; | ||
color?: string; | ||
imageUrl?: string; | ||
} | ||
|
||
interface CreateBody extends UpdateBody { | ||
id: string; | ||
} | ||
|
||
export class KbnClientSpaces { | ||
constructor(private readonly requester: KbnClientRequester) {} | ||
|
||
async create(body: CreateBody) { | ||
await this.requester.request({ | ||
method: 'POST', | ||
path: '/api/spaces/space', | ||
body, | ||
}); | ||
} | ||
|
||
async update(id: string, body: UpdateBody) { | ||
await this.requester.request({ | ||
method: 'PUT', | ||
path: uriencode`/api/spaces/space/${id}`, | ||
body, | ||
}); | ||
} | ||
|
||
async get(id: string) { | ||
const { data } = await this.requester.request({ | ||
method: 'GET', | ||
path: uriencode`/api/spaces/space/${id}`, | ||
}); | ||
|
||
return data; | ||
} | ||
|
||
async list() { | ||
const { data } = await this.requester.request({ | ||
method: 'GET', | ||
path: '/api/spaces/space', | ||
}); | ||
|
||
return data; | ||
} | ||
|
||
async delete(id: string) { | ||
await this.requester.request({ | ||
method: 'DELETE', | ||
path: uriencode`/api/spaces/space/${id}`, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.