Skip to content

cloud/instance endpoint returns different values if default location is set explicitly #418

@jnioche

Description

@jnioche

Bug description

curl -X 'POST'   'http://0.0.0.0:5000/v1/cloud/instance?verbose=true&duration=1&criteria=pe'   -H 'accept: application/json'   -H 'Content-Type: application/json'   -d '{
  "provider": "aws",
  "instance_type": "a1.4xlarge"
}'

gives a use impact of

 "use": {
        "value": 1.0,
        "min": 0.0006086,
        "max": 29.22
      }

which is the same as the GET

"http://0.0.0.0:5000/v1/cloud/instance?verbose=true&duration=1&criteria=pe&instance_type=a1.4xlarge"

by default 'EEE' is used as a location but when it is set explicitly with

'{
"provider": "aws",
"instance_type": "a1.4xlarge",
"usage": {
"usage_location": "EEE"}
}'

we are getting

  "use": {
        "value": 0.67,
        "min": 0.6027,
        "max": 0.8036
      }

instead.

To Reproduce

Expected behavior

JSON OUTPUT

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions