Commit Graph

56 Commits

Author SHA1 Message Date
Nik Everett 8ee190d741 Handle moving rest support
Original commit: elastic/x-pack-elasticsearch@99076b2936
2016-08-15 22:41:43 -04:00
jaymode a3e7536205 fix serialization of XPackFeatureSet.Usage
The XPackFeatureSet.Usage writeTo method failed to write the name to the
StreamOutput whereas the deserialization code expected it to be the first value
present in the StreamInput. This causes xpack usage requests made to nodes
other than the master to fail.

This change fixes the serialization and adds tests to all of the feature sets to ensure
that the usage is serialized properly.

Closes elastic/elasticsearch#3072

Original commit: elastic/x-pack-elasticsearch@eccab616ca
2016-08-12 07:48:55 -04:00
Ryan Ernst ce496938cd Consolidate settings for enabling xpack features
Currently there are a number of helper methods, all used at various
stages of initializing xpack, for reading "enabled" settings. Almost all
of these read the setting directly rather than use the new settings
infra. This change adds an XPackSettings class to contain these settings
constants, and adds all the enabled settings to it.

Note: While there is an existing MonitoringSettings, I think we do not
have enough settings (especially for all features) to warrant a separate
class per "feature" (eg graph would have nothing). We should decide
if/when this is necessary on a case by case basis, but I think the
enabled settings should all go here in XPackSettings.

Original commit: elastic/x-pack-elasticsearch@086152d5a5
2016-08-08 14:01:35 -07:00
Ryan Ernst cdae14a5b9 Switch to NamedWriteable pull based extension in xpack
This is the xplugins side of elastic/elasticsearchelastic/elasticsearch#19764. It converts
the one use of registering custom NamedWriteable readers in xpack for
xpack feature sets to register them up front with the new pull based
registration.

Original commit: elastic/x-pack-elasticsearch@48e2020816
2016-08-02 16:00:06 -07:00
Nik Everett 59cb8f2271 Fix rest spec for graph explore
Original commit: elastic/x-pack-elasticsearch@293b5c9ebd
2016-07-28 16:37:30 -04:00
Chris Earle 4d81792a56 [Graph] Log Deprecation Warnings for old API usage
This makes use of the `registerAsDeprecatedHandler` method to automatically warn users when they're using deprecated functionality.

This will also automatically provide a `Warning` header for anyone using HTTP clients (though they have to be looking for it...).

Graph portion only

Original commit: elastic/x-pack-elasticsearch@d6452a75c1
2016-07-28 12:11:10 -04:00
Ryan Ernst 059bf323c4 Cleanup: Move all license related classes into a single package
This change moves all license related code in xpack under
org.elasticsearch.license. Some classes become package private (more can
become package private later with further deguicing). It also adds
package level javadocs. Note, I did not move anything from the actual
licensing jar.  This should be cleaned up in a followup.

Original commit: elastic/x-pack-elasticsearch@2413c4f288
2016-07-26 13:26:29 -07:00
Ryan Ernst 0ae6e53173 Internal: Collapse Licensee per feature into single XPackLicenseState
The license code currently has a Licensee implementation per feature,
which is updated by the license service. This meant maintaining a
listener type feature for the license service, and having an abstract
listener and such. The licensee class also mixed in stuff only needed by
the license service (acknowledgement messages).

This change collapses all the methods from licensees into
XPackLicenseState. The naming was inconsistent across licensee
implementations, so here it is standardized on `is*Allowed()`. There are
also a number of tests which should be consolidated for testing the
license service but that is left for a future change. I also removed
collector tests that were testing license: that is better left for the
direct tests of the license state in XPackLicenseStateTests.

Original commit: elastic/x-pack-elasticsearch@734871e870
2016-07-23 16:55:04 -07:00
Ryan Ernst 7fcf05dcb1 Internal: Removed LicenseState enum
The LicenseState class exists to distinguish when a license is enabled,
vs being inside its grace period. However, the consumers of this state
do not care whether the license is in the grace period, they view that
and an active license as the same thing. The only part that cares about
the grace period is in the license service which logs a warning when a
license begins its grace period.

This change removes the LicenseState enum in favor of a simple boolean
indicating whether the license is active.

