此包使您能够使用简化的API使用bitbucket RESTapi
pygitbucket的Python项目详细描述
gitbucket是一个用Python编写的Bitbucket API包装器,它添加了Bitbucket管道等特性,同时保持了源repo的简单性。 它是从GearPlug/bitbucket-python分叉的
安装
pip install pygitbucket
新增功能
- [x] 增加了Bitbucket管道支持
使用
^{pr2}$获取用户信息
response = client.get_user()
获取存储库的帐户权限
response = client.get_privileges()
获取存储库
response = client.get_repositories()
获取存储库
response = client.get_repository('REPOSITORY_SLUG')
获取存储库的分支
response = client.get_repository_branches('REPOSITORY_SLUG')
获取存储库的标记
response = client.get_repository_tags('REPOSITORY_SLUG')
获取存储库的管道
response = client.get_repository_pipelines('REPOSITORY_SLUG')
获取存储库的最后10条管道
response = client.get_latest_pipelines('REPOSITORY_SLUG')
获取存储库的组件
response = client.get_repository_components('REPOSITORY_SLUG')
获取存储库的里程碑
response = client.get_repository_milestones('REPOSITORY_SLUG')
获取存储库的版本
response = client.get_repository_versions('REPOSITORY_SLUG')
创建问题
response = client.create_issue(repository_slug, title, description)
触发分支的管道部署
response = client.trigger_pipeline(repository_slug, branch_name)
获取所有问题
response = client.get_issues('REPOSITORY_SLUG')
获取问题
response = client.get_issue('REPOSITORY_SLUG', 'ISSUE_ID')
删除问题
response = client.delete_issue('REPOSITORY_SLUG', 'ISSUE_ID')
Webhooks
创建webhook
data = {
"description": "Webhook",
"url": "http://mywebsite.com",
"active": True,
"events": [
"repo:push",
"issue:created",
"issue:updated"
]
}
response = client.create_webhook('REPOSITORY_SLUG', data)
获取所有网络挂钩
response = client.get_webhooks('REPOSITORY_SLUG')
获取webhook
^{pr21}$删除webhook
response = client.delete_webhook('REPOSITORY_SLUG', 'WEBHOOK_ID')
要求
- 请求
- 项目
标签: