當前位置: 首頁>>代碼示例>>Golang>>正文


Golang api.Setup函數代碼示例

本文整理匯總了Golang中github.com/mrcsparker/ifin/api.Setup函數的典型用法代碼示例。如果您正苦於以下問題:Golang Setup函數的具體用法?Golang Setup怎麽用?Golang Setup使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Setup函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: GetOutputContent

/**
 * 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)
	}

}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:24,代碼來源:provenanceevents.go

示例2: DownloadFlowFileContent

/**
 * 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)
	}

}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:26,代碼來源:flowfilequeues.go

示例3: TransferFlowFiles

/**
 * 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)
	}

}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:24,代碼來源:datatransfer.go

示例4: UpdateConnection

/**
 * 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
}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:25,代碼來源:connections.go

示例5: UpdateRemoteProcessGroup

/**
 * 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
}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:25,代碼來源:remoteprocessgroups.go

示例6: GetUserGroup

/**
 * 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
}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:25,代碼來源:tenants.go

示例7: UpdateUser

/**
 * 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
}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:26,代碼來源:tenants.go

示例8: GenerateClientId

/**
 * 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
}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:23,代碼來源:flow.go

示例9: GetRemoteProcessGroupStatusHistory

/**
 * 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
}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:24,代碼來源:flow.go

示例10: GetFlowConfig

/**
 * 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
}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:23,代碼來源:flow.go

示例11: ClearState

/**
 * 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
}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:24,代碼來源:processors.go

示例12: GetPropertyDescriptor

/**
 * 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
}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:26,代碼來源:processors.go

示例13: GetState

/**
 * 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
}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:24,代碼來源:controllerservices.go

示例14: UpdateControllerServiceReferences

/**
 * 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
}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:25,代碼來源:controllerservices.go

示例15: ExportTemplate

/**
 * 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
}
開發者ID:mrcsparker,項目名稱:ifin,代碼行數:24,代碼來源:templates.go


注:本文中的github.com/mrcsparker/ifin/api.Setup函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。