python-cnb 1.20.13__tar.gz → 1.21.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. {python_cnb-1.20.13/python_cnb.egg-info → python_cnb-1.21.13}/PKG-INFO +1 -1
  2. python_cnb-1.21.13/cnb/charge.py +72 -0
  3. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/issues.py +4 -0
  4. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/knowledgebase.py +24 -1
  5. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/dto.py +33 -1
  6. python_cnb-1.21.13/cnb/models/errors.py +11 -0
  7. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/registries.py +16 -0
  8. {python_cnb-1.20.13 → python_cnb-1.21.13/python_cnb.egg-info}/PKG-INFO +1 -1
  9. {python_cnb-1.20.13 → python_cnb-1.21.13}/python_cnb.egg-info/SOURCES.txt +1 -0
  10. {python_cnb-1.20.13 → python_cnb-1.21.13}/setup.py +1 -1
  11. python_cnb-1.20.13/cnb/charge.py +0 -22
  12. {python_cnb-1.20.13 → python_cnb-1.21.13}/LICENSE +0 -0
  13. {python_cnb-1.20.13 → python_cnb-1.21.13}/MANIFEST.in +0 -0
  14. {python_cnb-1.20.13 → python_cnb-1.21.13}/README.md +0 -0
  15. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/__init__.py +0 -0
  16. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/activities.py +0 -0
  17. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/ai.py +0 -0
  18. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/ai_ext.py +0 -0
  19. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/assets.py +0 -0
  20. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/badge.py +0 -0
  21. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/build.py +0 -0
  22. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/client.py +0 -0
  23. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/cnb.py +0 -0
  24. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/event.py +0 -0
  25. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/exceptions.py +0 -0
  26. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/followers.py +0 -0
  27. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/git.py +0 -0
  28. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/gitsettings.py +0 -0
  29. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/members.py +0 -0
  30. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/missions.py +0 -0
  31. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/__init__.py +0 -0
  32. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/api.py +0 -0
  33. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/chart.py +0 -0
  34. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/constant.py +0 -0
  35. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/convert.py +0 -0
  36. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/die.py +0 -0
  37. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/flags.py +0 -0
  38. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.py +0 -0
  39. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/git_woa_com_cnb_monorepo_git_internal_app_vcs_service_bff_api.py +0 -0
  40. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/git_woa_com_cnb_monorepo_platform_service_api_internal_models_artifactory_dto.py +0 -0
  41. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/member.py +0 -0
  42. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/models.py +0 -0
  43. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/openapi.py +0 -0
  44. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/organization.py +0 -0
  45. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/models/web.py +0 -0
  46. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/organizations.py +0 -0
  47. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/pulls.py +0 -0
  48. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/rank.py +0 -0
  49. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/releases.py +0 -0
  50. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/repocodeissue.py +0 -0
  51. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/repocontributor.py +0 -0
  52. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/repolabels.py +0 -0
  53. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/repositories.py +0 -0
  54. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/search.py +0 -0
  55. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/security.py +0 -0
  56. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/starring.py +0 -0
  57. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/users.py +0 -0
  58. {python_cnb-1.20.13 → python_cnb-1.21.13}/cnb/workspace.py +0 -0
  59. {python_cnb-1.20.13 → python_cnb-1.21.13}/pyproject.toml +0 -0
  60. {python_cnb-1.20.13 → python_cnb-1.21.13}/python_cnb.egg-info/dependency_links.txt +0 -0
  61. {python_cnb-1.20.13 → python_cnb-1.21.13}/python_cnb.egg-info/requires.txt +0 -0
  62. {python_cnb-1.20.13 → python_cnb-1.21.13}/python_cnb.egg-info/top_level.txt +0 -0
  63. {python_cnb-1.20.13 → python_cnb-1.21.13}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-cnb
3
- Version: 1.20.13
3
+ Version: 1.21.13
4
4
  Summary: CNB OpenAPI的Python SDK,方便与CNB平台进行交互
5
5
  Home-page: https://cnb.cool
6
6
  Author: Tencent Cloud
