th config

ตั้ง Project, Region และ endpoint ของ Console ที่ CLI ใช้ ดูรายการ Project และ Region ของคุณ และแสดงเวอร์ชันของ CLI

เกี่ยวกับ

ไฟล์ config เก็บค่า 3 อย่าง: project (ID หรือ slug), region (ID) และ endpoint (URL ของ Console) พารามิเตอร์ในคำสั่งมาก่อนตัวแปรสภาพแวดล้อม (TH_PROJECT, TH_REGION, TH_ENDPOINT) และตัวแปรสภาพแวดล้อมมาก่อนไฟล์ config

ดูว่าคุณเข้าสู่ระบบเป็นใครด้วย th whoami

คู่มือการใช้งาน

สลับระหว่าง Project

  1. ดู Project ที่คุณเป็นเจ้าของหรือได้รับเชิญด้วย th projects list
  2. ตั้งเป็นค่าเริ่มต้นด้วย th config set project <slug>
  3. ถ้าต้องการรันคำสั่งเดียวใน Project อื่น ให้ใส่ --project <slug> แทน
Shell
th projects list
th config set project acme
th container services list --project acme-staging

คำสั่ง

คำสั่งคำอธิบาย
th config setบันทึกค่า (project, region หรือ endpoint) ลงไฟล์ config
th config getแสดงค่าหนึ่งค่าจากไฟล์ config
th config unsetลบค่าออกจากไฟล์ config
th config listแสดงทุกค่าในไฟล์ config
th projects listแสดง Project ที่คุณเป็นเจ้าของหรือได้รับเชิญ
th regions listแสดง Region และ compute class ของแต่ละ Region
th versionแสดงเวอร์ชันของ CLI

th config set

บันทึกค่า (project, region หรือ endpoint) ลงไฟล์ config

ไวยากรณ์

Shell
th config set PROPERTY VALUE

ค่าที่ตั้งได้: project (ID หรือ slug), region (ID), endpoint (URL ของ Console)

ตัวอย่าง

ใช้ Project acme เป็นค่าเริ่มต้น

Shell
th config set project acme

สร้างบริการใหม่ใน bkk

Shell
th config set region bkk

อาร์กิวเมนต์ตามตำแหน่ง

ชื่อคำอธิบาย
PROPERTYจำเป็นproject, region หรือ endpoint
VALUEจำเป็นค่าใหม่: Project ID หรือ slug, Region ID หรือ URL ของ Console

พารามิเตอร์ส่วนกลาง

คำสั่งนี้รับพารามิเตอร์ส่วนกลางด้วย: --project, --region, --endpoint, --format, --quiet

กลับขึ้นด้านบน ↑

th config get

แสดงค่าหนึ่งค่าจากไฟล์ config

ไวยากรณ์

Shell
th config get PROPERTY

ค่าที่ตั้งได้: project (ID หรือ slug), region (ID), endpoint (URL ของ Console)

ตัวอย่าง

แสดง Project เริ่มต้น

Shell
th config get project

อาร์กิวเมนต์ตามตำแหน่ง

ชื่อคำอธิบาย
PROPERTYจำเป็นproject, region หรือ endpoint

พารามิเตอร์ส่วนกลาง

คำสั่งนี้รับพารามิเตอร์ส่วนกลางด้วย: --project, --region, --endpoint, --format, --quiet

กลับขึ้นด้านบน ↑

th config unset

ลบค่าออกจากไฟล์ config

ไวยากรณ์

Shell
th config unset PROPERTY

ค่าที่ตั้งได้: project (ID หรือ slug), region (ID), endpoint (URL ของ Console)

ตัวอย่าง

ลบ Region เริ่มต้น

Shell
th config unset region

อาร์กิวเมนต์ตามตำแหน่ง

ชื่อคำอธิบาย
PROPERTYจำเป็นproject, region หรือ endpoint

พารามิเตอร์ส่วนกลาง

คำสั่งนี้รับพารามิเตอร์ส่วนกลางด้วย: --project, --region, --endpoint, --format, --quiet

กลับขึ้นด้านบน ↑

th config list

แสดงทุกค่าในไฟล์ config

ไวยากรณ์

Shell
th config list

ค่าที่ตั้งได้: project (ID หรือ slug), region (ID), endpoint (URL ของ Console)

ตัวอย่าง

ดูทุกค่า

Shell
th config list

พารามิเตอร์ส่วนกลาง

คำสั่งนี้รับพารามิเตอร์ส่วนกลางด้วย: --project, --region, --endpoint, --format, --quiet

กลับขึ้นด้านบน ↑

th projects list

แสดง Project ที่คุณเป็นเจ้าของหรือได้รับเชิญ

ไวยากรณ์

Shell
th projects list

ตัวอย่าง

ดูรายการ Project ของคุณ

Shell
th projects list

แสดงเป็น JSON

Shell
th projects list --format json

พารามิเตอร์ส่วนกลาง

คำสั่งนี้รับพารามิเตอร์ส่วนกลางด้วย: --project, --region, --endpoint, --format, --quiet

กลับขึ้นด้านบน ↑

th regions list

แสดง Region และ compute class ของแต่ละ Region

ไวยากรณ์

Shell
th regions list

ตัวอย่าง

ดูรายการ Region และ compute class

Shell
th regions list

พารามิเตอร์ส่วนกลาง

คำสั่งนี้รับพารามิเตอร์ส่วนกลางด้วย: --project, --region, --endpoint, --format, --quiet

กลับขึ้นด้านบน ↑

th version

แสดงเวอร์ชันของ CLI

ไวยากรณ์

Shell
th version

ตัวอย่าง

แสดงเวอร์ชัน ระบบปฏิบัติการ และชนิด CPU

Shell
th version

แสดงเป็น JSON

Shell
th version --format json

พารามิเตอร์ส่วนกลาง

คำสั่งนี้รับพารามิเตอร์ส่วนกลางด้วย: --project, --region, --endpoint, --format, --quiet

กลับขึ้นด้านบน ↑