https://prefect.io logo
#prefect-community
Title
# prefect-community
r

Rob Fowler

08/26/2020, 10:42 PM
here is a non working example but what I mean
Copy code
from prefect import Flow, task, Parameter
from flows.freq import request

@task(name="Creating an order")
def create_order(opts, user_agent, auth, js):
    return request(opts, 'POST', f"{opts.try_url}/orders", user_agent, auth, js)

def create_service_requests(delivery_type):
    return {'dt': delivery_type}

with Flow("azure_subscription_change_smacc") as flow:
    opts = Parameter('opts')
    user_agent = Parameter('user_agent')
    auth = Parameter('auth')
    regular_order_id_js = create_service_requests("Regular")
    accelerated_order_id_js = create_service_requests("Accelerated")
    regular_result = create_order(opts, user_agent, auth, regular_order_id_js)
    accelerated_result = create_order(opts, user_agent, auth, accelerated_order_id_js)

if __name__ == '__main__':
    state = flow.run(opts={}, user_agent="blah", auth="blahauth")