Skip to content

Latest commit

 

History

History
176 lines (124 loc) · 5.42 KB

ConnectionsApi.md

File metadata and controls

176 lines (124 loc) · 5.42 KB

ConnectionsApi

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

Method HTTP request Description
deleteConnection DELETE /connections/{id} Deletes a connection
getConnection GET /connections/{id} Gets a connection
updateConnection PUT /connections/{id} Updates a connection

deleteConnection

ConnectionEntity deleteConnection(id, version, clientId)

Deletes a connection

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.ConnectionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

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

ConnectionsApi apiInstance = new ConnectionsApi();
String id = "id_example"; // String | The connection id.
String version = "version_example"; // String | The revision is used to verify the client is working with the latest version of the flow.
String clientId = "clientId_example"; // String | If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.
try {
    ConnectionEntity result = apiInstance.deleteConnection(id, version, clientId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ConnectionsApi#deleteConnection");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String The connection id.
version String The revision is used to verify the client is working with the latest version of the flow. [optional]
clientId String If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response. [optional]

Return type

ConnectionEntity

Authorization

auth

HTTP request headers

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

getConnection

ConnectionEntity getConnection(id)

Gets a connection

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.ConnectionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

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

ConnectionsApi apiInstance = new ConnectionsApi();
String id = "id_example"; // String | The connection id.
try {
    ConnectionEntity result = apiInstance.getConnection(id);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ConnectionsApi#getConnection");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String The connection id.

Return type

ConnectionEntity

Authorization

auth

HTTP request headers

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

updateConnection

ConnectionEntity updateConnection(id, body)

Updates a connection

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.ConnectionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

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

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

Parameters

Name Type Description Notes
id String The connection id.
body ConnectionEntity The connection configuration details.

Return type

ConnectionEntity

Authorization

auth

HTTP request headers

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