logo
0
0
Login

cnb_api_client

本仓库使用openapi-generator-cli生成,对cnb的API进行了openapi V3的适配,详见swagger.json

如需其他SDK(如java)可自行下载swagger.json进行生成

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
  • Package version: 1.0.0
  • Generator version: 7.12.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://docs.cnb.cool/

Requirements.

Python 3.8+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://cnb.cool/root/cnb_api_client.git

(you may need to run pip with root permission: sudo pip install git+https://cnb.cool/root/cnb_api_client.git)

Then import the package:

import cnb_api_client

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import cnb_api_client

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import cnb_api_client from cnb_api_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.cnb.cool # See configuration.py for a list of all supported configuration parameters. configuration = cnb_api_client.Configuration( host = "https://api.cnb.cool" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: BearerAuth configuration.api_key['BearerAuth'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['BearerAuth'] = 'Bearer' # Enter a context with an instance of the API client with cnb_api_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = cnb_api_client.ArtifactoryApi(api_client) slug = 'slug_example' # str | 仓库 slug type = 'type_example' # str | 制品类型 name = 'name_example' # str | 制品名称 tag = 'tag_example' # str | 制品标签 try: # Delete the specific tag under specific package api_instance.delete_package_tag(slug, type, name, tag) except ApiException as e: print("Exception when calling ArtifactoryApi->delete_package_tag: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.cnb.cool

ClassMethodHTTP requestDescription
ArtifactoryApidelete_package_tagDELETE /{slug}/-/packages/{type}/{name}/-/tag/{tag}Delete the specific tag under specific package
ArtifactoryApidelete_registryDELETE /{registry}删除制品仓库
ArtifactoryApidownload_quotas_by_project_nameGET /{slug}/-/packages/{type}/-/quotas/downloadDownload registry quota details
ArtifactoryApiget_packageGET /{slug}/-/packages/{type}/{name}Get the specific package
ArtifactoryApiget_package_tag_detailGET /{slug}/-/packages/{type}/{name}/-/tag/{tag}Get the specific tag under specific package
ArtifactoryApiget_quota_by_project_nameGET /{slug}/-/packages/{type}/-/quotaGet quota of specific registry
ArtifactoryApiget_quotas_by_project_nameGET /{slug}/-/packages/{type}/-/quotasGet quotas of packages under one registry
ArtifactoryApihead_packagesHEAD /{slug}/-/packagesHead all packages
ArtifactoryApilist_package_tagsGET /{slug}/-/packages/{type}/{pkgname}/-/tagsList all tags under specific package
ArtifactoryApilist_packagesGET /{slug}/-/packagesList all packages
AssetsApiget_commit_assetsGET /{repo}/-/commit-assets/download/{fileName}发起一个获取 commits 附件的请求,返回内容或者 302 到某个地址
AssetsApiget_filesGET /{repo}/-/files/{userIdKey}/{randomUUID}/{fileName}发起一个获取 files 的请求,返回内容或者 302 到某个地址
AssetsApiget_imgsGET /{repo}/-/imgs/{userIdKey}/{fileName}发起一个获取 imgs 的请求,返回内容或者 302 到某个地址
AssetsApiget_logosGET /{group}/-/logos/{size}发起一个获取 logo 的请求,返回内容或者 302 到某个地址
AssetsApiget_releases_assetGET /{repo}/-/releases/download/{fileName}发起一个获取 release 附件的请求,返回内容或者 302 到某个地址
AssetsApiget_user_avatarGET /users/{username}/avatar/{size}获取指定用户的用户头像
AssetsApiput_filesPUT /{repo}/-/files/{userIdKey}/{randomUUID}/{fileName}发起一个确认 files 的请求,上传的图片要调用此接口才能生效
AssetsApiput_imgsPUT /{repo}/-/imgs/{userIdKey}/{fileName}发起一个确认 imgs 的请求,上传的图片要调用此接口才能生效
AssetsApiput_logosPUT /{group}/-/logos确认上传的logo
AssetsApiupload_filesPOST /{repo}/-/upload/files发起一个上传 files(issue,pr 及其评论中文档,压缩包等)的请求,返回上传 cos 的 url 和 form 内容
AssetsApiupload_imgsPOST /{repo}/-/upload/imgs发起一个上传 imgs 的请求,返回上传 cos 的 url 和 form 内容
AssetsApiupload_logosPOST /{group}/-/upload/logos发起一个上传 logo 的请求,返回上传 cos 的 url 和 form 内容
AssetsApiupload_releasesPOST /{repo}/-/upload/releases/{tagName}发起一个上传 release 附件的请求,返回上传 cos 的 url 和 form 内容
BuildApiget_build_logsGET /{repo}/-/build/logs查询流水线构建列表
BuildApiget_build_statusGET /{repo}/-/build/status/{sn}查询流水线构建状态
BuildApistart_buildPOST /{repo}/-/build/start开始一个构建
BuildApistop_buildPOST /{repo}/-/build/stop/{sn}停止一个构建
CollaboratorsApiadd_members_of_groupPOST /{group}/-/members/{username}添加成员
CollaboratorsApiadd_members_of_missionPOST /{mission}/-/members/{username}添加成员
CollaboratorsApiadd_members_of_registryPOST /{registry}/-/members/{username}添加成员
CollaboratorsApiadd_members_of_repoPOST /{repo}/-/members/{username}添加成员
CollaboratorsApidelete_members_of_groupDELETE /{group}/-/members/{username}删除指定组织或仓库的直接成员, 包含两种场景: 1. 作为直接成员的用户自己退出 2. 由管理者移除指定的直接成员
CollaboratorsApidelete_members_of_repoDELETE /{repo}/-/members/{username}删除指定组织或仓库的直接成员, 包含两种场景: 1. 作为直接成员的用户自己退出 2. 由管理者移除指定的直接成员
CollaboratorsApidelete_outside_collaboratorsDELETE /{repo}/-/outside-collaborators/{username}删除指定仓库的外部贡献者, 包含两种场景: 1. 作为外部贡献者的用户自己退出仓库 2. 由仓库管理者移除指定的外部贡献者
CollaboratorsApilist_all_membersGET /{repo}/-/list-members获取指定仓库内的有效成员列表,包含继承成员
CollaboratorsApilist_inherit_members_of_groupGET /{group}/-/inherit-members获取指定组织或仓库内的继承成员
CollaboratorsApilist_inherit_members_of_repoGET /{repo}/-/inherit-members获取指定组织或仓库内的继承成员
CollaboratorsApilist_members_of_groupGET /{group}/-/members获取指定组织或仓库内的所有直接成员
CollaboratorsApilist_members_of_repoGET /{repo}/-/members获取指定组织或仓库内的所有直接成员
CollaboratorsApilist_outside_collaboratorsGET /{repo}/-/outside-collaborators获取指定仓库内的外部贡献者
CollaboratorsApitop_contributorsGET /{repo}/-/top-activity-users获取 top 贡献用户
CollaboratorsApiupdate_members_of_groupPUT /{group}/-/members/{username}更新指定组织或仓库内的直接成员权限信息
CollaboratorsApiupdate_members_of_repoPUT /{repo}/-/members/{username}更新指定组织或仓库内的直接成员权限信息
CollaboratorsApiupdate_outside_collaboratorsPUT /{repo}/-/outside-collaborators/{username}更新指定仓库的外部贡献者权限信息
ContributorsApiget_member_access_level_of_groupGET /{group}/-/members/access-level获取指定组织或仓库内, 访问成员在当前层级内的权限信息
ContributorsApiget_member_access_level_of_repoGET /{repo}/-/members/access-level获取指定组织或仓库内, 访问成员在当前层级内的权限信息
ContributorsApilist_member_access_level_of_groupGET /{group}/-/members/{username}/access-level获取指定组织或仓库内指定成员的权限信息, 结果按组织层级来展示, 包含上层组织的权限继承信息
ContributorsApilist_member_access_level_of_repoGET /{repo}/-/members/{username}/access-level获取指定组织或仓库内指定成员的权限信息, 结果按组织层级来展示, 包含上层组织的权限继承信息
FollowersApiget_followers_by_user_idGET /users/{username}/followers获取指定用户的粉丝列表
FollowersApiget_following_by_user_idGET /users/{username}/following获取指定用户的关注人列表
GitApicreate_blobPOST /{repo}/-/git/blobs创建一个 blob
GitApicreate_branchPOST /{repo}/-/git/branches创建新分支
GitApicreate_tagPOST /{repo}/-/git/tags创建一个 tag
GitApidelete_branchDELETE /{repo}/-/git/branches/{branch}删除指定分支
GitApidelete_commit_annotationDELETE /{repo}/-/git/commit-annotations/{sha}/{key}删除指定 commit 的元数据
GitApidelete_commit_assetDELETE /{repo}/-/git/commit-assets/{sha1}/{asset_id}删除指定 commit 的附件
GitApidelete_tagDELETE /{repo}/-/git/tags/{tag}删除指定标签
GitApidelete_tag_annotationDELETE /{repo}/-/git/tag-annotations/{tag_with_key}删除指定 tag 的元数据
GitApiget_archive_commit_changed_filesGET /{repo}/-/git/archive-commit-changed-files/{sha1}打包下载 commit 变更文件
GitApiget_archive_compare_changed_filesGET /{repo}/-/git/archive-compare-changed-files/{base_head}打包下载两次 ref 之间的变更文件
GitApiget_branchGET /{repo}/-/git/branches/{branch}查询指定分支
GitApiget_commitGET /{repo}/-/git/commits/{ref}查询指定 commit
GitApiget_commit_annotationsGET /{repo}/-/git/commit-annotations/{sha}查询指定 commit 的元数据
GitApiget_commit_annotations_in_batchPOST /{repo}/-/git/commit-annotations-in-batch查询指定 commit 的元数据
GitApiget_commit_assets_by_shaGET /{repo}/-/git/commit-assets/{sha1}查询指定 commit 的附件
GitApiget_commit_statusesGET /{repo}/-/git/commit-statuses/{commitish}查询指定 commit 的 check statuses
GitApiget_compare_commitsGET /{repo}/-/git/compare/{base_head}对比 base...head
GitApiget_contentGET /{repo}/-/git/contents/{file_path}查询仓库文件列表或文件
GitApiget_headGET /{repo}/-/git/head获取仓库默认分支
GitApiget_tagGET /{repo}/-/git/tags/{tag}查询指定 Tag
GitApiget_tag_annotationsGET /{repo}/-/git/tag-annotations/{tag}查询指定 tag 的元数据
GitApilist_branchesGET /{repo}/-/git/branches查询分支列表
GitApilist_commitsGET /{repo}/-/git/commits查询 commit 列表
GitApilist_tagsGET /{repo}/-/git/tags查询标签列表
GitApipost_commit_asset_upload_confirmationPOST /{repo}/-/git/commit-assets/{sha1}/asset-upload-confirmation/{token}/{asset_path}确认 Commit asset 上传完成
GitApipost_commit_asset_upload_urlPOST /{repo}/-/git/commit-assets/{sha1}/asset-upload-url新增一个 Commit asset
GitApiput_commit_annotationsPUT /{repo}/-/git/commit-annotations/{sha}设定指定 commit 的元数据
GitApiput_tag_annotationsPUT /{repo}/-/git/tag-annotations/{tag}设定指定 tag 的元数据
GitSettingsApidelete_branch_protectionDELETE /{repo}/-/settings/branch-protections/{id}删除仓库保护分支规则(openapi)
GitSettingsApiget_branch_protectionGET /{repo}/-/settings/branch-protections/{id}查询仓库保护分支规则(openapi)
GitSettingsApiget_pipeline_settingsGET /{repo}/-/settings/cloud-native-build查询仓库云原生构建设置(openapi)
GitSettingsApiget_pull_request_settingsGET /{repo}/-/settings/pull-request查询仓库合并请求设置(openapi)
GitSettingsApiget_push_limit_settingsGET /{repo}/-/settings/push-limit查询仓库推送设置(openapi)
GitSettingsApilist_branch_protectionsGET /{repo}/-/settings/branch-protections查询仓库保护分支规则列表(openapi)
GitSettingsApipatch_branch_protectionPATCH /{repo}/-/settings/branch-protections/{id}更新仓库保护分支规则(openapi)
GitSettingsApipost_branch_protectionPOST /{repo}/-/settings/branch-protections新增仓库保护分支规则(openapi)
GitSettingsApiput_pipeline_settingsPUT /{repo}/-/settings/cloud-native-build更新仓库云原生构建设置(openapi)
GitSettingsApiput_pull_request_settingsPUT /{repo}/-/settings/pull-request设置仓库推送设置(openapi)
GitSettingsApiput_push_limit_settingsPUT /{repo}/-/settings/push-limit设置仓库推送设置(openapi)
IssuesApicreate_issuePOST /{repo}/-/issues创建一个 Issue
IssuesApidelete_issue_labelDELETE /{repo}/-/issues/{number}/labels/{name}删除 Issue 标签
IssuesApidelete_issue_labelsDELETE /{repo}/-/issues/{number}/labels清空 Issue 标签
IssuesApiget_issueGET /{repo}/-/issues/{number}查询指定的 Issues
IssuesApiget_issue_commentGET /{repo}/-/issues/{number}/comments/{comment_id}获取一个 Issue Comment
IssuesApilist_issue_commentsGET /{repo}/-/issues/{number}/comments查询仓库的 Issue 评论列表
IssuesApilist_issue_labelsGET /{repo}/-/issues/{number}/labels查询 Issue 的标签(label) 列表
IssuesApilist_issuesGET /{repo}/-/issues查询仓库的 Issues
IssuesApipatch_issue_commentPATCH /{repo}/-/issues/{number}/comments/{comment_id}修改一个 Issue Comment
IssuesApipost_issue_commentPOST /{repo}/-/issues/{number}/comments创建一个 Issue Comment
IssuesApipost_issue_labelsPOST /{repo}/-/issues/{number}/labels新增 Issue 标签
IssuesApiput_issue_labelsPUT /{repo}/-/issues/{number}/labels设置 Issue 标签
IssuesApiupdate_issuePATCH /{repo}/-/issues/{number}更新一个 Issue
MissionsApidelete_missionDELETE /{mission}删除指定任务集
OrganizationsApicreate_organizationPOST /groups创建新组织
OrganizationsApidelete_organizationDELETE /{group}删除指定组织
OrganizationsApiget_groupGET /{group}获取指定组织信息
OrganizationsApiget_group_settingGET /{group}/-/settings获取指定组织的配置详情
OrganizationsApiget_groups_by_user_idGET /users/{username}/groups获取指定用户拥有权限的顶层组织列表
OrganizationsApilist_groupsGET /user/groups/{group}查询当前用户在指定组织下拥有指定权限的子组织列表
OrganizationsApilist_subgroupsGET /{group}/-/sub-groups获取指定组织下的子组织列表
OrganizationsApilist_top_groupsGET /user/groups获取当前用户拥有权限的顶层组织列表
OrganizationsApiupdate_group_avatarPUT /{group}/-/avatar更新组织头像 URL 地址
OrganizationsApiupdate_group_settingPUT /{group}/-/settings更新指定组织的配置, 可更新内容为: 是否对外隐藏组织成员
OrganizationsApiupdate_organizationPUT /{group}更新组织信息, 可更新的内容为: 组织描述, 组织展示名称, 组织网站, 组织联系邮箱
PullsApidelete_pull_labelDELETE /{repo}/-/pulls/{number}/labels/{name}删除 Pull 标签
PullsApidelete_pull_labelsDELETE /{repo}/-/pulls/{number}/labels清空 Pull 标签
PullsApiget_pullGET /{repo}/-/pulls/{number}[openapi] 查询指定 Pull
PullsApilist_pull_commentsGET /{repo}/-/pulls/{number}/comments[openapi] 查询 Pull Comments 列表
PullsApilist_pull_labelsGET /{repo}/-/pulls/{number}/labels查询 Pull 的标签(label) 列表
PullsApilist_pullsGET /{repo}/-/pulls[openapi] 查询 Pull 列表
PullsApilist_pulls_by_numbersGET /{repo}/-/pull-in-batch[openapi] 根据numbers查询 Pull 列表
PullsApimerge_pullPUT /{repo}/-/pulls/{number}/merge[openapi] 合并一个 Pull Request
PullsApipatch_pullPATCH /{repo}/-/pulls/{number}[openapi] 更新一个 Pull Request
PullsApipost_pullPOST /{repo}/-/pulls[openapi] 新增一个 Pull
PullsApipost_pull_commentPOST /{repo}/-/pulls/{number}/comments[openapi] 新增一个 Pull Comment
PullsApipost_pull_labelsPOST /{repo}/-/pulls/{number}/labels新增 Pull 标签
PullsApipost_pull_reviewPOST /{repo}/-/pulls/{number}/reviews新增一次 pull request 评审
PullsApiput_pull_labelsPUT /{repo}/-/pulls/{number}/labels设置 Pull 标签
ReleasesApidelete_releaseDELETE /{repo}/-/releases/{release_id}[openapi] 删除指定的 release
ReleasesApidelete_release_assetDELETE /{repo}/-/releases/{release_id}/assets/{asset_id}[openapi] 删除指定的 release asset
ReleasesApiget_release_assetGET /{repo}/-/releases/{release_id}/assets/{asset_id}[openapi] 查询指定的 release asset
ReleasesApiget_release_by_idGET /{repo}/-/releases/{release_id}[openapi] 根据 id 查询指定 release
ReleasesApiget_release_by_tagGET /{repo}/-/releases/tags/{tag}[openapi] 通过 tag 查询指定 release
ReleasesApilist_releasesGET /{repo}/-/releases[openapi] 查询 release 列表
ReleasesApipatch_releasePATCH /{repo}/-/releases/{release_id}[openapi] 更新 release
ReleasesApipost_releasePOST /{repo}/-/releases[openapi] 新增一个 Release
ReleasesApipost_release_asset_upload_confirmationPOST /{repo}/-/releases/{release_id}/asset-upload-confirmation/{token}/{asset_path}[openapi] 确认 Release asset 上传完成
ReleasesApipost_release_asset_upload_urlPOST /{repo}/-/releases/{release_id}/asset-upload-url[openapi] 新增一个 Release asset
RepoContributorApiget_repo_contributor_trendGET /{repo}/-/contributor/trend查询仓库贡献者前 100 名的详细趋势数据
RepoLabelsApidelete_labelDELETE /{repo}/-/labels/{name}删除指定的仓库标签 label
RepoLabelsApilist_labelsGET /{repo}/-/labels查询仓库的标签(label) 列表
RepoLabelsApipatch_labelPATCH /{repo}/-/labels/{name}更新标签信息
RepoLabelsApipost_labelPOST /{repo}/-/labels创建一个 标签
RepositoriesApicreate_a_forkPOST /{repo}/-/forksfork 仓库
RepositoriesApicreate_repoPOST /{group}/-/repos创建仓库
RepositoriesApidelete_repoDELETE /{repo}删除指定仓库
RepositoriesApiget_group_sub_reposGET /{group}/-/repos查询组织下访问用户有权限查看到仓库
RepositoriesApiget_pinned_repo_by_groupGET /{group}/-/pinned-repos获取指定组织的仓库墙列表
RepositoriesApiget_pinned_repo_by_idGET /users/{username}/pinned-repos获取指定用户的用户仓库墙
RepositoriesApiget_repoGET /{repo}获取指定仓库信息
RepositoriesApiget_reposGET /user/repos获取当前用户拥有指定权限及其以上权限的仓库
RepositoriesApiget_repos_by_user_nameGET /users/{username}/repos获取指定用户有指定以上权限并且客人态可见的仓库
RepositoriesApiget_user_all_stared_reposGET /user/stared-repos获取当前用户 star 的仓库列表
RepositoriesApilist_forks_reposGET /{repo}/-/forks获取指定仓库的 fork 列表
RepositoriesApiset_pinned_repo_by_groupPUT /{group}/-/pinned-repos更新指定组织仓库墙
RepositoriesApiupdate_repoPATCH /{repo}更新仓库信息, 可更新的内容为: 仓库简介, 仓库站点, 仓库主题, 开源许可证
StarringApiget_user_stared_reposGET /users/{username}/stared-repos获取指定用户的 star 仓库列表
StarringApilist_star_usersGET /{repo}/-/stars获取指定仓库的star用户列表
UsersApiauto_complete_sourceGET /user/autocomplete_source查询当前用户用户拥有指定权限的所有资源列表
UsersApiget_user_infoGET /user获取指定用户的详情信息
UsersApiget_user_info_by_nameGET /users/{username}获取指定用户的详情信息
UsersApiupdate_user_infoPOST /user更新指定用户的详情信息, 可更新内容为: 昵称, 个人签名, 微信公众号名称, 微信公众号二维码链接, 个人网站, 个人地址, 公司名称
WorkspaceApidelete_workspacePOST /workspace/delete删除我的云原生开发环境
WorkspaceApiget_workspace_detailGET /{repo}/-/workspace/detail/{sn}根据流水线sn查询云原生开发访问地址
WorkspaceApilist_workspacesGET /workspace/list获取我的云原生开发环境列表

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

BearerAuth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

cnb@tencent.com

About

No description, topics, or website provided.
Language
Python81.1%
Markdown18.7%
TOML0.1%
Mustache0%
Others0.1%