项目作者: gaobinlong

项目描述 :
使用Serverless云函数把COS对象存储的元信息存储到ES中
高级语言: Python
项目地址: git://github.com/gaobinlong/cosMeta2es.git
创建时间: 2019-01-07T03:58:38Z
项目社区:https://github.com/gaobinlong/cosMeta2es

开源协议:Apache License 2.0

下载


cosMeta2es

使用Serverless云函数把COS对象存储的元信息存储到ES中,同步的元信息字段有:

  • Key
  • Content-Type
  • Content-Length
  • ETag
  • Last-Modified

使用方式

  1. clone该源码,在源码目录下执行
    1. pip install Elasticsearch -t ./
  2. 修改cos2es.py源码文件中的账户信息、cos信息、es信息
  1. appid = 1 # 请替换为您的 APPID
  2. secret_id = u'x' # 请替换为您的 SecretId
  3. secret_key = u'y' # 请替换为您的 SecretKey
  4. region = u'ap-guangzhou' # 请替换为您bucket 所在的地域
  5. token = ''
  6. esEndPoint = '1.1.1.1' # 请替换为您的ES地址
  1. 打包源码目录为zip格式,使用腾讯云无服务器云函数(SCF)部署
    1. zip cosMeta2es.zip * -r