在企業中組織帳戶
使用帳戶群組,在您的 IBM Cloud® 企業中組織相關的帳戶。 您可以藉由在帳戶群組內巢狀內嵌帳戶群組,來建立多層的企業階層。 如果需要,您可以在帳戶群組之間移動帳戶來進行重組。
例如,下圖說明您可以藉由巢狀內嵌帳戶群組來設定的四個層級企業。 首先,您可以建立兩個將企業作為母項的帳戶群組。 然後,您可以建立兩個其他的帳戶群組,將其中一個帳戶群組作為母項。 您可以在帳戶群組內自由移動帳戶,不論它們位於哪個層級。 不過,無法移動帳戶群組。
請記住,您組織企業的方式會影響您如何追蹤用量成本。 如需相關資訊,請參閱使用企業集中管理計費及用量。
建立帳戶群組
若要建立帳戶群組,您需要企業帳戶中「企業」服務的「管理者」或「編輯者」角色。
在主控台中建立帳戶群組
-
在 IBM Cloud 控制台的「企業」儀表板中,點選「帳戶」以檢視企業中的帳戶和帳戶群組。
-
在「帳戶群組」區段中,按一下建立。
-
輸入帳戶群組的名稱,該名稱反映其將包含的帳戶。 請參閱如何使用企業?,以作為您如何組織帳戶的範例。
-
如果您想要讓除了自己之外的企業使用者成為帳戶群組的主要聯絡人,請從聯絡人功能表中選取其 IBM ID。 如果您想要指派為聯絡人的使用者不在企業中,請先邀請該使用者加入企業帳戶。 如需相關資訊,請參閱邀請使用者。
聯絡人與帳戶擁有者不同,因為他們在帳戶群組或其帳戶內沒有任何其他存取權。 您選定為聯絡人的使用者,將擔任任何帳戶群組相關問題的聯絡窗口。 例如,如果財務主管通知帳戶群組的用量成本非預期地高,則他們可能會通知帳戶群組聯絡人。
-
如果您要帳戶群組位於企業階層的不同部分,請選取不同的母項。
無法從建立帳戶群組的位置刪除或移動帳戶群組。
-
按一下建立。
若要在企業階層中建立新的層級,請在帳戶群組內建立新的帳戶群組。 您可以將已在企業中的帳戶移至帳戶群組,也可以在其中匯入或建立帳戶。 如需匯入及建立帳戶的相關資訊,請參閱新增帳戶至企業。
使用 CLI 來建立帳戶群組
執行下列指令,以建立帳戶群組。 若要在另一個帳戶群組內巢狀內嵌帳戶群組,請在 --parent-account-group 選項指定帳戶群組的名稱。 如果您要讓不同的使用者成為帳戶群組的聯絡人,請在 --primary-contact-id 選項上指定其 IBM ID。
ibmcloud enterprise account-group-create NAME
[--parent-account-group ACCOUNT_GROUP_NAME] [--primary-contact-id USER_ID]
使用 API 來建立帳戶群組
您可以透過呼叫「企業管理 API」,以程式化方式在企業中建立帳戶群組。
下列要求範例會直接在企業層級下建立帳戶群組。 當您呼叫 API 時,請將 ID 變數取代為您企業的值。 若要在另一個帳戶群組內巢狀內嵌帳戶群組,請以下列格式指定「雲端資源名稱 (CRN)」中帳戶群組的 ID:crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$ACCOUNT_GROUP_ID。
curl -X POST "https://enterprise.cloud.ibm.com/v1/account-groups
-H "Authorization: Bearer <IAM_Token>"
-H 'Content-Type: application/json'
-d '{
"parent": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::enterprise:$ENTERPRISE_ID",
"name": "Example Account Group",
"primary_contact_iam_id": "$PRIMARY_CONTACT_IAM_ID"
}'
CreateAccountGroupOptions createAccountGroupOptions = new CreateAccountGroupOptions.Builder()
.parent(parentCRN)
.name("Example Account Group")
.primaryContactIamId(enterpriseAccountIamId)
.build();
Response<CreateAccountGroupResponse> response = service.createAccountGroup(createAccountGroupOptions).execute();
CreateAccountGroupResponse createAccountGroupResponse = response.getResult();
System.out.println(createAccountGroupResponse);
const params = {
parent: parentCrn,
name: 'Example Account Group',
primaryContactIamId: enterpriseAccountIamId,
};
enterpriseManagementService.createAccountGroup(params)
.then(res => {
console.log(JSON.stringify(res.result, null, 2));
})
.catch(err => {
console.warn(err)
});
create_account_group_response = enterprise_management_service.create_account_group(
parent=parent_crn,
name='Example Account Group',
primary_contact_iam_id=enterprise_account_iam_id,
).get_result()
print(json.dumps(create_account_group_response, indent=2))
createAccountGroupOptions := enterpriseManagementService.NewCreateAccountGroupOptions(
parentCRN,
"Example Account Group",
enterpriseAccountIamID,
)
createAccountGroupResponse, response, err := enterpriseManagementService.CreateAccountGroup(createAccountGroupOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(createAccountGroupResponse, "", " ")
fmt.Println(string(b))
有關此 API 的詳細資訊,請參閱「企業管理 API」。
在企業內移動帳戶
您可以在企業內的任何位置移動帳戶。 例如,您可以將一個帳戶從子帳戶群組移至其父帳戶群組,或者直接將其移至企業層級之下。 帳戶只能在企業內移動。 它們無法移至不同的企業,或從企業移除,以成為獨立式帳戶。
若要移動帳戶,您需要企業帳戶中「計費」服務的「管理者」角色,以及整個企業或現行和目標帳戶群組兩者的「編輯者」或「管理者」角色。
在主控台中移動帳戶
- 從主控台的企業儀表板,按一下帳戶。
- 在「帳戶」區段中,點選該帳戶行中的「動作
,然後選擇「移動帳戶」。
- 選取帳戶的新母項,然後按一下儲存。
使用 CLI 來移動帳戶
-
列出企業中的所有帳戶,以尋找帳戶名稱和 ID。
ibmcloud enterprise accounts --recursive -
如果您要將帳戶移至帳戶群組,請尋找帳戶群組名稱和 ID。
ibmcloud enterprise account-groups -
在相關選項上指定新的母項,以移動帳戶。
若要將帳戶移至帳戶群組,請在
--parent-account-group選項指定帳戶群組名稱。ibmcloud enterprise account-move -n NAME --parent-account-group ACCOUNT_GROUP_NAME若要將帳戶直接移至企業下,請指定
--parent-enterprise選項。ibmcloud enterprise account-move -n NAME --parent-enterprise
使用 API 來移動帳戶
您可以呼叫「企業管理 API」來移動帳戶,如下列範例要求所示。 將 IAM 記號及 ID 變數取代為您企業的值。
curl -X PATCH "https://enterprise.cloud.ibm.com/v1/accounts/$ACCOUNT_ID"
-H "Authorization: Bearer <IAM_Token>"
-H 'Content-Type: application/json'
-d '{
"parent": crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$NEW_PARENT_ACCOUNT_GROUP"",
}'
UpdateAccountOptions updateAccountOptions = new UpdateAccountOptions.Builder()
.accountId(accountId)
.parent(newParentCRN)
.build();
Response<Void> response = service.updateAccount(updateAccountOptions).execute();
const params = {
accountId: accountId,
parent: newParentCrn,
};
enterpriseManagementService.updateAccount(params)
.then(res => {
done();
})
.catch(err => {
console.warn(err)
});
response = enterprise_management_service.update_account(
account_id=account_id,
parent=new_parent_crn,
)
updateAccountOptions := enterpriseManagementService.NewUpdateAccountOptions(
accountID,
newParentCRN,
)
response, err := enterpriseManagementService.UpdateAccount(updateAccountOptions)
if err != nil {
panic(err)
}
有關此 API 的詳細資訊,請參閱「企業管理 API」。
使用企業管理的 IAM 範本指派移動帳戶
企業中的帳戶可能有不同的企業管理 IAM 範本指派歷史。 您可以透過指派更新的版本來取代範本指派,或透過在更高層級(例如帳戶群組層級)指派範本來取代指派。 在這些情況下,範本的先前指派會變成非作用中,而具有較高層級指派的版本則維持作用中。
當上一層級的指派取而代之,或指派了新版本的範本,使之前的版本失效時,就會發生不動態指派。
如需詳細資訊,請參閱 移動帳戶。