安装python客户端: pip install manta
import manta as pymanta
# cat ${MANTA_PRIVATE_KEY_PATH} | tr '\n' '#'
manta_pk = "dsfsdfsdf"
private_key = manta_pk.replace('#', '\n')
key_id = "64:be:0e:33:90:b7:1f:4a:7f:0c:b6:39:53:e7:f6:84"
account="jill"
url = "http://109.105.7.98"
is_tls = False
signer = pymanta.PrivateKeySigner(key_id, private_key)
client = pymanta.MantaClient(
url,
account,
disable_ssl_certificate_validation=is_tls,
signer=signer)
bucket = '/{}/stor'.format(account)
# print client.list_directory()
# mpath = '{}/{}'.format(bucket, "001")
# with open("./test.yaml", 'r') as f:
# client.put_object(mpath, file=f)
# client.mkdir(mpath)
print client.list_directory("/")