Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
This commit is contained in:
parent
0fb2c64ebf
commit
3e32ee02d4
|
@ -4581,7 +4581,7 @@
|
||||||
"description": [],
|
"description": [],
|
||||||
"source": {
|
"source": {
|
||||||
"path": "src/core/server/saved_objects/export/errors.ts",
|
"path": "src/core/server/saved_objects/export/errors.ts",
|
||||||
"lineNumber": 34
|
"lineNumber": 36
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -4589,7 +4589,7 @@
|
||||||
"returnComment": [],
|
"returnComment": [],
|
||||||
"source": {
|
"source": {
|
||||||
"path": "src/core/server/saved_objects/export/errors.ts",
|
"path": "src/core/server/saved_objects/export/errors.ts",
|
||||||
"lineNumber": 34
|
"lineNumber": 36
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -4628,7 +4628,7 @@
|
||||||
"description": [],
|
"description": [],
|
||||||
"source": {
|
"source": {
|
||||||
"path": "src/core/server/saved_objects/export/errors.ts",
|
"path": "src/core/server/saved_objects/export/errors.ts",
|
||||||
"lineNumber": 43
|
"lineNumber": 45
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -4641,7 +4641,7 @@
|
||||||
"description": [],
|
"description": [],
|
||||||
"source": {
|
"source": {
|
||||||
"path": "src/core/server/saved_objects/export/errors.ts",
|
"path": "src/core/server/saved_objects/export/errors.ts",
|
||||||
"lineNumber": 43
|
"lineNumber": 45
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -4649,7 +4649,7 @@
|
||||||
"returnComment": [],
|
"returnComment": [],
|
||||||
"source": {
|
"source": {
|
||||||
"path": "src/core/server/saved_objects/export/errors.ts",
|
"path": "src/core/server/saved_objects/export/errors.ts",
|
||||||
"lineNumber": 43
|
"lineNumber": 45
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -4681,7 +4681,7 @@
|
||||||
"description": [],
|
"description": [],
|
||||||
"source": {
|
"source": {
|
||||||
"path": "src/core/server/saved_objects/export/errors.ts",
|
"path": "src/core/server/saved_objects/export/errors.ts",
|
||||||
"lineNumber": 58
|
"lineNumber": 60
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -4689,7 +4689,7 @@
|
||||||
"returnComment": [],
|
"returnComment": [],
|
||||||
"source": {
|
"source": {
|
||||||
"path": "src/core/server/saved_objects/export/errors.ts",
|
"path": "src/core/server/saved_objects/export/errors.ts",
|
||||||
"lineNumber": 58
|
"lineNumber": 60
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -36,6 +36,9 @@ experimental[] Retrieve sets of saved objects that you want to import into {kib}
|
||||||
|
|
||||||
TIP: You must include `type` or `objects` in the request body.
|
TIP: You must include `type` or `objects` in the request body.
|
||||||
|
|
||||||
|
NOTE: The <<savedObjects-maxImportExportSize, `savedObjects.maxImportExportSize`>> configuration setting
|
||||||
|
limits the number of saved objects which may be exported.
|
||||||
|
|
||||||
[[saved-objects-api-export-request-response-body]]
|
[[saved-objects-api-export-request-response-body]]
|
||||||
==== Response body
|
==== Response body
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,11 @@ The request body must include the multipart/form-data type.
|
||||||
|
|
||||||
`file`::
|
`file`::
|
||||||
A file exported using the export API.
|
A file exported using the export API.
|
||||||
|
+
|
||||||
|
NOTE: The <<savedObjects-maxImportExportSize, `savedObjects.maxImportExportSize`>> configuration setting
|
||||||
|
limits the number of saved objects which may be included in this file. Similarly, the
|
||||||
|
<<savedObjects-maxImportPayloadBytes, `savedObjects.maxImportPayloadBytes`>> setting limits the overall
|
||||||
|
size of the file that can be imported.
|
||||||
|
|
||||||
[[saved-objects-api-import-response-body]]
|
[[saved-objects-api-import-response-body]]
|
||||||
==== Response body
|
==== Response body
|
||||||
|
|
|
@ -52,6 +52,12 @@ navigate to the NDJSON file that
|
||||||
represents the objects to import. By default,
|
represents the objects to import. By default,
|
||||||
saved objects already in {kib} are overwritten.
|
saved objects already in {kib} are overwritten.
|
||||||
|
|
||||||
|
NOTE: The <<savedObjects-maxImportExportSize, `savedObjects.maxImportExportSize`>> configuration setting
|
||||||
|
limits the number of saved objects which may be included in this file. Similarly, the
|
||||||
|
<<savedObjects-maxImportPayloadBytes, `savedObjects.maxImportPayloadBytes`>> setting limits the overall
|
||||||
|
size of the file that can be imported.
|
||||||
|
|
||||||
|
|
||||||
[float]
|
[float]
|
||||||
==== Export
|
==== Export
|
||||||
|
|
||||||
|
@ -63,6 +69,10 @@ You have two options for exporting saved objects.
|
||||||
This action creates an NDJSON with all your saved objects. By default, the NDJSON includes child objects that are related to the saved
|
This action creates an NDJSON with all your saved objects. By default, the NDJSON includes child objects that are related to the saved
|
||||||
objects. Exported dashboards include their associated index patterns.
|
objects. Exported dashboards include their associated index patterns.
|
||||||
|
|
||||||
|
NOTE: The <<savedObjects-maxImportExportSize, `savedObjects.maxImportExportSize`>> configuration setting
|
||||||
|
limits the number of saved objects which may be exported.
|
||||||
|
|
||||||
|
|
||||||
[float]
|
[float]
|
||||||
[role="xpack"]
|
[role="xpack"]
|
||||||
[[managing-saved-objects-copy-to-space]]
|
[[managing-saved-objects-copy-to-space]]
|
||||||
|
|
|
@ -455,6 +455,20 @@ manner that is inconsistent with `/proc/self/cgroup`.
|
||||||
| Override for cgroup cpuacct path when mounted
|
| Override for cgroup cpuacct path when mounted
|
||||||
in a manner that is inconsistent with `/proc/self/cgroup`.
|
in a manner that is inconsistent with `/proc/self/cgroup`.
|
||||||
|
|
||||||
|
|[[savedObjects-maxImportExportSize]] `savedObjects.maxImportExportSize:`
|
||||||
|
| The maximum count of saved objects that can be imported or exported.
|
||||||
|
This setting exists to prevent the {kib} server from runnning out of memory when handling
|
||||||
|
large numbers of saved objects. It is recommended to only raise this setting if you are
|
||||||
|
confident your server can hold this many objects in memory.
|
||||||
|
*Default: `10000`*
|
||||||
|
|
||||||
|
|[[savedObjects-maxImportPayloadBytes]] `savedObjects.maxImportPayloadBytes:`
|
||||||
|
| The maximum byte size of a saved objects import that the {kib} server will accept.
|
||||||
|
This setting exists to prevent the {kib} server from runnning out of memory when handling
|
||||||
|
a large import payload. Note that this setting overrides the more general
|
||||||
|
<<server-maxPayloadBytes, `server.maxPayloadBytes`>> for saved object imports only.
|
||||||
|
*Default: `26214400`*
|
||||||
|
|
||||||
|[[server-basePath]] `server.basePath:`
|
|[[server-basePath]] `server.basePath:`
|
||||||
| Enables you to specify a path to mount {kib} at if you are
|
| Enables you to specify a path to mount {kib} at if you are
|
||||||
running behind a proxy. Use the <<server-rewriteBasePath, `server.rewriteBasePath`>> setting to tell {kib}
|
running behind a proxy. Use the <<server-rewriteBasePath, `server.rewriteBasePath`>> setting to tell {kib}
|
||||||
|
@ -495,7 +509,7 @@ back end server. To allow remote users to connect, set the value to the IP addre
|
||||||
| The number of milliseconds to wait for additional data before restarting
|
| The number of milliseconds to wait for additional data before restarting
|
||||||
the <<server-socketTimeout, `server.socketTimeout`>> counter. *Default: `"120000"`*
|
the <<server-socketTimeout, `server.socketTimeout`>> counter. *Default: `"120000"`*
|
||||||
|
|
||||||
| `server.maxPayloadBytes:`
|
|[[server-maxPayloadBytes]] `server.maxPayloadBytes:`
|
||||||
| The maximum payload size in bytes
|
| The maximum payload size in bytes
|
||||||
for incoming server requests. *Default: `1048576`*
|
for incoming server requests. *Default: `1048576`*
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ const createStartContractMock = () => {
|
||||||
},
|
},
|
||||||
savedObjects: {
|
savedObjects: {
|
||||||
customIndex: false,
|
customIndex: false,
|
||||||
maxImportExportSizeBytes: 10000,
|
maxImportExportSize: 10000,
|
||||||
maxImportPayloadBytes: 26214400,
|
maxImportPayloadBytes: 26214400,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -239,7 +239,7 @@ describe('CoreUsageDataService', () => {
|
||||||
},
|
},
|
||||||
"savedObjects": Object {
|
"savedObjects": Object {
|
||||||
"customIndex": false,
|
"customIndex": false,
|
||||||
"maxImportExportSizeBytes": 10000,
|
"maxImportExportSize": 10000,
|
||||||
"maxImportPayloadBytes": 26214400,
|
"maxImportPayloadBytes": 26214400,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -235,7 +235,7 @@ export class CoreUsageDataService implements CoreService<CoreUsageDataSetup, Cor
|
||||||
savedObjects: {
|
savedObjects: {
|
||||||
customIndex: isCustomIndex(this.kibanaConfig!.index),
|
customIndex: isCustomIndex(this.kibanaConfig!.index),
|
||||||
maxImportPayloadBytes: this.soConfig.maxImportPayloadBytes.getValueInBytes(),
|
maxImportPayloadBytes: this.soConfig.maxImportPayloadBytes.getValueInBytes(),
|
||||||
maxImportExportSizeBytes: this.soConfig.maxImportExportSize.getValueInBytes(),
|
maxImportExportSize: this.soConfig.maxImportExportSize,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
environment: {
|
environment: {
|
||||||
|
|
|
@ -229,7 +229,7 @@ export interface CoreConfigUsageData {
|
||||||
savedObjects: {
|
savedObjects: {
|
||||||
customIndex: boolean;
|
customIndex: boolean;
|
||||||
maxImportPayloadBytes: number;
|
maxImportPayloadBytes: number;
|
||||||
maxImportExportSizeBytes: number;
|
maxImportExportSize: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
// uiSettings: {
|
// uiSettings: {
|
||||||
|
|
|
@ -27,7 +27,9 @@ export class SavedObjectsExportError extends Error {
|
||||||
static exportSizeExceeded(limit: number) {
|
static exportSizeExceeded(limit: number) {
|
||||||
return new SavedObjectsExportError(
|
return new SavedObjectsExportError(
|
||||||
'export-size-exceeded',
|
'export-size-exceeded',
|
||||||
`Can't export more than ${limit} objects`
|
`Can't export more than ${limit} objects. ` +
|
||||||
|
'If your server has enough memory, this limit can be increased ' +
|
||||||
|
'by adjusting the "savedObjects.maxImportExportSize" setting.'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -877,7 +877,9 @@ describe('getSortedObjectsForExport()', () => {
|
||||||
request,
|
request,
|
||||||
types: ['index-pattern', 'search'],
|
types: ['index-pattern', 'search'],
|
||||||
})
|
})
|
||||||
).rejects.toThrowErrorMatchingInlineSnapshot(`"Can't export more than 1 objects"`);
|
).rejects.toThrowErrorMatchingInlineSnapshot(
|
||||||
|
`"Can't export more than 1 objects. If your server has enough memory, this limit can be increased by adjusting the \\"savedObjects.maxImportExportSize\\" setting."`
|
||||||
|
);
|
||||||
expect(savedObjectsClient.closePointInTime).toHaveBeenCalledTimes(1);
|
expect(savedObjectsClient.closePointInTime).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1112,7 +1114,7 @@ describe('getSortedObjectsForExport()', () => {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
await expect(exporter.exportByObjects(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot(
|
await expect(exporter.exportByObjects(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot(
|
||||||
`"Can't export more than 1 objects"`
|
`"Can't export more than 1 objects. If your server has enough memory, this limit can be increased by adjusting the \\"savedObjects.maxImportExportSize\\" setting."`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ export const savedObjectsConfig = {
|
||||||
path: 'savedObjects',
|
path: 'savedObjects',
|
||||||
schema: schema.object({
|
schema: schema.object({
|
||||||
maxImportPayloadBytes: schema.byteSize({ defaultValue: 26214400 }),
|
maxImportPayloadBytes: schema.byteSize({ defaultValue: 26214400 }),
|
||||||
maxImportExportSize: schema.byteSize({ defaultValue: 10000 }),
|
maxImportExportSize: schema.number({ defaultValue: 10000 }),
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ export class SavedObjectConfig {
|
||||||
rawMigrationConfig: SavedObjectsMigrationConfigType
|
rawMigrationConfig: SavedObjectsMigrationConfigType
|
||||||
) {
|
) {
|
||||||
this.maxImportPayloadBytes = rawConfig.maxImportPayloadBytes.getValueInBytes();
|
this.maxImportPayloadBytes = rawConfig.maxImportPayloadBytes.getValueInBytes();
|
||||||
this.maxImportExportSize = rawConfig.maxImportExportSize.getValueInBytes();
|
this.maxImportExportSize = rawConfig.maxImportExportSize;
|
||||||
this.migration = rawMigrationConfig;
|
this.migration = rawMigrationConfig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ describe('SavedObjectsService', () => {
|
||||||
}
|
}
|
||||||
return new BehaviorSubject({
|
return new BehaviorSubject({
|
||||||
maxImportPayloadBytes: new ByteSizeValue(0),
|
maxImportPayloadBytes: new ByteSizeValue(0),
|
||||||
maxImportExportSize: new ByteSizeValue(0),
|
maxImportExportSize: 10000,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return mockCoreContext.create({ configService, env });
|
return mockCoreContext.create({ configService, env });
|
||||||
|
|
|
@ -452,7 +452,7 @@ export interface CoreConfigUsageData {
|
||||||
savedObjects: {
|
savedObjects: {
|
||||||
customIndex: boolean;
|
customIndex: boolean;
|
||||||
maxImportPayloadBytes: number;
|
maxImportPayloadBytes: number;
|
||||||
maxImportExportSizeBytes: number;
|
maxImportExportSize: number;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -269,11 +269,10 @@ export function getCoreUsageCollector(
|
||||||
'Maximum size of the payload in bytes of saved objects that can be imported.',
|
'Maximum size of the payload in bytes of saved objects that can be imported.',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
maxImportExportSizeBytes: {
|
maxImportExportSize: {
|
||||||
type: 'long',
|
type: 'long',
|
||||||
_meta: {
|
_meta: {
|
||||||
description:
|
description: 'Maximum count of saved objects that can be imported or exported.',
|
||||||
'Maximum size in bytes of saved object that can be imported or exported.',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -6675,10 +6675,10 @@
|
||||||
"description": "Maximum size of the payload in bytes of saved objects that can be imported."
|
"description": "Maximum size of the payload in bytes of saved objects that can be imported."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"maxImportExportSizeBytes": {
|
"maxImportExportSize": {
|
||||||
"type": "long",
|
"type": "long",
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"description": "Maximum size in bytes of saved object that can be imported or exported."
|
"description": "Maximum count of saved objects that can be imported or exported."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -553,7 +553,7 @@ export default function ({ getService }: FtrProviderContext) {
|
||||||
expect(resp.body).to.eql({
|
expect(resp.body).to.eql({
|
||||||
statusCode: 400,
|
statusCode: 400,
|
||||||
error: 'Bad Request',
|
error: 'Bad Request',
|
||||||
message: `Can't export more than 10001 objects`,
|
message: `Can't export more than 10001 objects. If your server has enough memory, this limit can be increased by adjusting the \"savedObjects.maxImportExportSize\" setting.`,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
await supertest
|
await supertest
|
||||||
|
|
Loading…
Reference in a new issue