mirror of
https://github.com/Fare-spec/get_ovh_bills.git
synced 2025-12-07 10:20:36 +00:00
started the project
This commit is contained in:
27
fetcher.py
Normal file
27
fetcher.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import json
|
||||
from re import error
|
||||
import ovh
|
||||
|
||||
|
||||
def fetch_api(app_key: str, app_secret: str, consumer_key: str) -> list[str]:
|
||||
client = ovh.Client(
|
||||
endpoint="ovh-eu",
|
||||
application_key=app_key,
|
||||
application_secret=app_secret,
|
||||
consumer_key=consumer_key,
|
||||
)
|
||||
bills = client.get("/me/bill/")
|
||||
return bills
|
||||
|
||||
|
||||
def fetch_invoice_content(
|
||||
id: str, app_key: str, app_secret: str, consumer_key: str
|
||||
) -> dict:
|
||||
client = ovh.Client(
|
||||
endpoint="ovh-eu",
|
||||
application_key=app_key,
|
||||
application_secret=app_secret,
|
||||
consumer_key=consumer_key,
|
||||
)
|
||||
bill = client.get(f"/me/bill/{id}")
|
||||
return bill
|
||||
Reference in New Issue
Block a user