Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- from boto import datapipeline as DP
- conn = DP.connect_to_region("us-east-1")
- more_dp = True
- marker = None
- dps = []
- while more_dp:
- res = conn.list_pipelines(marker=marker)
- if res.get("hasMoreResults") and res["hasMoreResults"] == True:
- marker = res["marker"]
- dps.extend(res["pipelineIdList"])
- else:
- more_dp = False
- dps.extend(res["pipelineIdList"])
- for dp in dps:
- time.sleep(1) # prevent hitting rate limit
- definition = conn.get_pipeline_definition(dp["id"])
- for x in definition["pipelineObjects"]:
- for y in x["fields"]:
- if y.get("key") and y["key"] == "subnetId":
- if y["stringValue"] == "subnet-af36c284":
- print(dp["id"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement