Storing data in FIWARE Object Storage -


i'm building application stores files fiware object storage. i don't quite understand correct way of storing files storage.

the code python code snippet below taken object storage - user , programmers guide shows 2 ways of doing it:

def store_text(token, auth, container_name, object_name, object_text):    headers = {"x-auth-token": token}     # 1. version    #body = '{"mimetype":"text/plain", "metadata":{}, "value" : "' + object_text + '"}'     # 2. version    body = object_text     url = auth + "/" + container_name + "/" + object_name     return swift_request('put', url, headers, body) 

the 1. version confuses me, because when first looked @ node.js module (repo: fiware-object-storage) works object storage, seemed use 1. version. module making calls old (v.1.1) api version instead of presumably newest (v.2.0), referencing python example, not sure if outdated version of doing or not.


as played more module, realised didn't work , code total mess. forked project , understood need rewrite form ground up, taking above mention python example usage guide reference. link repo.

as of writing methods aren't implement object storage (put) , object fetching (get).


had addition questions object storage sent fiware-lab-help@lists.fiware.org, haven't heard asking them here.

  1. haven't got experience writing api libraries. should need worry auth token expiring? presume not needed make new authentication, every time interact storage. authentication should happen once when server starting-up (we create instance) , internally keeps it. should implement kind of mechanism refreshes token?

  2. does tenant id change? quote below presume getting tenant 1 time deal, later can use in config make less authentication calls.

a valid token required access object store. section describes how valid token assuming identity management system compatible openstack keystone being used. if username, password , tenant details known, step 3 required. source

  1. during authentication when fetching tenants how should select "right" one? i'm taking first 1 similar example code does.

  2. is true object storage container belongs single region?

use call version 2. ignore version 1. commented out in example. should removed documentation.

(1) token valid period of time. hour or day, depending on setup. period of time should specified in token returned authentication service. token needs periodically refreshed.

(2) tenant id not change.

(3) typically 1 tenant id returned. possible, however, assigned more 1 id, in case have pick 1 using. containers typically belong single tenant , not shared between tenants.

(4) containers typically limited single region. may change in future when multi-region support container added swift.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -