本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
与 Amazon SDK或DeleteOrganizationalUnit
一起使用 CLI
以下代码示例演示如何使用 DeleteOrganizationalUnit
。
- .NET
-
- Amazon SDK for .NET
-
注意
还有更多相关信息 GitHub。查找完整示例,学习如何在 Amazon 代码示例存储库
中进行设置和运行。 using System; using System.Threading.Tasks; using Amazon.Organizations; using Amazon.Organizations.Model; /// <summary> /// Shows how to delete an existing AWS Organizations organizational unit. /// </summary> public class DeleteOrganizationalUnit { /// <summary> /// Initializes the Organizations client object and calls /// DeleteOrganizationalUnitAsync to delete the organizational unit /// with the selected ID. /// </summary> public static async Task Main() { // Create the client object using the default account. IAmazonOrganizations client = new AmazonOrganizationsClient(); var orgUnitId = "ou-0000-00000000"; var request = new DeleteOrganizationalUnitRequest { OrganizationalUnitId = orgUnitId, }; var response = await client.DeleteOrganizationalUnitAsync(request); if (response.HttpStatusCode == System.Net.HttpStatusCode.OK) { Console.WriteLine($"Successfully deleted the organizational unit with ID: {orgUnitId}."); } else { Console.WriteLine($"Could not delete the organizational unit with ID: {orgUnitId}."); } } }
-
有关API详细信息,请参阅 “Amazon SDK for .NET API参考 DeleteOrganizationalUnit” 中的。
-
- CLI
-
- Amazon CLI
-
删除 OU
以下示例说明如何删除 OU。该示例假设您之前已OUs从 OU 中删除了所有账户和其他账户:
aws organizations delete-organizational-unit --organizational-unit-id
ou-examplerootid111-exampleouid111
-
有关API详细信息,请参阅Amazon CLI 命令参考DeleteOrganizationalUnit
中的。
-
有关 Amazon SDK开发者指南和代码示例的完整列表,请参阅使用 Amazon Organizations 用一个 Amazon SDK。本主题还包括有关入门的信息以及有关先前SDK版本的详细信息。
DeleteOrganization
DeletePolicy