Exemple #1
0
/**
 * Gets the output content for a provenance event
 *
 *
 * Tags: ["provenance-events"]
 *
 * @param clusterNodeId The id of the node where the content exists if clustered.
 * @param id The provenance event id.
 * @return
 */
func (self ProvenanceEvents) GetOutputContent(clusterNodeId string, id string) {
	s := api.Setup()
	res := struct{}{}
	url := "http://localhost:8080/nifi-api/provenance-events/{id}/content/output"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

}
Exemple #2
0
/**
 * Gets the content for a FlowFile in a Connection.
 *
 *
 * Tags: ["flowfile-queues"]
 *
 * @param clientId If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.
 * @param id The connection id.
 * @param flowfileUuid The flowfile uuid.
 * @param clusterNodeId The id of the node where the content exists if clustered.
 * @return
 */
func (self FlowfileQueues) DownloadFlowFileContent(clientId string, id string, flowfileUuid string, clusterNodeId string) {
	s := api.Setup()
	res := struct{}{}
	url := "http://localhost:8080/nifi-api/flowfile-queues/{id}/flowfiles/{flowfile-uuid}/content"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

}
Exemple #3
0
/**
 * Transfer flow files from the output port
 *
 *
 * Tags: ["data-transfer"]
 *
 * @param portId The output port id.
 * @param transactionId
 * @return
 */
func (self DataTransfer) TransferFlowFiles(portId string, transactionId string) {
	s := api.Setup()
	res := struct{}{}
	url := "http://localhost:8080/nifi-api/data-transfer/output-ports/{portId}/transactions/{transactionId}/flow-files"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

}
Exemple #4
0
/**
 * Updates a connection
 *
 *
 * Tags: ["connections"]
 *
 * @param id The connection id.
 * @param body The connection configuration details.
 * @return model.ConnectionEntity
 */