@@ -0,0 +1,72 @@
1
+ # Code generated by cnb.cool/cnb/sdk/cnb-sdk-generator. DO NOT EDIT.
2
+ # source: https://api.cnb-dev.woa.com/swagger.json
3
+
4
+ from typing import Optional
5
+ from .models import dto
6
+ class ChargeService:
7
+ def __init__(self, client):
8
+ self._client = client
9
+
10
+ # 获取组织各资源类型当月额度
11
+ def get_quota(self,
12
+ slug: str,
13
+ ) -> dto.VolumeQuotaResp:
14
+ u = "/%s/-/charge/quota" % (slug, )
15
+
16
+ data = self._client.request(
17
+ method="GET",
18
+ endpoint=u,
19
+ )
20
+ return dto.VolumeQuotaResp.safe_parse(data)
21
+
22
+ # 分页获取组织仓库用量
23
+ def get_repos_volume(self,
24
+ slug: str,
25
+ type: Optional[str] = None,
26
+ page: Optional[int] = None,
27
+ page_size: Optional[int] = None,
28
+ ) -> list[dto.RepoVolume]:
29
+ u = "/%s/-/charge/repos-volume" % (slug, )
30
+
31
+ query_params = {
32
+ "type": type,
33
+ "page": page,
34
+ "page_size": page_size,
35
+ }
36
+ data = self._client.request(
37
+ method="GET",
38
+ endpoint=u,
39
+ params=query_params,
40
+ )
41
+ return [dto.RepoVolume.safe_parse(item) for item in data]
42
+
43
+ # 查看特权额度
44
+ def get_special_amount(self,
45
+ slug: str,
46
+ ) -> dto.SpecialAmount:
47
+ u = "/%s/-/charge/special-amount" % (slug, )
48
+
49
+ data = self._client.request(
50
+ method="GET",
51
+ endpoint=u,
52
+ )
53
+ return dto.SpecialAmount.safe_parse(data)
54
+
55
+ # 获取根组织各资源用量
56
+ def get_volume(self,
57
+ slug: str,
58
+ month: Optional[str] = None,
59
+ ) -> dto.VolumeUsedResp:
60
+ u = "/%s/-/charge/volume" % (slug, )
61
+
62
+ query_params = {
63
+ "month": month,
64
+ }
65
+ data = self._client.request(
66
+ method="GET",
67
+ endpoint=u,
68
+ params=query_params,
69
+ )
70
+ return dto.VolumeUsedResp.safe_parse(data)
71
+
72
+
@@ -322,6 +322,8 @@ class IssuesService:
322
322
  updated_time_end: Optional[str] = None,
323
323
  close_time_begin: Optional[str] = None,
324
324
  close_time_end: Optional[str] = None,
325
+ created_time_begin: Optional[str] = None,
326
+ created_time_end: Optional[str] = None,
325
327
  order_by: Optional[str] = None,
326
328
  ) -> list[api.UserIssue]:
327
329
  u = "/user/issues" % ()
@@ -338,6 +340,8 @@ class IssuesService:
338
340
  "updated_time_end": updated_time_end,
339
341
  "close_time_begin": close_time_begin,
340
342
  "close_time_end": close_time_end,
343
+ "created_time_begin": created_time_begin,
344
+ "created_time_end": created_time_end,
341
345
  "order_by": order_by,
342
346
  }
343
347
  data = self._client.request(
@@ -43,7 +43,7 @@ class KnowledgebaseService:
43
43
  )
44
44
  return [dto.EmbeddingModel.safe_parse(item) for item in data]
45
45
 
46
- # 查询知识库,使用文档:https://docs.cnb.cool/zh/ai/knowledge-base.html
46
+ # 查询知识库 [POST 接口已废弃,请使用 GET 替代]
47
47
  def query_knowledge_base(self,
48
48
  repo: str,
49
49
  body_params: dto.QueryKnowledgeBaseReq,
@@ -57,6 +57,29 @@ class KnowledgebaseService:
57
57
  )
58
58
  return [dto.QueryKnowledgeBaseRes.safe_parse(item) for item in data]
59
59
 
60
+ # 查询知识库,使用文档:https://docs.cnb.cool/zh/ai/knowledge-base.html
61
+ def query_knowledge_base_get(self,
62
+ repo: str,
63
+ query: Optional[str] = None,
64
+ top_k: Optional[int] = None,
65
+ score_threshold: Optional[float] = None,
66
+ metadata_filtering_conditions: Optional[str] = None,
67
+ ) -> list[dto.QueryKnowledgeBaseRes]:
68
+ u = "/%s/-/knowledge/base/query" % (repo, )
69
+
70
+ query_params = {
71
+ "query": query,
72
+ "top_k": top_k,
73
+ "score_threshold": score_threshold,
74
+ "metadata_filtering_conditions": metadata_filtering_conditions,
75
+ }
76
+ data = self._client.request(
77
+ method="GET",
78
+ endpoint=u,
79
+ params=query_params,
80
+ )
81
+ return [dto.QueryKnowledgeBaseRes.safe_parse(item) for item in data]
82
+
60
83
  # 全局语义搜索 NPC 角色
