aws-cost-calculator-cli 1.11.1__py3-none-any.whl → 2.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of aws-cost-calculator-cli might be problematic. Click here for more details.
- {aws_cost_calculator_cli-1.11.1.dist-info → aws_cost_calculator_cli-2.3.1.dist-info}/METADATA +1 -1
- aws_cost_calculator_cli-2.3.1.dist-info/RECORD +16 -0
- {aws_cost_calculator_cli-1.11.1.dist-info → aws_cost_calculator_cli-2.3.1.dist-info}/WHEEL +1 -1
- cost_calculator/api_client.py +18 -21
- cost_calculator/cli.py +575 -308
- cost_calculator/dimensions.py +141 -0
- cost_calculator/executor.py +25 -12
- aws_cost_calculator_cli-1.11.1.dist-info/RECORD +0 -15
- {aws_cost_calculator_cli-1.11.1.dist-info → aws_cost_calculator_cli-2.3.1.dist-info}/entry_points.txt +0 -0
- {aws_cost_calculator_cli-1.11.1.dist-info → aws_cost_calculator_cli-2.3.1.dist-info}/licenses/LICENSE +0 -0
- {aws_cost_calculator_cli-1.11.1.dist-info → aws_cost_calculator_cli-2.3.1.dist-info}/top_level.txt +0 -0
{aws_cost_calculator_cli-1.11.1.dist-info → aws_cost_calculator_cli-2.3.1.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aws-cost-calculator-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.3.1
|
|
4
4
|
Summary: AWS Cost Calculator CLI - Calculate daily and annual AWS costs across multiple accounts
|
|
5
5
|
Home-page: https://github.com/trilogy-group/aws-cost-calculator
|
|
6
6
|
Author: Cost Optimization Team
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
aws_cost_calculator_cli-2.3.1.dist-info/licenses/LICENSE,sha256=cYtmQZHNGGTXOtg3T7LHDRneleaH0dHXHfxFV3WR50Y,1079
|
|
2
|
+
cost_calculator/__init__.py,sha256=PJeIqvWh5AYJVrJxPPkI4pJnAt37rIjasrNS0I87kaM,52
|
|
3
|
+
cost_calculator/api_client.py,sha256=UN_dKo8OYWVN905xZAn8pLlHMBSFR_EJWCUq21K8IKg,2204
|
|
4
|
+
cost_calculator/cli.py,sha256=z8_eKrBrg2JsLn7oA8DkEI1vKkMVNvPiIDn8HEHINsw,87635
|
|
5
|
+
cost_calculator/cur.py,sha256=QaZ_nyDSw5_cti-h5Ho6eYLbqzY5TWoub24DpyzIiSs,9502
|
|
6
|
+
cost_calculator/dimensions.py,sha256=cTpdYm-w88IgqlcB4ObhUsvGREBMrMSZx0d2PyehI6M,4478
|
|
7
|
+
cost_calculator/drill.py,sha256=hGi-prLgZDvNMMICQc4fl3LenM7YaZ3To_Ei4LKwrdc,10543
|
|
8
|
+
cost_calculator/executor.py,sha256=vwp4SoZfTobUeTKPujRzZzkO7tjOG8_LEGxgtraOZAQ,9348
|
|
9
|
+
cost_calculator/forensics.py,sha256=uhRo3I_zOeMEaBENHfgq65URga31W0Z4vzS2UN6VmTY,12819
|
|
10
|
+
cost_calculator/monthly.py,sha256=6k9F8S7djhX1wGV3-T1MZP7CvWbbfhSTEaddwCfVu5M,7932
|
|
11
|
+
cost_calculator/trends.py,sha256=k_s4ylBX50sqoiM_fwepi58HW01zz767FMJhQUPDznk,12246
|
|
12
|
+
aws_cost_calculator_cli-2.3.1.dist-info/METADATA,sha256=AxN6JVPuY3KljBGk1uBzxOHCgKkd8dT1fCnXmtTPwoc,11978
|
|
13
|
+
aws_cost_calculator_cli-2.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
aws_cost_calculator_cli-2.3.1.dist-info/entry_points.txt,sha256=_5Qy4EcHbYVYrdgOu1E48faMHb9fLUl5VJ3djDHuJBo,47
|
|
15
|
+
aws_cost_calculator_cli-2.3.1.dist-info/top_level.txt,sha256=PRwGPPlNqASfyhGHDjSfyl4SXeE7GF3OVTu1tY1Uqyc,16
|
|
16
|
+
aws_cost_calculator_cli-2.3.1.dist-info/RECORD,,
|
cost_calculator/api_client.py
CHANGED
|
@@ -23,14 +23,15 @@ def get_api_config():
|
|
|
23
23
|
return None
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
def call_lambda_api(endpoint, credentials, accounts, **kwargs):
|
|
26
|
+
def call_lambda_api(endpoint, credentials, accounts=None, profile=None, **kwargs):
|
|
27
27
|
"""
|
|
28
|
-
Call
|
|
28
|
+
Call unified API Gateway endpoint.
|
|
29
29
|
|
|
30
30
|
Args:
|
|
31
|
-
endpoint: API endpoint name ('trends', 'monthly', 'drill')
|
|
31
|
+
endpoint: API endpoint name ('calculate', 'trends', 'monthly', 'drill', 'query', etc.)
|
|
32
32
|
credentials: dict with AWS credentials
|
|
33
|
-
accounts: list of account IDs
|
|
33
|
+
accounts: list of account IDs (deprecated - use profile instead)
|
|
34
|
+
profile: profile name (preferred over accounts)
|
|
34
35
|
**kwargs: additional parameters for the specific endpoint
|
|
35
36
|
|
|
36
37
|
Returns:
|
|
@@ -44,26 +45,22 @@ def call_lambda_api(endpoint, credentials, accounts, **kwargs):
|
|
|
44
45
|
if not api_config:
|
|
45
46
|
raise Exception("API not configured. Set COST_API_SECRET environment variable.")
|
|
46
47
|
|
|
47
|
-
#
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
'monthly': 'https://6aueebodw6q4zdeu3aaexb6tle0fqhhr.lambda-url.us-east-1.on.aws/',
|
|
51
|
-
'drill': 'https://3ncm2gzxrsyptrhud3ua3x5lju0akvsr.lambda-url.us-east-1.on.aws/',
|
|
52
|
-
'analyze': 'https://y6npmidtxwzg62nrqzkbacfs5q0edwgs.lambda-url.us-east-1.on.aws/',
|
|
53
|
-
'profiles': 'https://64g7jq7sjygec2zmll5lsghrpi0txrzo.lambda-url.us-east-1.on.aws/',
|
|
54
|
-
'forensics': 'https://gaekfzz7sc2hwn4mjyk64sieke0vadfo.lambda-url.us-east-1.on.aws/' # Will be populated after deployment
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
url = endpoint_urls.get(endpoint)
|
|
58
|
-
|
|
59
|
-
if not url:
|
|
60
|
-
raise Exception(f"Unknown endpoint: {endpoint}")
|
|
48
|
+
# Get base URL from environment or use default
|
|
49
|
+
base_url = os.environ.get('COST_CALCULATOR_API_URL', 'https://api.costcop.cloudfix.dev')
|
|
50
|
+
url = f"{base_url}/{endpoint}"
|
|
61
51
|
|
|
62
52
|
# Build request payload
|
|
63
53
|
payload = {
|
|
64
|
-
'credentials': credentials
|
|
65
|
-
'accounts': accounts
|
|
54
|
+
'credentials': credentials
|
|
66
55
|
}
|
|
56
|
+
|
|
57
|
+
# Add profile or accounts
|
|
58
|
+
if profile:
|
|
59
|
+
payload['profile'] = profile
|
|
60
|
+
elif accounts:
|
|
61
|
+
payload['accounts'] = accounts
|
|
62
|
+
|
|
63
|
+
# Add additional parameters
|
|
67
64
|
payload.update(kwargs)
|
|
68
65
|
|
|
69
66
|
# Make API call
|
|
@@ -72,7 +69,7 @@ def call_lambda_api(endpoint, credentials, accounts, **kwargs):
|
|
|
72
69
|
'Content-Type': 'application/json'
|
|
73
70
|
}
|
|
74
71
|
|
|
75
|
-
response = requests.post(url, headers=headers, json=payload, timeout=
|
|
72
|
+
response = requests.post(url, headers=headers, json=payload, timeout=900) # 15 min timeout
|
|
76
73
|
|
|
77
74
|
if response.status_code != 200:
|
|
78
75
|
raise Exception(f"API call failed: {response.status_code} - {response.text}")
|