|
@@ -26,6 +26,7 @@ import org.elasticsearch.common.Strings;
|
|
|
import org.elasticsearch.common.inject.Inject;
|
|
|
import org.elasticsearch.common.io.stream.StreamInput;
|
|
|
import org.elasticsearch.common.settings.Settings;
|
|
|
+import org.elasticsearch.ingest.IngestService;
|
|
|
import org.elasticsearch.license.License;
|
|
|
import org.elasticsearch.license.LicenseUtils;
|
|
|
import org.elasticsearch.license.RemoteClusterLicenseChecker;
|
|
@@ -74,6 +75,7 @@ public class TransportPutTransformAction extends TransportMasterNodeAction<Reque
|
|
|
private final SecurityContext securityContext;
|
|
|
private final TransformAuditor auditor;
|
|
|
private final SourceDestValidator sourceDestValidator;
|
|
|
+ private final IngestService ingestService;
|
|
|
|
|
|
@Inject
|
|
|
public TransportPutTransformAction(
|
|
@@ -85,7 +87,8 @@ public class TransportPutTransformAction extends TransportMasterNodeAction<Reque
|
|
|
ClusterService clusterService,
|
|
|
XPackLicenseState licenseState,
|
|
|
TransformServices transformServices,
|
|
|
- Client client
|
|
|
+ Client client,
|
|
|
+ IngestService ingestService
|
|
|
) {
|
|
|
this(
|
|
|
PutTransformAction.NAME,
|
|
@@ -97,7 +100,8 @@ public class TransportPutTransformAction extends TransportMasterNodeAction<Reque
|
|
|
clusterService,
|
|
|
licenseState,
|
|
|
transformServices,
|
|
|
- client
|
|
|
+ client,
|
|
|
+ ingestService
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -111,7 +115,8 @@ public class TransportPutTransformAction extends TransportMasterNodeAction<Reque
|
|
|
ClusterService clusterService,
|
|
|
XPackLicenseState licenseState,
|
|
|
TransformServices transformServices,
|
|
|
- Client client
|
|
|
+ Client client,
|
|
|
+ IngestService ingestService
|
|
|
) {
|
|
|
super(
|
|
|
name,
|
|
@@ -138,6 +143,7 @@ public class TransportPutTransformAction extends TransportMasterNodeAction<Reque
|
|
|
clusterService.getNodeName(),
|
|
|
License.OperationMode.BASIC.description()
|
|
|
);
|
|
|
+ this.ingestService = ingestService;
|
|
|
}
|
|
|
|
|
|
static HasPrivilegesRequest buildPrivilegeCheck(
|
|
@@ -335,6 +341,16 @@ public class TransportPutTransformAction extends TransportMasterNodeAction<Reque
|
|
|
if (request.isDeferValidation()) {
|
|
|
pivotValidationListener.onResponse(true);
|
|
|
} else {
|
|
|
+ if (config.getDestination().getPipeline() != null) {
|
|
|
+ if (ingestService.getPipeline(config.getDestination().getPipeline()) == null) {
|
|
|
+ listener.onFailure(new ElasticsearchStatusException(
|
|
|
+ TransformMessages.getMessage(TransformMessages.PIPELINE_MISSING, config.getDestination().getPipeline()),
|
|
|
+ RestStatus.BAD_REQUEST
|
|
|
+ )
|
|
|
+ );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
pivot.validateQuery(client, config.getSource(), pivotValidationListener);
|
|
|
}
|
|
|
}
|