swift-nodeclient
The promise support client for openstack with nodejs
How to use it.
How to install it.
$ npm i swift-nodeclient -save
API
const client = host: "127.0.0.1" // the location of swift server, if not assign port ,will only use host option. port: 12345 // the port of swift server authUrl: '' // the auth url .default /auth/v1.0 ; /** * Login * * @param * @param * @param * * @return * { * status: 'ok', * msg: null * } * @return * { * status: 'ng', * msg: * } */ await client /** * Get Container list * * @return * { * "status": "ok", * "msg": { * "bytesUsed": "545636", * "containerCount": "2", * "objectCount": "2", * "data": [ * "test", * "test1" * ] * } * } * @return * { * status: 'ng', * msg: * } */ await client /** * Create a new Container * * @param * * @return * { * status: 'ok', * msg: null * } * @return * { * status: 'ng', * msg: * } */ await client /** * Create a new Container * for option items ref: https://docs.openstack.org/swift/latest/overview_acl.html#container-acls * * @param * @param * * @return * { * status: 'ok', * msg: null * } * @return * { * status: 'ng', * msg: * } */ await client /** * Delete a Container * * @param * * @return * { * status: 'ok', * msg: null * } * @return * { * status: 'ng', * msg: * } */ await client /** * Create a text Object * * @param * @param * @param * @param * * @return * { * status: 'ok', * msg: null * } * @return * { * status: 'ng', * msg: * } */ await client const stream = fs; /** * Create a text Object * * @param * @param * @param * @param * * @return * { * status: 'ok', * msg: null * } * @return * { * status: 'ng', * msg: * } */ await client /** * Update a Object * * @param * @param * @param * @param * * @return * { * status: 'ok', * msg: null * } * @return * { * status: 'ng', * msg: * } */ await client /** * Get object list * * @param * * @return * { * "status": "ok", * "msg": { * "bytesUsed": "545636", * "objectCount": "2", * "data": [ * "test", * "test1" * ] * } * } * @return * { * status: 'ng', * msg: * } */ await client /** * Delete a Object * * @param * @param * * @return * { * "status": "ok", * "msg": null * } * @return * { * status: 'ng', * msg: * } */ await client /** * copy a Object to a new path * * @param * @param * @param * @param * * @return * { * "status": "ok", * "msg": null * } * @return * { * status: 'ng', * msg: * } */ await client