Organizations / Client / describe_organizational_unit

describe_organizational_unit#

Organizations.Client.describe_organizational_unit(**kwargs)#

Retrieves information about an organizational unit (OU).

This operation can be called only from the organization’s management account or by a member account that is a delegated administrator for an Amazon Web Services service.

See also: AWS API Documentation

Request Syntax

response = client.describe_organizational_unit(
    OrganizationalUnitId='string'
)
Parameters:

OrganizationalUnitId (string) –

[REQUIRED]

The unique identifier (ID) of the organizational unit that you want details about. You can get the ID from the ListOrganizationalUnitsForParent operation.

The regex pattern for an organizational unit ID string requires “ou-” followed by from 4 to 32 lowercase letters or digits (the ID of the root that contains the OU). This string is followed by a second “-” dash and from 8 to 32 additional lowercase letters or digits.

Return type:

dict

Returns:

Response Syntax

{
    'OrganizationalUnit': {
        'Id': 'string',
        'Arn': 'string',
        'Name': 'string'
    }
}

Response Structure

  • (dict) –

    • OrganizationalUnit (dict) –

      A structure that contains details about the specified OU.

      • Id (string) –

        The unique identifier (ID) associated with this OU.

        The regex pattern for an organizational unit ID string requires “ou-” followed by from 4 to 32 lowercase letters or digits (the ID of the root that contains the OU). This string is followed by a second “-” dash and from 8 to 32 additional lowercase letters or digits.

      • Arn (string) –

        The Amazon Resource Name (ARN) of this OU.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.

      • Name (string) –

        The friendly name of this OU.

        The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

Exceptions

  • Organizations.Client.exceptions.AccessDeniedException

  • Organizations.Client.exceptions.AWSOrganizationsNotInUseException

  • Organizations.Client.exceptions.InvalidInputException

  • Organizations.Client.exceptions.OrganizationalUnitNotFoundException

  • Organizations.Client.exceptions.ServiceException

  • Organizations.Client.exceptions.TooManyRequestsException

Examples

The following example shows how to request details about an OU:/n/n

response = client.describe_organizational_unit(
    OrganizationalUnitId='ou-examplerootid111-exampleouid111',
)

print(response)

Expected Output:

{
    'OrganizationalUnit': {
        'Arn': 'arn:aws:organizations::111111111111:ou/o-exampleorgid/ou-examplerootid111-exampleouid111',
        'Id': 'ou-examplerootid111-exampleouid111',
        'Name': 'Accounting Group',
    },
    'ResponseMetadata': {
        '...': '...',
    },
}