Coder Social home page Coder Social logo

qnctl's Introduction

qnctl build status

Unix-style command-line tool for Qiniu CDN, built on the official library qiniupkg.com/api.v7/kodo.

Supported operations:

  • add
  • rm
  • ls
  • stat
  • sync

Installation

make
cp qnctl /usr/bin/      # optional

Usage

Set up Qiniu keys

There are two ways to do that. Export QINIU_AK, QINIU_SK and QINIU_BUCKET

export QINIU_AK=abcd...
export QINIU_SK=dcba...
export QINIU_BUCKET=test

Or create a JSON file like

$ cat config.json
{
    "access_key": "abcd...",
    "secret_key": "dcba..."
}

$ qnctl -c config.json -b test ls images

add

If the first argument after add does not end with /, it would be the exact key. Otherwise, the key to save would be the concatenation of the first argument and the basename of the second argument.

$ qnctl add images/001.png path/to/001.png
$ qnctl add images/ path/to/001.png         # same as previous

# Save to another key
$ qnctl add images/002.png path/to/001.png

# Add multiple; MUST use single quotes
$ qnctl add images/ 'path/to/*.png'

# DON'T DO
$ qnctl add images path/to/001.png
$ qnctl add images path/to/*.png

rm

Delete one objects.

$ qnctl rm images/001.png

ls

List objects that match the prefix. Wildcard is not supported.

$ qnctl ls images/
    326842  2016-01-27 03:06:16  images/001.png
    140797  2016-01-27 03:06:16  images/002.png
       983  2016-01-27 03:06:16  images/003.png

stat

Return status of one object.

$ qnctl stat images/001.png
      Key: images/001.png
     Hash: FiBrvrIq6fUvc4p0BR9ZfNmILym1
     Size: 326842
Mime Type: image/png
 Put Time: 2016-01-27 03:06:16 +0800 CST
 End User:

sync

Refresh CDN cache.

$ qnctl sync http://your-cdn.com/key1 http://your-cdn.com/key2

qnctl's People

Contributors

wizawu avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.