Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Ruk's parameter #88

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,498 changes: 594 additions & 904 deletions jelastic/api/administration/__init__.py

Large diffs are not rendered by default.

81 changes: 71 additions & 10 deletions jelastic/api/automation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ class _Utils(Automation):
_endpoint2 = "utils"

def ClearBillingHistory(
self, uid: int, start_date: date, end_date: date, env_name: str = None
self,
uid: int,
start_date: date,
end_date: date,
env_name: str = None,
ruk: str = None,
):
return self._get(
"ClearBillingHistory",
Expand All @@ -50,28 +55,40 @@ def ClearBillingHistory(
"startDate": start_date,
"endDate": end_date,
"envName": env_name,
"ruk": ruk,
},
datetime_format="%Y-%m-%d",
)

def ClearMonthTraffic(self, uid: int, month_start: str):
def ClearMonthTraffic(
self,
uid: int,
month_start: str,
ruk: str = None,
):
return self._get(
"ClearMonthTraffic",
params={
"uid": uid,
"monthStart": month_start,
"ruk": ruk,
},
)

def ClearResourceStatistics(
self, uid: int, start_date_from: date, start_date_to: date
self,
uid: int,
start_date_from: date,
start_date_to: date,
ruk: str = None,
):
return self._get(
"ClearResourceStatistics",
params={
"uid": uid,
"startDateFrom": start_date_from,
"startDateTo": start_date_to,
"ruk": ruk,
},
datetime_format="%Y-%m-%d",
)
Expand All @@ -83,6 +100,7 @@ def GenerateBillableItemStatistics(
node_id: int,
item_id: int,
env_name: str = None,
ruk: str = None,
):
return self._get(
"GenerateBillableItemStatistics",
Expand All @@ -92,12 +110,18 @@ def GenerateBillableItemStatistics(
"nodeId": node_id,
"itemId": item_id,
"envName": env_name,
"ruk": ruk,
},
datetime_format="%Y-%m-%d",
)

def GenerateStatistics(
self, start_date: date, duration_hour: int, node_id: int, stat_json: dict
self,
start_date: date,
duration_hour: int,
node_id: int,
stat_json: dict,
ruk: str = None,
):
stat_json = json.dumps(stat_json)
return self._get(
Expand All @@ -107,34 +131,60 @@ def GenerateStatistics(
"durationHour": duration_hour,
"nodeId": node_id,
"statJson": stat_json,
"ruk": ruk,
},
datetime_format="%Y-%m-%d",
)

def GetUidUsageByPeriod(self, uid: int, start_date: date, end_date: date):
def GetUidUsageByPeriod(
self,
uid: int,
start_date: date,
end_date: date,
ruk: str = None,
):
return self._get(
"GetUidUsageByPeriod",
params={
"uid": uid,
"startDate": start_date,
"endDate": end_date,
"ruk": ruk,
},
datetime_format="%Y-%m-%d",
)

def SetAccountDate(self, uid: int, date_type: str, date_value: str):
def SetAccountDate(
self,
uid: int,
date_type: str,
date_value: str,
ruk: str = None,
):
return self._get(
"SetAccountDate",
params={"uid": uid, "dateType": date_type, "dateValue": date_value},
params={
"uid": uid,
"dateType": date_type,
"dateValue": date_value,
"ruk": ruk,
},
)

def SetAppNodeDate(self, env_name: str, date_type: str, date_value: str):
def SetAppNodeDate(
self,
env_name: str,
date_type: str,
date_value: str,
ruk: str = None,
):
return self._get(
"SetAppNodeDate",
params={
"envName": env_name,
"dateType": date_type,
"dateValue": date_value,
"ruk": ruk,
},
)

Expand All @@ -146,6 +196,7 @@ def SetBillingHistoryDate(
start_date_to: date,
date_type: str,
date_value: str,
ruk: str = None,
):
return self._get(
"SetBillingHistoryDate",
Expand All @@ -156,22 +207,31 @@ def SetBillingHistoryDate(
"startDateTo": start_date_to,
"dateType": date_type,
"dateValue": date_value,
"ruk": ruk,
},
datetime_format="%Y-%m-%d",
)

def SetMonthTraffic(self, uid: int, month_start: str, external_traffic: float):
def SetMonthTraffic(
self, uid: int, month_start: str, external_traffic: float, ruk: str = None
):
return self._get(
"SetMonthTraffic",
params={
"uid": uid,
"monthStart": month_start,
"externalTraffic": external_traffic,
"ruk": ruk,
},
)

def ShiftResourceCreatedOnDateToStartDate(
self, uid: int, env_name: str, start_date_from: date, start_date_to: date
self,
uid: int,
env_name: str,
start_date_from: date,
start_date_to: date,
ruk: str = None,
):
return self._get(
"ShiftResourceCreatedOnDateToStartDate",
Expand All @@ -180,6 +240,7 @@ def ShiftResourceCreatedOnDateToStartDate(
"envName": env_name,
"startDateFrom": start_date_from,
"startDateTo": start_date_to,
"ruk": ruk,
},
datetime_format="%Y-%m-%d",
)
Loading
Loading