Skip to content

Latest commit

 

History

History
172 lines (120 loc) · 5.11 KB

SnippetsApi.md

File metadata and controls

172 lines (120 loc) · 5.11 KB

SnippetsApi

All URIs are relative to http://localhost/nifi-api

Method HTTP request Description
createSnippet POST /snippets Creates a snippet. The snippet will be automatically discarded if not used in a subsequent request after 1 minute.
deleteSnippet DELETE /snippets/{id} Deletes the components in a snippet and discards the snippet
updateSnippet PUT /snippets/{id} Move's the components in this Snippet into a new Process Group and discards the snippet

createSnippet

SnippetEntity createSnippet(body)

Creates a snippet. The snippet will be automatically discarded if not used in a subsequent request after 1 minute.

Example

// Import classes:
//import com.github.hermannpencole.nifi.swagger.ApiClient;
//import com.github.hermannpencole.nifi.swagger.ApiException;
//import com.github.hermannpencole.nifi.swagger.Configuration;
//import com.github.hermannpencole.nifi.swagger.auth.*;
//import com.github.hermannpencole.nifi.swagger.client.SnippetsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: auth
OAuth auth = (OAuth) defaultClient.getAuthentication("auth");
auth.setAccessToken("YOUR ACCESS TOKEN");

SnippetsApi apiInstance = new SnippetsApi();
SnippetEntity body = new SnippetEntity(); // SnippetEntity | The snippet configuration details.
try {
    SnippetEntity result = apiInstance.createSnippet(body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SnippetsApi#createSnippet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body SnippetEntity The snippet configuration details.

Return type

SnippetEntity

Authorization

auth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteSnippet

SnippetEntity deleteSnippet(id)

Deletes the components in a snippet and discards the snippet

Example

// Import classes:
//import com.github.hermannpencole.nifi.swagger.ApiClient;
//import com.github.hermannpencole.nifi.swagger.ApiException;
//import com.github.hermannpencole.nifi.swagger.Configuration;
//import com.github.hermannpencole.nifi.swagger.auth.*;
//import com.github.hermannpencole.nifi.swagger.client.SnippetsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: auth
OAuth auth = (OAuth) defaultClient.getAuthentication("auth");
auth.setAccessToken("YOUR ACCESS TOKEN");

SnippetsApi apiInstance = new SnippetsApi();
String id = "id_example"; // String | The snippet id.
try {
    SnippetEntity result = apiInstance.deleteSnippet(id);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SnippetsApi#deleteSnippet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String The snippet id.

Return type

SnippetEntity

Authorization

auth

HTTP request headers

  • Content-Type: /
  • Accept: application/json

updateSnippet

SnippetEntity updateSnippet(id, body)

Move's the components in this Snippet into a new Process Group and discards the snippet

Example

// Import classes:
//import com.github.hermannpencole.nifi.swagger.ApiClient;
//import com.github.hermannpencole.nifi.swagger.ApiException;
//import com.github.hermannpencole.nifi.swagger.Configuration;
//import com.github.hermannpencole.nifi.swagger.auth.*;
//import com.github.hermannpencole.nifi.swagger.client.SnippetsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: auth
OAuth auth = (OAuth) defaultClient.getAuthentication("auth");
auth.setAccessToken("YOUR ACCESS TOKEN");

SnippetsApi apiInstance = new SnippetsApi();
String id = "id_example"; // String | The snippet id.
SnippetEntity body = new SnippetEntity(); // SnippetEntity | The snippet configuration details.
try {
    SnippetEntity result = apiInstance.updateSnippet(id, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SnippetsApi#updateSnippet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String The snippet id.
body SnippetEntity The snippet configuration details.

Return type

SnippetEntity

Authorization

auth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json