Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

TimeWindow remains same #228

Closed
daniyalAhmed-code opened this issue Jul 13, 2021 · 2 comments
Closed

TimeWindow remains same #228

daniyalAhmed-code opened this issue Jul 13, 2021 · 2 comments
Assignees
Labels
api: cloudasset Issues related to the googleapis/python-asset API. type: question Request for information or clarification. Not an issue.

Comments

@daniyalAhmed-code
Copy link

I've been trying to fetch batch_get_history of limited start and end time but the response I'm receiving has all the data beyond the given start and end time.

window { start_time { seconds: 1623974419 nanos: 950810000 } end_time { seconds: 9223372036 nanos: 854775807 } }

This is how I am trying to request the data

t = datetime.datetime.now().replace(hour=00, minute=00).timestamp()
    end_time = datetime.datetime.now().replace(hour=23, minute=59).timestamp()
    print(t)
    print(end_time)
    
    seconds = int(t)
    nanos = int(t % 1 * 1e9)
    end_seconds = int(end_time)
    end_nanos = int(end_time % 1 * 1e9)

    start_proto_timestamp = Timestamp(seconds=seconds,nanos=nanos)
    end_proto_timestamp = Timestamp(seconds=end_seconds,nanos=end_nanos)

sset_response = client.batch_get_assets_history(
    
    request={
        "parent": parent,
        "asset_names": asset_names,
        "read_time_window": asset_v1.TimeWindow(start_time = start_proto_timestamp, end_time = end_proto_timestamp),
        "content_type": content_type
    }
    )

Can someone please help me out how can I pass TimeWindow in batch_get_history request.
I'm using latest cloudasset plugin with python3.8

@product-auto-label product-auto-label bot added the api: cloudasset Issues related to the googleapis/python-asset API. label Jul 13, 2021
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jul 14, 2021
@parthea parthea added type: question Request for information or clarification. Not an issue. and removed triage me I really want to be triaged. labels Jul 16, 2021
@parthea
Copy link
Contributor

parthea commented Feb 5, 2022

Hi @daniyalAhmed-code,

I'm sorry that you didn't receive a response. As a next step, use the Try this API section on this page to help determine if this is an issue with the API or the client library itself. If the issue also exists when using the Try this API tool, then the issue can be escalated to the product team.

@parthea parthea self-assigned this Feb 5, 2022
@parthea
Copy link
Contributor

parthea commented Feb 25, 2022

I'm going to close this issue due to inactivity but please feel free to re-open it with more information.

@parthea parthea closed this as completed Feb 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: cloudasset Issues related to the googleapis/python-asset API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants