Skip to content

Fix field name that the API actually returns#33

Open
c-mart wants to merge 1 commit into
XSEDE:mainfrom
c-mart:fix-failed-records-field-name
Open

Fix field name that the API actually returns#33
c-mart wants to merge 1 commit into
XSEDE:mainfrom
c-mart:fix-failed-records-field-name

Conversation

@c-mart
Copy link
Copy Markdown
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