NIFI-11934 Allow FlowFile filename to be sent in header for InvokeHTTP

This closes #7639

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Mark Bean 2023-08-23 11:55:22 -04:00 committed by exceptionfactory
parent bf3c9ed4cb
commit d1b77018b2
No known key found for this signature in database
GPG Key ID: 29B6A52D2AAE8DBA
1 changed files with 7 additions and 6 deletions

View File

@ -130,7 +130,8 @@ import static org.apache.commons.lang3.StringUtils.trimToEmpty;
@Tags({"http", "https", "rest", "client"}) @Tags({"http", "https", "rest", "client"})
@InputRequirement(Requirement.INPUT_ALLOWED) @InputRequirement(Requirement.INPUT_ALLOWED)
@CapabilityDescription("An HTTP client processor which can interact with a configurable HTTP Endpoint. The destination URL and HTTP Method are configurable." @CapabilityDescription("An HTTP client processor which can interact with a configurable HTTP Endpoint. The destination URL and HTTP Method are configurable."
+ " FlowFile attributes are converted to HTTP headers and the FlowFile contents are included as the body of the request (if the HTTP Method is PUT, POST or PATCH).") + " When the HTTP Method is PUT, POST or PATCH, the FlowFile contents are included as the body of the request and FlowFile attributes are converted"
+ " to HTTP headers, optionally, based on configuration properties.")
@WritesAttributes({ @WritesAttributes({
@WritesAttribute(attribute = InvokeHTTP.STATUS_CODE, description = "The status code that is returned"), @WritesAttribute(attribute = InvokeHTTP.STATUS_CODE, description = "The status code that is returned"),
@WritesAttribute(attribute = InvokeHTTP.STATUS_MESSAGE, description = "The status message that is returned"), @WritesAttribute(attribute = InvokeHTTP.STATUS_MESSAGE, description = "The status message that is returned"),
@ -185,7 +186,6 @@ public class InvokeHTTP extends AbstractProcessor {
EXCEPTION_CLASS, EXCEPTION_CLASS,
EXCEPTION_MESSAGE, EXCEPTION_MESSAGE,
CoreAttributes.UUID.key(), CoreAttributes.UUID.key(),
CoreAttributes.FILENAME.key(),
CoreAttributes.PATH.key() CoreAttributes.PATH.key()
))); )));
@ -391,10 +391,11 @@ public class InvokeHTTP extends AbstractProcessor {
public static final PropertyDescriptor REQUEST_HEADER_ATTRIBUTES_PATTERN = new PropertyDescriptor.Builder() public static final PropertyDescriptor REQUEST_HEADER_ATTRIBUTES_PATTERN = new PropertyDescriptor.Builder()
.name("Attributes to Send") .name("Attributes to Send")
.displayName("Request Header Attributes Pattern") .displayName("Request Header Attributes Pattern")
.description("Regular expression that defines which attributes to send as HTTP headers in the request. " .description("Regular expression that defines which FlowFile attributes to send as HTTP headers in the request. "
+ "If not defined, no attributes are sent as headers. Dynamic properties will be sent as headers. " + "If not defined, no attributes are sent as headers. Dynamic properties will be always be sent as headers. "
+ "The dynamic property name will be the header key and the dynamic property value will be interpreted as expression " + "The dynamic property name will be the header key and the dynamic property value, interpreted as Expression "
+ "language will be the header value.") + "Language, will be the header value. Attributes and their values are limited to ASCII characters due to "
+ "the requirement of the HTTP protocol.")
.required(false) .required(false)
.addValidator(StandardValidators.REGULAR_EXPRESSION_VALIDATOR) .addValidator(StandardValidators.REGULAR_EXPRESSION_VALIDATOR)
.build(); .build();