2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Cloud Foundry の cf target コマンドで org (組織) や space (スペース) を切り替える

Posted at

概要

  • cf target, cf orgs, cf spaces コマンドで org や space を切り替える

space (スペース) を切り替える

cf spaces コマンドで org 内の space 一覧を表示。

$ cf spaces
user@example.com として組織 first-org 内のスペースを取得しています...

名前
foo-space
bar-space

cf target -s で使用する space に切り替えることができる。

$ cf target -s bar-space
API エンドポイント   https://api.example.com
API バージョン:      2.55.0
ユーザー:            user@.example.com
組織:                first-org
スペース:            bar-space

org (組織) を切り替える

cf orgs コマンドで利用可能な org 一覧を表示。

$ cf orgs
user@example.com として組織を取得しています...

名前
first-org
second-org

cf target -o で使用する org に切り替えることができる。

$ cf target -o second-org
API エンドポイント   https://api.example.com
API バージョン:      2.55.0
ユーザー:            user@example.com
組織:                second-org
スペースがターゲットになっていません、'cf target -s SPACE' を使用してください

org と space を同時に指定することも可能。

$ cf target -o second-org -s bar-space
API エンドポイント   https://api.example.com
API バージョン:      2.55.0
ユーザー:            user@example.com
組織:                second-org
スペース:            bar-space

参考資料 (cf target コマンドのリファレンスガイド)

target - Cloud Foundry CLI Reference Guide

名前
target - ターゲットにされた組織またはスペースを設定または表示します

使用法
cf target [-o ORG] [-s SPACE]

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?