...
- /site-to-site/
- GET: Returns required information of Site-to-Site for the source NiFi environment. Representing Controller of target NiFi environment.
- /site-to-site/peers/
- GET: Returns available peers of this NiFi environment.
- /site-to-site/input-ports/{portId}/transactions/
- POST: Initiate new transaction to send data from source to target NiFi. A new transaction id is published and returned.
- /site-to-site/input-ports/{portId}/transactions/{transactionId}
- POST: Transfer data from source to target NiFi. The transaction will be held on server side instead of commit it immediately, in order to provide 2-phase style commit. Returns Checksum calculated on server side.
- DELETE: Commit the transaction which is held on server side.
- /site-to-site/output-ports/{portId}/transactions/
- POST: Initiate new transaction to receive data from target to source NiFi. A new transaction id is published and returned.
- /site-to-site/output-ports/{portId}/transactions/{transactionId}
- GET: Transfer data from target to source NiFi. The transaction will be held on server side instead of commit it immediately, in order to provide 2-phase style commit.
- DELETE: Commit the transaction which is held on server side. Client sends a Checksum calculated on client side.
PlantUML |
---|
actor A_component actor HttpClient actor HttpClientTransaction actor SiteToSiteRestApiUtil actor SiteToSiteResource ' comment: initialize A_component -> HttpClient: createTransaction HttpClient -> SiteToSiteRestApiUtil: initiateTransaction SiteToSiteRestApiUtil -> SiteToSiteResource: POST /site-to-site/output-ports/{portId}/transactions SiteToSiteRestApiUtil <-- SiteToSiteResource: transactionUrl-1, transactionProtocolVersion HttpClient <-- SiteToSiteRestApiUtil HttpClient -> HttpClientTransaction: new HttpClientTransaction -> HttpClientTransaction: state = TRANSACTION_STARTED HttpClientTransaction -> SiteToSiteRestApiUtil: openConnectionForReceive SiteToSiteRestApiUtil -> SiteToSiteResource: GET /site-to-site/output-ports/{portId}/transactions/{transactionId-1} SiteToSiteRestApiUtil <-- SiteToSiteResource: 201 Created: transactionUrl-2 HttpClientTransaction <-- SiteToSiteRestApiUtil HttpClient <-- HttpClientTransaction A_component <-- HttpClient: Transaction 'comment: receive alt while there is data packet to receive A_component -> HttpClientTransaction: receive HttpClientTransaction <-- SiteToSiteResource: read from inputstream HttpClientTransaction -> HttpClientTransaction: state = DATA_EXCHANGED A_component <-- HttpClientTransaction: data packet end 'comment: confirm A_component -> HttpClientTransaction: confirm HttpClientTransaction -> SiteToSiteRestApiUtil: commitReceivingFlowFiles(checksum) SiteToSiteRestApiUtil -> SiteToSiteResource: DELETE /site-to-site/output-ports/{portId}/transactions/{transactionId-2} -2} SiteToSiteRestApiUtil <-- SiteToSiteResource: 200 OK HttpClientTransaction <-- SiteToSiteRestApiUtil HttpClientTransaction -> HttpClientTransaction: state = TRANSACTION_CONFIRMED A_component <-- HttpClientTransaction 'comment: complete A_component -> HttpClientTransaction: complete HttpClientTransaction -> HttpClientTransaction: state = TRANSACTION_COMPLETED A_component <-- HttpClientTransaction |
Refer 'REST interactions and scenarios' below for the details of how these REST endpoints are used.
...
Scenario Type | {portId}/transactions | {portId}/transactions/{transactionId} | {portId}/transactions/{transactionId} |
---|---|---|---|
Transaction Initiation Failure |
| N/A | N/A |
Normal Case |
|
| -- confirm()
-- complete()
|
Normal Case - Destination becomes full | (after above interactions) | (after above interactions) | (branched from above interactions)
|
BAD_CHECKSUM | (after above interactions) | (after above interactions) |
|
Cancel transaction | (after above interactions) | (after above interactions) |
|
Defunct transaction | (after above interactions) | (after above interactions) |
|
Expired transaction | (after above interactions) | (after above interactions) |
|
Transaction Initiation Failure | (after above interactions) | (after above interactions) |
|
Defunct transaction | (after above interactions) |
| N/A |
Expired transaction | (after above interactions) |
| N/A |
Transaction Initiation Failure | (after above interactions) |
| N/A |
...