def reset_password(info): """Send reset password link to registered email address""" confirmation('Are you sure you want to reset your password? This will ' 'trigger an email for resetting your password and ' 'clear cookies.', abort=True) check_login_status(info) api = ce_api.UsersApi(api_client(info)) user = api_call(api.get_loggedin_user_api_v1_users_me_get) api = ce_api.LoginApi(api_client(info)) api_call(api.send_reset_pass_email_api_v1_login_email_resetpassword_post, AuthEmail(email=user.email)) info[constants.ACTIVE_USER] = None info.save() declare("Reset password email sent to {}".format(user.email))
def organization(info): """Info about the account which is currently logged in""" check_login_status(info) api = ce_api.OrganizationsApi(api_client(info)) billing_api = ce_api.BillingApi(api_client(info)) org = api_call(api.get_loggedin_organization_api_v1_organizations_get) bill = api_call( billing_api.get_organization_billing_api_v1_billing_organization_get) table = [{ 'Organization Name': org.name, 'Processed Datapoints total': bill.total_processed_datapoints, 'Cost Total': bill.cost_total, 'Processed Datapoints this Month': bill.processed_datapoints_this_month, 'Cost This Month': bill.cost_this_month, }] click.echo(tabulate(table, headers='keys', tablefmt='presto'))
def whoami(info): """Info about the account which is currently logged in""" check_login_status(info) api = ce_api.UsersApi(api_client(info)) billing_api = ce_api.BillingApi(api_client(info)) user = api_call(api.get_loggedin_user_api_v1_users_me_get) bill = api_call(billing_api.get_user_billing_api_v1_billing_users_user_id_get, user_id=user.id) table = [{ 'Email': info[constants.ACTIVE_USER], 'Full Name': user.full_name if user.full_name else '', 'Pipelines Run': user.n_pipelines_executed, 'Processed Datapoints total': bill.total_processed_datapoints, 'Cost Total': bill.cost_total, 'Processed Datapoints this Month': bill.processed_datapoints_this_month, 'Cost This Month': bill.cost_this_month, }] click.echo(tabulate(table, headers='keys', tablefmt='presto'))
def pipeline(info): """Create, configure and deploy pipeline runs""" utils.check_login_status(info) utils.check_workspace(info)
def backend(info): """Set up your backend configurations with the Core Engine""" check_login_status(info)
def function(info): """Integrate your own custom logic to the Core Engine""" check_login_status(info)
def workspace(info): """Interaction with workspaces""" check_login_status(info)
def provider(info): """Set up your cloud provider with the Core Engine""" check_login_status(info)
def datasource(info): """Interaction with datasources""" check_login_status(info)