Skip to main content
Solved

revert to parent version of pipeline using python sdk

  • February 26, 2023
  • 4 replies
  • 69 views

Yumura
Fan

I want to delete the latest published version of a pipeline and want to revert back e.g from v 2.1 to v2.0. 2.0 would be the latest version available… How would I do it using control hub?

Best answer by saleempothiwala

@Yumura 

 

In order to delete the last version of any pipeline, you will need this:

 

 pipeline=sch.pipelines.get(name="DeleteTest")
 sch.delete_pipeline(pipeline, only_selected_version=True)

 

here, sch is the instance of your Control Hub. The above two lines will delete the last version (committed or draft, any)

If you specify only_selected_version=False then the whole pipeline will be deleted.

 

View original
Did this topic help you find an answer to your question?

4 replies

Bikram
Headliner
Forum|alt.badge.img+1
  • Headliner
  • 486 replies
  • February 27, 2023

@Yumura 

Please click on the version history and select the version do you want to delete and click on the option delete commit which will delete the particular version .

 

As per below screen shot i have committed til version 4 and version 5 is in draft mode , i want to delete the version 4 ,so clicked on 3 dots on the right side where its asking to delete the commit and its delete the version 4.

Kindly refer the below screenshots where the selected version has been deleted and let me know if it helps.

 

 

Thanks & Regards

Bikram_


Yumura
Fan
  • Author
  • Fan
  • 2 replies
  • February 27, 2023

Thank you Bikram, I can’t edit my question but unfortunately I wanted to do it using Python SDK for streamsets.


saleempothiwala
Headliner
Forum|alt.badge.img

@Yumura 

 

In order to delete the last version of any pipeline, you will need this:

 

 pipeline=sch.pipelines.get(name="DeleteTest")
 sch.delete_pipeline(pipeline, only_selected_version=True)

 

here, sch is the instance of your Control Hub. The above two lines will delete the last version (committed or draft, any)

If you specify only_selected_version=False then the whole pipeline will be deleted.

 


Yumura
Fan
  • Author
  • Fan
  • 2 replies
  • February 27, 2023

Thankyou, it worked

 


Reply