talkncloud / tnc-cup-client

npm client for tnc cup api
MIT License
6 stars 0 forks source link

Backend API changes to return json #68

Closed talkncloud closed 3 years ago

talkncloud commented 3 years ago

Is your feature request related to a problem? Please describe. The backend api has changed and the client needs to be updated to reflect those changes.

Describe the solution you'd like Parse json response from backend api and display for user.

Additional context Example output from backend (dev):


[
    {
        "tncup": {
            "group": "Cognito",
            "items": [
                {
                    "pool": {
                        "price": 27.5,
                        "description": "Cognito User Pools us-east-1 tier 1 pricing",
                        "units": 5000,
                        "uom": "USER"
                    }
                }
            ]
        }
    },
    {
        "api": {
            "group": "AppSync",
            "items": [
                {
                    "api": {
                        "price": 40.0,
                        "description": "$4 per million query and data modification operations in US East (N. Virginia)",
                        "units": 10000000,
                        "uom": "REQ"
                    }
                }
            ]
        }
    },
    {
        "waf": {
            "group": "WAFv2",
            "items": [
                {
                    "req": {
                        "price": 0.06,
                        "description": "$0.60 per million requests processed",
                        "units": 100000,
                        "uom": "REQ"
                    },
                    "rule": {
                        "price": 3.0,
                        "description": "$1.00 per rule created (prorated hourly)",
                        "units": 3,
                        "uom": "RULE"
                    },
                    "acl": {
                        "price": 5.0,
                        "description": "$5.00 per web ACL created (prorated hourly)",
                        "units": 1,
                        "uom": "COUNT"
                    }
                }
            ]
        }
    },
    {
        "TOTAL (USD)": {
            "description": "Total estimated price (USD)",
            "price": 76
        }
    },
    {
        "budget": {
            "status": 1,
            "message": "over budget by $65 (USD)"
        }
    },
    {
        "notimplemented": []
    }
]
talkncloud commented 3 years ago

the /services endpoint has also been udpated, the client will need to be updated to match the parent key or cloudformation e.g. 'AWS::S3::Bucket'

{ "AWS::AppSync::GraphQLApi": { "name": "AppSync", "cloudformation": "AWS::AppSync::GraphQLApi", "description": "managed GraphQL API service" }, "AWS::Cognito::UserPool": { "name": "Cognito", "cloudformation": "AWS::Cognito::UserPool", "description": "user authentication and authorization such as oAuth" }, "AWS::DynamoDB::Table": { "name": "DynamoDB", "cloudformation": "AWS::DynamoDB::Table", "description": "NoSQL database service" }, "AWS::EC2::Instance": { "name": "EC2", "cloudformation": "AWS::EC2::Instance", "description": "virtual servers (IaaS)" }, "AWS::EC2::Volume": { "name": "EC2-Storage", "cloudformation": "AWS::EC2::Volume", "description": "storage assoicated with servers e.g. block storage" }, "AWS::RDS::DBInstance": { "name": "RDS", "cloudformation": "AWS::RDS::DBInstance", "description": "managed relational database service e.g. MySQL" }, "AWS::WAFv2::WebACL": { "name": "WAF", "cloudformation": "AWS::WAFv2::WebACL", "description": "web application firewall" }, "Amazon::S3::Bucket": { "name": "S3", "cloudformation": "Amazon::S3::Bucket", "description": "simple object storage" } }

tientham commented 3 years ago

@talkncloud : could you please open another issue for /services api change? Because I think #68 is for /template endpoint change.