Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix field name that the API actually returns #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

c-mart
Copy link
Contributor

@c-mart c-mart commented Sep 22, 2022

When querying /usage/failed, this Python client looks for a key named ValidationFailedRecords in the response object. But the API actually returns a key named FailedRecords:

$ curl -s -H "XA-SITE: IU" -H "XA-API-KEY: redacted" https://usage.xsede.org/api/v1_test/usage/failed | jq -r . | head -n 6
{
  "FailedRecords": [
    {
      "Charge": 166.158,
      "EndTime": "2022-09-14T00:00:00Z",
      "Resource": "jetstream2.indiana.xsede.org",

As a result, client.get_failed_records() was returning <FailedUsageResponse: 0 records> when we definitely had some failed records. With the change in this PR, I now see <FailedUsageResponse: 1539 records>, what I would expect.

@c-mart c-mart marked this pull request as ready for review September 22, 2022 19:02
@sabo sabo self-assigned this Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants