Skip to content

Instantly share code, notes, and snippets.

Avatar

Pierre Villard pvillard31

View GitHub Profile
View template-nifi-oauth2.xml
<?xml version="1.0" ?>
<template encoding-version="1.0">
<description></description>
<groupId>e5a5f628-0159-1000-afdb-0edd88ca8397</groupId>
<name>template-nifi-oauth2</name>
<snippet>
<connections>
<id>f66d8688-0159-1000-0000-000000000000</id>
<parentGroupId>e5a5f628-0159-1000-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
View nifi-oauth.groovy
import java.security.SignatureException
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec
def flowFile = session.get()
if (!flowFile) return
def static hmac(String data, String key) throws java.security.SignatureException
{
String result
View FTP-UTF8-Test.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.3">
<description></description>
<groupId>2e083aef-0162-1000-80bc-8c6bbfc00ca8</groupId>
<name>FTP-UTF8-Test</name>
<snippet>
<processGroups>
<id>3982c999-cd5f-3ac7-0000-000000000000</id>
<parentGroupId>16e377d4-8369-3464-0000-000000000000</parentGroupId>
<position>
View XmlToJson.java
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
View XmlToJson.groovy
import org.apache.commons.io.IOUtils
import java.nio.charset.*
import org.json.JSONObject;
import org.json.XML;
def flowFile = session.get()
if (!flowFile) return
flowFile = session.write(flowFile,
{ inputStream, outputStream ->
View TestQueryRecord.java
@Test
public void testNoMatchingRecords() throws InitializationException {
TestRunner runner = getRunner();
final JsonTreeReader jsonReader = new JsonTreeReader();
runner.addControllerService("reader", jsonReader);
runner.setProperty(jsonReader, SchemaAccessUtils.SCHEMA_ACCESS_STRATEGY, SchemaInferenceUtil.INFER_SCHEMA);
final JsonRecordSetWriter jsonWriter = new JsonRecordSetWriter();
runner.addControllerService("writer", jsonWriter);
@pvillard31
pvillard31 / MDD.xml
Created Aug 29, 2018
Template for Monitoring Driven Development in NiFi
View MDD.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.2">
<description></description>
<groupId>8927f4c0-0160-1000-597a-ea764ccd81a7</groupId>
<name>MDD</name>
<snippet>
<connections>
<id>a2098494-cce9-3fa4-0000-000000000000</id>
<parentGroupId>a8352767-434f-3321-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
View terraform-deploy
pvillard@cloudshell:~/nifi-gcp-terraform/gcp-cluster-secured-nifi-oidc (nifi-dev-project)$ /bin/sh deploy.sh nifi-dev-project nifi_bin
Updated property [core/project].
Initializing the backend...
Initializing provider plugins...
The following providers do not have any version constraints in configuration,
so the latest version was installed.
View deploy-nifi-cluster-terraform
git clone https://github.com/pvillard31/nifi-gcp-terraform.git
cd nifi-gcp-terraform/gcp-cluster-secured-nifi-oidc
/bin/sh deploy.sh <gcp-project-id> <gcs-bucket>
View deploy-nifi-terraform.sh
git clone https://github.com/pvillard31/nifi-gcp-terraform.git
cd nifi-gcp-terraform/gcp-single-secured-nifi-oidc/
terraform init
terraform apply