Original commit: elastic/x-pack-elasticsearch@5a90a0e3d4
2016-07-22 11:30:56 -07:00
Areek Zillur 0db0e2f0c9 Implements cloud_internal license type
"cloud_internal" license type enables dynamically updating license operation mode via a config file.

When the installed license is "cloud_internal", the node level operation mode can be updated by writing
a `license_mode` file in the x-pack config directory (config/x-pack/license_mode). The file is expected
to have a string representing the desired license mode (e.g. "gold", "basic"). In case of a failure to
read a valid license mode from the `license_mode` file, the operation mode for "cloud_internal" license
defaults to PLATINUM.
This change also ensures that the correct operation mode is reported via the _xpack endpoint.

closes elastic/elasticsearch#2042

Original commit: elastic/x-pack-elasticsearch@6a2d788e45
2016-07-15 12:08:34 -04:00
Ryan Ernst f82fa65d7d Internal: Remove guice construction of most license classes
This change removes some of the complexity around licensing classes in
xpack. It removes the interfaces for registration and management so the
remaining LicensesService class is the thing that components wanting to
interact with the license should use. It also removes complexity around
the Licensee interface, removing generics and the registration at
construction time, as well as making the licensees no longer have a
lifecycle. There is still more to be done with simplification of license
classes construction, but this is a step towards a simpler world.

Original commit: elastic/x-pack-elasticsearch@5307d67b5b
2016-07-13 14:23:23 -07:00
Ryan Ernst e92860f552 Plugin node modules/services rename to guice related
See elastic/elasticsearchelastic/elasticsearch#19371

Original commit: elastic/x-pack-elasticsearch@40f7e43cc5
2016-07-11 14:28:47 -07:00
Karel Minarik dc6e78a62c Graph: Moved the index creation to a `setup` section in the REST test
Closes elastic/elasticsearch#2679

Original commit: elastic/x-pack-elasticsearch@51a4a5e530
2016-07-11 18:42:03 +02:00
Karel Minarik 0b3c97c083 Graph: Fixed incorrect API call in the REST test
Related: elastic/elasticsearch#2678

Original commit: elastic/x-pack-elasticsearch@3157c97ca2
2016-07-11 18:42:03 +02:00
Karel Minarik 7d6a68fd0a Graph: Added the `xpack` namespace to the Graph API JSON specification
The `graph.explore` API has not been prefixed with `xpack`, as the other X-Pack APIs.

Closes elastic/elasticsearch#2678

Original commit: elastic/x-pack-elasticsearch@4501fb5b63
2016-07-11 18:39:03 +02:00
Tanguy Leroux bd0cf521aa Enable Checkstyle RedundantModifier
Original commit: elastic/x-pack-elasticsearch@7455e88dce
2016-07-04 15:17:50 +02:00
Jason Tedor 1cd53c41e2 Do not catch throwable
Today throughout the codebase, catch throwable is used with reckless
abandon. This is dangerous because the throwable could be a fatal
virtual machine error resulting from an internal error in the JVM, or an
out of memory error or a stack overflow error that leaves the virtual
machine in an unstable and unpredictable state. This commit removes
catch throwable from the codebase and removes the temptation to use it
by modifying listener APIs to receive instances of Exception instead of
the top-level Throwable.

Relates elastic/elasticsearch#2694

Original commit: elastic/x-pack-elasticsearch@7ecdd7d978
2016-07-04 08:41:08 -04:00
Ryan Ernst 0fcb52a794 Merge branch 'master' into rest_handler_client
Original commit: elastic/x-pack-elasticsearch@429edeea84
2016-06-29 17:03:27 -07:00
Ryan Ernst 7822f28d7b Simplify rest handler constructors
This is the xplugins side of moving the client dependency for rest
handlers to the handleRequest method

Original commit: elastic/x-pack-elasticsearch@ce66e35e7b
2016-06-29 16:30:55 -07:00
Nik Everett 672d91f2a4 Move rest handler registration to ActionPlugin
Original commit: elastic/x-pack-elasticsearch@b3bc7d4a9f
2016-06-29 18:32:58 -04:00
Tanguy Leroux a06f4a02fd Rename Marvel packages and directories to Monitoring
related to elastic/elasticsearch#2383

