project-koku / masu

This is a READ ONLY repo. See https://github.com/project-koku/koku for current masu implementation
GNU Affero General Public License v3.0
5 stars 6 forks source link

Calculate OCP charges from tiered rates #272

Closed dccurtis closed 5 years ago

dccurtis commented 5 years ago

User Story

As user, I want to have OCP charges based on tiered rates.

Impacts

API, Docs

Role

User

Assumptions

API Details

The charge field will be calculated based on max(request, usage) * Tiered Rate. If a fixed rate also exists it will be added to the tiered rate API Detail
Method GET
Path /api/v1/reports/inventory/ocp/memory/?filter[resolution]=monthly&filter[time_scope_value]=-1&filter[time_scope_units]=month&group_by[cluster]=*

Response:

{
    "group_by": {
        "cluster": [
            "*"
        ]
    },
    "filter": {
        "resolution": "monthly",
        "time_scope_value": "-1",
        "time_scope_units": "month"
    },
    "data": [
        {
            "date": "2018-11",
            "clusters": [
                {
                    "cluster": "3de10d3e-4a16-51f2-a51d-90366553d530",
                    "values": [
                        {
                            "date": "2018-11",
                            "cluster": "3de10d3e-4a16-51f2-a51d-90366553d530",
                            "usage": 13.830152,
                            "request": 16.743582,
                            "charge": 2.651103,
                            "limit": 21.055042
                        }
                    ]
                }
            ]
        }
    ],
    "total": {
        "usage": 13.830152,
        "request": 16.743582,
        "charge": 2.651103,
        "limit": 21.055042
    }
}

UI Details

UI will charge in the same way that it does with fixed rate.

Acceptance Criteria

dccurtis commented 5 years ago

See https://github.com/project-koku/masu/pull/267

lcouzens commented 5 years ago

Closing this as Tiered rates will be changed soon so this testing will need to be redone. https://app.zenhub.com/workspaces/project-koku-5ab50f63d0f4ea53b00232c8/issues/project-koku/masu/281

Created a card in hccm-plugin for tracking the testing.