import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.plans.update_bandwidth(data={
"type": latitudesh_python_sdk.UpdatePlansBandwidthPlansType.BANDWIDTH_PACKAGES,
"attributes": {
"project": "proj_VE1Wd3EKDXnZJ",
"quantity": 5,
"region_slug": "brazil",
},
})
# Handle response
print(res)
{
"data": {
"type": "bandwidth_packages",
"attributes": {
"project": {
"id": "proj_z2A3DVZ3DnawP",
"name": "Renner-Rodriguez",
"slug": "renner-rodriguez"
},
"packages": [
{
"region_slug": "united-states",
"unit_price": 0.5,
"currency": "USD",
"contracted": 10,
"total_price": 5
},
{
"region_slug": "brazil",
"unit_price": 4.6,
"currency": "USD",
"contracted": 0,
"total_price": 0
}
]
}
}
}
Allows to increase or decrease bandwidth packages. Only admins and owners can request.
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.plans.update_bandwidth(data={
"type": latitudesh_python_sdk.UpdatePlansBandwidthPlansType.BANDWIDTH_PACKAGES,
"attributes": {
"project": "proj_VE1Wd3EKDXnZJ",
"quantity": 5,
"region_slug": "brazil",
},
})
# Handle response
print(res)
{
"data": {
"type": "bandwidth_packages",
"attributes": {
"project": {
"id": "proj_z2A3DVZ3DnawP",
"name": "Renner-Rodriguez",
"slug": "renner-rodriguez"
},
"packages": [
{
"region_slug": "united-states",
"unit_price": 0.5,
"currency": "USD",
"contracted": 10,
"total_price": 5
},
{
"region_slug": "brazil",
"unit_price": 4.6,
"currency": "USD",
"contracted": 0,
"total_price": 0
}
]
}
}
}
Show child attributes
Was this page helpful?