GithubHelp home page GithubHelp logo

azurecostestimatorapi's Introduction

Azure Cost Estimator API

Overview

This API wraps the Azure RateCard API and helps map Azure sku id's to the latest rate cards. It can be used to build cost estimation products built around spreadsheets and/or ARM template editors

Valid Offer's supported by this API are listed at https://azure.microsoft.com/en-us/support/legal/offer-details/. Prefix the codes with MS-AZR- before passing them to the API

Build and Test Details

Prerequisites

Build

  1. Edit /config/default.json to add storage account info & client app id/secret. Client app needs to have contributor access to a subscription
  2. npm install
  3. npm start

Test

Unit Tests

  1. npm run test

Integration Tests

  1. Run generatetestdata.sh to create local json files used during integration tests
  2. npm run integration_tests

Usage

See the /tests/Functions.spec.ts for examples on how to use the api. This integration test will hit the API after it is deployed to Azure functions

  1. /api/costmodel - takes a json document and returns details on the costs for each sku in the document

    Sample Input:

    Optional Parameter: offercode=MS-AZR-0121p

    Offer will default to MS-AZR-0003p if none is provided

  2. /api/cost/{location}/ - returns rate card values for all skus in a particular region

    Optional Parameter: offercode=MS-AZR-0121p

    Offer will default to MS-AZR-0003p if none is provided

    Example: http://localhost:7071/api/cost/eastus

  3. /api/cost/{location}/{sku name} - returns single rate card applied to sku in specific region

    Optional Parameter: offercode=MS-AZR-0121p

    Offer will default to MS-AZR-0003p if none is provided

    Example: http://localhost:7071/api/cost/eastus/A3_standard

azurecostestimatorapi's People

Contributors

mjzawacki avatar

Watchers

 avatar  avatar

azurecostestimatorapi's Issues

Add Rate tests

Check that the API is returning the expected rates for all VMs and disks. automate in CI/CD on a regular schedule

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.