# conoha-storage

> ConoHaオブジェクトストレージのためのクライアントとコマンド

Latest version **0.3.0** (published 2021-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install conoha-storage
pnpm add conoha-storage
yarn add conoha-storage
bun add conoha-storage
```

Provides the command `conoha-storage`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2021-09-02 |
| First published | 2021-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 41 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nakamura |
| Maintainers | ittedev |
| Keywords | conoha, object-storage, command, client |

## Links

- npm: https://www.npmjs.com/package/conoha-storage
- Repository: https://github.com/ittedev/conoha-storage
- Homepage: https://github.com/ittedev/conoha-storage#readme
- Issues: https://github.com/ittedev/conoha-storage/issues
- npm.io page: https://npm.io/package/conoha-storage

## Dependencies (5)

- [got](https://npm.io/package/got.md) ^11.8.2
- [dayjs](https://npm.io/package/dayjs.md) ^1.10.6
- [dotenv](https://npm.io/package/dotenv.md) ^10.0.0
- [towait](https://npm.io/package/towait.md) ^0.0.3
- [commander](https://npm.io/package/commander.md) ^8.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2021-09-02
- 0.2.2 — 2021-07-28
- 0.1.2 — 2021-07-17
- 0.1.1 — 2021-07-17
- 0.1.0 — 2021-07-17

## README

# conoha-storage

ConoHaオブジェクトストレージのためのnode.js製クライアントとコマンド

## インストール

```bash
npm install -g conoha-storage
```

node.jsはv15.0.0以上に対応しています。

## セットアップ

ConoHaオブジェクトストレージの情報を.envファイルに記載します。
[ConoHa API情報](https://manage.conoha.jp/API/)にログインして以下の例のように設定情報を記載します。

```
CONOHA_ENDPOINT=https://object-storage....
CONOHA_TENANTID=0e844...
CONOHA_USERNAME=gncu5...
CONOHA_PASSWORD=T3Zfo...
```

`auth`コマンドを実行して次のように出力されれば認証成功です。

```bash
$ conoha-storage auth
token  : 9b07a...
expires: 2021-...
```

## 使い方

### `auth`コマンド

認証を行い、トークンを発行します。

```bash
conoha-storage auth
```

### `list`コマンド

コンテナの一覧を取得します。

```bash
conoha-storage list
```

コンテナを指定することでそのコンテナ内のオブジェクト一覧を取得します。

```bash
conoha-storage list container
```

### `mkdir`コマンド

コンテナを追加します。

```bash
conoha-storage mkdir container
```

`--archive`オプションを使うことでバージョン管理用のコンテナを指定できます。

```bash
conoha-storage mkdir container --archive=archive_dir
```

### `put`コマンド

ローカルファイルをストレージにアップロードします。

```bash
conoha-storage put log.txt container/log.txt
```

ローカルファイルに`-`を指定することで標準入力から入力を受け付けます（Linuxのみ）。

```bash
echo 'hello' | conoha-storage put - container/log.txt
```

`put -`は省略できます。

```bash
echo 'hello' | conoha-storage container/log.txt
```

### `get`コマンド

ストレージからファイルをダウンロードします。

```bash
conoha-storage get container/log.txt log.txt
```

ローカルファイルに`-`を指定することでファイル内容を標準出力に出力します。

```bash
conoha-storage get container/log.txt -
```

`get -`には別の記法があります。

```bash
conoha-storage cat container/log.txt
```

### `studio`コマンド

管理用GUIサーバーを立ち上げます。

```bash
conoha-storage studio
```

### その他

その他の使い方は`conoha-storage --help`で確認できます。

## バックアップ例

MySQLのバックアップを行う例を記します。

予めバックアップ用のコンテナを準備しておきます。

```bash
conoha-storage mkdir backup --archive=backup_archive
```

`mysqldump`の出力をファイルに保存せずに直接ストレージに保存します。
ここでは`--delete-after`オプションで30日後に自動的に削除されるようにしています。

```
mysqldump -x -A | conoha-storage backup/backup.sql --delete-after=2592000
```

## 今後の開発予定

- CSV出力
- `list`コマンドに検索条件やページングを追加

---
_Source: https://npm.io/package/conoha-storage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
