Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fakeサーバCLI: sacloud-ojs-fake-server #22

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

yamamoto-febc
Copy link
Member

開発用のfakeサーバをスタンドアロンで起動可能なCLI sacloud-ojs-fake-serverを提供する。

$ sacloud-ojs-fake-server --help

Start the fake API server

Usage:
  object-storage-fake-server [flags]

Flags:
      --addr string      the address for the server to listen on (default ":8080")
      --data string      the file path to the fake data JSON file
  -h, --help             help for object-storage-fake-server
      --output-example   the flag to output a fake data JSON example
  -v, --version          version for object-storage-fake-server

オブジェクトストレージAPIのURLのうち、https://secure.sakura.ad.jp/cloud/zone/is1a/api/objectstorage/1.0までの部分をこのサーバのURLに置き換えて利用する。

# fakeサーバを使う場合(--addrはデフォルトのままの場合)
$ ROOT_URL=http://localhost:8080
# オブジェクトストレージAPI(本番環境)を使う場合
# $ ROOT_URL=https://secure.sakura.ad.jp/cloud/zone/is1a/api/objectstorage/1.0

# 例: サイト一覧取得
$ curl -s $ROOT_URL/fed/v1/clusters | jq .
{
  "data": [
    {
      "api_zone": null,
      "control_panel_url": "https://secure.sakura.ad.jp/objectstorage/",
      "dislpay_name_en_us": "Ishikari Site #1(fake)",
      "dislpay_name_ja": "石狩第1サイト(fake)",
      "display_name": "石狩第1サイト(fake)",
      "display_order": 1,
      "endpoint_base": "isk01.sakurastorage.jp",
      "iam_endpoint": "",
      "iam_endpoint_for_control_panel": "",
      "id": "isk01",
      "s3_endpoint": "",
      "s3_endpoint_for_control_panel": "",
      "storage_zone": null
    }
  ]
}

@yamamoto-febc yamamoto-febc changed the title fakeサーバをスタンドアロンで起動するためのCLI sacloud-ojs-fake-serverを追加 fakeサーバCLI sacloud-ojs-fake-server Mar 2, 2022
@yamamoto-febc yamamoto-febc changed the title fakeサーバCLI sacloud-ojs-fake-server fakeサーバCLI: sacloud-ojs-fake-server Mar 2, 2022
@yamamoto-febc yamamoto-febc merged commit 064eb30 into sacloud:main Mar 2, 2022
@yamamoto-febc yamamoto-febc deleted the cmd/fake branch March 2, 2022 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant