要获取Bitbucket Cloud Source Repository使用的IP范围,可以使用Bitbucket的API来获取该信息。以下是一个Python代码示例:
import requests
# 请求Bitbucket的API来获取IP范围
response = requests.get('https://api.bitbucket.org/2.0/meta/ip-whitelist')
# 获取响应结果
data = response.json()
# 提取IP范围
cidr_ranges = data['ranges']['ipv4_cidrs']
# 打印IP范围
for cidr in cidr_ranges:
print(cidr)
运行此代码将打印Bitbucket Cloud Source Repository使用的IP范围。