baidubce-cli
Version:
baidu cloud engine command line tools
182 lines (121 loc) • 3.48 kB
Markdown
## baidubce-cli
Baidu Cloud Engine Node.js Command Line Tools.
Currently support operations on BS, BOS, Media service.
## Install
```
npm i -g baidubce-cli
```
## BOS Usage
### Configuration
For first time, you should config the `ak`, `sk` and `endpoint`.
```
baidubce bos -c bos.ak my_ak
baidubce bos -c bos.sk my_sk
baidubce bos -c bos.endpoint http://10.105.97.15
```
Btw, you can also set specific `bucket` to a different `endpoint` which will override the default configuration.
```
baidubce bos -c bos.my-bucket-1.ak my_ak
baidubce bos -c bos.my-bucket-1.sk my_sk
baidubce bos -c bos.my-bucket-1.endpoint http://10.26.208.32:8998
```
### create a bucket
```
baidubce bos --create-buckets my-bucket-1 my-bucket-2
```
### list all buckets
```
baidubce bos --list-buckets
```
### upload a regular file
```
# Upload hello.js to my-bucket-1 and rename to world.js
baidubce bos --put-object hello.js bos://my-bucket-1/world.js
# Upload hello.js to my-bucket-1 and keep the same file name.
baidubce bos --put-object hello.js bos://my-bucket-1/
baidubce bos --put-object hello.js bos://my-bucket-1
```
### upload a large file
```
baidubce bos --put-superfile cute-kitty.avi bos://my-bucket-1/
[=== ] 27%
```
> Btw, upload a large file you'll get a progress bar notification.
## BS Usage
### Configuration
For first time, you should config the `ak`, `sk` and `endpoint`.
```
baidubce bs -c bs.ak my_ak
baidubce bs -c bs.sk my_sk
baidubce bs -c bs.endpoint https://bs.baidu.com
```
Btw, you can also set specific `bucket` to a different `endpoint` which will override the default configuration.
```
baidubce bs -c bs.my-bucket-1.ak my_ak
baidubce bs -c bs.my-bucket-1.sk my_sk
baidubce bs -c bs.my-bucket-1.endpoint http://10.26.208.32:8998
```
### create a bucket
```
baidubce bs --create-buckets my-bucket-1 my-bucket-2
```
### list all buckets
```
baidubce bs --list-buckets
```
### list all objects
```
baidubce bs --list-objects my-bucket-1
baidubce bs --list-objects my-bucket-1 --start=10 --limit=20
```
### upload a regular file
```
# Upload hello.js to my-bucket-1 and rename to world.js
baidubce bs --put-object hello.js bs://my-bucket-1/world.js
# Upload hello.js to my-bucket-1 and keep the same file name.
baidubce bs --put-object hello.js bs://my-bucket-1/
baidubce bs --put-object hello.js bs://my-bucket-1
```
### upload a large file
> Unimplemented.
## Media Usage
### Configuration
For first time, you should config the `ak`, `sk` and `endpoint`.
```
baidubce media -c media.ak my_ak
baidubce media -c media.sk my_sk
# Optional
# baidubce media -c media.endpoint http://10.105.97.15
# baidubce media -c media.region my_region
```
### Create bucket
```
baidubce bos --create-buckets media-test-in media-test-out
```
### Upload Video
```
baidubce bos --put-object a.mov bos://media-test-in/a.mov
```
Or
```
baidubce bos --put-superfile a.mov bos://media-test-in/a.mov
[=== ] 27%
```
### Create pipeline
```
baidubce media --create-pipeline \
--pn leeight_test \
--pc '{"capacity": 1}' \
--sb media-test-in \
--tb media-test-out
```
### Create job
```
baidubce media --create-job --pn leeight_test --rn bce_video_mp4_854x480_800kbps --sk a.mov --tk b.mov
```
### Check job status
```
baidubce media --get-all-jobs --pn leeight_test
```
## Others
More usages please refer `baidubce bos -h` or `baidubce media -h`. Feedback is welcome, feel free to send me an email for any question.