func (self Connections) UpdateConnection(id string, body model.ConnectionEntity) model.ConnectionEntity {
	s := api.Setup()
	res := model.ConnectionEntity{}
	url := "http://localhost:8080/nifi-api/connections/{id}"
	resp, err := s.Put(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
/**
 * Updates a remote process group
 *
 *
 * Tags: ["remote-process-groups"]
 *
 * @param id The remote process group id.
 * @param body The remote process group.
 * @return model.RemoteProcessGroupEntity
 */
func (self RemoteProcessGroups) UpdateRemoteProcessGroup(id string, body model.RemoteProcessGroupEntity) model.RemoteProcessGroupEntity {
	s := api.Setup()
	res := model.RemoteProcessGroupEntity{}
	url := "http://localhost:8080/nifi-api/remote-process-groups/{id}"
	resp, err := s.Put(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #6
0
/**
 * Gets a user group
 *
 * Note: This endpoint is subject to change as NiFi and it's REST API evolve.
 *
 * Tags: ["tenants"]
 *
 * @param id The user group id.
 * @return model.UserGroupEntity
 */
func (self Tenants) GetUserGroup(id string) model.UserGroupEntity {
	s := api.Setup()
	res := model.UserGroupEntity{}
	url := "http://localhost:8080/nifi-api/tenants/user-groups/{id}"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #7
0
/**
 * Updates a user
 *
 * Note: This endpoint is subject to change as NiFi and it's REST API evolve.
 *
 * Tags: ["tenants"]
 *
 * @param id The user id.
 * @param body The user configuration details.
 * @return model.UserEntity
 */
func (self Tenants) UpdateUser(id string, body model.UserEntity) model.UserEntity {
	s := api.Setup()
	res := model.UserEntity{}
	url := "http://localhost:8080/nifi-api/tenants/users/{id}"
	resp, err := s.Put(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #8
0
/**
 * Generates a client id.
 *
 *
 * Tags: ["flow"]
 *
 * @return string
 */
func (self Flow) GenerateClientId() string {
	s := api.Setup()
	res := ""
	url := "http://localhost:8080/nifi-api/flow/client-id"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #9
0
/**
 * Gets the status history
 *
 *
 * Tags: ["flow"]
 *
 * @param id The remote process group id.
 * @return model.StatusHistoryEntity
 */
func (self Flow) GetRemoteProcessGroupStatusHistory(id string) model.StatusHistoryEntity {
	s := api.Setup()
	res := model.StatusHistoryEntity{}
	url := "http://localhost:8080/nifi-api/flow/remote-process-groups/{id}/status/history"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #10
0
/**
 * Retrieves the configuration for this NiFi flow
 *
 *
 * Tags: ["flow"]
 *
 * @return model.FlowConfigurationEntity
 */
func (self Flow) GetFlowConfig() model.FlowConfigurationEntity {
	s := api.Setup()
	res := model.FlowConfigurationEntity{}
	url := "http://localhost:8080/nifi-api/flow/config"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #11
0
/**
 * Clears the state for a processor
 *
 *
 * Tags: ["processors"]
 *
 * @param id The processor id.
 * @return model.ComponentStateDTO
 */
func (self Processors) ClearState(id string) model.ComponentStateDTO {
	s := api.Setup()
	res := model.ComponentStateDTO{}
	url := "http://localhost:8080/nifi-api/processors/{id}/state/clear-requests"
	resp, err := s.Post(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #12
0
/**
 * Gets the descriptor for a processor property
 *
 *
 * Tags: ["processors"]
 *
 * @param clientId If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.
 * @param id The processor id.
 * @param propertyName The property name.
 * @return model.PropertyDescriptorEntity
 */
func (self Processors) GetPropertyDescriptor(clientId string, id string, propertyName string) model.PropertyDescriptorEntity {
	s := api.Setup()
	res := model.PropertyDescriptorEntity{}
	url := "http://localhost:8080/nifi-api/processors/{id}/descriptors"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #13
0
/**
 * Gets the state for a controller service
 *
 *
 * Tags: ["controller-services"]
 *
 * @param id The controller service id.
 * @return model.ComponentStateDTO
 */
func (self ControllerServices) GetState(id string) model.ComponentStateDTO {
	s := api.Setup()
	res := model.ComponentStateDTO{}
	url := "http://localhost:8080/nifi-api/controller-services/{id}/state"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #14
0
/**
 * Updates a controller services references
 *
 *
 * Tags: ["controller-services"]
 *
 * @param id The controller service id.
 * @param body The controller service request update request.
 * @return model.ControllerServiceReferencingComponentsEntity
 */
func (self ControllerServices) UpdateControllerServiceReferences(id string, body model.UpdateControllerServiceReferenceRequestEntity) model.ControllerServiceReferencingComponentsEntity {
	s := api.Setup()
	res := model.ControllerServiceReferencingComponentsEntity{}
	url := "http://localhost:8080/nifi-api/controller-services/{id}/references"
	resp, err := s.Put(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #15
0
/**
 * Exports a template
 *
 *
 * Tags: ["templates"]
 *
 * @param id The template id.
 * @return model.TemplateDTO
 */
func (self Templates) ExportTemplate(id string) model.TemplateDTO {
	s := api.Setup()
	res := model.TemplateDTO{}
	url := "http://localhost:8080/nifi-api/templates/{id}/download"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #16
0
/**
 * Gets status for a processor
 *
 *
 * Tags: ["flow"]
 *
 * @param nodewise Whether or not to include the breakdown per node. Optional, defaults to false
 * @param clusterNodeId The id of the node where to get the status.
 * @param id The processor id.
 * @return model.ProcessorStatusEntity
 */
func (self Flow) GetProcessorStatus(nodewise bool, clusterNodeId string, id string) model.ProcessorStatusEntity {
	s := api.Setup()
	res := model.ProcessorStatusEntity{}
	url := "http://localhost:8080/nifi-api/flow/processors/{id}/status"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #17
0
/**
 * Gets current bulletins
 *
 *
 * Tags: ["flow"]
 *
 * @param after Includes bulletins with an id after this value.
 * @param sourceName Includes bulletins originating from this sources whose name match this regular expression.
 * @param message Includes bulletins whose message that match this regular expression.
 * @param sourceId Includes bulletins originating from this sources whose id match this regular expression.
 * @param groupId Includes bulletins originating from this sources whose group id match this regular expression.
 * @param limit The number of bulletins to limit the response to.
 * @return model.BulletinBoardEntity
 */
func (self Flow) GetBulletinBoard(after string, sourceName string, message string, sourceId string, groupId string, limit string) model.BulletinBoardEntity {
	s := api.Setup()
	res := model.BulletinBoardEntity{}
	url := "http://localhost:8080/nifi-api/flow/bulletin-board"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #18
0
/**
 * Retrieves Controller level bulletins
 *
 *
 * Tags: ["flow"]
 *
 * @return model.ControllerBulletinsEntity
 */
func (self Flow) GetBulletins() model.ControllerBulletinsEntity {
	s := api.Setup()
	res := model.ControllerBulletinsEntity{}
	url := "http://localhost:8080/nifi-api/flow/controller/bulletins"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #19
0
/**
 * Gets all templates
 *
 *
 * Tags: ["flow"]
 *
 * @return model.TemplatesEntity
 */
func (self Flow) GetTemplates() model.TemplatesEntity {
	s := api.Setup()
	res := model.TemplatesEntity{}
	url := "http://localhost:8080/nifi-api/flow/templates"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #20
0
/**
 * Retrieves the user identity of the user making the request
 *
 *
 * Tags: ["flow"]
 *
 * @return model.CurrentUserEntity
 */
func (self Flow) GetCurrentUser() model.CurrentUserEntity {
	s := api.Setup()
	res := model.CurrentUserEntity{}
	url := "http://localhost:8080/nifi-api/flow/current-user"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #21
0
/**
 * Searches the cluster for a node with the specified address
 *
 * Note: This endpoint is subject to change as NiFi and it's REST API evolve.
 *
 * Tags: ["tenants"]
 *
 * @param q Node address to search for.
 * @return model.ClusterSearchResultsEntity
 */
func (self Tenants) SearchCluster(q string) model.ClusterSearchResultsEntity {
	s := api.Setup()
	res := model.ClusterSearchResultsEntity{}
	url := "http://localhost:8080/nifi-api/tenants/search-results"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #22
0
/**
 * Gets configuration history
 *
 * Note: This endpoint is subject to change as NiFi and it's REST API evolve.
 *
 * Tags: ["flow"]
 *
 * @param offset The offset into the result set.
 * @param count The number of actions to return.
 * @param sortColumn The field to sort on.
 * @param sortOrder The direction to sort.
 * @param startDate Include actions after this date.
 * @param endDate Include actions before this date.
 * @param userIdentity Include actions performed by this user.
 * @param sourceId Include actions on this component.
 * @return model.HistoryEntity
 */
func (self Flow) QueryHistory(offset string, count string, sortColumn string, sortOrder string, startDate string, endDate string, userIdentity string, sourceId string) model.HistoryEntity {
	s := api.Setup()
	res := model.HistoryEntity{}
	url := "http://localhost:8080/nifi-api/flow/history"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #23
0
/**
 * Deletes a user
 *
 * Note: This endpoint is subject to change as NiFi and it's REST API evolve.
 *
 * Tags: ["tenants"]
 *
 * @param version The revision is used to verify the client is working with the latest version of the flow.
 * @param clientId If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.
 * @param id The user id.
 * @return model.UserEntity
 */
func (self Tenants) RemoveUser(version string, clientId string, id string) model.UserEntity {
	s := api.Setup()
	res := model.UserEntity{}
	url := "http://localhost:8080/nifi-api/tenants/users/{id}"
	resp, err := s.Delete(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #24
0
/**
 * Gets configuration history for a component
 *
 * Note: This endpoint is subject to change as NiFi and it's REST API evolve.
 *
 * Tags: ["flow"]
 *
 * @param componentId The component id.
 * @return model.ComponentHistoryEntity
 */
func (self Flow) GetComponentHistory(componentId string) model.ComponentHistoryEntity {
	s := api.Setup()
	res := model.ComponentHistoryEntity{}
	url := "http://localhost:8080/nifi-api/flow/history/components/{componentId}"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #25
0
/**
 * Gets a funnel
 *
 *
 * Tags: ["funnel"]
 *
 * @param id The funnel id.
 * @return model.FunnelEntity
 */
func (self Funnels) GetFunnel(id string) model.FunnelEntity {
	s := api.Setup()
	res := model.FunnelEntity{}
	url := "http://localhost:8080/nifi-api/funnels/{id}"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #26
0
/**
 * Gets an action
 *
 * Note: This endpoint is subject to change as NiFi and it's REST API evolve.
 *
 * Tags: ["flow"]
 *
 * @param id The action id.
 * @return model.ActionEntity
 */
func (self Flow) GetAction(id string) model.ActionEntity {
	s := api.Setup()
	res := model.ActionEntity{}
	url := "http://localhost:8080/nifi-api/flow/history/{id}"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
/**
 * Deletes a remote process group
 *
 *
 * Tags: ["remote-process-groups"]
 *
 * @param version The revision is used to verify the client is working with the latest version of the flow.
 * @param clientId If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.
 * @param id The remote process group id.
 * @return model.RemoteProcessGroupEntity
 */
func (self RemoteProcessGroups) RemoveRemoteProcessGroup(version string, clientId string, id string) model.RemoteProcessGroupEntity {
	s := api.Setup()
	res := model.RemoteProcessGroupEntity{}
	url := "http://localhost:8080/nifi-api/remote-process-groups/{id}"
	resp, err := s.Delete(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #28
0
/**
 * Schedule or unschedule comopnents in the specified Process Group.
 *
 *
 * Tags: ["flow"]
 *
 * @param id The process group id.
 * @param body The request to schedule or unschedule. If the comopnents in the request are not specified, all authorized components will be considered.
 * @return model.ScheduleComponentsEntity
 */
func (self Flow) ScheduleComponents(id string, body model.ScheduleComponentsEntity) model.ScheduleComponentsEntity {
	s := api.Setup()
	res := model.ScheduleComponentsEntity{}
	url := "http://localhost:8080/nifi-api/flow/process-groups/{id}"
	resp, err := s.Put(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #29
0
/**
 * Deletes a connection
 *
 *
 * Tags: ["connections"]
 *
 * @param version The revision is used to verify the client is working with the latest version of the flow.
 * @param clientId If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.
 * @param id The connection id.
 * @return model.ConnectionEntity
 */
func (self Connections) DeleteConnection(version string, clientId string, id string) model.ConnectionEntity {
	s := api.Setup()
	res := model.ConnectionEntity{}
	url := "http://localhost:8080/nifi-api/connections/{id}"
	resp, err := s.Delete(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}
Exemple #30
0
/**
 * Gets all controller services
 *
 *
 * Tags: ["flow"]
 *
 * @param id The process group id.
 * @return model.ControllerServicesEntity
 */
func (self Flow) GetControllerServicesFromGroup(id string) model.ControllerServicesEntity {
	s := api.Setup()
	res := model.ControllerServicesEntity{}
	url := "http://localhost:8080/nifi-api/flow/process-groups/{id}/controller-services"
	resp, err := s.Get(url, nil, &res, nil)
	if err != nil {
		log.Fatal(err)
	}

	if resp.Status() != 200 {
		fmt.Println(res)
	}

	return res
}