Skip to content

describe_group

describe_group(
    directory_id: DirectoryId,
    sam_account_name: GroupName,
    *,
    config_overrides: Optional[DirectoryServiceDataClientConfig] = None,
    realm: Optional[Realm] = None,
    other_attributes: Optional[LdapDisplayNameList] = None,
) -> DescribeGroupResult

Returns information about a specific group.

Parameters:

  • directory_id (DirectoryId) –

    The Identifier (ID) of the directory associated with the group.

  • realm (Optional[Realm], default: None ) –

    The domain name that's associated with the group.

    This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

    This value is case insensitive.

  • sam_account_name (GroupName) –

    The name of the group.

  • other_attributes (Optional[LdapDisplayNameList], default: None ) –

    One or more attributes to be returned for the group. For a list of supported attributes, see Directory Service Data Attributes.

Raises:

  • AccessDeniedException –

    You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

    Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

  • DirectoryUnavailableException –

    The request could not be completed due to a problem in the configuration or current state of the specified directory.

  • InternalServerException –

    The operation didn't succeed because an internal error occurred. Try again later.

  • ResourceNotFoundException –

    The resource couldn't be found.

  • ThrottlingException –

    The limit on the number of requests per second has been exceeded.

  • ValidationException –

    The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To return the attributes of a group The following command returns the mapped attributes for a group along with the display name, description, and GUID for the group.

>>> client.describe_group(directory_id='d-12233abcde', other_attributes=['displayName', 'description', 'objectGUID'], realm='example.domain.com', sam_account_name='DevOpsMail')
Source code in docs_src/capo_directory_service_data/_services/directory_service_data.py
def describe_group(
    self,
    directory_id: "capo_directory_service_data.types.directory_id.DirectoryId",
    sam_account_name: "capo_directory_service_data.types.group_name.GroupName",
    *,
    config_overrides: Optional[DirectoryServiceDataClientConfig] = None,
    realm: Optional["capo_directory_service_data.types.realm.Realm"] = None,
    other_attributes: Optional[
        "capo_directory_service_data.types.ldap_display_name_list.LdapDisplayNameList"
    ] = None,
) -> "capo_directory_service_data.types.describe_group_result.DescribeGroupResult":
    """<p>Returns information about a specific group.</p>

    Args:
        directory_id: <p>The Identifier (ID) of the directory associated with the group.</p>
        realm: <p> The domain name that's associated with the group. </p> <note> <p> This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned. </p> <p> This value is case insensitive. </p> </note>
        sam_account_name: <p> The name of the group. </p>
        other_attributes: <p> One or more attributes to be returned for the group. For a list of supported attributes, see <a href="https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ad_data_attributes.html">Directory Service Data Attributes</a>. </p>

    Raises:
        capo_directory_service_data.errors.access_denied_exception.AccessDeniedException: <p> You don't have permission to perform the request or access the directory. It can also occur when the <code>DirectoryId</code> doesn't exist or the user, member, or group might be outside of your organizational unit (OU). </p> <p> Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU. </p>
        capo_directory_service_data.errors.directory_unavailable_exception.DirectoryUnavailableException: <p> The request could not be completed due to a problem in the configuration or current state of the specified directory. </p>
        capo_directory_service_data.errors.internal_server_exception.InternalServerException: <p> The operation didn't succeed because an internal error occurred. Try again later. </p>
        capo_directory_service_data.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource couldn't be found. </p>
        capo_directory_service_data.errors.throttling_exception.ThrottlingException: <p> The limit on the number of requests per second has been exceeded. </p>
        capo_directory_service_data.errors.validation_exception.ValidationException: <p> The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request. </p>
        capo_directory_service_data.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To return the attributes of a group
        The following command returns the mapped attributes for a group along with the display name, description, and GUID for the group.

        >>> client.describe_group(directory_id='d-12233abcde', other_attributes=['displayName', 'description', 'objectGUID'], realm='example.domain.com', sam_account_name='DevOpsMail')
    """

    def _handler(
        req: "OperationRequest[capo_directory_service_data.types.describe_group_request.DescribeGroupRequest]",
    ) -> OperationResponse[
        "capo_directory_service_data.types.describe_group_result.DescribeGroupResult"
    ]:
        import capo_directory_service_data._operations.directory_service_data.describe_group

        output, http_response = (
            capo_directory_service_data._operations.directory_service_data.describe_group.describe_group(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_directory_service_data.types.describe_group_result.DescribeGroupResult",
    ) -> dict[str, Any]:
        import capo_directory_service_data.types.describe_group_result

        return capo_directory_service_data.types.describe_group_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DescribeGroup", redact_output=_redact_output),
    )
    input_: capo_directory_service_data.types.describe_group_request.DescribeGroupRequest = {
        "directory_id": directory_id,
        "sam_account_name": sam_account_name,
    }
    if realm is not None:
        input_["realm"] = realm
    if other_attributes is not None:
        input_["other_attributes"] = other_attributes

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output