Skip to content

Want to get the Service Account created datetime #14329

@LiNuo0

Description

@LiNuo0

Determine this is the right repository

  • I determined this is the correct repository in which to report this feature request.

Summary of the feature request

In my product, I want to retrieve the existing service accounts from my GCP project and get the creation datetime for each of them.

Here I want to check whether the service account was created too long time ago as I want to cleanup the orphan service account from the project

But I cannot get the creation datetime value.

Desired code experience

from googleapiclient import discovery

... ...
current_service_accouts = discovery.build("iam", "v1", credentials=my_credentials).projects().serviceAccounts().list(name="projects/xxx").execute()
for account in current_service_accouts:
    <if the service account was created 1 year ago>
         delete it

Expected results

I want to get the service account creation datetime value like service_account['createTimestamp'].

API client name and version

google-api-python-client 2.179.0

Use case

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions