Support "enterprise" license types#49223
Conversation
This adds "enterprise" as an acceptable type for a license loaded through the PUT _license API. Internally an enterprise license is treated as having a "platinum" operating mode. The handling of License types was refactored to have a new explicit "LicenseType" enum in addition to the existing "OperatingMode" enum.
|
Pinging @elastic/es-security (:Security/License) |
|
Notes:
|
| "Must specify either --license or --licenseFile"); | ||
| } | ||
| if (licenseSpec == null) { | ||
| throw new UserException(ExitCodes.DATA_ERROR, "Could parse license spec"); |
There was a problem hiding this comment.
| throw new UserException(ExitCodes.DATA_ERROR, "Could parse license spec"); | |
| throw new UserException(ExitCodes.DATA_ERROR, "Could not parse license spec"); |
| case "cloud_internal": | ||
| case "internal": // bwc for 1.x subscription_type field | ||
| case PLATINUM: | ||
| case ENTERPRISE: // TODO Add an explicit platinum operating mode |
There was a problem hiding this comment.
| case ENTERPRISE: // TODO Add an explicit platinum operating mode | |
| case ENTERPRISE: // TODO Add an explicit enterprise operating mode |
|
|
||
| private static boolean licenseIsCompatible(License license, Version version) { | ||
| if (License.LicenseType.ENTERPRISE.getTypeName().equalsIgnoreCase(license.type())) { | ||
| return version.onOrAfter(Version.V_8_0_0); |
There was a problem hiding this comment.
IIRC the suggested approach is to use the targeted version here and set bwc_enabled to false in build.gradle until the backporting PR is merged
| if (VALID_TRIAL_TYPES.contains(request.getType()) == false) { | ||
| License.LicenseType requestedType = License.LicenseType.parse(request.getType()); | ||
| if (VALID_TRIAL_TYPES.contains(requestedType) == false) { | ||
| throw new IllegalArgumentException("Cannot start trial of type [" + request.getType() + "]. Valid trial types are " |
There was a problem hiding this comment.
request.getType() to requestedType.getTypeName() ?
|
Do we really need LicenceType and OperatingMode nowadays? Should we merge those in a followup? |
No, I don't think we do, but all this BWC stuff in licensing is getting a bit crazy. We ought to look at cleaning up a bunch of stuff for 8.0 |
This adds "enterprise" as an acceptable type for a license loaded through the PUT _license API. Internally an enterprise license is treated as having a "platinum" operating mode. The handling of License types was refactored to have a new explicit "LicenseType" enum in addition to the existing "OperatingMode" enum. Backport of: elastic#49223
|
@tvernum I'm planning to add the changes to ECE to install the new "enterprise" stack license in ECE clusters with stack version >= 7.6 (https://github.com/elastic/cloud/issues/43639). I have a few questions to make sure we're on the same page. You mentioned in a comment above:
My understanding is the Elasticsearch API supports PUT requests with a payload like The ECE license bundles stack licenses with this format. Currently, ECE installs stack licenses by making a PUT request against the ES API with a payload that has the same structure as the JSON pasted above. My understanding is, in order for ECE to support the new "enterprise" stack license on v7.6+, it will continue to install stack licenses with the payload structure shown above, but the value of the "type" field will be "enterprise". According to my understanding, license update requests from ECE will not be using a different JSON format. I wanted to make sure there isn't a misunderstanding on my end. For reference, here is a sample ECE license (which at some point will include an enterprise stack license in "cluster_licenses": |
|
ECE currently makes a |
This adds "enterprise" as an acceptable type for a license loaded through the PUT _license API. Internally an enterprise license is treated as having a "platinum" operating mode. The handling of License types was refactored to have a new explicit "LicenseType" enum in addition to the existing "OperatingMode" enum. By default (in 7.x) the GET license API will return "platinum" when an enterprise license is active in order to be compatible with existing consumers of that API. A new "accept_enterprise" flag has been introduced to allow clients to opt-in to receive the correct "enterprise" type. Backport of: #49223
Relates: #4341, elastic/elasticsearch#49223, elastic/elasticsearch#50735 This commit adds support for Enterprise LicenseType, and adds max_resource_units to GetLicenseResponse.
Relates: #4341, elastic/elasticsearch#49223, elastic/elasticsearch#50735 This commit adds support for Enterprise LicenseType, and adds max_resource_units to GetLicenseResponse.
Relates: #4341, elastic/elasticsearch#49223, elastic/elasticsearch#50735 This commit adds support for Enterprise LicenseType, and adds max_resource_units to GetLicenseResponse.
Relates: #4341, elastic/elasticsearch#49223, elastic/elasticsearch#50735 This commit adds support for Enterprise LicenseType, and adds max_resource_units to GetLicenseResponse. Co-authored-by: Russ Cam <russ.cam@elastic.co>
Relates: #4341, elastic/elasticsearch#49223, elastic/elasticsearch#50735 This commit adds support for Enterprise LicenseType, and adds max_resource_units to GetLicenseResponse. (cherry picked from commit c737df6)
This adds "enterprise" as an acceptable type for a license loaded
through the PUT _license API.
Internally an enterprise license is treated as having a "platinum"
operating mode.
The handling of License types was refactored to have a new explicit
"LicenseType" enum in addition to the existing "OperatingMode" enum.
Relates: #48510