mcloud-organizations

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cloud CLI: Organizations Commands

Cloud CLI:组织命令

Execute
mcloud organizations
commands to list and retrieve Cloud organizations.
执行
mcloud organizations
命令来列出和检索云组织信息。

Constraints

约束条件

  • organizations list
    requires personal auth (browser login or personal access key). Organization access keys return 401 on this command.
  • When authenticated with
    MCLOUD_TOKEN
    using an org access key, use
    mcloud whoami --json
    to get the organization ID instead.
  • organizations list
    命令需要个人认证(浏览器登录或个人访问密钥)。使用组织访问密钥执行此命令会返回401错误。
  • 若使用组织访问密钥通过
    MCLOUD_TOKEN
    认证,请改用
    mcloud whoami --json
    命令获取组织ID。

Commands

命令说明

organizations list

organizations list

List all organizations your account has access to.
bash
mcloud organizations list --json
Options:
  • --json
    — Output as JSON
列出您的账号有权访问的所有组织。
bash
mcloud organizations list --json
选项:
  • --json
    — 以JSON格式输出

organizations get

organizations get

Retrieve a single organization by ID. Returns metadata, subscription details, and members.
bash
mcloud organizations get <organization-id> --json
Arguments:
  • organization
    — Organization ID (required)
Options:
  • -o/--organization <id>
    — Override the organization in active context (must match the argument)
  • --json
    — Output as JSON
通过ID获取单个组织的信息。返回元数据、订阅详情及成员信息。
bash
mcloud organizations get <organization-id> --json
参数:
  • organization
    — 组织ID(必填)
选项:
  • -o/--organization <id>
    — 覆盖当前上下文的组织(必须与参数匹配)
  • --json
    — 以JSON格式输出

Organization Fields (JSON)

组织字段(JSON格式)

FieldDescription
id
Organization ID
name
Organization display name
billing_email
Billing contact email
status
active
or otherwise
members
Array of member objects with
id
,
role
,
user.email
subscription
Current plan, period, and
is_active
flag
account_holder
Billing account holder details
字段描述
id
组织ID
name
组织显示名称
billing_email
账单联系人邮箱
status
状态(
active
或其他状态)
members
成员对象数组,包含
id
role
user.email
字段
subscription
当前套餐、周期及
is_active
状态标识
account_holder
账单账户持有人详情

Examples

示例

bash
undefined
bash
undefined

List all organizations

列出所有组织

mcloud organizations list --json
mcloud organizations list --json

Set context to first organization

将上下文切换至第一个组织

ORGANIZATION_ID=$( mcloud organizations list --json
| jq -r '.[0].id' ) mcloud use --organization "$ORGANIZATION_ID"
ORGANIZATION_ID=$( mcloud organizations list --json
| jq -r '.[0].id' ) mcloud use --organization "$ORGANIZATION_ID"

Find organization ID by name

通过名称查找组织ID

ORGANIZATION_ID=$( mcloud organizations list --json
| jq -r '.[] | select(.name == "My Organization") | .id' )
ORGANIZATION_ID=$( mcloud organizations list --json
| jq -r '.[] | select(.name == "My Organization") | .id' )

Get organization details (subscription, members)

获取组织详情(订阅、成员)

mcloud organizations get org_123 --json
mcloud organizations get org_123 --json

List member emails

列出成员邮箱

mcloud organizations get org_123 --json
| jq -r '.members[].user.email'
mcloud organizations get org_123 --json
| jq -r '.members[].user.email'

Check subscription plan

检查订阅套餐

mcloud organizations get org_123 --json
| jq '{plan: .subscription.plan.name, status: .subscription.is_active}'
undefined
mcloud organizations get org_123 --json
| jq '{plan: .subscription.plan.name, status: .subscription.is_active}'
undefined