61
84
  def search_npc(self,
62
85
  key: Optional[str] = None,
@@ -113,7 +113,6 @@ class BuildCommonResult(CNBBaseModel):
113
113
  pass
114
114
  class BuildLogsResult(CNBBaseModel):
115
115
  data: Optional[list['LogInfo']] = Field(alias="data", default=None)
116
- init: Optional[bool] = Field(alias="init", default=None)
117
116
  timestamp: Optional[int] = Field(alias="timestamp", default=None)
118
117
  total: Optional[int] = Field(alias="total", default=None)
119
118
  pass
@@ -951,6 +950,10 @@ class QueryKnowledgeBaseRes(CNBBaseModel):
951
950
  metadata: Optional[Dict[str, 'object']] = Field(alias="metadata", default=None)
952
951
  score: Optional[float] = Field(alias="score", default=None)
953
952
  pass
953
+ class QuotaItem(CNBBaseModel):
954
+ free: Optional[int] = Field(alias="free", default=None)
955
+ total: Optional[int] = Field(alias="total", default=None)
956
+ pass
954
957
  class RankDetailWithIncr(CNBBaseModel):
955
958
  created_at: Optional[str] = Field(alias="created_at", default=None)
956
959
  description: Optional[str] = Field(alias="description", default=None)
@@ -1051,6 +1054,13 @@ class RepoStarUsers(CNBBaseModel):
1051
1054
  total: Optional[int] = Field(alias="total", default=None)
1052
1055
  users: Optional[list['StarUser']] = Field(alias="users", default=None)
1053
1056
  pass
1057
+ class RepoVolume(CNBBaseModel):
1058
+ is_deleted: Optional[bool] = Field(alias="is_deleted", default=None)
1059
+ resource_id: Optional[str] = Field(alias="resource_id", default=None)
1060
+ resource_type: Optional['constant.SlugType'] = Field(alias="resource_type", default=None)
1061
+ slug: Optional[str] = Field(alias="slug", default=None)
1062
+ volume: Optional[str] = Field(alias="volume", default=None)
1063
+ pass
1054
1064
  class Repos4User(CNBBaseModel):
1055
1065
  access: Optional['constant.AccessRole'] = Field(alias="access", default=None)
1056
1066
  created_at: Optional[str] = Field(alias="created_at", default=None)
@@ -1194,6 +1204,7 @@ class StartBuildReq(CNBBaseModel):
1194
1204
  sha: Optional[str] = Field(alias="sha", default=None)
1195
1205
  sync: Optional[str] = Field(alias="sync", default=None)
1196
1206
  tag: Optional[str] = Field(alias="tag", default=None)
1207
+ title: Optional[str] = Field(alias="title", default=None)
1197
1208
  pass
1198
1209
  class StartWorkspaceReq(CNBBaseModel):
1199
1210
  branch: Optional[str] = Field(alias="branch", default=None)
@@ -1237,6 +1248,9 @@ class UpdateMembersRequest(CNBBaseModel):
1237
1248
  access_level: Optional[str] = Field(alias="access_level", default=None)
1238
1249
  is_outside_collaborator: Optional[bool] = Field(alias="is_outside_collaborator", default=None)
1239
1250
  pass
1251
+ class UpdatePackageRequest(CNBBaseModel):
1252
+ description: Optional[str] = Field(alias="description", default=None)
1253
+ pass
1240
1254
  class UpdateUserInfoPayload(CNBBaseModel):
1241
1255
  address: Optional[str] = Field(alias="address", default=None)
1242
1256
  bio: Optional[str] = Field(alias="bio", default=None)
@@ -1357,6 +1371,24 @@ class UsersWithAccessLevelInSlug(CNBBaseModel):
1357
1371
  verified: Optional[int] = Field(alias="verified", default=None)
1358
1372
  verified_expire_in: Optional[str] = Field(alias="verified_expire_in", default=None)
1359
1373
  pass
1374
+ class VolumeQuotaResp(CNBBaseModel):
1375
+ ci_gpu_in_sec: Optional['QuotaItem'] = Field(alias="ci_gpu_in_sec", default=None)
1376
+ ci_in_sec: Optional['QuotaItem'] = Field(alias="ci_in_sec", default=None)
1377
+ credit_in_milli: Optional['QuotaItem'] = Field(alias="credit_in_milli", default=None)
1378
+ dev_gpu_in_sec: Optional['QuotaItem'] = Field(alias="dev_gpu_in_sec", default=None)
1379
+ dev_in_sec: Optional['QuotaItem'] = Field(alias="dev_in_sec", default=None)
1380
+ git_in_byte: Optional['QuotaItem'] = Field(alias="git_in_byte", default=None)
1381
+ object_in_byte: Optional['QuotaItem'] = Field(alias="object_in_byte", default=None)
1382
+ pass
1383
+ class VolumeUsedResp(CNBBaseModel):
1384
+ ci_gpu_in_sec: Optional[int] = Field(alias="ci_gpu_in_sec", default=None)
1385
+ ci_in_sec: Optional[int] = Field(alias="ci_in_sec", default=None)
1386
+ credit_in_milli: Optional[int] = Field(alias="credit_in_milli", default=None)
1387
+ dev_gpu_in_sec: Optional[int] = Field(alias="dev_gpu_in_sec", default=None)
1388
+ dev_in_sec: Optional[int] = Field(alias="dev_in_sec", default=None)
1389
+ git_in_byte: Optional[int] = Field(alias="git_in_byte", default=None)
1390
+ object_in_byte: Optional[int] = Field(alias="object_in_byte", default=None)
1391
+ pass
1360
1392
  class WorkspaceDeleteReq(CNBBaseModel):
1361
1393
  pipelineId: Optional[str] = Field(alias="pipelineId", default=None)
1362
1394
  sn: Optional[str] = Field(alias="sn", default=None)
@@ -0,0 +1,11 @@
1
+ # Code generated by cnb.cool/cnb/sdk/cnb-sdk-generator. DO NOT EDIT.
2
+ # source: https://api.cnb-dev.woa.com/swagger.json
3
+
4
+ from pydantic import Field
5
+ from enum import Enum
6
+ from typing import Optional, Dict
7
+ from .models import CNBBaseModel
8
+ class WebError(CNBBaseModel):
9
+ errcode: Optional[int] = Field(alias="errcode", default=None)
10
+ errmsg: Optional[str] = Field(alias="errmsg", default=None)
11
+ pass
@@ -181,4 +181,20 @@ class RegistriesService:
181
181
  )
