adding new script
parent
0967927110
commit
764d06fc24
|
|
@ -8,26 +8,6 @@ import requests
|
|||
import openpyxl
|
||||
import argparse
|
||||
|
||||
def initargparse() -> argparse.ArgumentParser:
|
||||
parser = argparse.ArgumentParser(
|
||||
usage="%(prog)s [--fromDate] [toDate] or [preSelect]",
|
||||
description="gather SLO in daily slices for given Timeframe"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-f","--fromDate",
|
||||
help = "YYYY-mm-dd e.g. 2022-01-01"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-t","--toDate",
|
||||
help = "YYYY-mm-dd e.g. 2022-01-31"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-p","--preSelect",
|
||||
help = "week | month - gathers the data for the last full week or month"
|
||||
)
|
||||
|
||||
return parser
|
||||
|
||||
def make_request(url, headers,verify,parameters):
|
||||
try:
|
||||
response = requests.get(url, headers=headers,verify=verify,params=parameters)
|
||||
|
|
@ -106,6 +86,26 @@ def get_daily_slice(start_date, end_date):
|
|||
|
||||
return days
|
||||
|
||||
def initargparse() -> argparse.ArgumentParser:
|
||||
parser = argparse.ArgumentParser(
|
||||
usage="%(prog)s [--fromDate] [toDate] or [preSelect]",
|
||||
description="gather SLO in daily slices for given Timeframe"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-f","--fromDate",
|
||||
help = "YYYY-mm-dd e.g. 2022-01-01"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-t","--toDate",
|
||||
help = "YYYY-mm-dd e.g. 2022-01-31"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-p","--preSelect",
|
||||
help = "week | month - gathers the data for the last full week or month"
|
||||
)
|
||||
|
||||
return parser
|
||||
|
||||
def main() -> None:
|
||||
|
||||
parser = initargparse()
|
||||
|
|
|
|||
Loading…
Reference in New Issue