本文件介紹icehouse發行版keystone命令
keystone Command-Line Interface (CLI)提供用於和keystone伺服器互動的方便工具,但是該命令列工具逐漸受到社群的拋棄:
“Pending deprecation: Command-line interface to the OpenStack Identity API. This CLI is pending deprecation in favor of python-openstackclient. For a Python library, continue using python-keystoneclient.”
用法
$ keystone [--version]
[--timeout <seconds>]
[--os-username <auth-user-name>]
[--os-password <auth-password>]
[--os-tenant-name <auth-tenant-name>]
[--os-tenant-id <tenant-id>]
[--os-auth-url <auth-url>]
[--os-region-name <region-name>]
[--os-identity-api-version <identity-api-version>]
[--os-token <service-token>]
[--os-endpoint <service-endpoint>]
[--os-cacert <ca-certificate>]
[--insecure]
[--os-cert <certificate>]
[--os-key <key>]
[--os-cache]
[--force-new-token]
[--stale-duration <seconds>]
<subcommand> ...
可用子命令
subcommands
bash-completion //輸出所有可選的命令及選項
help [subcommand] //顯示本程式或子命令的使用幫助
discover //發現keystone伺服器的地址,支援的API和擴充套件
bootstrap //簡單初始化,在建立使用者、角色和租戶後,將使用者賦予租戶的該角色
catalog //顯示可用的openstack服務目錄, possibly filtered by service.
ec2-credentials-create //Create EC2-compatible credentials for user per tenant.
ec2-credentials-delete //Delete EC2-compatible credentials.
ec2-credentials-get //Display EC2-compatible credentials.
ec2-credentials-list //List EC2-compatible credentials for a user.
endpoint-create //建立新endpoint
endpoint-delete //刪除一個service endpoint.
endpoint-get //通過制定條件檢視一個endpoint
endpoint-list //檢視所有已配置的endpoints
role-create //建立角色
role-delete //刪除角色
role-get //顯示角色詳情
role-list //顯示所有角色
service-create //新增服務
service-delete //刪除服務
service-get //檢視某一服務細節
service-list //顯示所有服務
tenant-create //建立專案
tenant-delete //刪除專案
tenant-get //顯示某一專案細節
tenant-list //列出所有專案
tenant-update //更新專案的名稱,描述和啟用狀態
user-create //建立使用者
user-delete //刪除使用者
user-get //顯示使用者細節
user-list //顯示所有使用者
user-role-add //為使用者新增角色
user-role-list //顯示使用者擁有的所有角色
user-role-remove //刪除使用者角色
user-update //更新使用者姓名,郵箱,和啟用狀態
user-password-update //更新任一指定使用者的密碼
password-update //更新當前使用者的密碼
token-get //顯示當前使用者token
環境變數可以使用export設定到每一次會話中,也可以寫指令碼這樣每一次執行時不用重複輸入大量重複的內容
如:
export OS_SERVICE_TOKEN=ADMIN
可用選項
--version
顯示當前client的版本,退出
--timeout <seconds>
設定請求超時(秒)
--os-identity-api-version <identity-api-version>
指明要用的Identity API版本預設為環境變數 OS_IDENTITY_API_VERSION 或2.0版
--os-region-name <region-name>
指明使用的region,預設為環境變數 OS_REGION_NAME
使用使用者名稱+密碼登入時使用的選項
--os-username <auth-user-name>
用於登入OpenStack Identity服務的使用者名稱,預設為環境變數 OS_USERNAME
--os-password <auth-password>
登入使用者密碼,預設為環境變數 OS_PASSWORD
--os-tenant-name <auth-tenant-name>
登入使用者所屬的專案名稱,預設為環境變數 OS_TENANT_NAME
--os-tenant-id <tenant-id>
登入使用者所屬的專案ID,預設為環境變數 OS_TENANT_ID
--os-auth-url <auth-url>
身份認證的目標keystone節點,預設為環境變數 OS_AUTH_URL
使用token登入的選項
--os-token <service-token>
已有token,並選擇使用該token進行身份認證,不需要再次獲取token.預設為環境變數 OS_SERVICE_TOKEN
--os-endpoint <service-endpoint>
指定認證的物件節點. 預設為環境變數 OS_SERVICE_ENDPOINT
CA自己的數字證書+CA頒發的數字證書+自己的私鑰
--os-cacert <ca-certificate>
指定一個CA檔案用來驗證 TLS (https) 伺服器證書. 預設為環境變數 OS_CACERT
--os-cert <certificate>
預設為環境變數 OS_CERT
--os-key <key>
預設為環境變數 OS_KEY
--insecure
明確允許keystoneclient進行"不安全的" TLS (https)請求. 該選項下,keystoneclient不會驗證伺服器的證書,應謹慎使用。
--os-cache
使用 auth token cache. 預設為環境變數OS_CACHE.
--force-new-token
如果keyring可用且當前正在使用,到token失效前每一次都會在keyring中存取token。該命令可以可以請求一個新的token並替代當前keyring中現存的。
--stale-duration <seconds>
從keyring中獲取token時用來判斷token是否失效的失效間隔(Stale duration) (單位:秒), 該命令有助於緩解網路延遲,預設為30秒。