Skip to main content

Versions

Struct Versions 

Source
pub struct Versions<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Versions<'a>

Source

pub async fn get_version_information( &self, id: &str, ) -> Result<VersionControlInformationEntity, NifiError>

Gets the Version Control information for a process group

Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls GET /nifi-api/versions/process-groups/{id}.

§Parameters
  • id: The process group id.
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions

Requires Read - /process-groups/{uuid}.

Source

pub async fn export_flow_version(&self, id: &str) -> Result<Value, NifiError>

Gets the latest version of a Process Group for download

Calls GET /nifi-api/versions/process-groups/{id}/download.

§Parameters
  • id: The process group id.
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions

Requires Read - /process-groups/{uuid}.

Source

pub async fn get_revert_request( &self, id: &str, ) -> Result<VersionedFlowUpdateRequestEntity, NifiError>

Returns the Revert Request with the given ID

Returns the Revert Request with the given ID. Once a Revert Request has been created by performing a POST to /versions/revert-requests/process-groups/{id}, that request can subsequently be retrieved via this endpoint, and the request that is fetched will contain the updated state, such as percent complete, the current state of the request, and any failures. Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls GET /nifi-api/versions/revert-requests/{id}.

§Parameters
  • id: The ID of the Revert Request
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions

Requires Only the user that submitted the request can get it.

Source

pub async fn get_update_request( &self, id: &str, ) -> Result<VersionedFlowUpdateRequestEntity, NifiError>

Returns the Update Request with the given ID

Returns the Update Request with the given ID. Once an Update Request has been created by performing a POST to /versions/update-requests/process-groups/{id}, that request can subsequently be retrieved via this endpoint, and the request that is fetched will contain the updated state, such as percent complete, the current state of the request, and any failures. Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls GET /nifi-api/versions/update-requests/{id}.

§Parameters
  • id: The ID of the Update Request
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions

Requires Only the user that submitted the request can get it.

Source

pub async fn create_version_control_request( &self, body: &CreateActiveRequestEntity, ) -> Result<String, NifiError>

Create a version control request

Creates a request so that a Process Group can be placed under Version Control or have its Version Control configuration changed. Creating this request will prevent any other threads from simultaneously saving local changes to Version Control. It will not, however, actually save the local flow to the Flow Registry. A POST to /versions/process-groups/{id} should be used to initiate saving of the local flow to the Flow Registry. Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls POST /nifi-api/versions/active-requests.

§Parameters
  • body: The versioned flow details.
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions

Requires Write - /process-groups/{uuid}.

Source

pub async fn save_to_flow_registry( &self, id: &str, body: &StartVersionControlRequestEntity, ) -> Result<VersionControlInformationEntity, NifiError>

Save the Process Group with the given ID

Begins version controlling the Process Group with the given ID or commits changes to the Versioned Flow, depending on if the provided VersionControlInformation includes a flowId. Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls POST /nifi-api/versions/process-groups/{id}.

§Parameters
  • id: The process group id.
  • body: The versioned flow details.
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions
  • Read - /process-groups/{uuid}
  • Write - /process-groups/{uuid}
  • Read - /{component-type}/{uuid} - For all encapsulated components
  • Read - any referenced Controller Services by any encapsulated components - /controller-services/{uuid}
Source

pub async fn initiate_revert_flow_version( &self, id: &str, body: &VersionControlInformationEntity, ) -> Result<VersionedFlowUpdateRequestEntity, NifiError>

Initiate the Revert Request of a Process Group with the given ID

For a Process Group that is already under Version Control, this will initiate the action of reverting any local changes that have been made to the Process Group since it was last synchronized with the Flow Registry. This will result in the flow matching the Versioned Flow that exists in the Flow Registry. This can be a lengthy process, as it will stop any Processors and disable any Controller Services necessary to perform the action and then restart them. As a result, the endpoint will immediately return a VersionedFlowUpdateRequestEntity, and the process of updating the flow will occur asynchronously in the background. The client may then periodically poll the status of the request by issuing a GET request to /versions/revert-requests/{requestId}. Once the request is completed, the client is expected to issue a DELETE request to /versions/revert-requests/{requestId}. Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls POST /nifi-api/versions/revert-requests/process-groups/{id}.

§Parameters
  • id: The process group id.
  • body: The Version Control Information to revert to.
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions
  • Read - /process-groups/{uuid}
  • Write - /process-groups/{uuid}
  • Read - /{component-type}/{uuid} - For all encapsulated components
  • Write - /{component-type}/{uuid} - For all encapsulated components
  • Write - if the template contains any restricted components - /restricted-components
  • Read - /parameter-contexts/{uuid} - For any Parameter Context that is referenced by a Property that is changed, added, or removed
Source

pub async fn initiate_version_control_update( &self, id: &str, body: &VersionControlInformationEntity, ) -> Result<VersionedFlowUpdateRequestEntity, NifiError>

Initiate the Update Request of a Process Group with the given ID

For a Process Group that is already under Version Control, this will initiate the action of changing from a specific version of the flow in the Flow Registry to a different version of the flow. This can be a lengthy process, as it will stop any Processors and disable any Controller Services necessary to perform the action and then restart them. As a result, the endpoint will immediately return a VersionedFlowUpdateRequestEntity, and the process of updating the flow will occur asynchronously in the background. The client may then periodically poll the status of the request by issuing a GET request to /versions/update-requests/{requestId}. Once the request is completed, the client is expected to issue a DELETE request to /versions/update-requests/{requestId}. Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls POST /nifi-api/versions/update-requests/process-groups/{id}.

