diff --git a/autogen.py b/autogen.py index 13d9e9a..2a528de 100644 --- a/autogen.py +++ b/autogen.py @@ -628,7 +628,7 @@ def _collect_handler_routes(resources: dict[str, Resource]) -> dict[str, list[tu for endpoint in resource.endpoints: if endpoint.response_handler: handler_routes.setdefault(endpoint.response_handler, []).append( - (endpoint.method, endpoint.path) + (endpoint.method, "/v2" + endpoint.path) ) return handler_routes @@ -643,7 +643,7 @@ def _collect_boolean_status_prefixes(resources: dict[str, Resource]) -> list[tup for resource in resources.values(): for endpoint in resource.endpoints: if endpoint.boolean_status: - prefix = endpoint.path.split("{")[0] + prefix = ("/v2" + endpoint.path).split("{")[0] result.append((endpoint.method, prefix)) return result @@ -883,7 +883,7 @@ def generate_sync_method(endpoint: Endpoint, method_name: str) -> list[str]: lines.append(' """') # Build path with parameters (URL-encode each path arg) - path = endpoint.path + path = "/v2" + endpoint.path for pp in path_params: path = path.replace(f"{{{pp.name}}}", f"{{quote(str({pp.python_name}), safe='')}}") @@ -1163,7 +1163,7 @@ def generate_async_method(endpoint: Endpoint, method_name: str) -> list[str]: lines.append(' """') # Build path with parameters (URL-encode each path arg) - path = endpoint.path + path = "/v2" + endpoint.path for pp in path_params: path = path.replace(f"{{{pp.name}}}", f"{{quote(str({pp.python_name}), safe='')}}") diff --git a/pyproject.toml b/pyproject.toml index 3b1225a..3cbfbe1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "vantage-python" -version = "0.3.3" +version = "0.4.0" description = "Python SDK for the Vantage API" readme = "README.md" license = "MIT" diff --git a/src/vantage/_async/client.py b/src/vantage/_async/client.py index 65fbd4f..8afce0d 100644 --- a/src/vantage/_async/client.py +++ b/src/vantage/_async/client.py @@ -116,7 +116,7 @@ async def request( json=body, ) - if method.upper() == "GET" and path.startswith("/virtual_tag_configs/async/"): + if method.upper() == "GET" and path.startswith("/v2/virtual_tag_configs/async/"): if response.status_code == 404: return False elif response.is_success: @@ -135,7 +135,7 @@ async def request( body=response.text, ) - if (method, path) in {("POST", "/costs/data_exports"), ("POST", "/kubernetes_efficiency_reports/data_exports"), ("POST", "/unit_costs/data_exports")}: + if (method, path) in {("POST", "/v2/costs/data_exports"), ("POST", "/v2/kubernetes_efficiency_reports/data_exports"), ("POST", "/v2/unit_costs/data_exports")}: return self._request_for_location(response) try: @@ -162,7 +162,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all Access Grants that the current API token has access to. """ - path = "/access_grants" + path = "/v2/access_grants" params = { "page": page, "limit": limit, @@ -179,7 +179,7 @@ async def create(self, body: CreateAccessGrant) -> AccessGrant: Create an Access Grant. """ - path = "/access_grants" + path = "/v2/access_grants" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -193,7 +193,7 @@ async def get(self, access_grant_token: str) -> AccessGrant: Return a specific Access Grant. """ - path = f"/access_grants/{quote(str(access_grant_token), safe='')}" + path = f"/v2/access_grants/{quote(str(access_grant_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -207,7 +207,7 @@ async def update(self, access_grant_token: str, body: UpdateAccessGrant) -> Acce Update an AccessGrant. """ - path = f"/access_grants/{quote(str(access_grant_token), safe='')}" + path = f"/v2/access_grants/{quote(str(access_grant_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -221,7 +221,7 @@ async def delete(self, access_grant_token: str) -> None: Delete an Access Grant. """ - path = f"/access_grants/{quote(str(access_grant_token), safe='')}" + path = f"/v2/access_grants/{quote(str(access_grant_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -239,7 +239,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None, Return all Anomaly Alerts that the current API token has access to. """ - path = "/anomaly_alerts" + path = "/v2/anomaly_alerts" params = { "page": page, "limit": limit, @@ -262,7 +262,7 @@ async def get(self, anomaly_alert_token: str) -> AnomalyAlert: Return an AnomalyAlert that the current API token has access to. """ - path = f"/anomaly_alerts/{quote(str(anomaly_alert_token), safe='')}" + path = f"/v2/anomaly_alerts/{quote(str(anomaly_alert_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -276,7 +276,7 @@ async def update(self, anomaly_alert_token: str, body: UpdateAnomalyAlert) -> An Update an AnomalyAlert. """ - path = f"/anomaly_alerts/{quote(str(anomaly_alert_token), safe='')}" + path = f"/v2/anomaly_alerts/{quote(str(anomaly_alert_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -297,7 +297,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all Anomaly Notifications. """ - path = "/anomaly_notifications" + path = "/v2/anomaly_notifications" params = { "page": page, "limit": limit, @@ -314,7 +314,7 @@ async def create(self, body: CreateAnomalyNotification) -> AnomalyNotification: Create an Anomaly Notification for a Cost Report. """ - path = "/anomaly_notifications" + path = "/v2/anomaly_notifications" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -328,7 +328,7 @@ async def get(self, anomaly_notification_token: str) -> AnomalyNotification: Return an Anomaly Notification that the current API token has access to. """ - path = f"/anomaly_notifications/{quote(str(anomaly_notification_token), safe='')}" + path = f"/v2/anomaly_notifications/{quote(str(anomaly_notification_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -342,7 +342,7 @@ async def update(self, anomaly_notification_token: str, body: UpdateAnomalyNotif Update an Anomaly Notification. """ - path = f"/anomaly_notifications/{quote(str(anomaly_notification_token), safe='')}" + path = f"/v2/anomaly_notifications/{quote(str(anomaly_notification_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -356,7 +356,7 @@ async def delete(self, anomaly_notification_token: str) -> None: Delete an Anomaly Notification. """ - path = f"/anomaly_notifications/{quote(str(anomaly_notification_token), safe='')}" + path = f"/v2/anomaly_notifications/{quote(str(anomaly_notification_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -374,7 +374,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None, Return all AuditLogs. """ - path = "/audit_logs" + path = "/v2/audit_logs" params = { "page": page, "limit": limit, @@ -401,7 +401,7 @@ async def get(self, audit_log_token: str) -> AuditLog: Return a specific AuditLog. """ - path = f"/audit_logs/{quote(str(audit_log_token), safe='')}" + path = f"/v2/audit_logs/{quote(str(audit_log_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -422,7 +422,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Returns a list of billing profiles (MSP invoicing required). """ - path = "/billing_profiles" + path = "/v2/billing_profiles" params = { "page": page, "limit": limit, @@ -439,7 +439,7 @@ async def create(self, body: CreateBillingProfile) -> BillingProfile: Create a billing profile (MSP invoicing required). """ - path = "/billing_profiles" + path = "/v2/billing_profiles" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -453,7 +453,7 @@ async def get(self, billing_profile_token: str) -> BillingProfile: Requires MSP invoicing to be enabled on the account. """ - path = f"/billing_profiles/{quote(str(billing_profile_token), safe='')}" + path = f"/v2/billing_profiles/{quote(str(billing_profile_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -467,7 +467,7 @@ async def update(self, billing_profile_token: str, body: UpdateBillingProfile) - Requires MSP invoicing to be enabled on the account. """ - path = f"/billing_profiles/{quote(str(billing_profile_token), safe='')}" + path = f"/v2/billing_profiles/{quote(str(billing_profile_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -481,7 +481,7 @@ async def delete(self, billing_profile_token: str) -> None: Requires MSP invoicing to be enabled on the account. """ - path = f"/billing_profiles/{quote(str(billing_profile_token), safe='')}" + path = f"/v2/billing_profiles/{quote(str(billing_profile_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -499,7 +499,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Returns a list of billing rules. """ - path = "/billing_rules" + path = "/v2/billing_rules" params = { "page": page, "limit": limit, @@ -516,7 +516,7 @@ async def create(self, body: CreateBillingRule) -> BillingRule: Create a BillingRule. """ - path = "/billing_rules" + path = "/v2/billing_rules" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -530,7 +530,7 @@ async def get(self, billing_rule_token: str) -> BillingRule: Return a BillingRule. """ - path = f"/billing_rules/{quote(str(billing_rule_token), safe='')}" + path = f"/v2/billing_rules/{quote(str(billing_rule_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -544,7 +544,7 @@ async def update(self, billing_rule_token: str, body: UpdateBillingRule) -> Bill Update a BillingRule. """ - path = f"/billing_rules/{quote(str(billing_rule_token), safe='')}" + path = f"/v2/billing_rules/{quote(str(billing_rule_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -558,7 +558,7 @@ async def delete(self, billing_rule_token: str) -> None: Delete a BillingRule. """ - path = f"/billing_rules/{quote(str(billing_rule_token), safe='')}" + path = f"/v2/billing_rules/{quote(str(billing_rule_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -576,7 +576,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all BudgetAlerts. """ - path = "/budget_alerts" + path = "/v2/budget_alerts" params = { "page": page, "limit": limit, @@ -593,7 +593,7 @@ async def create(self, body: CreateBudgetAlert) -> BudgetAlert: Create a Budget Alert. """ - path = "/budget_alerts" + path = "/v2/budget_alerts" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -607,7 +607,7 @@ async def get(self, budget_alert_token: str) -> BudgetAlert: Return a BudgetAlert. """ - path = f"/budget_alerts/{quote(str(budget_alert_token), safe='')}" + path = f"/v2/budget_alerts/{quote(str(budget_alert_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -621,7 +621,7 @@ async def update(self, budget_alert_token: str, body: UpdateBudgetAlert) -> Budg Updates an existing BudgetAlert. """ - path = f"/budget_alerts/{quote(str(budget_alert_token), safe='')}" + path = f"/v2/budget_alerts/{quote(str(budget_alert_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -635,7 +635,7 @@ async def delete(self, budget_alert_token: str) -> None: Delete a BudgetAlert. """ - path = f"/budget_alerts/{quote(str(budget_alert_token), safe='')}" + path = f"/v2/budget_alerts/{quote(str(budget_alert_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -653,7 +653,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all Budgets. """ - path = "/budgets" + path = "/v2/budgets" params = { "page": page, "limit": limit, @@ -670,7 +670,7 @@ async def create(self, body: CreateBudget) -> Budget: Create a Budget. """ - path = "/budgets" + path = "/v2/budgets" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -684,7 +684,7 @@ async def get(self, budget_token: str, *, include_performance: Optional[bool] = Return a Budget. """ - path = f"/budgets/{quote(str(budget_token), safe='')}" + path = f"/v2/budgets/{quote(str(budget_token), safe='')}" params = { "include_performance": include_performance, } @@ -700,7 +700,7 @@ async def update(self, budget_token: str, body: UpdateBudget) -> Budget: Update a Budget. """ - path = f"/budgets/{quote(str(budget_token), safe='')}" + path = f"/v2/budgets/{quote(str(budget_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -714,7 +714,7 @@ async def delete(self, budget_token: str) -> None: Delete a Budget. """ - path = f"/budgets/{quote(str(budget_token), safe='')}" + path = f"/v2/budgets/{quote(str(budget_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -732,7 +732,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all BusinessMetrics that the current API token has access to. """ - path = "/business_metrics" + path = "/v2/business_metrics" params = { "page": page, "limit": limit, @@ -749,7 +749,7 @@ async def create(self, body: CreateBusinessMetric) -> BusinessMetric: Create a new BusinessMetric. """ - path = "/business_metrics" + path = "/v2/business_metrics" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -763,7 +763,7 @@ async def get(self, business_metric_token: str) -> BusinessMetric: Return a BusinessMetric. """ - path = f"/business_metrics/{quote(str(business_metric_token), safe='')}" + path = f"/v2/business_metrics/{quote(str(business_metric_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -777,7 +777,7 @@ async def update(self, business_metric_token: str, body: UpdateBusinessMetric) - Updates an existing BusinessMetric. """ - path = f"/business_metrics/{quote(str(business_metric_token), safe='')}" + path = f"/v2/business_metrics/{quote(str(business_metric_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -791,7 +791,7 @@ async def delete(self, business_metric_token: str) -> None: Deletes an existing BusinessMetric. """ - path = f"/business_metrics/{quote(str(business_metric_token), safe='')}" + path = f"/v2/business_metrics/{quote(str(business_metric_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -802,7 +802,7 @@ async def get_values(self, business_metric_token: str, *, page: Optional[int] = Return values of a BusinessMetric """ - path = f"/business_metrics/{quote(str(business_metric_token), safe='')}/values" + path = f"/v2/business_metrics/{quote(str(business_metric_token), safe='')}/values" params = { "page": page, "limit": limit, @@ -820,7 +820,7 @@ async def get_forecasted_values(self, business_metric_token: str, *, page: Optio Return forecasted values of a BusinessMetric """ - path = f"/business_metrics/{quote(str(business_metric_token), safe='')}/forecasted_values" + path = f"/v2/business_metrics/{quote(str(business_metric_token), safe='')}/forecasted_values" params = { "page": page, "limit": limit, @@ -838,7 +838,7 @@ async def update_values_csv(self, business_metric_token: str, body: dict[str, An Updates the values for an existing BusinessMetric from a CSV file. """ - path = f"/business_metrics/{quote(str(business_metric_token), safe='')}/values.csv" + path = f"/v2/business_metrics/{quote(str(business_metric_token), safe='')}/values.csv" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -859,7 +859,7 @@ async def get_events(self, cost_alert_token: str, *, report_token: Optional[str] Get all CostAlertEvents """ - path = f"/cost_alerts/{quote(str(cost_alert_token), safe='')}/events" + path = f"/v2/cost_alerts/{quote(str(cost_alert_token), safe='')}/events" params = { "report_token": report_token, "page": page, @@ -877,7 +877,7 @@ async def get_event(self, cost_alert_token: str, event_token: str) -> CostAlertE Get a CostAlertEvent """ - path = f"/cost_alerts/{quote(str(cost_alert_token), safe='')}/events/{quote(str(event_token), safe='')}" + path = f"/v2/cost_alerts/{quote(str(cost_alert_token), safe='')}/events/{quote(str(event_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -891,7 +891,7 @@ async def list(self) -> CostAlerts: List all Cost Alerts """ - path = "/cost_alerts" + path = "/v2/cost_alerts" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -905,7 +905,7 @@ async def create(self, body: CreateCostAlert) -> CostAlert: Create a new Cost Alert """ - path = "/cost_alerts" + path = "/v2/cost_alerts" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -919,7 +919,7 @@ async def get(self, cost_alert_token: str) -> CostAlert: Get a Cost Alert """ - path = f"/cost_alerts/{quote(str(cost_alert_token), safe='')}" + path = f"/v2/cost_alerts/{quote(str(cost_alert_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -933,7 +933,7 @@ async def update(self, cost_alert_token: str, body: UpdateCostAlert) -> CostAler Update a Cost Alert """ - path = f"/cost_alerts/{quote(str(cost_alert_token), safe='')}" + path = f"/v2/cost_alerts/{quote(str(cost_alert_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -947,7 +947,7 @@ async def delete(self, cost_alert_token: str) -> None: Delete a Cost Alert """ - path = f"/cost_alerts/{quote(str(cost_alert_token), safe='')}" + path = f"/v2/cost_alerts/{quote(str(cost_alert_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -965,7 +965,7 @@ async def list(self, *, workspace_token: Optional[str] = None, provider: Optiona List CostProviderAccounts available in a given Workspace. """ - path = "/cost_provider_accounts" + path = "/v2/cost_provider_accounts" params = { "workspace_token": workspace_token, "provider": provider, @@ -991,7 +991,7 @@ async def list(self, *, workspace_token: Optional[str] = None) -> CostProviders: List CostProviders available to query in a given Workspace. """ - path = "/cost_providers" + path = "/v2/cost_providers" params = { "workspace_token": workspace_token, } @@ -1014,7 +1014,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None, Return all CostReports. """ - path = "/cost_reports" + path = "/v2/cost_reports" params = { "page": page, "limit": limit, @@ -1032,7 +1032,7 @@ async def create(self, body: CreateCostReport) -> CostReport: Create a CostReport. """ - path = "/cost_reports" + path = "/v2/cost_reports" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1046,7 +1046,7 @@ async def get(self, cost_report_token: str) -> CostReport: Return a CostReport. """ - path = f"/cost_reports/{quote(str(cost_report_token), safe='')}" + path = f"/v2/cost_reports/{quote(str(cost_report_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -1060,7 +1060,7 @@ async def update(self, cost_report_token: str, body: UpdateCostReport) -> CostRe Update a CostReport. """ - path = f"/cost_reports/{quote(str(cost_report_token), safe='')}" + path = f"/v2/cost_reports/{quote(str(cost_report_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -1074,7 +1074,7 @@ async def delete(self, cost_report_token: str) -> None: Delete a CostReport. """ - path = f"/cost_reports/{quote(str(cost_report_token), safe='')}" + path = f"/v2/cost_reports/{quote(str(cost_report_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -1085,7 +1085,7 @@ async def get_forecasted_costs(self, cost_report_token: str, *, start_date: Opti Return all ForecastedCosts. """ - path = f"/cost_reports/{quote(str(cost_report_token), safe='')}/forecasted_costs" + path = f"/v2/cost_reports/{quote(str(cost_report_token), safe='')}/forecasted_costs" params = { "start_date": start_date, "end_date": end_date, @@ -1113,7 +1113,7 @@ async def list(self, *, workspace_token: Optional[str] = None) -> CostServices: List CostServices available to query in a given Workspace. """ - path = "/cost_services" + path = "/v2/cost_services" params = { "workspace_token": workspace_token, } @@ -1136,7 +1136,7 @@ async def create_export(self, body: CreateCostExport, *, groupings: Optional[Lis Generate a DataExport of costs. """ - path = "/costs/data_exports" + path = "/v2/costs/data_exports" params = { "groupings": groupings, } @@ -1149,7 +1149,7 @@ async def list(self, *, cost_report_token: Optional[str] = None, filter: Optiona Return all Costs for a CostReport or VQL filter. """ - path = "/costs" + path = "/v2/costs" params = { "cost_report_token": cost_report_token, "filter": filter, @@ -1189,7 +1189,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all Dashboards. """ - path = "/dashboards" + path = "/v2/dashboards" params = { "page": page, "limit": limit, @@ -1206,7 +1206,7 @@ async def create(self, body: CreateDashboard) -> Dashboard: Create a Dashboard. """ - path = "/dashboards" + path = "/v2/dashboards" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1220,7 +1220,7 @@ async def get(self, dashboard_token: str) -> Dashboard: Return a specific Dashboard. """ - path = f"/dashboards/{quote(str(dashboard_token), safe='')}" + path = f"/v2/dashboards/{quote(str(dashboard_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -1234,7 +1234,7 @@ async def update(self, dashboard_token: str, body: UpdateDashboard) -> Dashboard Update a Dashboard. """ - path = f"/dashboards/{quote(str(dashboard_token), safe='')}" + path = f"/v2/dashboards/{quote(str(dashboard_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -1248,7 +1248,7 @@ async def delete(self, dashboard_token: str) -> None: Delete a Dashboard. """ - path = f"/dashboards/{quote(str(dashboard_token), safe='')}" + path = f"/v2/dashboards/{quote(str(dashboard_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -1266,7 +1266,7 @@ async def get(self, data_export_token: str) -> DataExport: Get the status of a data export. """ - path = f"/data_exports/{quote(str(data_export_token), safe='')}" + path = f"/v2/data_exports/{quote(str(data_export_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -1287,7 +1287,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all Exchange Rates. """ - path = "/exchange_rates" + path = "/v2/exchange_rates" params = { "page": page, "limit": limit, @@ -1304,7 +1304,7 @@ async def create_via_csv(self, body: dict[str, Any]) -> None: Upload Exchange Rates via CSV. """ - path = "/exchange_rates/csv" + path = "/v2/exchange_rates/csv" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body await self._client.request("POST", path, params=params, body=body_data) @@ -1322,7 +1322,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all FinancialCommitmentReports. """ - path = "/financial_commitment_reports" + path = "/v2/financial_commitment_reports" params = { "page": page, "limit": limit, @@ -1339,7 +1339,7 @@ async def create(self, body: CreateFinancialCommitmentReport) -> FinancialCommit Create a FinancialCommitmentReport. """ - path = "/financial_commitment_reports" + path = "/v2/financial_commitment_reports" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1353,7 +1353,7 @@ async def get(self, financial_commitment_report_token: str) -> FinancialCommitme Return a FinancialCommitmentReport. """ - path = f"/financial_commitment_reports/{quote(str(financial_commitment_report_token), safe='')}" + path = f"/v2/financial_commitment_reports/{quote(str(financial_commitment_report_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -1367,7 +1367,7 @@ async def update(self, financial_commitment_report_token: str, body: UpdateFinan Update a FinancialCommitmentReport. """ - path = f"/financial_commitment_reports/{quote(str(financial_commitment_report_token), safe='')}" + path = f"/v2/financial_commitment_reports/{quote(str(financial_commitment_report_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -1381,7 +1381,7 @@ async def delete(self, financial_commitment_report_token: str) -> None: Delete a FinancialCommitmentReport. """ - path = f"/financial_commitment_reports/{quote(str(financial_commitment_report_token), safe='')}" + path = f"/v2/financial_commitment_reports/{quote(str(financial_commitment_report_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -1399,7 +1399,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all FinancialCommitments. """ - path = "/financial_commitments" + path = "/v2/financial_commitments" params = { "page": page, "limit": limit, @@ -1423,7 +1423,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all Folders for CostReports. """ - path = "/folders" + path = "/v2/folders" params = { "page": page, "limit": limit, @@ -1440,7 +1440,7 @@ async def create(self, body: CreateFolder) -> Folder: Create a Folder for CostReports. """ - path = "/folders" + path = "/v2/folders" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1454,7 +1454,7 @@ async def get(self, folder_token: str) -> Folder: Return a specific Folder for CostReports. """ - path = f"/folders/{quote(str(folder_token), safe='')}" + path = f"/v2/folders/{quote(str(folder_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -1468,7 +1468,7 @@ async def update(self, folder_token: str, body: UpdateFolder) -> Folder: Update a Folder for CostReports. """ - path = f"/folders/{quote(str(folder_token), safe='')}" + path = f"/v2/folders/{quote(str(folder_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -1482,7 +1482,7 @@ async def delete(self, folder_token: str) -> None: Delete a Folder for CostReports. """ - path = f"/folders/{quote(str(folder_token), safe='')}" + path = f"/v2/folders/{quote(str(folder_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -1500,7 +1500,7 @@ async def list(self, *, provider: Optional[str] = None, account_identifier: Opti Return all Integrations. """ - path = "/integrations" + path = "/v2/integrations" params = { "provider": provider, "account_identifier": account_identifier, @@ -1519,7 +1519,7 @@ async def get(self, integration_token: str) -> Integration: Return an Integration. """ - path = f"/integrations/{quote(str(integration_token), safe='')}" + path = f"/v2/integrations/{quote(str(integration_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -1533,7 +1533,7 @@ async def update(self, integration_token: str, body: UpdateIntegration) -> Integ Update an Integration. """ - path = f"/integrations/{quote(str(integration_token), safe='')}" + path = f"/v2/integrations/{quote(str(integration_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -1547,7 +1547,7 @@ async def delete(self, integration_token: str) -> None: Delete an Integration. """ - path = f"/integrations/{quote(str(integration_token), safe='')}" + path = f"/v2/integrations/{quote(str(integration_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -1558,7 +1558,7 @@ async def create_custom_provider(self, body: CreateCustomProviderIntegration) -> Create a Custom Provider Integration """ - path = "/integrations/custom_provider" + path = "/v2/integrations/custom_provider" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1572,7 +1572,7 @@ async def create_user_costs_upload_via_csv(self, integration_token: str, body: d Create UserCostsUpload via CSV for a Custom Provider Integration. """ - path = f"/integrations/{quote(str(integration_token), safe='')}/costs.csv" + path = f"/v2/integrations/{quote(str(integration_token), safe='')}/costs.csv" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1586,7 +1586,7 @@ async def delete_user_costs_upload(self, integration_token: str, user_costs_uplo Delete a UserCostsUpload. """ - path = f"/integrations/{quote(str(integration_token), safe='')}/costs/{quote(str(user_costs_upload_token), safe='')}" + path = f"/v2/integrations/{quote(str(integration_token), safe='')}/costs/{quote(str(user_costs_upload_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -1597,7 +1597,7 @@ async def get_user_costs_uploads(self, integration_token: str) -> UserCostsUploa List UserCostUploads. """ - path = f"/integrations/{quote(str(integration_token), safe='')}/costs" + path = f"/v2/integrations/{quote(str(integration_token), safe='')}/costs" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -1611,7 +1611,7 @@ async def create_gcp(self, body: CreateGcpIntegration) -> Integration: Create a GCP Integration """ - path = "/integrations/gcp" + path = "/v2/integrations/gcp" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1625,7 +1625,7 @@ async def create_azure(self, body: CreateAzureIntegration) -> Integration: Create an Azure Integration """ - path = "/integrations/azure" + path = "/v2/integrations/azure" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1646,7 +1646,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None, Returns a list of invoices (MSP invoicing required). """ - path = "/invoices" + path = "/v2/invoices" params = { "page": page, "limit": limit, @@ -1664,7 +1664,7 @@ async def create(self, body: CreateInvoice) -> Invoice: Create an invoice (MSP accounts only). """ - path = "/invoices" + path = "/v2/invoices" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1678,7 +1678,7 @@ async def get(self, invoice_token: str) -> Invoice: Return an invoice. """ - path = f"/invoices/{quote(str(invoice_token), safe='')}" + path = f"/v2/invoices/{quote(str(invoice_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -1692,7 +1692,7 @@ async def download(self, invoice_token: str, body: DownloadInvoiceRequest) -> Do Download invoice file (PDF or CSV). """ - path = f"/invoices/{quote(str(invoice_token), safe='')}/download" + path = f"/v2/invoices/{quote(str(invoice_token), safe='')}/download" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1706,7 +1706,7 @@ async def send(self, invoice_token: str) -> SendInvoice: Send invoice via email. """ - path = f"/invoices/{quote(str(invoice_token), safe='')}/send" + path = f"/v2/invoices/{quote(str(invoice_token), safe='')}/send" params = None body_data = None data = await self._client.request("POST", path, params=params, body=body_data) @@ -1720,7 +1720,7 @@ async def send_and_approve(self, invoice_token: str) -> SendInvoice: Send and approve invoice via email (MSP accounts only). """ - path = f"/invoices/{quote(str(invoice_token), safe='')}/send_and_approve" + path = f"/v2/invoices/{quote(str(invoice_token), safe='')}/send_and_approve" params = None body_data = None data = await self._client.request("POST", path, params=params, body=body_data) @@ -1734,7 +1734,7 @@ async def get_cost_report(self, invoice_token: str) -> CostReportUrl: Get cost report URL for invoice period. """ - path = f"/invoices/{quote(str(invoice_token), safe='')}/cost_report" + path = f"/v2/invoices/{quote(str(invoice_token), safe='')}/cost_report" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -1748,7 +1748,7 @@ async def regenerate(self, invoice_token: str) -> Invoice: Regenerate an existing invoice (MSP accounts only). """ - path = f"/invoices/{quote(str(invoice_token), safe='')}/regenerate" + path = f"/v2/invoices/{quote(str(invoice_token), safe='')}/regenerate" params = None body_data = None data = await self._client.request("POST", path, params=params, body=body_data) @@ -1769,7 +1769,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all KubernetesEfficiencyReports. """ - path = "/kubernetes_efficiency_reports" + path = "/v2/kubernetes_efficiency_reports" params = { "page": page, "limit": limit, @@ -1786,7 +1786,7 @@ async def create(self, body: CreateKubernetesEfficiencyReport) -> KubernetesEffi Create a KubernetesEfficiencyReport. """ - path = "/kubernetes_efficiency_reports" + path = "/v2/kubernetes_efficiency_reports" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1800,7 +1800,7 @@ async def create_export(self, body: CreateKubernetesEfficiencyReportExport, *, g Generate a DataExport of Kubernetes efficiency data. """ - path = "/kubernetes_efficiency_reports/data_exports" + path = "/v2/kubernetes_efficiency_reports/data_exports" params = { "groupings": groupings, } @@ -1813,7 +1813,7 @@ async def get(self, kubernetes_efficiency_report_token: str) -> KubernetesEffici Return a KubernetesEfficiencyReport. """ - path = f"/kubernetes_efficiency_reports/{quote(str(kubernetes_efficiency_report_token), safe='')}" + path = f"/v2/kubernetes_efficiency_reports/{quote(str(kubernetes_efficiency_report_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -1827,7 +1827,7 @@ async def update(self, kubernetes_efficiency_report_token: str, body: UpdateKube Update a KubernetesEfficiencyReport. """ - path = f"/kubernetes_efficiency_reports/{quote(str(kubernetes_efficiency_report_token), safe='')}" + path = f"/v2/kubernetes_efficiency_reports/{quote(str(kubernetes_efficiency_report_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -1841,7 +1841,7 @@ async def delete(self, kubernetes_efficiency_report_token: str) -> None: Delete a KubernetesEfficiencyReport. """ - path = f"/kubernetes_efficiency_reports/{quote(str(kubernetes_efficiency_report_token), safe='')}" + path = f"/v2/kubernetes_efficiency_reports/{quote(str(kubernetes_efficiency_report_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -1859,7 +1859,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Returns a list of managed accounts. """ - path = "/managed_accounts" + path = "/v2/managed_accounts" params = { "page": page, "limit": limit, @@ -1876,7 +1876,7 @@ async def create(self, body: CreateManagedAccount) -> ManagedAccount: Create a Managed Account. """ - path = "/managed_accounts" + path = "/v2/managed_accounts" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1890,7 +1890,7 @@ async def get(self, managed_account_token: str) -> ManagedAccount: Return a Managed Account. """ - path = f"/managed_accounts/{quote(str(managed_account_token), safe='')}" + path = f"/v2/managed_accounts/{quote(str(managed_account_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -1904,7 +1904,7 @@ async def update(self, managed_account_token: str, body: UpdateManagedAccount) - Update a Managed Account. """ - path = f"/managed_accounts/{quote(str(managed_account_token), safe='')}" + path = f"/v2/managed_accounts/{quote(str(managed_account_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -1918,7 +1918,7 @@ async def delete(self, managed_account_token: str) -> None: Delete a Managed Account. """ - path = f"/managed_accounts/{quote(str(managed_account_token), safe='')}" + path = f"/v2/managed_accounts/{quote(str(managed_account_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -1929,7 +1929,7 @@ async def update_sso_connection_for(self, managed_account_token: str, body: Upda Update SSO configuration for a Managed Account. """ - path = f"/managed_accounts/{quote(str(managed_account_token), safe='')}/sso_connection" + path = f"/v2/managed_accounts/{quote(str(managed_account_token), safe='')}/sso_connection" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -1943,7 +1943,7 @@ async def create_sso_connection_for(self, managed_account_token: str, body: Crea Configure SSO for a Managed Account. """ - path = f"/managed_accounts/{quote(str(managed_account_token), safe='')}/sso_connection" + path = f"/v2/managed_accounts/{quote(str(managed_account_token), safe='')}/sso_connection" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -1951,6 +1951,17 @@ async def create_sso_connection_for(self, managed_account_token: str, body: Crea return ManagedAccount.model_validate(data) return data + async def delete_sso_connection_for(self, managed_account_token: str) -> None: + """ + Delete SSO connection for managed account + + Delete SSO connection for a Managed Account. + """ + path = f"/v2/managed_accounts/{quote(str(managed_account_token), safe='')}/sso_connection" + params = None + body_data = None + await self._client.request("DELETE", path, params=params, body=body_data) + class MeAsyncApi: """Async API methods for me resource.""" @@ -1964,7 +1975,7 @@ async def get(self) -> Me: Get information about the authenticated BearerToken. """ - path = "/me" + path = "/v2/me" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -1985,7 +1996,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all NetworkFlowReports. """ - path = "/network_flow_reports" + path = "/v2/network_flow_reports" params = { "page": page, "limit": limit, @@ -2002,7 +2013,7 @@ async def create(self, body: CreateNetworkFlowReport) -> NetworkFlowReport: Create a NetworkFlowReport. """ - path = "/network_flow_reports" + path = "/v2/network_flow_reports" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -2016,7 +2027,7 @@ async def get(self, network_flow_report_token: str) -> NetworkFlowReport: Return a NetworkFlowReport. """ - path = f"/network_flow_reports/{quote(str(network_flow_report_token), safe='')}" + path = f"/v2/network_flow_reports/{quote(str(network_flow_report_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2030,7 +2041,7 @@ async def update(self, network_flow_report_token: str, body: UpdateNetworkFlowRe Update a NetworkFlowReport. """ - path = f"/network_flow_reports/{quote(str(network_flow_report_token), safe='')}" + path = f"/v2/network_flow_reports/{quote(str(network_flow_report_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -2044,7 +2055,7 @@ async def delete(self, network_flow_report_token: str) -> None: Delete a NetworkFlowReport. """ - path = f"/network_flow_reports/{quote(str(network_flow_report_token), safe='')}" + path = f"/v2/network_flow_reports/{quote(str(network_flow_report_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -2058,7 +2069,7 @@ def __init__(self, client: AsyncClient) -> None: async def ping(self) -> None: """This is a health check endpoint that can be used to determine Vantage API healthiness. It will return 200 if everything is running smoothly.""" - path = "/ping" + path = "/v2/ping" params = None body_data = None await self._client.request("GET", path, params=params, body=body_data) @@ -2076,7 +2087,7 @@ async def get_prices(self, product_id: str, *, page: Optional[int] = None, limit Return available Prices across all Regions for a Product. """ - path = f"/products/{quote(str(product_id), safe='')}/prices" + path = f"/v2/products/{quote(str(product_id), safe='')}/prices" params = { "page": page, "limit": limit, @@ -2093,7 +2104,7 @@ async def get_price(self, product_id: str, id: str) -> Price: Returns a price """ - path = f"/products/{quote(str(product_id), safe='')}/prices/{quote(str(id), safe='')}" + path = f"/v2/products/{quote(str(product_id), safe='')}/prices/{quote(str(id), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2107,7 +2118,7 @@ async def list(self, *, provider_id: Optional[str] = None, service_id: Optional[ Return available Products for a Service. For example, with a Provider of AWS and a Service of EC2, Products will be a list of all EC2 Instances. By default, this endpoint returns all Products across all Services and Providers but has optional query parameters for filtering listed below. """ - path = "/products" + path = "/v2/products" params = { "provider_id": provider_id, "service_id": service_id, @@ -2127,7 +2138,7 @@ async def get(self, id: str) -> Product: Return a product """ - path = f"/products/{quote(str(id), safe='')}" + path = f"/v2/products/{quote(str(id), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2148,7 +2159,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all RecommendationViews. """ - path = "/recommendation_views" + path = "/v2/recommendation_views" params = { "page": page, "limit": limit, @@ -2165,7 +2176,7 @@ async def create(self, body: CreateRecommendationView) -> RecommendationView: Create a RecommendationView. """ - path = "/recommendation_views" + path = "/v2/recommendation_views" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -2179,7 +2190,7 @@ async def get(self, recommendation_view_token: str) -> RecommendationView: Return a specific RecommendationView. """ - path = f"/recommendation_views/{quote(str(recommendation_view_token), safe='')}" + path = f"/v2/recommendation_views/{quote(str(recommendation_view_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2193,7 +2204,7 @@ async def update(self, recommendation_view_token: str, body: UpdateRecommendatio Update a RecommendationView. """ - path = f"/recommendation_views/{quote(str(recommendation_view_token), safe='')}" + path = f"/v2/recommendation_views/{quote(str(recommendation_view_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -2207,7 +2218,7 @@ async def delete(self, recommendation_view_token: str) -> None: Delete a RecommendationView. """ - path = f"/recommendation_views/{quote(str(recommendation_view_token), safe='')}" + path = f"/v2/recommendation_views/{quote(str(recommendation_view_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -2225,7 +2236,7 @@ async def list(self, *, provider_ids: Optional[List[str]] = None, billing_accoun Return all Recommendations. Use the `type` query parameter with a fuzzy fragment to filter recommendation type case-insensitively (for example: aws, aws:ec2, aws:ec2:rightsizing). """ - path = "/recommendations" + path = "/v2/recommendations" params = { "provider_ids": provider_ids, "billing_account_ids": billing_account_ids, @@ -2256,7 +2267,7 @@ async def get(self, recommendation_token: str) -> Recommendation: Return a Recommendation. """ - path = f"/recommendations/{quote(str(recommendation_token), safe='')}" + path = f"/v2/recommendations/{quote(str(recommendation_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2270,7 +2281,7 @@ async def get_resources(self, recommendation_token: str, *, page: Optional[int] Return all Active Resources, including Recommendation Actions, referenced in this Recommendation. """ - path = f"/recommendations/{quote(str(recommendation_token), safe='')}/resources" + path = f"/v2/recommendations/{quote(str(recommendation_token), safe='')}/resources" params = { "page": page, "limit": limit, @@ -2287,7 +2298,7 @@ async def get_resource(self, recommendation_token: str, resource_token: str) -> Return an Active Resource, including Recommendation Actions, referenced in this Recommendation. """ - path = f"/recommendations/{quote(str(recommendation_token), safe='')}/resources/{quote(str(resource_token), safe='')}" + path = f"/v2/recommendations/{quote(str(recommendation_token), safe='')}/resources/{quote(str(resource_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2301,7 +2312,7 @@ async def get_type_resources(self, type: str, *, provider_ids: Optional[List[str Return all Active Resources associated with recommendations of the specified type. """ - path = f"/recommendations/by_type/{quote(str(type), safe='')}/resources" + path = f"/v2/recommendations/by_type/{quote(str(type), safe='')}/resources" params = { "provider_ids": provider_ids, "billing_account_ids": billing_account_ids, @@ -2335,7 +2346,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all ReportNotifications. """ - path = "/report_notifications" + path = "/v2/report_notifications" params = { "page": page, "limit": limit, @@ -2352,7 +2363,7 @@ async def create(self, body: CreateReportNotification) -> ReportNotification: Create a ReportNotification. """ - path = "/report_notifications" + path = "/v2/report_notifications" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -2366,7 +2377,7 @@ async def get(self, report_notification_token: str) -> ReportNotification: Return a ReportNotification. """ - path = f"/report_notifications/{quote(str(report_notification_token), safe='')}" + path = f"/v2/report_notifications/{quote(str(report_notification_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2380,7 +2391,7 @@ async def update(self, report_notification_token: str, body: UpdateReportNotific Update a ReportNotification. """ - path = f"/report_notifications/{quote(str(report_notification_token), safe='')}" + path = f"/v2/report_notifications/{quote(str(report_notification_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -2394,7 +2405,7 @@ async def delete(self, report_notification_token: str) -> None: Delete a ReportNotification. """ - path = f"/report_notifications/{quote(str(report_notification_token), safe='')}" + path = f"/v2/report_notifications/{quote(str(report_notification_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -2412,7 +2423,7 @@ async def get_columns(self, *, resource_type: str) -> ResourceReportColumns: List available columns for a resource type. """ - path = "/resource_reports/columns" + path = "/v2/resource_reports/columns" params = { "resource_type": resource_type, } @@ -2428,7 +2439,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all ResourceReports. """ - path = "/resource_reports" + path = "/v2/resource_reports" params = { "page": page, "limit": limit, @@ -2445,7 +2456,7 @@ async def create(self, body: CreateResourceReport) -> ResourceReport: Create a ResourceReport. """ - path = "/resource_reports" + path = "/v2/resource_reports" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -2459,7 +2470,7 @@ async def get(self, resource_report_token: str) -> ResourceReport: Return a ResourceReport. """ - path = f"/resource_reports/{quote(str(resource_report_token), safe='')}" + path = f"/v2/resource_reports/{quote(str(resource_report_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2473,7 +2484,7 @@ async def update(self, resource_report_token: str, body: UpdateResourceReport) - Update a ResourceReport. """ - path = f"/resource_reports/{quote(str(resource_report_token), safe='')}" + path = f"/v2/resource_reports/{quote(str(resource_report_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -2487,7 +2498,7 @@ async def delete(self, resource_report_token: str) -> None: Delete a ResourceReport. """ - path = f"/resource_reports/{quote(str(resource_report_token), safe='')}" + path = f"/v2/resource_reports/{quote(str(resource_report_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -2505,7 +2516,7 @@ async def get_report(self, *, resource_report_token: Optional[str] = None, filte Return Resources contained in a ResourceReport """ - path = "/resources" + path = "/v2/resources" params = { "resource_report_token": resource_report_token, "filter": filter, @@ -2526,7 +2537,7 @@ async def get(self, resource_token: str, *, include_cost: Optional[bool] = None) Return a single Resource """ - path = f"/resources/{quote(str(resource_token), safe='')}" + path = f"/v2/resources/{quote(str(resource_token), safe='')}" params = { "include_cost": include_cost, } @@ -2549,7 +2560,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all SavedFilters that can be applied to a CostReport. """ - path = "/saved_filters" + path = "/v2/saved_filters" params = { "page": page, "limit": limit, @@ -2566,7 +2577,7 @@ async def create(self, body: CreateSavedFilter) -> SavedFilter: Create a SavedFilter for CostReports. """ - path = "/saved_filters" + path = "/v2/saved_filters" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -2580,7 +2591,7 @@ async def get(self, saved_filter_token: str) -> SavedFilter: Return a specific SavedFilter. """ - path = f"/saved_filters/{quote(str(saved_filter_token), safe='')}" + path = f"/v2/saved_filters/{quote(str(saved_filter_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2594,7 +2605,7 @@ async def update(self, saved_filter_token: str, body: UpdateSavedFilter) -> Save Update a SavedFilter for CostReports. """ - path = f"/saved_filters/{quote(str(saved_filter_token), safe='')}" + path = f"/v2/saved_filters/{quote(str(saved_filter_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -2608,7 +2619,7 @@ async def delete(self, saved_filter_token: str) -> None: Delete a SavedFilter for CostReports. """ - path = f"/saved_filters/{quote(str(saved_filter_token), safe='')}" + path = f"/v2/saved_filters/{quote(str(saved_filter_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -2626,7 +2637,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all Segments. """ - path = "/segments" + path = "/v2/segments" params = { "page": page, "limit": limit, @@ -2643,7 +2654,7 @@ async def create(self, body: CreateSegment) -> Segment: Create a Segment. """ - path = "/segments" + path = "/v2/segments" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -2657,7 +2668,7 @@ async def get(self, segment_token: str) -> Segment: Return a Segment. """ - path = f"/segments/{quote(str(segment_token), safe='')}" + path = f"/v2/segments/{quote(str(segment_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2671,7 +2682,7 @@ async def update(self, segment_token: str, body: UpdateSegment) -> Segment: Update a Segment. """ - path = f"/segments/{quote(str(segment_token), safe='')}" + path = f"/v2/segments/{quote(str(segment_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -2685,7 +2696,7 @@ async def delete(self, segment_token: str) -> None: Delete a Segment. """ - path = f"/segments/{quote(str(segment_token), safe='')}" + path = f"/v2/segments/{quote(str(segment_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -2703,7 +2714,7 @@ async def list(self, *, providers: Optional[List[str]] = None, search_query: Opt Return all Tags that the current API token has access to. """ - path = "/tags" + path = "/v2/tags" params = { "providers": providers, "search_query": search_query, @@ -2723,7 +2734,7 @@ async def update(self, body: UpdateTag) -> Tags: Updates an existing Tag. """ - path = "/tags" + path = "/v2/tags" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -2737,7 +2748,7 @@ async def get_values(self, key: str, *, providers: Optional[List[str]] = None, s Returns corresponding TagValues for a given Tag. """ - path = f"/tags/{quote(str(key), safe='')}/values" + path = f"/v2/tags/{quote(str(key), safe='')}/values" params = { "providers": providers, "sort_direction": sort_direction, @@ -2764,7 +2775,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all Teams that the current API token has access to. """ - path = "/teams" + path = "/v2/teams" params = { "page": page, "limit": limit, @@ -2781,7 +2792,7 @@ async def create(self, body: CreateTeam) -> Team: Create a new Team. """ - path = "/teams" + path = "/v2/teams" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -2795,7 +2806,7 @@ async def get(self, team_token: str) -> Team: Return a specific Team. """ - path = f"/teams/{quote(str(team_token), safe='')}" + path = f"/v2/teams/{quote(str(team_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2809,7 +2820,7 @@ async def update(self, team_token: str, body: UpdateTeam) -> Team: Update a Team. """ - path = f"/teams/{quote(str(team_token), safe='')}" + path = f"/v2/teams/{quote(str(team_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -2823,7 +2834,7 @@ async def delete(self, team_token: str) -> None: Delete a Team. """ - path = f"/teams/{quote(str(team_token), safe='')}" + path = f"/v2/teams/{quote(str(team_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -2834,7 +2845,7 @@ async def get_members(self, team_token: str, *, page: Optional[int] = None, limi Return all members of a Team. """ - path = f"/teams/{quote(str(team_token), safe='')}/members" + path = f"/v2/teams/{quote(str(team_token), safe='')}/members" params = { "page": page, "limit": limit, @@ -2851,7 +2862,7 @@ async def add_member(self, team_token: str, body: AddTeamMember) -> TeamMember: Add a member to a Team. """ - path = f"/teams/{quote(str(team_token), safe='')}/members" + path = f"/v2/teams/{quote(str(team_token), safe='')}/members" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -2865,7 +2876,7 @@ async def remove_member(self, team_token: str, user_token: str) -> None: Remove a member from a Team. """ - path = f"/teams/{quote(str(team_token), safe='')}/members/{quote(str(user_token), safe='')}" + path = f"/v2/teams/{quote(str(team_token), safe='')}/members/{quote(str(user_token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -2883,7 +2894,7 @@ async def create_export(self, body: CreateUnitCostsExport) -> str: Generate a DataExport of unit costs. """ - path = "/unit_costs/data_exports" + path = "/v2/unit_costs/data_exports" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body return await self._client.request("POST", path, params=params, body=body_data) @@ -2894,7 +2905,7 @@ async def list(self, *, cost_report_token: str, start_date: Optional[str] = None Return all UnitCosts for a CostReport. """ - path = "/unit_costs" + path = "/v2/unit_costs" params = { "cost_report_token": cost_report_token, "start_date": start_date, @@ -2923,7 +2934,7 @@ async def create(self, body: CreateUserFeedback) -> UserFeedback: Provide UserFeedback for our product and features. """ - path = "/user_feedback" + path = "/v2/user_feedback" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -2944,7 +2955,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all Users that the current API token has access to. """ - path = "/users" + path = "/v2/users" params = { "page": page, "limit": limit, @@ -2961,7 +2972,7 @@ async def get(self, user_token: str) -> User: Return a specific User. """ - path = f"/users/{quote(str(user_token), safe='')}" + path = f"/v2/users/{quote(str(user_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2982,7 +2993,7 @@ async def list(self) -> VirtualTagConfigs: Return all VirtualTagConfigs that the current API token has access to. """ - path = "/virtual_tag_configs" + path = "/v2/virtual_tag_configs" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -2996,7 +3007,7 @@ async def create(self, body: CreateVirtualTagConfig) -> VirtualTagConfig: Create a new VirtualTagConfig. """ - path = "/virtual_tag_configs" + path = "/v2/virtual_tag_configs" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -3010,7 +3021,7 @@ async def get(self, token: str) -> VirtualTagConfig: Return a specific VirtualTagConfig. """ - path = f"/virtual_tag_configs/{quote(str(token), safe='')}" + path = f"/v2/virtual_tag_configs/{quote(str(token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -3024,7 +3035,7 @@ async def update(self, token: str, body: UpdateVirtualTagConfig) -> VirtualTagCo Updates an existing VirtualTagConfig. """ - path = f"/virtual_tag_configs/{quote(str(token), safe='')}" + path = f"/v2/virtual_tag_configs/{quote(str(token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -3038,7 +3049,7 @@ async def delete(self, token: str) -> None: Deletes an existing VirtualTagConfig. """ - path = f"/virtual_tag_configs/{quote(str(token), safe='')}" + path = f"/v2/virtual_tag_configs/{quote(str(token), safe='')}" params = None body_data = None await self._client.request("DELETE", path, params=params, body=body_data) @@ -3049,7 +3060,7 @@ async def get_status(self, token: str) -> VirtualTagConfigStatus: Return the processing status of a specific VirtualTagConfig. """ - path = f"/virtual_tag_configs/{quote(str(token), safe='')}/status" + path = f"/v2/virtual_tag_configs/{quote(str(token), safe='')}/status" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -3063,7 +3074,7 @@ async def update_async(self, token: str, body: UpdateAsyncVirtualTagConfig) -> A Asynchronously updates an existing VirtualTagConfig. """ - path = f"/virtual_tag_configs/{quote(str(token), safe='')}/async" + path = f"/v2/virtual_tag_configs/{quote(str(token), safe='')}/async" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) @@ -3077,7 +3088,7 @@ async def get_async_virtual_tag_config_status(self, request_id: str) -> bool: Check the status of an async VirtualTagConfig update. """ - path = f"/virtual_tag_configs/async/{quote(str(request_id), safe='')}" + path = f"/v2/virtual_tag_configs/async/{quote(str(request_id), safe='')}" params = None body_data = None return await self._client.request("GET", path, params=params, body=body_data) @@ -3095,7 +3106,7 @@ async def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) Return all Workspaces that the current API token has access to. """ - path = "/workspaces" + path = "/v2/workspaces" params = { "page": page, "limit": limit, @@ -3112,7 +3123,7 @@ async def create(self, body: CreateWorkspace) -> Workspace: Create a workspace """ - path = "/workspaces" + path = "/v2/workspaces" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("POST", path, params=params, body=body_data) @@ -3126,7 +3137,7 @@ async def get(self, workspace_token: str) -> Workspace: Return a specific Workspace. """ - path = f"/workspaces/{quote(str(workspace_token), safe='')}" + path = f"/v2/workspaces/{quote(str(workspace_token), safe='')}" params = None body_data = None data = await self._client.request("GET", path, params=params, body=body_data) @@ -3140,7 +3151,7 @@ async def update(self, workspace_token: str, body: UpdateWorkspace) -> Workspace Update a workspace """ - path = f"/workspaces/{quote(str(workspace_token), safe='')}" + path = f"/v2/workspaces/{quote(str(workspace_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = await self._client.request("PUT", path, params=params, body=body_data) diff --git a/src/vantage/_base.py b/src/vantage/_base.py index 1147066..6ff75e9 100644 --- a/src/vantage/_base.py +++ b/src/vantage/_base.py @@ -71,4 +71,4 @@ def build_query_string(params: Dict[str, Any]) -> str: return "?" + "&".join(parts) if parts else "" -DEFAULT_BASE_URL = "https://api.vantage.sh/v2" +DEFAULT_BASE_URL = "https://api.vantage.sh" diff --git a/src/vantage/_sync/client.py b/src/vantage/_sync/client.py index 737b4bd..103881f 100644 --- a/src/vantage/_sync/client.py +++ b/src/vantage/_sync/client.py @@ -116,7 +116,7 @@ def request( json=body, ) - if method.upper() == "GET" and path.startswith("/virtual_tag_configs/async/"): + if method.upper() == "GET" and path.startswith("/v2/virtual_tag_configs/async/"): if response.status_code == 404: return False elif response.is_success: @@ -135,7 +135,7 @@ def request( body=response.text, ) - if (method, path) in {("POST", "/costs/data_exports"), ("POST", "/kubernetes_efficiency_reports/data_exports"), ("POST", "/unit_costs/data_exports")}: + if (method, path) in {("POST", "/v2/costs/data_exports"), ("POST", "/v2/kubernetes_efficiency_reports/data_exports"), ("POST", "/v2/unit_costs/data_exports")}: return self._request_for_location(response) try: @@ -162,7 +162,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Ac Return all Access Grants that the current API token has access to. """ - path = "/access_grants" + path = "/v2/access_grants" params = { "page": page, "limit": limit, @@ -179,7 +179,7 @@ def create(self, body: CreateAccessGrant) -> AccessGrant: Create an Access Grant. """ - path = "/access_grants" + path = "/v2/access_grants" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -193,7 +193,7 @@ def get(self, access_grant_token: str) -> AccessGrant: Return a specific Access Grant. """ - path = f"/access_grants/{quote(str(access_grant_token), safe='')}" + path = f"/v2/access_grants/{quote(str(access_grant_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -207,7 +207,7 @@ def update(self, access_grant_token: str, body: UpdateAccessGrant) -> AccessGran Update an AccessGrant. """ - path = f"/access_grants/{quote(str(access_grant_token), safe='')}" + path = f"/v2/access_grants/{quote(str(access_grant_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -221,7 +221,7 @@ def delete(self, access_grant_token: str) -> None: Delete an Access Grant. """ - path = f"/access_grants/{quote(str(access_grant_token), safe='')}" + path = f"/v2/access_grants/{quote(str(access_grant_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -239,7 +239,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None, start Return all Anomaly Alerts that the current API token has access to. """ - path = "/anomaly_alerts" + path = "/v2/anomaly_alerts" params = { "page": page, "limit": limit, @@ -262,7 +262,7 @@ def get(self, anomaly_alert_token: str) -> AnomalyAlert: Return an AnomalyAlert that the current API token has access to. """ - path = f"/anomaly_alerts/{quote(str(anomaly_alert_token), safe='')}" + path = f"/v2/anomaly_alerts/{quote(str(anomaly_alert_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -276,7 +276,7 @@ def update(self, anomaly_alert_token: str, body: UpdateAnomalyAlert) -> AnomalyA Update an AnomalyAlert. """ - path = f"/anomaly_alerts/{quote(str(anomaly_alert_token), safe='')}" + path = f"/v2/anomaly_alerts/{quote(str(anomaly_alert_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -297,7 +297,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> An Return all Anomaly Notifications. """ - path = "/anomaly_notifications" + path = "/v2/anomaly_notifications" params = { "page": page, "limit": limit, @@ -314,7 +314,7 @@ def create(self, body: CreateAnomalyNotification) -> AnomalyNotification: Create an Anomaly Notification for a Cost Report. """ - path = "/anomaly_notifications" + path = "/v2/anomaly_notifications" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -328,7 +328,7 @@ def get(self, anomaly_notification_token: str) -> AnomalyNotification: Return an Anomaly Notification that the current API token has access to. """ - path = f"/anomaly_notifications/{quote(str(anomaly_notification_token), safe='')}" + path = f"/v2/anomaly_notifications/{quote(str(anomaly_notification_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -342,7 +342,7 @@ def update(self, anomaly_notification_token: str, body: UpdateAnomalyNotificatio Update an Anomaly Notification. """ - path = f"/anomaly_notifications/{quote(str(anomaly_notification_token), safe='')}" + path = f"/v2/anomaly_notifications/{quote(str(anomaly_notification_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -356,7 +356,7 @@ def delete(self, anomaly_notification_token: str) -> None: Delete an Anomaly Notification. """ - path = f"/anomaly_notifications/{quote(str(anomaly_notification_token), safe='')}" + path = f"/v2/anomaly_notifications/{quote(str(anomaly_notification_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -374,7 +374,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None, user: Return all AuditLogs. """ - path = "/audit_logs" + path = "/v2/audit_logs" params = { "page": page, "limit": limit, @@ -401,7 +401,7 @@ def get(self, audit_log_token: str) -> AuditLog: Return a specific AuditLog. """ - path = f"/audit_logs/{quote(str(audit_log_token), safe='')}" + path = f"/v2/audit_logs/{quote(str(audit_log_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -422,7 +422,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Bi Returns a list of billing profiles (MSP invoicing required). """ - path = "/billing_profiles" + path = "/v2/billing_profiles" params = { "page": page, "limit": limit, @@ -439,7 +439,7 @@ def create(self, body: CreateBillingProfile) -> BillingProfile: Create a billing profile (MSP invoicing required). """ - path = "/billing_profiles" + path = "/v2/billing_profiles" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -453,7 +453,7 @@ def get(self, billing_profile_token: str) -> BillingProfile: Requires MSP invoicing to be enabled on the account. """ - path = f"/billing_profiles/{quote(str(billing_profile_token), safe='')}" + path = f"/v2/billing_profiles/{quote(str(billing_profile_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -467,7 +467,7 @@ def update(self, billing_profile_token: str, body: UpdateBillingProfile) -> Bill Requires MSP invoicing to be enabled on the account. """ - path = f"/billing_profiles/{quote(str(billing_profile_token), safe='')}" + path = f"/v2/billing_profiles/{quote(str(billing_profile_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -481,7 +481,7 @@ def delete(self, billing_profile_token: str) -> None: Requires MSP invoicing to be enabled on the account. """ - path = f"/billing_profiles/{quote(str(billing_profile_token), safe='')}" + path = f"/v2/billing_profiles/{quote(str(billing_profile_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -499,7 +499,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Bi Returns a list of billing rules. """ - path = "/billing_rules" + path = "/v2/billing_rules" params = { "page": page, "limit": limit, @@ -516,7 +516,7 @@ def create(self, body: CreateBillingRule) -> BillingRule: Create a BillingRule. """ - path = "/billing_rules" + path = "/v2/billing_rules" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -530,7 +530,7 @@ def get(self, billing_rule_token: str) -> BillingRule: Return a BillingRule. """ - path = f"/billing_rules/{quote(str(billing_rule_token), safe='')}" + path = f"/v2/billing_rules/{quote(str(billing_rule_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -544,7 +544,7 @@ def update(self, billing_rule_token: str, body: UpdateBillingRule) -> BillingRul Update a BillingRule. """ - path = f"/billing_rules/{quote(str(billing_rule_token), safe='')}" + path = f"/v2/billing_rules/{quote(str(billing_rule_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -558,7 +558,7 @@ def delete(self, billing_rule_token: str) -> None: Delete a BillingRule. """ - path = f"/billing_rules/{quote(str(billing_rule_token), safe='')}" + path = f"/v2/billing_rules/{quote(str(billing_rule_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -576,7 +576,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Bu Return all BudgetAlerts. """ - path = "/budget_alerts" + path = "/v2/budget_alerts" params = { "page": page, "limit": limit, @@ -593,7 +593,7 @@ def create(self, body: CreateBudgetAlert) -> BudgetAlert: Create a Budget Alert. """ - path = "/budget_alerts" + path = "/v2/budget_alerts" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -607,7 +607,7 @@ def get(self, budget_alert_token: str) -> BudgetAlert: Return a BudgetAlert. """ - path = f"/budget_alerts/{quote(str(budget_alert_token), safe='')}" + path = f"/v2/budget_alerts/{quote(str(budget_alert_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -621,7 +621,7 @@ def update(self, budget_alert_token: str, body: UpdateBudgetAlert) -> BudgetAler Updates an existing BudgetAlert. """ - path = f"/budget_alerts/{quote(str(budget_alert_token), safe='')}" + path = f"/v2/budget_alerts/{quote(str(budget_alert_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -635,7 +635,7 @@ def delete(self, budget_alert_token: str) -> None: Delete a BudgetAlert. """ - path = f"/budget_alerts/{quote(str(budget_alert_token), safe='')}" + path = f"/v2/budget_alerts/{quote(str(budget_alert_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -653,7 +653,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Bu Return all Budgets. """ - path = "/budgets" + path = "/v2/budgets" params = { "page": page, "limit": limit, @@ -670,7 +670,7 @@ def create(self, body: CreateBudget) -> Budget: Create a Budget. """ - path = "/budgets" + path = "/v2/budgets" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -684,7 +684,7 @@ def get(self, budget_token: str, *, include_performance: Optional[bool] = None) Return a Budget. """ - path = f"/budgets/{quote(str(budget_token), safe='')}" + path = f"/v2/budgets/{quote(str(budget_token), safe='')}" params = { "include_performance": include_performance, } @@ -700,7 +700,7 @@ def update(self, budget_token: str, body: UpdateBudget) -> Budget: Update a Budget. """ - path = f"/budgets/{quote(str(budget_token), safe='')}" + path = f"/v2/budgets/{quote(str(budget_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -714,7 +714,7 @@ def delete(self, budget_token: str) -> None: Delete a Budget. """ - path = f"/budgets/{quote(str(budget_token), safe='')}" + path = f"/v2/budgets/{quote(str(budget_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -732,7 +732,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Bu Return all BusinessMetrics that the current API token has access to. """ - path = "/business_metrics" + path = "/v2/business_metrics" params = { "page": page, "limit": limit, @@ -749,7 +749,7 @@ def create(self, body: CreateBusinessMetric) -> BusinessMetric: Create a new BusinessMetric. """ - path = "/business_metrics" + path = "/v2/business_metrics" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -763,7 +763,7 @@ def get(self, business_metric_token: str) -> BusinessMetric: Return a BusinessMetric. """ - path = f"/business_metrics/{quote(str(business_metric_token), safe='')}" + path = f"/v2/business_metrics/{quote(str(business_metric_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -777,7 +777,7 @@ def update(self, business_metric_token: str, body: UpdateBusinessMetric) -> Busi Updates an existing BusinessMetric. """ - path = f"/business_metrics/{quote(str(business_metric_token), safe='')}" + path = f"/v2/business_metrics/{quote(str(business_metric_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -791,7 +791,7 @@ def delete(self, business_metric_token: str) -> None: Deletes an existing BusinessMetric. """ - path = f"/business_metrics/{quote(str(business_metric_token), safe='')}" + path = f"/v2/business_metrics/{quote(str(business_metric_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -802,7 +802,7 @@ def get_values(self, business_metric_token: str, *, page: Optional[int] = None, Return values of a BusinessMetric """ - path = f"/business_metrics/{quote(str(business_metric_token), safe='')}/values" + path = f"/v2/business_metrics/{quote(str(business_metric_token), safe='')}/values" params = { "page": page, "limit": limit, @@ -820,7 +820,7 @@ def get_forecasted_values(self, business_metric_token: str, *, page: Optional[in Return forecasted values of a BusinessMetric """ - path = f"/business_metrics/{quote(str(business_metric_token), safe='')}/forecasted_values" + path = f"/v2/business_metrics/{quote(str(business_metric_token), safe='')}/forecasted_values" params = { "page": page, "limit": limit, @@ -838,7 +838,7 @@ def update_values_csv(self, business_metric_token: str, body: dict[str, Any]) -> Updates the values for an existing BusinessMetric from a CSV file. """ - path = f"/business_metrics/{quote(str(business_metric_token), safe='')}/values.csv" + path = f"/v2/business_metrics/{quote(str(business_metric_token), safe='')}/values.csv" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -859,7 +859,7 @@ def get_events(self, cost_alert_token: str, *, report_token: Optional[str] = Non Get all CostAlertEvents """ - path = f"/cost_alerts/{quote(str(cost_alert_token), safe='')}/events" + path = f"/v2/cost_alerts/{quote(str(cost_alert_token), safe='')}/events" params = { "report_token": report_token, "page": page, @@ -877,7 +877,7 @@ def get_event(self, cost_alert_token: str, event_token: str) -> CostAlertEvent: Get a CostAlertEvent """ - path = f"/cost_alerts/{quote(str(cost_alert_token), safe='')}/events/{quote(str(event_token), safe='')}" + path = f"/v2/cost_alerts/{quote(str(cost_alert_token), safe='')}/events/{quote(str(event_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -891,7 +891,7 @@ def list(self) -> CostAlerts: List all Cost Alerts """ - path = "/cost_alerts" + path = "/v2/cost_alerts" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -905,7 +905,7 @@ def create(self, body: CreateCostAlert) -> CostAlert: Create a new Cost Alert """ - path = "/cost_alerts" + path = "/v2/cost_alerts" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -919,7 +919,7 @@ def get(self, cost_alert_token: str) -> CostAlert: Get a Cost Alert """ - path = f"/cost_alerts/{quote(str(cost_alert_token), safe='')}" + path = f"/v2/cost_alerts/{quote(str(cost_alert_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -933,7 +933,7 @@ def update(self, cost_alert_token: str, body: UpdateCostAlert) -> CostAlert: Update a Cost Alert """ - path = f"/cost_alerts/{quote(str(cost_alert_token), safe='')}" + path = f"/v2/cost_alerts/{quote(str(cost_alert_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -947,7 +947,7 @@ def delete(self, cost_alert_token: str) -> None: Delete a Cost Alert """ - path = f"/cost_alerts/{quote(str(cost_alert_token), safe='')}" + path = f"/v2/cost_alerts/{quote(str(cost_alert_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -965,7 +965,7 @@ def list(self, *, workspace_token: Optional[str] = None, provider: Optional[str] List CostProviderAccounts available in a given Workspace. """ - path = "/cost_provider_accounts" + path = "/v2/cost_provider_accounts" params = { "workspace_token": workspace_token, "provider": provider, @@ -991,7 +991,7 @@ def list(self, *, workspace_token: Optional[str] = None) -> CostProviders: List CostProviders available to query in a given Workspace. """ - path = "/cost_providers" + path = "/v2/cost_providers" params = { "workspace_token": workspace_token, } @@ -1014,7 +1014,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None, folde Return all CostReports. """ - path = "/cost_reports" + path = "/v2/cost_reports" params = { "page": page, "limit": limit, @@ -1032,7 +1032,7 @@ def create(self, body: CreateCostReport) -> CostReport: Create a CostReport. """ - path = "/cost_reports" + path = "/v2/cost_reports" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1046,7 +1046,7 @@ def get(self, cost_report_token: str) -> CostReport: Return a CostReport. """ - path = f"/cost_reports/{quote(str(cost_report_token), safe='')}" + path = f"/v2/cost_reports/{quote(str(cost_report_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -1060,7 +1060,7 @@ def update(self, cost_report_token: str, body: UpdateCostReport) -> CostReport: Update a CostReport. """ - path = f"/cost_reports/{quote(str(cost_report_token), safe='')}" + path = f"/v2/cost_reports/{quote(str(cost_report_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -1074,7 +1074,7 @@ def delete(self, cost_report_token: str) -> None: Delete a CostReport. """ - path = f"/cost_reports/{quote(str(cost_report_token), safe='')}" + path = f"/v2/cost_reports/{quote(str(cost_report_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -1085,7 +1085,7 @@ def get_forecasted_costs(self, cost_report_token: str, *, start_date: Optional[s Return all ForecastedCosts. """ - path = f"/cost_reports/{quote(str(cost_report_token), safe='')}/forecasted_costs" + path = f"/v2/cost_reports/{quote(str(cost_report_token), safe='')}/forecasted_costs" params = { "start_date": start_date, "end_date": end_date, @@ -1113,7 +1113,7 @@ def list(self, *, workspace_token: Optional[str] = None) -> CostServices: List CostServices available to query in a given Workspace. """ - path = "/cost_services" + path = "/v2/cost_services" params = { "workspace_token": workspace_token, } @@ -1136,7 +1136,7 @@ def create_export(self, body: CreateCostExport, *, groupings: Optional[List[str] Generate a DataExport of costs. """ - path = "/costs/data_exports" + path = "/v2/costs/data_exports" params = { "groupings": groupings, } @@ -1149,7 +1149,7 @@ def list(self, *, cost_report_token: Optional[str] = None, filter: Optional[str] Return all Costs for a CostReport or VQL filter. """ - path = "/costs" + path = "/v2/costs" params = { "cost_report_token": cost_report_token, "filter": filter, @@ -1189,7 +1189,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Da Return all Dashboards. """ - path = "/dashboards" + path = "/v2/dashboards" params = { "page": page, "limit": limit, @@ -1206,7 +1206,7 @@ def create(self, body: CreateDashboard) -> Dashboard: Create a Dashboard. """ - path = "/dashboards" + path = "/v2/dashboards" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1220,7 +1220,7 @@ def get(self, dashboard_token: str) -> Dashboard: Return a specific Dashboard. """ - path = f"/dashboards/{quote(str(dashboard_token), safe='')}" + path = f"/v2/dashboards/{quote(str(dashboard_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -1234,7 +1234,7 @@ def update(self, dashboard_token: str, body: UpdateDashboard) -> Dashboard: Update a Dashboard. """ - path = f"/dashboards/{quote(str(dashboard_token), safe='')}" + path = f"/v2/dashboards/{quote(str(dashboard_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -1248,7 +1248,7 @@ def delete(self, dashboard_token: str) -> None: Delete a Dashboard. """ - path = f"/dashboards/{quote(str(dashboard_token), safe='')}" + path = f"/v2/dashboards/{quote(str(dashboard_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -1266,7 +1266,7 @@ def get(self, data_export_token: str) -> DataExport: Get the status of a data export. """ - path = f"/data_exports/{quote(str(data_export_token), safe='')}" + path = f"/v2/data_exports/{quote(str(data_export_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -1287,7 +1287,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Ex Return all Exchange Rates. """ - path = "/exchange_rates" + path = "/v2/exchange_rates" params = { "page": page, "limit": limit, @@ -1304,7 +1304,7 @@ def create_via_csv(self, body: dict[str, Any]) -> None: Upload Exchange Rates via CSV. """ - path = "/exchange_rates/csv" + path = "/v2/exchange_rates/csv" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body self._client.request("POST", path, params=params, body=body_data) @@ -1322,7 +1322,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Fi Return all FinancialCommitmentReports. """ - path = "/financial_commitment_reports" + path = "/v2/financial_commitment_reports" params = { "page": page, "limit": limit, @@ -1339,7 +1339,7 @@ def create(self, body: CreateFinancialCommitmentReport) -> FinancialCommitmentRe Create a FinancialCommitmentReport. """ - path = "/financial_commitment_reports" + path = "/v2/financial_commitment_reports" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1353,7 +1353,7 @@ def get(self, financial_commitment_report_token: str) -> FinancialCommitmentRepo Return a FinancialCommitmentReport. """ - path = f"/financial_commitment_reports/{quote(str(financial_commitment_report_token), safe='')}" + path = f"/v2/financial_commitment_reports/{quote(str(financial_commitment_report_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -1367,7 +1367,7 @@ def update(self, financial_commitment_report_token: str, body: UpdateFinancialCo Update a FinancialCommitmentReport. """ - path = f"/financial_commitment_reports/{quote(str(financial_commitment_report_token), safe='')}" + path = f"/v2/financial_commitment_reports/{quote(str(financial_commitment_report_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -1381,7 +1381,7 @@ def delete(self, financial_commitment_report_token: str) -> None: Delete a FinancialCommitmentReport. """ - path = f"/financial_commitment_reports/{quote(str(financial_commitment_report_token), safe='')}" + path = f"/v2/financial_commitment_reports/{quote(str(financial_commitment_report_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -1399,7 +1399,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Fi Return all FinancialCommitments. """ - path = "/financial_commitments" + path = "/v2/financial_commitments" params = { "page": page, "limit": limit, @@ -1423,7 +1423,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Fo Return all Folders for CostReports. """ - path = "/folders" + path = "/v2/folders" params = { "page": page, "limit": limit, @@ -1440,7 +1440,7 @@ def create(self, body: CreateFolder) -> Folder: Create a Folder for CostReports. """ - path = "/folders" + path = "/v2/folders" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1454,7 +1454,7 @@ def get(self, folder_token: str) -> Folder: Return a specific Folder for CostReports. """ - path = f"/folders/{quote(str(folder_token), safe='')}" + path = f"/v2/folders/{quote(str(folder_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -1468,7 +1468,7 @@ def update(self, folder_token: str, body: UpdateFolder) -> Folder: Update a Folder for CostReports. """ - path = f"/folders/{quote(str(folder_token), safe='')}" + path = f"/v2/folders/{quote(str(folder_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -1482,7 +1482,7 @@ def delete(self, folder_token: str) -> None: Delete a Folder for CostReports. """ - path = f"/folders/{quote(str(folder_token), safe='')}" + path = f"/v2/folders/{quote(str(folder_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -1500,7 +1500,7 @@ def list(self, *, provider: Optional[str] = None, account_identifier: Optional[s Return all Integrations. """ - path = "/integrations" + path = "/v2/integrations" params = { "provider": provider, "account_identifier": account_identifier, @@ -1519,7 +1519,7 @@ def get(self, integration_token: str) -> Integration: Return an Integration. """ - path = f"/integrations/{quote(str(integration_token), safe='')}" + path = f"/v2/integrations/{quote(str(integration_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -1533,7 +1533,7 @@ def update(self, integration_token: str, body: UpdateIntegration) -> Integration Update an Integration. """ - path = f"/integrations/{quote(str(integration_token), safe='')}" + path = f"/v2/integrations/{quote(str(integration_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -1547,7 +1547,7 @@ def delete(self, integration_token: str) -> None: Delete an Integration. """ - path = f"/integrations/{quote(str(integration_token), safe='')}" + path = f"/v2/integrations/{quote(str(integration_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -1558,7 +1558,7 @@ def create_custom_provider(self, body: CreateCustomProviderIntegration) -> Integ Create a Custom Provider Integration """ - path = "/integrations/custom_provider" + path = "/v2/integrations/custom_provider" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1572,7 +1572,7 @@ def create_user_costs_upload_via_csv(self, integration_token: str, body: dict[st Create UserCostsUpload via CSV for a Custom Provider Integration. """ - path = f"/integrations/{quote(str(integration_token), safe='')}/costs.csv" + path = f"/v2/integrations/{quote(str(integration_token), safe='')}/costs.csv" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1586,7 +1586,7 @@ def delete_user_costs_upload(self, integration_token: str, user_costs_upload_tok Delete a UserCostsUpload. """ - path = f"/integrations/{quote(str(integration_token), safe='')}/costs/{quote(str(user_costs_upload_token), safe='')}" + path = f"/v2/integrations/{quote(str(integration_token), safe='')}/costs/{quote(str(user_costs_upload_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -1597,7 +1597,7 @@ def get_user_costs_uploads(self, integration_token: str) -> UserCostsUploads: List UserCostUploads. """ - path = f"/integrations/{quote(str(integration_token), safe='')}/costs" + path = f"/v2/integrations/{quote(str(integration_token), safe='')}/costs" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -1611,7 +1611,7 @@ def create_gcp(self, body: CreateGcpIntegration) -> Integration: Create a GCP Integration """ - path = "/integrations/gcp" + path = "/v2/integrations/gcp" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1625,7 +1625,7 @@ def create_azure(self, body: CreateAzureIntegration) -> Integration: Create an Azure Integration """ - path = "/integrations/azure" + path = "/v2/integrations/azure" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1646,7 +1646,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None, manag Returns a list of invoices (MSP invoicing required). """ - path = "/invoices" + path = "/v2/invoices" params = { "page": page, "limit": limit, @@ -1664,7 +1664,7 @@ def create(self, body: CreateInvoice) -> Invoice: Create an invoice (MSP accounts only). """ - path = "/invoices" + path = "/v2/invoices" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1678,7 +1678,7 @@ def get(self, invoice_token: str) -> Invoice: Return an invoice. """ - path = f"/invoices/{quote(str(invoice_token), safe='')}" + path = f"/v2/invoices/{quote(str(invoice_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -1692,7 +1692,7 @@ def download(self, invoice_token: str, body: DownloadInvoiceRequest) -> Download Download invoice file (PDF or CSV). """ - path = f"/invoices/{quote(str(invoice_token), safe='')}/download" + path = f"/v2/invoices/{quote(str(invoice_token), safe='')}/download" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1706,7 +1706,7 @@ def send(self, invoice_token: str) -> SendInvoice: Send invoice via email. """ - path = f"/invoices/{quote(str(invoice_token), safe='')}/send" + path = f"/v2/invoices/{quote(str(invoice_token), safe='')}/send" params = None body_data = None data = self._client.request("POST", path, params=params, body=body_data) @@ -1720,7 +1720,7 @@ def send_and_approve(self, invoice_token: str) -> SendInvoice: Send and approve invoice via email (MSP accounts only). """ - path = f"/invoices/{quote(str(invoice_token), safe='')}/send_and_approve" + path = f"/v2/invoices/{quote(str(invoice_token), safe='')}/send_and_approve" params = None body_data = None data = self._client.request("POST", path, params=params, body=body_data) @@ -1734,7 +1734,7 @@ def get_cost_report(self, invoice_token: str) -> CostReportUrl: Get cost report URL for invoice period. """ - path = f"/invoices/{quote(str(invoice_token), safe='')}/cost_report" + path = f"/v2/invoices/{quote(str(invoice_token), safe='')}/cost_report" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -1748,7 +1748,7 @@ def regenerate(self, invoice_token: str) -> Invoice: Regenerate an existing invoice (MSP accounts only). """ - path = f"/invoices/{quote(str(invoice_token), safe='')}/regenerate" + path = f"/v2/invoices/{quote(str(invoice_token), safe='')}/regenerate" params = None body_data = None data = self._client.request("POST", path, params=params, body=body_data) @@ -1769,7 +1769,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Ku Return all KubernetesEfficiencyReports. """ - path = "/kubernetes_efficiency_reports" + path = "/v2/kubernetes_efficiency_reports" params = { "page": page, "limit": limit, @@ -1786,7 +1786,7 @@ def create(self, body: CreateKubernetesEfficiencyReport) -> KubernetesEfficiency Create a KubernetesEfficiencyReport. """ - path = "/kubernetes_efficiency_reports" + path = "/v2/kubernetes_efficiency_reports" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1800,7 +1800,7 @@ def create_export(self, body: CreateKubernetesEfficiencyReportExport, *, groupin Generate a DataExport of Kubernetes efficiency data. """ - path = "/kubernetes_efficiency_reports/data_exports" + path = "/v2/kubernetes_efficiency_reports/data_exports" params = { "groupings": groupings, } @@ -1813,7 +1813,7 @@ def get(self, kubernetes_efficiency_report_token: str) -> KubernetesEfficiencyRe Return a KubernetesEfficiencyReport. """ - path = f"/kubernetes_efficiency_reports/{quote(str(kubernetes_efficiency_report_token), safe='')}" + path = f"/v2/kubernetes_efficiency_reports/{quote(str(kubernetes_efficiency_report_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -1827,7 +1827,7 @@ def update(self, kubernetes_efficiency_report_token: str, body: UpdateKubernetes Update a KubernetesEfficiencyReport. """ - path = f"/kubernetes_efficiency_reports/{quote(str(kubernetes_efficiency_report_token), safe='')}" + path = f"/v2/kubernetes_efficiency_reports/{quote(str(kubernetes_efficiency_report_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -1841,7 +1841,7 @@ def delete(self, kubernetes_efficiency_report_token: str) -> None: Delete a KubernetesEfficiencyReport. """ - path = f"/kubernetes_efficiency_reports/{quote(str(kubernetes_efficiency_report_token), safe='')}" + path = f"/v2/kubernetes_efficiency_reports/{quote(str(kubernetes_efficiency_report_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -1859,7 +1859,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Ma Returns a list of managed accounts. """ - path = "/managed_accounts" + path = "/v2/managed_accounts" params = { "page": page, "limit": limit, @@ -1876,7 +1876,7 @@ def create(self, body: CreateManagedAccount) -> ManagedAccount: Create a Managed Account. """ - path = "/managed_accounts" + path = "/v2/managed_accounts" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1890,7 +1890,7 @@ def get(self, managed_account_token: str) -> ManagedAccount: Return a Managed Account. """ - path = f"/managed_accounts/{quote(str(managed_account_token), safe='')}" + path = f"/v2/managed_accounts/{quote(str(managed_account_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -1904,7 +1904,7 @@ def update(self, managed_account_token: str, body: UpdateManagedAccount) -> Mana Update a Managed Account. """ - path = f"/managed_accounts/{quote(str(managed_account_token), safe='')}" + path = f"/v2/managed_accounts/{quote(str(managed_account_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -1918,7 +1918,7 @@ def delete(self, managed_account_token: str) -> None: Delete a Managed Account. """ - path = f"/managed_accounts/{quote(str(managed_account_token), safe='')}" + path = f"/v2/managed_accounts/{quote(str(managed_account_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -1929,7 +1929,7 @@ def update_sso_connection_for(self, managed_account_token: str, body: UpdateSsoC Update SSO configuration for a Managed Account. """ - path = f"/managed_accounts/{quote(str(managed_account_token), safe='')}/sso_connection" + path = f"/v2/managed_accounts/{quote(str(managed_account_token), safe='')}/sso_connection" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -1943,7 +1943,7 @@ def create_sso_connection_for(self, managed_account_token: str, body: CreateSsoC Configure SSO for a Managed Account. """ - path = f"/managed_accounts/{quote(str(managed_account_token), safe='')}/sso_connection" + path = f"/v2/managed_accounts/{quote(str(managed_account_token), safe='')}/sso_connection" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -1951,6 +1951,17 @@ def create_sso_connection_for(self, managed_account_token: str, body: CreateSsoC return ManagedAccount.model_validate(data) return data + def delete_sso_connection_for(self, managed_account_token: str) -> None: + """ + Delete SSO connection for managed account + + Delete SSO connection for a Managed Account. + """ + path = f"/v2/managed_accounts/{quote(str(managed_account_token), safe='')}/sso_connection" + params = None + body_data = None + self._client.request("DELETE", path, params=params, body=body_data) + class MeApi: """API methods for me resource.""" @@ -1964,7 +1975,7 @@ def get(self) -> Me: Get information about the authenticated BearerToken. """ - path = "/me" + path = "/v2/me" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -1985,7 +1996,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Ne Return all NetworkFlowReports. """ - path = "/network_flow_reports" + path = "/v2/network_flow_reports" params = { "page": page, "limit": limit, @@ -2002,7 +2013,7 @@ def create(self, body: CreateNetworkFlowReport) -> NetworkFlowReport: Create a NetworkFlowReport. """ - path = "/network_flow_reports" + path = "/v2/network_flow_reports" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -2016,7 +2027,7 @@ def get(self, network_flow_report_token: str) -> NetworkFlowReport: Return a NetworkFlowReport. """ - path = f"/network_flow_reports/{quote(str(network_flow_report_token), safe='')}" + path = f"/v2/network_flow_reports/{quote(str(network_flow_report_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2030,7 +2041,7 @@ def update(self, network_flow_report_token: str, body: UpdateNetworkFlowReport) Update a NetworkFlowReport. """ - path = f"/network_flow_reports/{quote(str(network_flow_report_token), safe='')}" + path = f"/v2/network_flow_reports/{quote(str(network_flow_report_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -2044,7 +2055,7 @@ def delete(self, network_flow_report_token: str) -> None: Delete a NetworkFlowReport. """ - path = f"/network_flow_reports/{quote(str(network_flow_report_token), safe='')}" + path = f"/v2/network_flow_reports/{quote(str(network_flow_report_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -2058,7 +2069,7 @@ def __init__(self, client: SyncClient) -> None: def ping(self) -> None: """This is a health check endpoint that can be used to determine Vantage API healthiness. It will return 200 if everything is running smoothly.""" - path = "/ping" + path = "/v2/ping" params = None body_data = None self._client.request("GET", path, params=params, body=body_data) @@ -2076,7 +2087,7 @@ def get_prices(self, product_id: str, *, page: Optional[int] = None, limit: Opti Return available Prices across all Regions for a Product. """ - path = f"/products/{quote(str(product_id), safe='')}/prices" + path = f"/v2/products/{quote(str(product_id), safe='')}/prices" params = { "page": page, "limit": limit, @@ -2093,7 +2104,7 @@ def get_price(self, product_id: str, id: str) -> Price: Returns a price """ - path = f"/products/{quote(str(product_id), safe='')}/prices/{quote(str(id), safe='')}" + path = f"/v2/products/{quote(str(product_id), safe='')}/prices/{quote(str(id), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2107,7 +2118,7 @@ def list(self, *, provider_id: Optional[str] = None, service_id: Optional[str] = Return available Products for a Service. For example, with a Provider of AWS and a Service of EC2, Products will be a list of all EC2 Instances. By default, this endpoint returns all Products across all Services and Providers but has optional query parameters for filtering listed below. """ - path = "/products" + path = "/v2/products" params = { "provider_id": provider_id, "service_id": service_id, @@ -2127,7 +2138,7 @@ def get(self, id: str) -> Product: Return a product """ - path = f"/products/{quote(str(id), safe='')}" + path = f"/v2/products/{quote(str(id), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2148,7 +2159,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Re Return all RecommendationViews. """ - path = "/recommendation_views" + path = "/v2/recommendation_views" params = { "page": page, "limit": limit, @@ -2165,7 +2176,7 @@ def create(self, body: CreateRecommendationView) -> RecommendationView: Create a RecommendationView. """ - path = "/recommendation_views" + path = "/v2/recommendation_views" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -2179,7 +2190,7 @@ def get(self, recommendation_view_token: str) -> RecommendationView: Return a specific RecommendationView. """ - path = f"/recommendation_views/{quote(str(recommendation_view_token), safe='')}" + path = f"/v2/recommendation_views/{quote(str(recommendation_view_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2193,7 +2204,7 @@ def update(self, recommendation_view_token: str, body: UpdateRecommendationView) Update a RecommendationView. """ - path = f"/recommendation_views/{quote(str(recommendation_view_token), safe='')}" + path = f"/v2/recommendation_views/{quote(str(recommendation_view_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -2207,7 +2218,7 @@ def delete(self, recommendation_view_token: str) -> None: Delete a RecommendationView. """ - path = f"/recommendation_views/{quote(str(recommendation_view_token), safe='')}" + path = f"/v2/recommendation_views/{quote(str(recommendation_view_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -2225,7 +2236,7 @@ def list(self, *, provider_ids: Optional[List[str]] = None, billing_account_ids: Return all Recommendations. Use the `type` query parameter with a fuzzy fragment to filter recommendation type case-insensitively (for example: aws, aws:ec2, aws:ec2:rightsizing). """ - path = "/recommendations" + path = "/v2/recommendations" params = { "provider_ids": provider_ids, "billing_account_ids": billing_account_ids, @@ -2256,7 +2267,7 @@ def get(self, recommendation_token: str) -> Recommendation: Return a Recommendation. """ - path = f"/recommendations/{quote(str(recommendation_token), safe='')}" + path = f"/v2/recommendations/{quote(str(recommendation_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2270,7 +2281,7 @@ def get_resources(self, recommendation_token: str, *, page: Optional[int] = None Return all Active Resources, including Recommendation Actions, referenced in this Recommendation. """ - path = f"/recommendations/{quote(str(recommendation_token), safe='')}/resources" + path = f"/v2/recommendations/{quote(str(recommendation_token), safe='')}/resources" params = { "page": page, "limit": limit, @@ -2287,7 +2298,7 @@ def get_resource(self, recommendation_token: str, resource_token: str) -> Provid Return an Active Resource, including Recommendation Actions, referenced in this Recommendation. """ - path = f"/recommendations/{quote(str(recommendation_token), safe='')}/resources/{quote(str(resource_token), safe='')}" + path = f"/v2/recommendations/{quote(str(recommendation_token), safe='')}/resources/{quote(str(resource_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2301,7 +2312,7 @@ def get_type_resources(self, type: str, *, provider_ids: Optional[List[str]] = N Return all Active Resources associated with recommendations of the specified type. """ - path = f"/recommendations/by_type/{quote(str(type), safe='')}/resources" + path = f"/v2/recommendations/by_type/{quote(str(type), safe='')}/resources" params = { "provider_ids": provider_ids, "billing_account_ids": billing_account_ids, @@ -2335,7 +2346,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Re Return all ReportNotifications. """ - path = "/report_notifications" + path = "/v2/report_notifications" params = { "page": page, "limit": limit, @@ -2352,7 +2363,7 @@ def create(self, body: CreateReportNotification) -> ReportNotification: Create a ReportNotification. """ - path = "/report_notifications" + path = "/v2/report_notifications" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -2366,7 +2377,7 @@ def get(self, report_notification_token: str) -> ReportNotification: Return a ReportNotification. """ - path = f"/report_notifications/{quote(str(report_notification_token), safe='')}" + path = f"/v2/report_notifications/{quote(str(report_notification_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2380,7 +2391,7 @@ def update(self, report_notification_token: str, body: UpdateReportNotification) Update a ReportNotification. """ - path = f"/report_notifications/{quote(str(report_notification_token), safe='')}" + path = f"/v2/report_notifications/{quote(str(report_notification_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -2394,7 +2405,7 @@ def delete(self, report_notification_token: str) -> None: Delete a ReportNotification. """ - path = f"/report_notifications/{quote(str(report_notification_token), safe='')}" + path = f"/v2/report_notifications/{quote(str(report_notification_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -2412,7 +2423,7 @@ def get_columns(self, *, resource_type: str) -> ResourceReportColumns: List available columns for a resource type. """ - path = "/resource_reports/columns" + path = "/v2/resource_reports/columns" params = { "resource_type": resource_type, } @@ -2428,7 +2439,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Re Return all ResourceReports. """ - path = "/resource_reports" + path = "/v2/resource_reports" params = { "page": page, "limit": limit, @@ -2445,7 +2456,7 @@ def create(self, body: CreateResourceReport) -> ResourceReport: Create a ResourceReport. """ - path = "/resource_reports" + path = "/v2/resource_reports" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -2459,7 +2470,7 @@ def get(self, resource_report_token: str) -> ResourceReport: Return a ResourceReport. """ - path = f"/resource_reports/{quote(str(resource_report_token), safe='')}" + path = f"/v2/resource_reports/{quote(str(resource_report_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2473,7 +2484,7 @@ def update(self, resource_report_token: str, body: UpdateResourceReport) -> Reso Update a ResourceReport. """ - path = f"/resource_reports/{quote(str(resource_report_token), safe='')}" + path = f"/v2/resource_reports/{quote(str(resource_report_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -2487,7 +2498,7 @@ def delete(self, resource_report_token: str) -> None: Delete a ResourceReport. """ - path = f"/resource_reports/{quote(str(resource_report_token), safe='')}" + path = f"/v2/resource_reports/{quote(str(resource_report_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -2505,7 +2516,7 @@ def get_report(self, *, resource_report_token: Optional[str] = None, filter: Opt Return Resources contained in a ResourceReport """ - path = "/resources" + path = "/v2/resources" params = { "resource_report_token": resource_report_token, "filter": filter, @@ -2526,7 +2537,7 @@ def get(self, resource_token: str, *, include_cost: Optional[bool] = None) -> Re Return a single Resource """ - path = f"/resources/{quote(str(resource_token), safe='')}" + path = f"/v2/resources/{quote(str(resource_token), safe='')}" params = { "include_cost": include_cost, } @@ -2549,7 +2560,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Sa Return all SavedFilters that can be applied to a CostReport. """ - path = "/saved_filters" + path = "/v2/saved_filters" params = { "page": page, "limit": limit, @@ -2566,7 +2577,7 @@ def create(self, body: CreateSavedFilter) -> SavedFilter: Create a SavedFilter for CostReports. """ - path = "/saved_filters" + path = "/v2/saved_filters" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -2580,7 +2591,7 @@ def get(self, saved_filter_token: str) -> SavedFilter: Return a specific SavedFilter. """ - path = f"/saved_filters/{quote(str(saved_filter_token), safe='')}" + path = f"/v2/saved_filters/{quote(str(saved_filter_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2594,7 +2605,7 @@ def update(self, saved_filter_token: str, body: UpdateSavedFilter) -> SavedFilte Update a SavedFilter for CostReports. """ - path = f"/saved_filters/{quote(str(saved_filter_token), safe='')}" + path = f"/v2/saved_filters/{quote(str(saved_filter_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -2608,7 +2619,7 @@ def delete(self, saved_filter_token: str) -> None: Delete a SavedFilter for CostReports. """ - path = f"/saved_filters/{quote(str(saved_filter_token), safe='')}" + path = f"/v2/saved_filters/{quote(str(saved_filter_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -2626,7 +2637,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Se Return all Segments. """ - path = "/segments" + path = "/v2/segments" params = { "page": page, "limit": limit, @@ -2643,7 +2654,7 @@ def create(self, body: CreateSegment) -> Segment: Create a Segment. """ - path = "/segments" + path = "/v2/segments" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -2657,7 +2668,7 @@ def get(self, segment_token: str) -> Segment: Return a Segment. """ - path = f"/segments/{quote(str(segment_token), safe='')}" + path = f"/v2/segments/{quote(str(segment_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2671,7 +2682,7 @@ def update(self, segment_token: str, body: UpdateSegment) -> Segment: Update a Segment. """ - path = f"/segments/{quote(str(segment_token), safe='')}" + path = f"/v2/segments/{quote(str(segment_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -2685,7 +2696,7 @@ def delete(self, segment_token: str) -> None: Delete a Segment. """ - path = f"/segments/{quote(str(segment_token), safe='')}" + path = f"/v2/segments/{quote(str(segment_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -2703,7 +2714,7 @@ def list(self, *, providers: Optional[List[str]] = None, search_query: Optional[ Return all Tags that the current API token has access to. """ - path = "/tags" + path = "/v2/tags" params = { "providers": providers, "search_query": search_query, @@ -2723,7 +2734,7 @@ def update(self, body: UpdateTag) -> Tags: Updates an existing Tag. """ - path = "/tags" + path = "/v2/tags" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -2737,7 +2748,7 @@ def get_values(self, key: str, *, providers: Optional[List[str]] = None, sort_di Returns corresponding TagValues for a given Tag. """ - path = f"/tags/{quote(str(key), safe='')}/values" + path = f"/v2/tags/{quote(str(key), safe='')}/values" params = { "providers": providers, "sort_direction": sort_direction, @@ -2764,7 +2775,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Te Return all Teams that the current API token has access to. """ - path = "/teams" + path = "/v2/teams" params = { "page": page, "limit": limit, @@ -2781,7 +2792,7 @@ def create(self, body: CreateTeam) -> Team: Create a new Team. """ - path = "/teams" + path = "/v2/teams" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -2795,7 +2806,7 @@ def get(self, team_token: str) -> Team: Return a specific Team. """ - path = f"/teams/{quote(str(team_token), safe='')}" + path = f"/v2/teams/{quote(str(team_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2809,7 +2820,7 @@ def update(self, team_token: str, body: UpdateTeam) -> Team: Update a Team. """ - path = f"/teams/{quote(str(team_token), safe='')}" + path = f"/v2/teams/{quote(str(team_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -2823,7 +2834,7 @@ def delete(self, team_token: str) -> None: Delete a Team. """ - path = f"/teams/{quote(str(team_token), safe='')}" + path = f"/v2/teams/{quote(str(team_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -2834,7 +2845,7 @@ def get_members(self, team_token: str, *, page: Optional[int] = None, limit: Opt Return all members of a Team. """ - path = f"/teams/{quote(str(team_token), safe='')}/members" + path = f"/v2/teams/{quote(str(team_token), safe='')}/members" params = { "page": page, "limit": limit, @@ -2851,7 +2862,7 @@ def add_member(self, team_token: str, body: AddTeamMember) -> TeamMember: Add a member to a Team. """ - path = f"/teams/{quote(str(team_token), safe='')}/members" + path = f"/v2/teams/{quote(str(team_token), safe='')}/members" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -2865,7 +2876,7 @@ def remove_member(self, team_token: str, user_token: str) -> None: Remove a member from a Team. """ - path = f"/teams/{quote(str(team_token), safe='')}/members/{quote(str(user_token), safe='')}" + path = f"/v2/teams/{quote(str(team_token), safe='')}/members/{quote(str(user_token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -2883,7 +2894,7 @@ def create_export(self, body: CreateUnitCostsExport) -> str: Generate a DataExport of unit costs. """ - path = "/unit_costs/data_exports" + path = "/v2/unit_costs/data_exports" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body return self._client.request("POST", path, params=params, body=body_data) @@ -2894,7 +2905,7 @@ def list(self, *, cost_report_token: str, start_date: Optional[str] = None, end_ Return all UnitCosts for a CostReport. """ - path = "/unit_costs" + path = "/v2/unit_costs" params = { "cost_report_token": cost_report_token, "start_date": start_date, @@ -2923,7 +2934,7 @@ def create(self, body: CreateUserFeedback) -> UserFeedback: Provide UserFeedback for our product and features. """ - path = "/user_feedback" + path = "/v2/user_feedback" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -2944,7 +2955,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Us Return all Users that the current API token has access to. """ - path = "/users" + path = "/v2/users" params = { "page": page, "limit": limit, @@ -2961,7 +2972,7 @@ def get(self, user_token: str) -> User: Return a specific User. """ - path = f"/users/{quote(str(user_token), safe='')}" + path = f"/v2/users/{quote(str(user_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2982,7 +2993,7 @@ def list(self) -> VirtualTagConfigs: Return all VirtualTagConfigs that the current API token has access to. """ - path = "/virtual_tag_configs" + path = "/v2/virtual_tag_configs" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -2996,7 +3007,7 @@ def create(self, body: CreateVirtualTagConfig) -> VirtualTagConfig: Create a new VirtualTagConfig. """ - path = "/virtual_tag_configs" + path = "/v2/virtual_tag_configs" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -3010,7 +3021,7 @@ def get(self, token: str) -> VirtualTagConfig: Return a specific VirtualTagConfig. """ - path = f"/virtual_tag_configs/{quote(str(token), safe='')}" + path = f"/v2/virtual_tag_configs/{quote(str(token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -3024,7 +3035,7 @@ def update(self, token: str, body: UpdateVirtualTagConfig) -> VirtualTagConfig: Updates an existing VirtualTagConfig. """ - path = f"/virtual_tag_configs/{quote(str(token), safe='')}" + path = f"/v2/virtual_tag_configs/{quote(str(token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -3038,7 +3049,7 @@ def delete(self, token: str) -> None: Deletes an existing VirtualTagConfig. """ - path = f"/virtual_tag_configs/{quote(str(token), safe='')}" + path = f"/v2/virtual_tag_configs/{quote(str(token), safe='')}" params = None body_data = None self._client.request("DELETE", path, params=params, body=body_data) @@ -3049,7 +3060,7 @@ def get_status(self, token: str) -> VirtualTagConfigStatus: Return the processing status of a specific VirtualTagConfig. """ - path = f"/virtual_tag_configs/{quote(str(token), safe='')}/status" + path = f"/v2/virtual_tag_configs/{quote(str(token), safe='')}/status" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -3063,7 +3074,7 @@ def update_async(self, token: str, body: UpdateAsyncVirtualTagConfig) -> AsyncVi Asynchronously updates an existing VirtualTagConfig. """ - path = f"/virtual_tag_configs/{quote(str(token), safe='')}/async" + path = f"/v2/virtual_tag_configs/{quote(str(token), safe='')}/async" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) @@ -3077,7 +3088,7 @@ def get_async_virtual_tag_config_status(self, request_id: str) -> bool: Check the status of an async VirtualTagConfig update. """ - path = f"/virtual_tag_configs/async/{quote(str(request_id), safe='')}" + path = f"/v2/virtual_tag_configs/async/{quote(str(request_id), safe='')}" params = None body_data = None return self._client.request("GET", path, params=params, body=body_data) @@ -3095,7 +3106,7 @@ def list(self, *, page: Optional[int] = None, limit: Optional[int] = None) -> Wo Return all Workspaces that the current API token has access to. """ - path = "/workspaces" + path = "/v2/workspaces" params = { "page": page, "limit": limit, @@ -3112,7 +3123,7 @@ def create(self, body: CreateWorkspace) -> Workspace: Create a workspace """ - path = "/workspaces" + path = "/v2/workspaces" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("POST", path, params=params, body=body_data) @@ -3126,7 +3137,7 @@ def get(self, workspace_token: str) -> Workspace: Return a specific Workspace. """ - path = f"/workspaces/{quote(str(workspace_token), safe='')}" + path = f"/v2/workspaces/{quote(str(workspace_token), safe='')}" params = None body_data = None data = self._client.request("GET", path, params=params, body=body_data) @@ -3140,7 +3151,7 @@ def update(self, workspace_token: str, body: UpdateWorkspace) -> Workspace: Update a workspace """ - path = f"/workspaces/{quote(str(workspace_token), safe='')}" + path = f"/v2/workspaces/{quote(str(workspace_token), safe='')}" params = None body_data = body.model_dump(by_alias=True, exclude_none=True) if hasattr(body, 'model_dump') else body data = self._client.request("PUT", path, params=params, body=body_data) diff --git a/src/vantage/_types.py b/src/vantage/_types.py index a6767e9..e95d772 100644 --- a/src/vantage/_types.py +++ b/src/vantage/_types.py @@ -317,7 +317,7 @@ class BudgetAlert(BaseModel): token: str budget_tokens: List[str] = Field(description="The tokens for the Budgets that the Budget Alert is monitoring to trigger alerts on.") created_at: str = Field(description="The date and time, in UTC, the Budget Alert was created. ISO 8601 Formatted.") - workspace_token: str = Field(description="The token for the Workspace the ResourceReport is a part of.") + workspace_token: Optional[str] = Field(description="The token for the Workspace the ResourceReport is a part of.") user_token: Optional[str] = Field(default=None, description="The token for the User who created this BudgetAlert.") user_tokens: List[str] = Field(description="The Users that receive the alert.") duration_in_days: Optional[int] = Field(description="The number of days from the start or end of the month to trigger the alert if the threshold is reached.")