clear-skies-cortex 2.0.3__py3-none-any.whl → 2.0.4__py3-none-any.whl
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.
- {clear_skies_cortex-2.0.3.dist-info → clear_skies_cortex-2.0.4.dist-info}/METADATA +1 -1
- clear_skies_cortex-2.0.4.dist-info/RECORD +28 -0
- clearskies_cortex/backends/cortex_backend.py +173 -38
- clearskies_cortex/columns/string_list.py +49 -5
- clearskies_cortex/dataclasses.py +177 -7
- clearskies_cortex/defaults/default_cortex_auth.py +46 -0
- clearskies_cortex/defaults/default_cortex_url.py +38 -0
- clearskies_cortex/models/cortex_catalog_entity.py +158 -1
- clearskies_cortex/models/cortex_catalog_entity_domain.py +29 -1
- clearskies_cortex/models/cortex_catalog_entity_group.py +26 -1
- clearskies_cortex/models/cortex_catalog_entity_scorecard.py +50 -1
- clearskies_cortex/models/cortex_catalog_entity_service.py +35 -1
- clearskies_cortex/models/cortex_catalog_entity_team.py +30 -1
- clearskies_cortex/models/cortex_catalog_entity_types.py +38 -1
- clearskies_cortex/models/cortex_entity_relationships.py +40 -1
- clearskies_cortex/models/cortex_model.py +24 -1
- clearskies_cortex/models/cortex_scorecard.py +42 -1
- clearskies_cortex/models/cortex_team.py +98 -1
- clearskies_cortex/models/cortex_team_category_tree.py +41 -1
- clearskies_cortex/models/cortex_team_department.py +37 -1
- clear_skies_cortex-2.0.3.dist-info/RECORD +0 -28
- {clear_skies_cortex-2.0.3.dist-info → clear_skies_cortex-2.0.4.dist-info}/WHEEL +0 -0
- {clear_skies_cortex-2.0.3.dist-info → clear_skies_cortex-2.0.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -18,7 +18,37 @@ from clearskies_cortex.models import cortex_team_category_tree
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
class CortexTeam(Model):
|
|
21
|
-
"""
|
|
21
|
+
"""
|
|
22
|
+
Model for Cortex teams.
|
|
23
|
+
|
|
24
|
+
This model represents teams in Cortex. Teams are organizational units that own and manage
|
|
25
|
+
services and other entities. Teams support hierarchical relationships through parent-child
|
|
26
|
+
connections.
|
|
27
|
+
|
|
28
|
+
The model connects to the Cortex API endpoint `teams` and provides navigation through
|
|
29
|
+
team hierarchies using CategoryTree relationships.
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from clearskies_cortex.models import CortexTeam
|
|
33
|
+
|
|
34
|
+
# Fetch all teams
|
|
35
|
+
teams = CortexTeam()
|
|
36
|
+
for team in teams:
|
|
37
|
+
print(f"Team: {team.get_name()}")
|
|
38
|
+
|
|
39
|
+
# Find a specific team
|
|
40
|
+
team = teams.find("team_tag=my-team")
|
|
41
|
+
|
|
42
|
+
# Navigate team hierarchy
|
|
43
|
+
if team.has_parents():
|
|
44
|
+
top_team = team.find_top_level_team()
|
|
45
|
+
print(f"Top-level team: {top_team.get_name()}")
|
|
46
|
+
|
|
47
|
+
if team.has_childeren():
|
|
48
|
+
for child in team.children:
|
|
49
|
+
print(f"Child team: {child.get_name()}")
|
|
50
|
+
```
|
|
51
|
+
"""
|
|
22
52
|
|
|
23
53
|
id_column_name: str = "team_tag"
|
|
24
54
|
|
|
@@ -33,26 +63,93 @@ class CortexTeam(Model):
|
|
|
33
63
|
"""Return the slug of the api endpoint for this model."""
|
|
34
64
|
return "teams"
|
|
35
65
|
|
|
66
|
+
"""
|
|
67
|
+
The unique tag identifier for the team.
|
|
68
|
+
"""
|
|
36
69
|
team_tag = String()
|
|
70
|
+
|
|
71
|
+
"""
|
|
72
|
+
The tag of the catalog entity associated with this team.
|
|
73
|
+
"""
|
|
37
74
|
catalog_entity_tag = String()
|
|
75
|
+
|
|
76
|
+
"""
|
|
77
|
+
Whether the team is archived.
|
|
78
|
+
"""
|
|
38
79
|
is_archived = Boolean()
|
|
80
|
+
|
|
81
|
+
"""
|
|
82
|
+
CategoryTree relationship for parent team navigation.
|
|
83
|
+
|
|
84
|
+
Uses CortexTeamCategoryTree to manage hierarchical team relationships.
|
|
85
|
+
"""
|
|
39
86
|
parent_team_tag = CategoryTree(
|
|
40
87
|
cortex_team_category_tree.CortexTeamCategoryTree,
|
|
41
88
|
load_relatives_strategy="individual",
|
|
42
89
|
tree_child_id_column_name="child_team_tag",
|
|
43
90
|
tree_parent_id_column_name="parent_team_tag",
|
|
44
91
|
)
|
|
92
|
+
|
|
93
|
+
"""
|
|
94
|
+
The parent team model instance.
|
|
95
|
+
"""
|
|
45
96
|
parent = BelongsToModel("parent_team_tag")
|
|
97
|
+
|
|
98
|
+
"""
|
|
99
|
+
List of direct child teams.
|
|
100
|
+
"""
|
|
46
101
|
children = CategoryTreeChildren("parent_team_tag")
|
|
102
|
+
|
|
103
|
+
"""
|
|
104
|
+
List of all ancestor teams (from immediate parent to root).
|
|
105
|
+
"""
|
|
47
106
|
ancestors = CategoryTreeAncestors("parent_team_tag")
|
|
107
|
+
|
|
108
|
+
"""
|
|
109
|
+
List of all descendant teams (all children recursively).
|
|
110
|
+
"""
|
|
48
111
|
descendants = CategoryTreeDescendants("parent_team_tag")
|
|
112
|
+
|
|
113
|
+
"""
|
|
114
|
+
JSON object containing external links associated with the team.
|
|
115
|
+
"""
|
|
49
116
|
links = Json()
|
|
117
|
+
|
|
118
|
+
"""
|
|
119
|
+
JSON object containing custom metadata for the team.
|
|
120
|
+
|
|
121
|
+
Includes the team name accessible via `get_name()`.
|
|
122
|
+
"""
|
|
50
123
|
metadata = Json()
|
|
124
|
+
|
|
125
|
+
"""
|
|
126
|
+
JSON object containing Slack channel configurations.
|
|
127
|
+
"""
|
|
51
128
|
slack_channels = Json()
|
|
129
|
+
|
|
130
|
+
"""
|
|
131
|
+
The type of team.
|
|
132
|
+
"""
|
|
52
133
|
type = String()
|
|
134
|
+
|
|
135
|
+
"""
|
|
136
|
+
JSON object containing team member information.
|
|
137
|
+
"""
|
|
53
138
|
members = Json()
|
|
139
|
+
|
|
140
|
+
"""
|
|
141
|
+
The unique identifier for the team.
|
|
142
|
+
"""
|
|
54
143
|
id = String()
|
|
144
|
+
|
|
145
|
+
"""
|
|
146
|
+
Timestamp of when the team was last updated.
|
|
147
|
+
"""
|
|
55
148
|
last_updated = Datetime()
|
|
149
|
+
|
|
150
|
+
"""
|
|
151
|
+
Search parameter: Include teams without members in results.
|
|
152
|
+
"""
|
|
56
153
|
include_teams_without_members = Boolean(is_searchable=True, is_temporary=True)
|
|
57
154
|
|
|
58
155
|
def get_name(self) -> str:
|
|
@@ -9,7 +9,28 @@ from clearskies_cortex.backends import CortexBackend, CortexTeamRelationshipBack
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class CortexTeamCategoryTree(Model):
|
|
12
|
-
"""
|
|
12
|
+
"""
|
|
13
|
+
Model for Cortex team hierarchy relationships.
|
|
14
|
+
|
|
15
|
+
This model represents the hierarchical relationships between teams in Cortex.
|
|
16
|
+
It is used internally by the CategoryTree column type to manage parent-child
|
|
17
|
+
team relationships.
|
|
18
|
+
|
|
19
|
+
The model connects to the Cortex API endpoint `teams/relationships` using the
|
|
20
|
+
CortexTeamRelationshipBackend to transform the API response into a format
|
|
21
|
+
suitable for clearskies CategoryTree operations.
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from clearskies_cortex.models import CortexTeamCategoryTree
|
|
25
|
+
|
|
26
|
+
# This model is typically used internally by CortexTeam
|
|
27
|
+
# Direct usage example:
|
|
28
|
+
tree = CortexTeamCategoryTree()
|
|
29
|
+
relationships = tree.where("parent_team_tag=my-parent-team")
|
|
30
|
+
for rel in relationships:
|
|
31
|
+
print(f"Child: {rel.child_team_tag}, Level: {rel.level}")
|
|
32
|
+
```
|
|
33
|
+
"""
|
|
13
34
|
|
|
14
35
|
id_column_name: str = "id"
|
|
15
36
|
|
|
@@ -20,8 +41,27 @@ class CortexTeamCategoryTree(Model):
|
|
|
20
41
|
"""Return the slug of the api endpoint for this model."""
|
|
21
42
|
return "teams/relationships"
|
|
22
43
|
|
|
44
|
+
"""
|
|
45
|
+
Unique identifier for the relationship record.
|
|
46
|
+
"""
|
|
23
47
|
id = Uuid()
|
|
48
|
+
|
|
49
|
+
"""
|
|
50
|
+
The tag of the parent team in the relationship.
|
|
51
|
+
"""
|
|
24
52
|
parent_team_tag = String()
|
|
53
|
+
|
|
54
|
+
"""
|
|
55
|
+
The tag of the child team in the relationship.
|
|
56
|
+
"""
|
|
25
57
|
child_team_tag = String()
|
|
58
|
+
|
|
59
|
+
"""
|
|
60
|
+
Whether this record represents a parent relationship.
|
|
61
|
+
"""
|
|
26
62
|
is_parent = Boolean()
|
|
63
|
+
|
|
64
|
+
"""
|
|
65
|
+
The depth level in the hierarchy (0 for direct parent/child).
|
|
66
|
+
"""
|
|
27
67
|
level = Integer()
|
|
@@ -8,7 +8,24 @@ from clearskies_cortex.backends import CortexBackend
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class CortexTeamDepartment(Model):
|
|
11
|
-
"""
|
|
11
|
+
"""
|
|
12
|
+
Model for Cortex team departments.
|
|
13
|
+
|
|
14
|
+
This model represents departments within teams in Cortex. Departments are organizational
|
|
15
|
+
subdivisions within teams that can have their own members and descriptions.
|
|
16
|
+
|
|
17
|
+
The model connects to the Cortex API endpoint `teams/departments` to fetch department data.
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from clearskies_cortex.models import CortexTeamDepartment
|
|
21
|
+
|
|
22
|
+
# Fetch all departments
|
|
23
|
+
departments = CortexTeamDepartment()
|
|
24
|
+
for dept in departments:
|
|
25
|
+
print(f"Department: {dept.name}")
|
|
26
|
+
print(f"Description: {dept.description}")
|
|
27
|
+
```
|
|
28
|
+
"""
|
|
12
29
|
|
|
13
30
|
backend = CortexBackend()
|
|
14
31
|
id_column_name: str = "department_tag"
|
|
@@ -18,8 +35,27 @@ class CortexTeamDepartment(Model):
|
|
|
18
35
|
"""Return the slug of the api endpoint for this model."""
|
|
19
36
|
return "teams/departments"
|
|
20
37
|
|
|
38
|
+
"""
|
|
39
|
+
The unique tag identifier for the department.
|
|
40
|
+
"""
|
|
21
41
|
department_tag = String()
|
|
42
|
+
|
|
43
|
+
"""
|
|
44
|
+
The tag of the catalog entity associated with this department.
|
|
45
|
+
"""
|
|
22
46
|
catalog_entity_tag = String()
|
|
47
|
+
|
|
48
|
+
"""
|
|
49
|
+
A description of the department's purpose and responsibilities.
|
|
50
|
+
"""
|
|
23
51
|
description = String()
|
|
52
|
+
|
|
53
|
+
"""
|
|
54
|
+
The human-readable name of the department.
|
|
55
|
+
"""
|
|
24
56
|
name = String()
|
|
57
|
+
|
|
58
|
+
"""
|
|
59
|
+
JSON object containing department member information.
|
|
60
|
+
"""
|
|
25
61
|
members = Json()
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
clearskies_cortex/__init__.py,sha256=SwFkNfKLJgcq2qE6YJ_78_JfeoRGojlKuR_3DymZZSQ,142
|
|
2
|
-
clearskies_cortex/dataclasses.py,sha256=rmSwJkMPwyfQltHuGzRRn9OrwMXKHajkG1jA39ix9lU,1446
|
|
3
|
-
clearskies_cortex/backends/__init__.py,sha256=Ek74kpJLE7ERY-6yhH2KwFO25gm3Yjz51laUApnhgnU,179
|
|
4
|
-
clearskies_cortex/backends/cortex_backend.py,sha256=kmF54P0W3eK2BpCAh4dpIBPmo6iWKU7oUYSPB-IG7IE,4149
|
|
5
|
-
clearskies_cortex/backends/cortex_team_relationship_backend.py,sha256=UiMZp0jcKvpx3tLbR8aMBS8-KIfECxJGiwM3fz8DmuM,7648
|
|
6
|
-
clearskies_cortex/columns/__init__.py,sha256=BpoVCEVXRtKcsyRFnAYLtlwYtHBjciUbzuzaBxmfH00,87
|
|
7
|
-
clearskies_cortex/columns/string_list.py,sha256=khsJS_0T4XZvTeXFpRvZsFX8iNTWbx_urCEa9Tv0Bmo,754
|
|
8
|
-
clearskies_cortex/defaults/__init__.py,sha256=tulZSvFgp4YUKj_bnArIevmlpC8z_AQKO0okYs4hCDo,216
|
|
9
|
-
clearskies_cortex/defaults/default_cortex_auth.py,sha256=yA5kCwGxPEdV2t-28UArkKXgI3qbxt-7P6az4cLI1Rg,508
|
|
10
|
-
clearskies_cortex/defaults/default_cortex_url.py,sha256=SaR6dQW3ELtuy4Woap8ufYL_zGQ0K0XwHUv0CYi_p78,305
|
|
11
|
-
clearskies_cortex/models/__init__.py,sha256=zckJ4-KOjIcmtN7h7lXOESUu3d6JBsZZJq-s2MJ0NLQ,1145
|
|
12
|
-
clearskies_cortex/models/cortex_catalog_entity.py,sha256=ASwCKiZ682YvsFUrkPo8J_MQYCT_39aElJGWDTDH7GQ,3060
|
|
13
|
-
clearskies_cortex/models/cortex_catalog_entity_domain.py,sha256=gApQwSIGO0UGxhkJo-aaDK7clCxmTQTzHcgCjdPAZEE,1386
|
|
14
|
-
clearskies_cortex/models/cortex_catalog_entity_group.py,sha256=dvuwwuj8Mwm0HgqVjkz1MpUycBAl9WUrDNC0XNGeWGk,514
|
|
15
|
-
clearskies_cortex/models/cortex_catalog_entity_scorecard.py,sha256=sWp_v7O9uY3VbJjdb_VWUPHgBIn-rRj6kZDHqZq4lXI,908
|
|
16
|
-
clearskies_cortex/models/cortex_catalog_entity_service.py,sha256=GeJmR9qfRjNFwxbJriJeTWMm4L4yH-z6wCXQWXAolg4,2780
|
|
17
|
-
clearskies_cortex/models/cortex_catalog_entity_team.py,sha256=mKVKjOMf0xOk53XJI8juPQzNSdHvmxI1bJWfQVCKEQQ,1364
|
|
18
|
-
clearskies_cortex/models/cortex_catalog_entity_types.py,sha256=EJBRv0ZMHwZ6HpaXxy0A_EBGqmu9EeVAZiX4xPIljz4,568
|
|
19
|
-
clearskies_cortex/models/cortex_entity_relationships.py,sha256=bB46YFK8Vc2SZsvobvFeyTfEj8YfcaXFaPnkW0o_nG4,607
|
|
20
|
-
clearskies_cortex/models/cortex_model.py,sha256=QmwQ45vuK4iUKCJsOk1pwu1at8IYKg39pYO9TtlYrEA,175
|
|
21
|
-
clearskies_cortex/models/cortex_scorecard.py,sha256=YlINfUGudmqQHe-0ZpD2qOzAUKWshUycwgXYEcxqsUk,663
|
|
22
|
-
clearskies_cortex/models/cortex_team.py,sha256=LXqHx_lwBvuVMyUlj1l2Sfpngj0zTZGpVi0WrJP-o3E,2246
|
|
23
|
-
clearskies_cortex/models/cortex_team_category_tree.py,sha256=PLC-9E5kuMeItow7RKFX7jKUiAfJ-7ehXIy3eeaFzr8,721
|
|
24
|
-
clearskies_cortex/models/cortex_team_department.py,sha256=DL3k91462-R0VVqbUQgBfYM_TndE5MKmDPBSF448XYw,639
|
|
25
|
-
clear_skies_cortex-2.0.3.dist-info/METADATA,sha256=aDSWFEtcMWOw5fGdQGg1B--y7ECfX89nyI1WRa-36jg,2117
|
|
26
|
-
clear_skies_cortex-2.0.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
27
|
-
clear_skies_cortex-2.0.3.dist-info/licenses/LICENSE,sha256=MkEX8JF8kZxdyBpTTcB0YTd-xZpWnHvbRlw-pQh8u58,1069
|
|
28
|
-
clear_skies_cortex-2.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|