§Parameters
  • id: The process group id.
  • body: The controller service configuration details.
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions
  • Read - /process-groups/{uuid}
  • Write - /process-groups/{uuid}
  • Read - /{component-type}/{uuid} - For all encapsulated components
  • Write - /{component-type}/{uuid} - For all encapsulated components
  • Write - if the template contains any restricted components - /restricted-components
  • Read - /parameter-contexts/{uuid} - For any Parameter Context that is referenced by a Property that is changed, added, or removed
Source

pub async fn update_version_control_request( &self, id: &str, body: &VersionControlComponentMappingEntity, ) -> Result<VersionControlInformationEntity, NifiError>

Updates the request with the given ID

Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls PUT /nifi-api/versions/active-requests/{id}.

§Parameters
  • id: The request ID.
  • body: The version control component mapping.
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions

Requires Only the user that submitted the request can update it.

Source

pub async fn update_flow_version( &self, id: &str, body: &VersionedFlowSnapshotEntity, ) -> Result<VersionControlInformationEntity, NifiError>

Update the version of a Process Group with the given ID

For a Process Group that is already under Version Control, this will update the version of the flow to a different version. This endpoint expects that the given snapshot will not modify any Processor that is currently running or any Controller Service that is enabled. Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls PUT /nifi-api/versions/process-groups/{id}.

§Parameters
  • id: The process group id.
  • body: The controller service configuration details.
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions
  • Read - /process-groups/{uuid}
  • Write - /process-groups/{uuid}
Source

pub async fn delete_version_control_request( &self, id: &str, disconnected_node_acknowledged: Option<bool>, ) -> Result<(), NifiError>

Deletes the version control request with the given ID

Deletes the Version Control Request with the given ID. This will allow other threads to save flows to the Flow Registry. See also the documentation for POSTing to /versions/active-requests for information regarding why this is done. Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls DELETE /nifi-api/versions/active-requests/{id}.

§Parameters
  • id: The request ID.
  • disconnected_node_acknowledged: Acknowledges that this node is disconnected to allow for mutable requests to proceed.
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions

Requires Only the user that submitted the request can remove it.

Source

pub async fn stop_version_control( &self, id: &str, version: Option<&str>, client_id: Option<&str>, disconnected_node_acknowledged: Option<bool>, ) -> Result<VersionControlInformationEntity, NifiError>

Stops version controlling the Process Group with the given ID

Stops version controlling the Process Group with the given ID. The Process Group will no longer track to any Versioned Flow. Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls DELETE /nifi-api/versions/process-groups/{id}.

§Parameters
  • id: The process group id.
  • version: The version is used to verify the client is working with the latest version of the flow.
  • client_id: If the client id is not specified, a new one will be generated. This value (whether specified or generated) is included in the response.
  • disconnected_node_acknowledged: Acknowledges that this node is disconnected to allow for mutable requests to proceed.
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions
  • Read - /process-groups/{uuid}
  • Write - /process-groups/{uuid}
Source

pub async fn delete_revert_request( &self, id: &str, disconnected_node_acknowledged: Option<bool>, ) -> Result<VersionedFlowUpdateRequestEntity, NifiError>

Deletes the Revert Request with the given ID

Deletes the Revert Request with the given ID. After a request is created via a POST to /versions/revert-requests/process-groups/{id}, it is expected that the client will properly clean up the request by DELETE’ing it, once the Revert process has completed. If the request is deleted before the request completes, then the Revert request will finish the step that it is currently performing and then will cancel any subsequent steps. Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls DELETE /nifi-api/versions/revert-requests/{id}.

§Parameters
  • id: The ID of the Revert Request
  • disconnected_node_acknowledged: Acknowledges that this node is disconnected to allow for mutable requests to proceed.
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions

Requires Only the user that submitted the request can remove it.

Source

pub async fn delete_update_request( &self, id: &str, disconnected_node_acknowledged: Option<bool>, ) -> Result<VersionedFlowUpdateRequestEntity, NifiError>

Deletes the Update Request with the given ID

Deletes the Update Request with the given ID. After a request is created via a POST to /versions/update-requests/process-groups/{id}, it is expected that the client will properly clean up the request by DELETE’ing it, once the Update process has completed. If the request is deleted before the request completes, then the Update request will finish the step that it is currently performing and then will cancel any subsequent steps. Note: This endpoint is subject to change as NiFi and it’s REST API evolve.

Calls DELETE /nifi-api/versions/update-requests/{id}.

§Parameters
  • id: The ID of the Update Request
  • disconnected_node_acknowledged: Acknowledges that this node is disconnected to allow for mutable requests to proceed.
§Errors
  • 400: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
  • 401: Client could not be authenticated.
  • 403: Client is not authorized to make this request.
  • 404: The specified resource could not be found.
  • 409: The request was valid but NiFi was not in the appropriate state to process it.
§Permissions

Requires Only the user that submitted the request can remove it.

Auto Trait Implementations§

§

impl<'a> Freeze for Versions<'a>

§

impl<'a> !RefUnwindSafe for Versions<'a>

§

impl<'a> Send for Versions<'a>

§

impl<'a> Sync for Versions<'a>

§

impl<'a> Unpin for Versions<'a>

§

impl<'a> UnsafeUnpin for Versions<'a>

§

impl<'a> !UnwindSafe for Versions<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more