Support Questions
Find answers, ask questions, and share your expertise

Create process groups with processor's using NiFi Rest -API

Highlighted

Create process groups with processor's using NiFi Rest -API

New Contributor

I'm trying to create new ProcessGroup with processor's detail

 

Create Endpoint:

 

nifi-api/process-groups/2deb4e55-0170-1000-dcff-be55b881c8f4/process-groups

 

where

 

2deb4e55-0170-1000-dcff-be55b881c8f4

 

is the ID of my root process group.

The content of my request is the following JSON:

 

{
    "revision": {
        "version": 0
    },
    "component": {
        "parentGroupId": "2deb4e55-0170-1000-dcff-be55b881c8f4",
        "name": "Suma TestProcessGroup1",
        "comments": "created through PostMan1",
        "contents": {
            "processors": [
                {
                    "name": "Receive request and data",
                    "type": "org.apache.nifi.processors.standard.HandleHttpRequest",
                    "bundle": {
                        "group": "org.apache.nifi",
                        "artifact": "nifi-standard-nar",
                        "version": "1.11.1"
                    },
                    "state": "STOPPED",
                    "description": "suma testing",
                    "supportsParallelProcessing": true,
                    "supportsEventDriven": false,
                    "supportsBatching": false,
                    "persistsState": false,
                    "restricted": false,
                    "deprecated": false,
                    "extensionMissing": false,
                    "executionNodeRestricted": false,
                    "multipleVersionsAvailable": false,
                    "inputRequirement": "INPUT_FORBIDDEN",
                    "config": {
                        "properties": {
                            "Listening Port": "8085",
                            "Hostname": null,
                            "SSL Context Service": null,
                            "HTTP Context Map": null,
                            "Allowed Paths": "/test",
                            "Default URL Character Set": "UTF-8",
                            "Allow GET": "true",
                            "Allow POST": "true",
                            "Allow PUT": "true",
                            "Allow DELETE": "true",
                            "Allow HEAD": "false",
                            "Allow OPTIONS": "false",
                            "Additional HTTP Methods": null,
                            "Client Authentication": "No Authentication",
                            "container-queue-size": "50",
                            "multipart-request-max-size": "1 MB",
                            "multipart-read-buffer-size": "512 KB"
                        },
                        "descriptors": {
                            "Listening Port": {
                                "name": "Listening Port",
                                "displayName": "Listening Port",
                                "description": "The Port to listen on for incoming HTTP requests",
                                "defaultValue": "80",
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": true,
                                "expressionLanguageScope": "Variable Registry Only"
                            },
                            "Hostname": {
                                "name": "Hostname",
                                "displayName": "Hostname",
                                "description": "The Hostname to bind to. If not specified, will bind to all hosts",
                                "required": false,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "SSL Context Service": {
                                "name": "SSL Context Service",
                                "displayName": "SSL Context Service",
                                "description": "The SSL Context Service to use in order to secure the server. If specified, the server will accept only HTTPS requests; otherwise, the server will accept only HTTP requests",
                                "allowableValues": [],
                                "required": false,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported",
                                "identifiesControllerService": "org.apache.nifi.ssl.RestrictedSSLContextService",
                                "identifiesControllerServiceBundle": {
                                    "group": "org.apache.nifi",
                                    "artifact": "nifi-standard-services-api-nar",
                                    "version": "1.11.1"
                                }
                            },
                            "HTTP Context Map": {
                                "name": "HTTP Context Map",
                                "displayName": "HTTP Context Map",
                                "description": "The HTTP Context Map Controller Service to use for caching the HTTP Request Information",
                                "allowableValues": [
                                    {
                                        "allowableValue": {
                                            "displayName": "StandardHttpContextMap",
                                            "value": "3826243a-0170-1000-5776-5ad01ae6db7a"
                                        },
                                        "canRead": true
                                    }
                                ],
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported",
                                "identifiesControllerService": "org.apache.nifi.http.HttpContextMap",
                                "identifiesControllerServiceBundle": {
                                    "group": "org.apache.nifi",
                                    "artifact": "nifi-standard-services-api-nar",
                                    "version": "1.11.1"
                                }
                            },
                            "Allowed Paths": {
                                "name": "Allowed Paths",
                                "displayName": "Allowed Paths",
                                "description": "A Regular Expression that specifies the valid HTTP Paths that are allowed in the incoming URL Requests. If this value is specified and the path of the HTTP Requests does not match this Regular Expression, the Processor will respond with a 404: NotFound",
                                "required": false,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "Default URL Character Set": {
                                "name": "Default URL Character Set",
                                "displayName": "Default URL Character Set",
                                "description": "The character set to use for decoding URL parameters if the HTTP Request does not supply one",
                                "defaultValue": "UTF-8",
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "Allow GET": {
                                "name": "Allow GET",
                                "displayName": "Allow GET",
                                "description": "Allow HTTP GET Method",
                                "defaultValue": "true",
                                "allowableValues": [
                                    {
                                        "allowableValue": {
                                            "displayName": "true",
                                            "value": "true"
                                        },
                                        "canRead": true
                                    },
                                    {
                                        "allowableValue": {
                                            "displayName": "false",
                                            "value": "false"
                                        },
                                        "canRead": true
                                    }
                                ],
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "Allow POST": {
                                "name": "Allow POST",
                                "displayName": "Allow POST",
                                "description": "Allow HTTP POST Method",
                                "defaultValue": "true",
                                "allowableValues": [
                                    {
                                        "allowableValue": {
                                            "displayName": "true",
                                            "value": "true"
                                        },
                                        "canRead": true
                                    },
                                    {
                                        "allowableValue": {
                                            "displayName": "false",
                                            "value": "false"
                                        },
                                        "canRead": true
                                    }
                                ],
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "Allow PUT": {
                                "name": "Allow PUT",
                                "displayName": "Allow PUT",
                                "description": "Allow HTTP PUT Method",
                                "defaultValue": "true",
                                "allowableValues": [
                                    {
                                        "allowableValue": {
                                            "displayName": "true",
                                            "value": "true"
                                        },
                                        "canRead": true
                                    },
                                    {
                                        "allowableValue": {
                                            "displayName": "false",
                                            "value": "false"
                                        },
                                        "canRead": true
                                    }
                                ],
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "Allow DELETE": {
                                "name": "Allow DELETE",
                                "displayName": "Allow DELETE",
                                "description": "Allow HTTP DELETE Method",
                                "defaultValue": "true",
                                "allowableValues": [
                                    {
                                        "allowableValue": {
                                            "displayName": "true",
                                            "value": "true"
                                        },
                                        "canRead": true
                                    },
                                    {
                                        "allowableValue": {
                                            "displayName": "false",
                                            "value": "false"
                                        },
                                        "canRead": true
                                    }
                                ],
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "Allow HEAD": {
                                "name": "Allow HEAD",
                                "displayName": "Allow HEAD",
                                "description": "Allow HTTP HEAD Method",
                                "defaultValue": "false",
                                "allowableValues": [
                                    {
                                        "allowableValue": {
                                            "displayName": "true",
                                            "value": "true"
                                        },
                                        "canRead": true
                                    },
                                    {
                                        "allowableValue": {
                                            "displayName": "false",
                                            "value": "false"
                                        },
                                        "canRead": true
                                    }
                                ],
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "Allow OPTIONS": {
                                "name": "Allow OPTIONS",
                                "displayName": "Allow OPTIONS",
                                "description": "Allow HTTP OPTIONS Method",
                                "defaultValue": "false",
                                "allowableValues": [
                                    {
                                        "allowableValue": {
                                            "displayName": "true",
                                            "value": "true"
                                        },
                                        "canRead": true
                                    },
                                    {
                                        "allowableValue": {
                                            "displayName": "false",
                                            "value": "false"
                                        },
                                        "canRead": true
                                    }
                                ],
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "Additional HTTP Methods": {
                                "name": "Additional HTTP Methods",
                                "displayName": "Additional HTTP Methods",
                                "description": "A comma-separated list of non-standard HTTP Methods that should be allowed",
                                "required": false,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "Client Authentication": {
                                "name": "Client Authentication",
                                "displayName": "Client Authentication",
                                "description": "Specifies whether or not the Processor should authenticate clients. This value is ignored if the <SSL Context Service> Property is not specified or the SSL Context provided uses only a KeyStore and not a TrustStore.",
                                "defaultValue": "No Authentication",
                                "allowableValues": [
                                    {
                                        "allowableValue": {
                                            "displayName": "No Authentication",
                                            "value": "No Authentication",
                                            "description": "Processor will not authenticate clients. Anyone can communicate with this Processor anonymously"
                                        },
                                        "canRead": true
                                    },
                                    {
                                        "allowableValue": {
                                            "displayName": "Want Authentication",
                                            "value": "Want Authentication",
                                            "description": "Processor will try to verify the client but if unable to verify will allow the client to communicate anonymously"
                                        },
                                        "canRead": true
                                    },
                                    {
                                        "allowableValue": {
                                            "displayName": "Need Authentication",
                                            "value": "Need Authentication",
                                            "description": "Processor will reject communications from any client unless the client provides a certificate that is trusted by the TrustStorespecified in the SSL Context Service"
                                        },
                                        "canRead": true
                                    }
                                ],
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "container-queue-size": {
                                "name": "container-queue-size",
                                "displayName": "Container Queue Size",
                                "description": "The size of the queue for Http Request Containers",
                                "defaultValue": "50",
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "multipart-request-max-size": {
                                "name": "multipart-request-max-size",
                                "displayName": "Multipart Request Max Size",
                                "description": "The max size of the request. Only applies for requests with Content-Type: multipart/form-data, and is used to prevent denial of service type of attacks, to prevent filling up the heap or disk space",
                                "defaultValue": "1 MB",
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            },
                            "multipart-read-buffer-size": {
                                "name": "multipart-read-buffer-size",
                                "displayName": "Multipart Read Buffer Size",
                                "description": "The threshold size, at which the contents of an incoming file would be written to disk. Only applies for requests with Content-Type: multipart/form-data. It is used to prevent denial of service type of attacks, to prevent filling up the heap or disk space.",
                                "defaultValue": "512 KB",
                                "required": true,
                                "sensitive": false,
                                "dynamic": false,
                                "supportsEl": false,
                                "expressionLanguageScope": "Not Supported"
                            }
                        },
                        "schedulingPeriod": "0 sec",
                        "schedulingStrategy": "TIMER_DRIVEN",
                        "executionNode": "ALL",
                        "penaltyDuration": "30 sec",
                        "yieldDuration": "1 sec",
                        "bulletinLevel": "WARN",
                        "runDurationMillis": 0,
                        "concurrentlySchedulableTaskCount": 1,
                        "comments": "hello",
                        "lossTolerant": false,
                        "defaultConcurrentTasks": {
                            "TIMER_DRIVEN": "1",
                            "EVENT_DRIVEN": "0",
                            "CRON_DRIVEN": "1"
                        },
                        "defaultSchedulingPeriod": {
                            "TIMER_DRIVEN": "0 sec",
                            "CRON_DRIVEN": "* * * * * ?"
                        }
                    },
                    "validationErrors": [],
                    "validationStatus": "VALID"
                }
            ]
        }
    }
}

 

 While trying this, I got a below error

 

N/A
 at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 406, column: 13] (through reference chain: org.apache.nifi.web.api.entity.ProcessGroupEntity["component"]->org.apache.nifi.web.api.dto.ProcessGroupDTO["contents"]->org.apache.nifi.web.api.dto.FlowSnippetDTO["processors"])

 

I'm new to NIFI, Can anyone help with the above issue.