跳到主要内容
版本:Next

My Hours

My Hours 源连接器

支持这些引擎

Spark
Flink
SeaTunnel Zeta

关键特性

描述

用于从 My Hours 读取数据。

支持的数据源信息

为了使用 My Hours 连接器,需要以下依赖项。 可以通过 install-plugin.sh 或从 Maven 中央存储库下载。

数据源支持的版本依赖
My Hoursuniversal下载

源选项

参数名类型必须默认值描述
urlString-HTTP 请求 URL
emailString-My Hours 登录电子邮件地址
passwordString-My Hours 登录密码
schemaConfig-HTTP 和 SeaTunnel 数据结构映射
schema.fieldsConfig-上游数据的模式字段
json_fieldConfig-此参数帮助您配置模式,因此此参数必须与 schema 一起使用。
content_jsonString-此参数可以获取一些 JSON 数据。
formatStringjson上游数据的格式,现在仅支持 json text,默认 json
methodStringgetHTTP 请求方法,仅支持 GET、POST 方法。
headersMap-HTTP 请求头
paramsMap-HTTP 参数
bodyString-HTTP 请求体
poll_interval_millisInt-流模式下请求 HTTP API 的间隔(毫秒)
retryInt-如果 HTTP 请求返回 IOException 的最大重试次数
retry_backoff_multiplier_msInt100HTTP 请求失败时的重试退避倍数(毫秒)
retry_backoff_max_msInt10000HTTP 请求失败时的最大重试退避时间(毫秒)
enable_multi_linesBooleanfalse是否启用多行模式
common-options-源插件通用参数

如何创建 My Hours 数据同步作业

env {
parallelism = 1
job.mode = "BATCH"
}

source {
MyHours{
url = "https://api2.myhours.com/api/Projects/getAll"
email = "seatunnel@test.com"
password = "seatunnel"
schema {
fields {
name = string
archived = boolean
dateArchived = string
dateCreated = string
clientName = string
budgetAlertPercent = string
budgetType = int
totalTimeLogged = double
budgetValue = double
totalAmount = double
totalExpense = double
laborCost = double
totalCost = double
billableTimeLogged = double
totalBillableAmount = double
billable = boolean
roundType = int
roundInterval = int
budgetSpentPercentage = double
budgetTarget = int
budgetPeriodType = string
budgetSpent = string
id = string
}
}
}
}

# 控制台打印读取的数据
sink {
Console {
parallelism = 1
}
}

参数解释

format

当您指定格式为 json 时,您还应该指定 schema 选项。

content_json

此参数可以获取一些 JSON 数据。如果您只需要 'book' 部分中的数据,配置 content_field = "$.store.book.*"

json_field

此参数帮助您配置模式,因此此参数必须与 schema 一起使用。

变更日志

Change Log
ChangeCommitVersion
[Feature][connector-http] Parameters support placeholder replacement (#9184)https://github.com/apache/seatunnel/commit/8617014edc2.3.11
[improve] http connector options (#8969)https://github.com/apache/seatunnel/commit/63ff9f910a2.3.10
[Fix][connector-http] fix when post have param (#8434)https://github.com/apache/seatunnel/commit/c1b2675ab02.3.10
[Improve][dist]add shade check rule (#8136)https://github.com/apache/seatunnel/commit/51ef8000162.3.9
[Feature][Connector-V2] Support TableSourceFactory/TableSinkFactory on http (#5816)https://github.com/apache/seatunnel/commit/6f49ec6ead2.3.4
[Improve][build] Give the maven module a human readable name (#4114)https://github.com/apache/seatunnel/commit/d7cd6010512.3.1
[Improve][Project] Code format with spotless plugin. (#4101)https://github.com/apache/seatunnel/commit/a2ab1665612.3.1
[Improve][Connector-V2][Http]Improve json parse option rule for all http connector (#3627)https://github.com/apache/seatunnel/commit/589e4161ec2.3.0
[Feature][Connector-V2][HTTP] Use json-path parsing (#3510)https://github.com/apache/seatunnel/commit/1807eb6c952.3.0
[Hotfix][OptionRule] Fix option rule about all connectors (#3592)https://github.com/apache/seatunnel/commit/226dc6a1192.3.0
[Improve][Connector-V2][MyHours]Unified exception for MyHours connector (#3538)https://github.com/apache/seatunnel/commit/48ab7c97d52.3.0
[HotFix][Core][API] Fix OptionValidation error code (#3439)https://github.com/apache/seatunnel/commit/ace219f3762.3.0
[Improve][Connector-V2][My Hours]Add http method enum && Improve My Hours connector option rule (#3390)https://github.com/apache/seatunnel/commit/a86c9d90f72.3.0
[Feature][Connector-V2][Http] Add option rules && Improve Myhours sink connector (#3351)https://github.com/apache/seatunnel/commit/cc8bb60c832.3.0
[Feature][Connector-V2][My Hours] Add My Hours Source Connector (#3228)https://github.com/apache/seatunnel/commit/4104a3e30e2.3.0