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}")
        • This reply was modified 1 year, 2 months ago by Arash SARABI.
        #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.