Original commit: elastic/x-pack-elasticsearch@7f4001a031
2016-06-29 09:10:25 +02:00
Nik Everett 6f6426b444 Switch plugin action registration to pull
Original commit: elastic/x-pack-elasticsearch@2154918b6e
2016-06-28 08:56:54 -04:00
jaymode c024dbfc49 security: remove use of shield in files and directory names
This commit removes as much of the use of shield as possible in the source code.

See elastic/elasticsearch#2383

Original commit: elastic/x-pack-elasticsearch@00009cc06e
2016-06-20 10:26:10 -04:00
Ryan Ernst e985159f65 Merge branch 'master' into plugin_name_api
Original commit: elastic/x-pack-elasticsearch@ddc161e695
2016-06-16 14:34:23 -07:00
Simon Willnauer b2c944a480 Cut over settings registration to a pull model elastic/elasticsearchelastic/elasticsearch#18890 (elastic/elasticsearch#2538)
Followup for elastic/elasticsearchelastic/elasticsearch#18890

Original commit: elastic/x-pack-elasticsearch@a65ee6913f
2016-06-16 15:53:01 +02:00
Simon Willnauer 36ad326483 Simplify ScriptModule and script registration elastic/elasticsearchelastic/elasticsearch#18903 (elastic/elasticsearch#2535)
follow up PR for elastic/elasticsearchelastic/elasticsearch#18903

Original commit: elastic/x-pack-elasticsearch@d6ab3ab141
2016-06-16 09:35:16 +02:00
Ryan Ernst 7cb7f85709 Remove name() and description() from plugin api
This is the xplugins side of elastic/elasticsearchelastic/elasticsearch#18906

Original commit: elastic/x-pack-elasticsearch@b47422fe91
2016-06-15 17:11:34 -07:00
Nik Everett 2dd6cfae2b Handle core changing TimeValue to Writeable
Original commit: elastic/x-pack-elasticsearch@72e33d6e52
2016-06-10 15:48:54 -04:00
markharwood 294fabb817 Graph refactored package name to new xpack convention as per issue 2383
Original commit: elastic/x-pack-elasticsearch@ae798f64e8
2016-06-07 14:04:04 +01:00
Christoph Büscher 9774e5472a Adapt to api changes in es core, inner query parsing now return Optional<QueryBuilder>
Changes relate to elastic/elasticsearch#17624

Original commit: elastic/x-pack-elasticsearch@bd9d31a9ff
2016-06-02 18:37:30 +02:00
uboness 27db7c40b1 addressed review comments
Original commit: elastic/x-pack-elasticsearch@01552f5e82
2016-05-20 13:11:41 +01:00
uboness 084179f457 Added security realm feature usage stats
- if active, `file` realm size
- if active, `native` realm size
- if active, `ldap` realm size, whether SSL is used, load balance type used, user search used
- if active, `active_directory` realm size, whether SSL is used, load balance type used

 `size` is scale estimation based on the local cache. Scales are: `small` (under 10 users), `medium` (under 50 users), `large` (under 250 users) and `x-large` (above 250 users).

Original commit: elastic/x-pack-elasticsearch@c6efb17aa4
2016-05-20 13:11:41 +01:00
uboness 9dbbfd09f8 Introducing infrastructure for feature usage API
- Each `XPackFeatureSet` can now return a `Usage` object that encapsulates the feature usage stats of the set
- A new `/_xpack/usage` REST API is introduced to access the usage stats of all features
- Intentionally not explicitly exposing the API in the `XPackClient` as this API is primarily meant for use by Kibana X-Pack (that said, it is still possible to call this API from the transport client using the `XPathUsageRequestBuilder`)
- For now the usage stats that are returned are minimal, once this infrastructure is in, we'll start adding more stats

Relates to elastic/elasticsearch#2210

Original commit: elastic/x-pack-elasticsearch@d651fe4b01
2016-05-20 13:11:41 +01:00
Ali Beyad d6179855bd Renamed AggregatorBuilder to AggregationBuilder, applying the changes to
x-plugins.

Closes elastic/elasticsearch#2263
Relates elastic/elasticsearch#18377

Original commit: elastic/x-pack-elasticsearch@6d1a698669
2016-05-19 09:28:53 -04:00
markharwood e7b70794b6 Prefix Graph REST endpoint with _xpack. Partial fix for issue 1760
Original commit: elastic/x-pack-elasticsearch@53ceb1c20d
2016-05-10 13:45:07 +01:00
Adrien Grand 5db861d14b Remove generics from QueryBuilder.
Related to elastic/elasticsearchelastic/elasticsearch#18133.