182
182
  return [dto.Package.safe_parse(item) for item in data]
183
183
 
184
+ # 更新制品描述。Update the description of the specific package.
185
+ def update_package_description(self,
186
+ slug: str,
187
+ t: str,
188
+ name: str,
189
+ body_params: dto.UpdatePackageRequest,
190
+ ):
191
+ u = "/%s/-/packages/%s/%s/-/description" % (slug, t, name, )
192
+
193
+ data = self._client.request(
194
+ method="PUT",
195
+ endpoint=u,
196
+ json=body_params.to_dict(),
197
+ )
198
+ return
199
+
184
200
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-cnb
3
- Version: 1.20.13
3
+ Version: 1.21.13
4
4
  Summary: CNB OpenAPI的Python SDK,方便与CNB平台进行交互
5
5
  Home-page: https://cnb.cool
6
6
  Author: Tencent Cloud
@@ -43,6 +43,7 @@ cnb/models/constant.py
43
43
  cnb/models/convert.py
44
44
  cnb/models/die.py
45
45
  cnb/models/dto.py
46
+ cnb/models/errors.py
46
47
  cnb/models/flags.py
47
48
  cnb/models/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.py
48
49
  cnb/models/git_woa_com_cnb_monorepo_git_internal_app_vcs_service_bff_api.py
@@ -7,7 +7,7 @@ long_description = (this_directory / "README.md").read_text(encoding="utf-8")
7
7
 
8
8
  setup(
9
9
  name="python-cnb",
10
- version="1.20.13",
10
+ version="1.21.13",
11
11
  author="Tencent Cloud",
12
12
  author_email="ericdduan@tencent.com",
13
13
  description="CNB OpenAPI的Python SDK,方便与CNB平台进行交互",
@@ -1,22 +0,0 @@
1
- # Code generated by cnb.cool/cnb/sdk/cnb-sdk-generator. DO NOT EDIT.
2
- # source: https://api.cnb-dev.woa.com/swagger.json
3
-
4
- from typing import Optional
5
- from .models import dto
6
- class ChargeService:
7
- def __init__(self, client):
8
- self._client = client
9
-
10
- # 查看特权额度
11
- def get_special_amount(self,
12
- slug: str,
13
- ) -> dto.SpecialAmount:
14
- u = "/%s/-/charge/special-amount" % (slug, )
15
-
16
- data = self._client.request(
17
- method="GET",
18
- endpoint=u,
19
- )
20
- return dto.SpecialAmount.safe_parse(data)
21
-
22
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes