Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import time
  2. from boto import datapipeline as DP
  3.  
  4. conn = DP.connect_to_region("us-east-1")
  5. more_dp = True
  6. marker = None
  7. dps = []
  8. while more_dp:
  9. res = conn.list_pipelines(marker=marker)
  10. if res.get("hasMoreResults") and res["hasMoreResults"] == True:
  11. marker = res["marker"]
  12. dps.extend(res["pipelineIdList"])
  13. else:
  14. more_dp = False
  15. dps.extend(res["pipelineIdList"])
  16.  
  17. for dp in dps:
  18. time.sleep(1) # prevent hitting rate limit
  19. definition = conn.get_pipeline_definition(dp["id"])
  20. for x in definition["pipelineObjects"]:
  21. for y in x["fields"]:
  22. if y.get("key") and y["key"] == "subnetId":
  23. if y["stringValue"] == "subnet-af36c284":
  24. print(dp["id"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement