Skip to content

Commit

Permalink
Merge pull request #167 from chaolee50/master
Browse files Browse the repository at this point in the history
add ingestion
  • Loading branch information
wjo1212 committed Jul 31, 2020
2 parents b030711 + e1ce40f commit 0222c16
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/sample_ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ def main():

ingest_config = '{"schedule":{"delay":0,"runImmediately":true,"interval":"5m","type":"FixedRate"},"lastModifiedTime":1596087431,"recyclable":false,"configuration":{"source":{"bucket":"test-lichao","endpoint":"oss-cn-hangzhou-internal.aliyuncs.com","roleARN":"acs:ram::1049446484210612:role/aliyunlogimportossrole","prefix":" 2019/08/20/13/","compressionCodec":"snappy","restoreObjectEnabled":false,"pattern":"","format":{"skipInvalidRows":false,"timeField":"","type":"JSON"},"type":"AliyunOSS","encoding":"UTF-8"},"logstore":"233"},"createTime":1596087431,"displayName":"osstest","name":"ingest-1596087431-683090","description":"","state":"Enabled","type":"Ingestion","status":"SUCCESSED"}'
res = client.create_ingestion(project, ingest_config)
print res.log_print()
res.log_print()

res = client.list_ingestion(project)
print res.get_ingestions()
res.log_print()

res = client.get_ingestion(project, "ingest-1596087431-683089")
print res.log_print()
res.log_print()

res = client.stop_ingestion(project, "ingest-1596087431-683089")
print res.log_print()
res.log_print()

res = client.start_ingestion(project, "ingest-1596087431-683089")
print res.log_print()
res.log_print()

ingest_config = '{"schedule":{"delay":0,"runImmediately":true,"interval":"5m","type":"FixedRate"},"lastModifiedTime":1596087431,"recyclable":false,"configuration":{"source":{"bucket":"test-lichao","endpoint":"oss-cn-hangzhou-internal.aliyuncs.com","roleARN":"acs:ram::1049446484210612:role/aliyunlogimportossrole","prefix":" 2019/08/20/13/","compressionCodec":"snappy","restoreObjectEnabled":false,"pattern":"","format":{"skipInvalidRows":false,"timeField":"","type":"JSON"},"type":"AliyunOSS","encoding":"UTF-8"},"logstore":"666"},"createTime":1596087431,"displayName":"osstest","name":"ingest-1596087431-683089","description":"","state":"Enabled","type":"Ingestion","status":"SUCCESSED"}'
res = client.update_ingestion(project, "ingest-1596087431-683089", ingest_config)
print res.log_print()
res.log_print()

res = client.delete_ingestion(project, "ingest-1596087431-683089")
print res.log_print()
res.log_print()


if __name__ == '__main__':
Expand Down

0 comments on commit 0222c16

Please sign in to comment.