Skip to content

list_service_specific_credentials

list_service_specific_credentials(
    *,
    config_overrides: Optional[IAMClientConfig] = None,
    user_name: Optional[userNameType] = None,
    service_name: Optional[serviceName] = None,
    all_users: Optional[allUsers] = None,
    marker: Optional[markerType] = None,
    max_items: Optional[maxItemsType] = None,
) -> ListServiceSpecificCredentialsResponse

Returns information about the service-specific credentials associated with the specified IAM user. If none exists, the operation returns an empty list. The service-specific credentials returned by this operation are used only for authenticating the IAM user to a specific service. For more information about using service-specific credentials to authenticate to an Amazon Web Services service, refer to the following docs:

Parameters:

  • user_name (Optional[userNameType], default: None ) –

    The name of the user whose service-specific credentials you want information about. If this value is not specified, then the operation assumes the user whose credentials are used to call the operation.

    This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

  • service_name (Optional[serviceName], default: None ) –

    Filters the returned results to only those for the specified Amazon Web Services service. If not specified, then Amazon Web Services returns service-specific credentials for all services.

  • all_users (Optional[allUsers], default: None ) –

    A flag indicating whether to list service specific credentials for all users. This parameter cannot be specified together with UserName. When true, returns all credentials associated with the specified service.

  • marker (Optional[markerType], default: None ) –

    Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the Marker from the response that you received to indicate where the next call should start.

  • max_items (Optional[maxItemsType], default: None ) –

    Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true.

Raises:

  • NoSuchEntityException –

    The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ServiceNotSupportedException –

    The specified service does not support service-specific credentials.

  • UnknownServiceError –

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

Source code in docs_src/capo_iam/_services/iam.py
def list_service_specific_credentials(
    self,
    *,
    config_overrides: Optional[IAMClientConfig] = None,
    user_name: Optional["capo_iam.types.user_name_type.userNameType"] = None,
    service_name: Optional["capo_iam.types.service_name.serviceName"] = None,
    all_users: Optional["capo_iam.types.all_users.allUsers"] = None,
    marker: Optional["capo_iam.types.marker_type.markerType"] = None,
    max_items: Optional["capo_iam.types.max_items_type.maxItemsType"] = None,
) -> "capo_iam.types.list_service_specific_credentials_response.ListServiceSpecificCredentialsResponse":
    """<p>Returns information about the service-specific credentials associated with the specified IAM user. If none exists, the operation returns an empty list. The service-specific credentials returned by this operation are used only for authenticating the IAM user to a specific service. For more information about using service-specific credentials to authenticate to an Amazon Web Services service, refer to the following docs:</p> <ul> <li> <p>For service-specific credentials with CodeCommit, refer to <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_ssh-keys.html">IAM credentials for CodeCommit: Git credentials, SSH keys, and Amazon Web Services access keys</a> in the <i>IAM User Guide</i>.</p> </li> <li> <p>For service-specific credentials with Amazon Keyspaces (for Apache Cassandra), refer to <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_keyspaces.html">Use IAM with Amazon Keyspaces (for Apache Cassandra)</a> in the <i>IAM User Guide</i>.</p> </li> <li> <p>For services that support long-term API keys, refer to <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_api_keys_for_aws_services.html">API keys for Amazon Web Services services</a> in the <i>IAM User Guide</i>.</p> </li> </ul>

    Args:
        user_name: <p>The name of the user whose service-specific credentials you want information about. If this value is not specified, then the operation assumes the user whose credentials are used to call the operation.</p> <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
        service_name: <p>Filters the returned results to only those for the specified Amazon Web Services service. If not specified, then Amazon Web Services returns service-specific credentials for all services.</p>
        all_users: <p>A flag indicating whether to list service specific credentials for all users. This parameter cannot be specified together with UserName. When true, returns all credentials associated with the specified service.</p>
        marker: <p>Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the Marker from the response that you received to indicate where the next call should start.</p>
        max_items: <p>Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true.</p>

    Raises:
        capo_iam.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.</p>
        capo_iam.errors.service_not_supported_exception.ServiceNotSupportedException: <p>The specified service does not support service-specific credentials.</p>
        capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iam.types.list_service_specific_credentials_request.ListServiceSpecificCredentialsRequest]",
    ) -> OperationResponse[
        "capo_iam.types.list_service_specific_credentials_response.ListServiceSpecificCredentialsResponse"
    ]:
        import capo_iam._operations.aws_identity_management_v20100508.list_service_specific_credentials

        output, http_response = (
            capo_iam._operations.aws_identity_management_v20100508.list_service_specific_credentials.list_service_specific_credentials(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListServiceSpecificCredentials")
    )
    input_: capo_iam.types.list_service_specific_credentials_request.ListServiceSpecificCredentialsRequest = {}
    if user_name is not None:
        input_["user_name"] = user_name
    if service_name is not None:
        input_["service_name"] = service_name
    if all_users is not None:
        input_["all_users"] = all_users
    if marker is not None:
        input_["marker"] = marker
    if max_items is not None:
        input_["max_items"] = max_items

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