Add support for S3 intelligent tiering in Snapshot and Restore (#149129)

Closes https://github.com/elastic/kibana/issues/136682

## Summary

This PR adds the "intelligent_tiering" option to the Storage class field
in the Repository form for AWS S3.

<img width="1299" alt="Screenshot 2023-01-18 at 14 40 10"
src="https://user-images.githubusercontent.com/59341489/213200327-60766fca-3261-4441-bc33-463a3d73d0e1.png">

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Elena Stoeva 2023-01-23 11:43:25 +00:00 committed by GitHub
parent 57fd55bf85
commit b49ec7b939
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 1 deletions

View file

@ -135,6 +135,7 @@ type TestSubjects =
| 'stepTwo.readOnlyToggle'
| 'stepTwo.submitButton'
| 'stepTwo.title'
| 'storageClassSelect'
| 'submitButton'
| 'title'
| 'urlRepositoryType';

View file

@ -545,4 +545,53 @@ describe('<RepositoryAdd />', () => {
});
});
});
describe('settings for s3 repository', () => {
beforeEach(async () => {
httpRequestsMockHelpers.setLoadRepositoryTypesResponse(repositoryTypes);
testBed = await setup(httpSetup);
});
test('should correctly set the intelligent_tiering storage class', async () => {
const { form, actions, component } = testBed;
const s3Repository = getRepository({
type: 's3',
settings: {
bucket: 'test_bucket',
storageClass: 'intelligent_tiering',
},
});
// Fill step 1 required fields and go to step 2
form.setInputValue('nameInput', s3Repository.name);
actions.selectRepositoryType(s3Repository.type);
actions.clickNextButton();
// Fill step 2
form.setInputValue('bucketInput', s3Repository.settings.bucket);
form.setSelectValue('storageClassSelect', s3Repository.settings.storageClass);
await act(async () => {
actions.clickSubmitButton();
});
component.update();
expect(httpSetup.put).toHaveBeenLastCalledWith(
`${API_BASE_PATH}repositories`,
expect.objectContaining({
body: JSON.stringify({
name: s3Repository.name,
type: s3Repository.type,
settings: {
bucket: s3Repository.settings.bucket,
storageClass: s3Repository.settings.storageClass,
},
}),
})
);
});
});
});

View file

@ -71,7 +71,12 @@ export const S3Settings: React.FunctionComponent<Props> = ({
});
};
const storageClassOptions = ['standard', 'reduced_redundancy', 'standard_ia'].map((option) => ({
const storageClassOptions = [
'standard',
'reduced_redundancy',
'standard_ia',
'intelligent_tiering',
].map((option) => ({
value: option,
text: option,
}));