1. How to extend the lease end date?

How to extend the lease end date?

Home Forums FABRIC General Questions and Discussion How to extend the lease end date?

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3820
    Nagmat Nazarov
    Participant

      Dear Community,

      I created my slice and it is automatically deleted after 24 hours.

      How can I extend my slice lease end date? My slice id is : 3eb74e73-9105-4e37-9e89-251f18e31f49

      Kind regards,

      Nagmat

      #3821
      Arash SARABI
      Participant

        Hi, You can use the following code to extend your lease:

        from datetime import datetime
        from datetime import timezone
        from datetime import timedelta
        
        #Set end host to now plus 1 day
        end_date = (datetime.now(timezone.utc) + timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S %z")
        
        try:
            slice = fablib.get_slice(name=slice_name)
        
            slice.renew(end_date)
        except Exception as e:
            print(f"Exception: {e}")
        #3823
        Paul Ruth
        Keymaster

          Note that a great place to learn about FABlib is in the JupyterExample that come pre-installed in your JupyterHub container.  You can also pull the examples from github

          Current examples in a zip file (FABRIC Jupyter Examples 1.4.2)

          The index of other example can be found here: (Jupyter Examples Index)

          The renew example can be found there (github link: Renew Slice)

          All of these examples are pre-installed in your JupyterHub container and should run after you configure the environment with your username and keys.

          #4316
          Nagmat Nazarov
          Participant

            It worked thanks!

          Viewing 4 posts - 1 through 4 (of 4 total)
          • The topic ‘How to extend the lease end date?’ is closed to new replies.
          FABRIC invites nominations for four awards recognizing innovative uses of FABRIC resources—Best Published Paper, Best FABRIC Matrix, Best FABRIC Experiment, and Best Classroom Use of FABRIC — submissions due by **Monday, February 24 at 11:59 PM ET**, and winners announced at KNIT10. [>>>Submit Form](https://docs.google.com/forms/d/e/1FAIpQLSeTp3i2iDhB7bHgN8ryMxZci8ya87yjeQd7_JMZImUodNinVA/viewform)

          KNIT10 Call for Demos Now Open! Submit your demo by **February 24**. [>>>Submit Demo](https://docs.google.com/forms/d/e/1FAIpQLScRIWqHliNP3DFWBCnalYN_fBXJXVM0PpP9YWWJdSebC95TvA/viewform)
          FABRIC invites nominations for four awards recognizing innovative uses of FABRIC resources—Best Published Paper, Best FABRIC Matrix, Best FABRIC Experiment, and Best Classroom Use of FABRIC — submissions due by **Monday, February 24 at 11:59 PM ET**, and winners announced at KNIT10. [>>>Submit Form](https://docs.google.com/forms/d/e/1FAIpQLSeTp3i2iDhB7bHgN8ryMxZci8ya87yjeQd7_JMZImUodNinVA/viewform)

          KNIT10 Call for Demos Now Open! Submit your demo by **February 24**. [>>>Submit Demo](https://docs.google.com/forms/d/e/1FAIpQLScRIWqHliNP3DFWBCnalYN_fBXJXVM0PpP9YWWJdSebC95TvA/viewform)