Ismail Cenik
04/23/2021, 8:36 PMnicholas
04/23/2021, 8:40 PMIsmail Cenik
04/23/2021, 9:09 PMnicholas
04/23/2021, 9:10 PMdefault_parameters
to each of your clocks on the scheduleIsmail Cenik
04/23/2021, 9:55 PMimport time
from prefect import task, Flow
from prefect import Client
import boto3
XXX_KDA = "...-kda"
YYY_KDA = "...-kda"
ZZZ_KDA = "...-kda"
@task(log_stdout=True)
def start_XXX_KDA():
kinesis_client = boto3.client(
'kinesisanalyticsv2)
kinesis_client.start_application(
ApplicationName = XXX_KDA,
RunConfiguration = {})nicholas
04/23/2021, 10:02 PMfrom prefect import task, Flow
from prefect import Client
import boto3
@task(log_stdout=True)
def start(application):
kinesis_client = boto3.client(
'kinesisanalyticsv2)
kinesis_client.start_application(
ApplicationName = application,
RunConfiguration = {})
with Flow("my flow") as flow:
application = Parameter("application", default="XXX_KDA")
start(application=application)
application
parameter to whichever application you want?Ismail Cenik
04/23/2021, 10:07 PMnicholas
04/23/2021, 10:08 PMIsmail Cenik
04/23/2021, 10:12 PMprefect run cloud --name "My Flow Name" --project "Hello, World!"
You can guide me for the specific command. The only requirement, I want to pass a parameter which is Jira Ticket Numbernicholas
04/23/2021, 10:16 PMprefect run cloud --name "My Flow Name" --project "Hello, World!" --parameters-string '{"ticket_number": <<ticket_number_from_jenkins>> }'
and in your code:
with Flow("My Flow Name") as flow:
ticket = Parameter("ticket_number", required=True)
# pass ticket to whatever tasks need it
Ismail Cenik
04/23/2021, 10:17 PMnicholas
04/23/2021, 10:33 PMrun
command differently?Ismail Cenik
04/23/2021, 10:44 PMnicholas
04/23/2021, 10:46 PMIsmail Cenik
04/24/2021, 12:06 AM