Original commit: elastic/x-pack-elasticsearch@bd8ca4f061
2016-05-06 09:06:30 +02:00
Alexander Reelsen 74edbe6332 Watcher: Refactoring, move to org.elasticsearch.xpack
This refactors the org.elasticsearch.watcher over to
org.elasticsearch.xpack.watcher

This also adds all watcher actions to the KnownActionsTests,
as watcher actions had not been taken care of until here.

Original commit: elastic/x-pack-elasticsearch@a046dc7c6a
2016-05-02 10:58:34 +02:00
markharwood 29b996ea1d Test fix - graph test occasionally failed to fail on all shards due to random nature of indexing. Tightened test class logic to deal with partial failures.
Original commit: elastic/x-pack-elasticsearch@b2dcdd7600
2016-04-29 14:45:15 +01:00
markharwood 077599b63f X-plugin tests - added testing for Standard licence in graph plugin. See https://github.com/elastic/x-plugins/issues/1263
Original commit: elastic/x-pack-elasticsearch@6773ead0fc
2016-04-28 13:51:43 +01:00
uboness 5c9d96211f Extended X-Pack Info API with Features Info
- introduced the "Feature Set" notion - graph, security, monitoring, watcher, these are all feature sets
- each feature set can be:
 - `available` - indicates whether this feature set is available under the current license
 - `enabled` - indicates whether this feature set is enabled (note that the feature set can be enabled, yet unavailable under the current license)
- while at it, cleaned up the main modules of watcher, security, monitoring and graph.

Original commit: elastic/x-pack-elasticsearch@5b3e19fe8c
2016-04-20 14:30:48 -07:00
Nik Everett 28bb39955c Replace (read|write)Query with (read|write)NamedWriteable
(read|write)Query is going away.

Original commit: elastic/x-pack-elasticsearch@5ac3ded68e
2016-04-19 11:06:39 -04:00
Ryan Ernst 7275d48bbd Remove XContentBuilderString
This is the xplugins side of elastic/elasticsearchelastic/elasticsearch#17833

Original commit: elastic/x-pack-elasticsearch@2400192775
2016-04-18 14:37:17 -07:00
Christoph Büscher e6bce6b36e Adapt to changes in core ES (elastic/elasticsearch#17417)
Original commit: elastic/x-pack-elasticsearch@2df6d5b27e
2016-04-18 15:33:25 +02:00
Christoph Büscher dfe5bf5366 Adapt to removal of parseFieldMatcher getters and setters in core
Original commit: elastic/x-pack-elasticsearch@4fd754d0ae
2016-04-15 15:22:13 +02:00
Nik Everett 29263637c0 React to registration changes in core
Original commit: elastic/x-pack-elasticsearch@f5961dc410
2016-04-07 18:48:00 -04:00
jaymode f888082ce6 security: remove the use of shield in settings
This commit migrates all of the `shield.` settings to `xpack.security.` and makes changes to
use the new Settings infrastructure in core.

As a cleanup, this commit also renames Shield to Security since this class is only in master
and will not affect 2.x.

See elastic/elasticsearch#1441

Original commit: elastic/x-pack-elasticsearch@a5a9798b1b
2016-04-06 14:00:46 -04:00
Martijn van Groningen 1e3c56ce97 test: wait only for the index test_1
(there are other indices too, montoring indices and waiting for green fails there because these indices have replica shards)

Original commit: elastic/x-pack-elasticsearch@63dd3e6ebb
2016-04-06 10:52:50 +02:00
Chris Earle 86ed96b83b Adding support for STANDARD license
Original commit: elastic/x-pack-elasticsearch@1671d8ade3
2016-04-01 12:49:05 -04:00
Chris Earle 55b9569f7b Removing isPaid, allFeaturesEnabled, and isActive methods from enums.
Original commit: elastic/x-pack-elasticsearch@8b8c7792c7
2016-04-01 12:49:05 -04:00
Chris Earle 5e81beabf9 Simplifying License Checks
Too many places are checking for enumerations when they're really more interested in a "higher" level of
information. This will help with the forthcoming addition of the STANDARD operation mode as well.

Original commit: elastic/x-pack-elasticsearch@2799c27e19
2016-04-01 12:49:05 -04:00