Giter Site home page Giter Site logo

Getting Job Name? about ndscheduler HOT 4 CLOSED

nextdoor avatar nextdoor commented on July 21, 2024
Getting Job Name?

from ndscheduler.

Comments (4)

sabw8217 avatar sabw8217 commented on July 21, 2024

I'm not sure I understand the question. Are you trying to get the job name via an API from inside the job? I think you can get your execution_id, from there look up the particular Execution and get a job_id, and then use apscheduler APIs to look up a particular Job. The datastore extends apscheduler.jobstores.sqlalchemy.SQLAlchemyJobStore.

from ndscheduler.

dejaentenduu avatar dejaentenduu commented on July 21, 2024

Sorry, I should have given more detail and probably didn't ask that correctly. For context, I'm trying to set up an email notification system that alerts you when a job either fails or successfully completes. Right now, I can get the job_id and execution_id, and they would be helpful for an alert, but having the job name as it is written in the UI would great as well.

What you described sounds like what I need, I appreciate the response.

from ndscheduler.

dejaentenduu avatar dejaentenduu commented on July 21, 2024

I was able to get the job name, thanks for the help. Probably relatively simple for most people, but
below is how I did it for anyone else struggling like I was:

Code already present in JobBase class:
scheduler = scheduler_manager.ScheduleManager.get_instance()
datastore = scheduler.get_datastore()

Code needed to get the name:
execution = datastore.get_execution(execution_id) # returns a dict with a nested job dict
job_name = execution['job']['name']

from ndscheduler.

nbhoj avatar nbhoj commented on July 21, 2024

I am still not clear on how to fetch the jobs name within the job. could you tell me which scripts-functions to import?

from ndscheduler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.