oc-cdtapi 3.19.2__py3-none-any.whl → 3.19.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.
- oc_cdtapi/PgAPI.py +56 -0
- oc_cdtapi/PgQAPI.py +1 -1
- {oc_cdtapi-3.19.2.dist-info → oc_cdtapi-3.19.4.dist-info}/METADATA +1 -1
- {oc_cdtapi-3.19.2.dist-info → oc_cdtapi-3.19.4.dist-info}/RECORD +8 -8
- {oc_cdtapi-3.19.2.data → oc_cdtapi-3.19.4.data}/scripts/nexus.py +0 -0
- {oc_cdtapi-3.19.2.dist-info → oc_cdtapi-3.19.4.dist-info}/WHEEL +0 -0
- {oc_cdtapi-3.19.2.dist-info → oc_cdtapi-3.19.4.dist-info}/licenses/LICENSE +0 -0
- {oc_cdtapi-3.19.2.dist-info → oc_cdtapi-3.19.4.dist-info}/top_level.txt +0 -0
oc_cdtapi/PgAPI.py
CHANGED
@@ -11,6 +11,62 @@ class PostgresAPI(API.HttpAPI):
|
|
11
11
|
def __init__(self, *args, **kwargs):
|
12
12
|
super().__init__(*args, **kwargs)
|
13
13
|
|
14
|
+
def get_citypedms_by_citype_id(self, citype):
|
15
|
+
"""
|
16
|
+
Retrieve citypedms information for a given CI type ID.
|
17
|
+
|
18
|
+
This method fetches a list of citypedms entries containing id, ci_type_id,
|
19
|
+
dms_id, and gav_template for the specified CI type ID.
|
20
|
+
|
21
|
+
Args:
|
22
|
+
citype (str): The CI type ID to query.
|
23
|
+
|
24
|
+
Returns:
|
25
|
+
dict: A dictionary containing citypedms information with the following keys:
|
26
|
+
- id: The citypedms entry ID
|
27
|
+
- ci_type_id: The CI type ID
|
28
|
+
- dms_id: The DMS ID
|
29
|
+
- gav_template: The GAV (Group:Artifact:Version) template
|
30
|
+
|
31
|
+
Example:
|
32
|
+
>>> citypedms = api.get_citypedms_by_citype_id("CI123")
|
33
|
+
>>> print(citypedms['id'])
|
34
|
+
'CP456'
|
35
|
+
"""
|
36
|
+
req = f"rest/api/1/citypedms/{citype}"
|
37
|
+
res = self.get(req).json()
|
38
|
+
logging.debug(f'Using get_citypedms_by_citype_id to get information about {citype}')
|
39
|
+
|
40
|
+
return res
|
41
|
+
|
42
|
+
def get_citypedms_by_dms_id(self, dms_id):
|
43
|
+
"""
|
44
|
+
Retrieve citypedms information for a given DMS ID.
|
45
|
+
|
46
|
+
This method fetches a list of citypedms entries containing id, ci_type_id,
|
47
|
+
dms_id, and gav_template for the specified DMS ID (component ID).
|
48
|
+
|
49
|
+
Args:
|
50
|
+
dms_id (str): The DMS ID (component ID) to query.
|
51
|
+
|
52
|
+
Returns:
|
53
|
+
dict: A dictionary containing citypedms information with the following keys:
|
54
|
+
- id: The citypedms entry ID
|
55
|
+
- ci_type_id: The CI type ID
|
56
|
+
- dms_id: The DMS ID
|
57
|
+
- gav_template: The GAV (Group:Artifact:Version) template
|
58
|
+
|
59
|
+
Example:
|
60
|
+
>>> citypedms = api.get_citypedms_by_dms_id("DMS789")
|
61
|
+
>>> print(citypedms['gav_template'])
|
62
|
+
'com.example:{artifact}:{version}'
|
63
|
+
"""
|
64
|
+
req = f"rest/api/1/citypedms/{dms_id}?bycomponent=True"
|
65
|
+
res = self.get(req)
|
66
|
+
logging.debug(f'Using get_citypedms_by_dms_id to get information about {dms_id}')
|
67
|
+
|
68
|
+
return res.json()
|
69
|
+
|
14
70
|
def get_ci_type_by_code(self, request):
|
15
71
|
"""
|
16
72
|
Retrieve a list of ci type based on the provided ci type code.
|
oc_cdtapi/PgQAPI.py
CHANGED
@@ -137,7 +137,7 @@ class PgQAPI (object):
|
|
137
137
|
logging.debug('connected. [%s]' % conn)
|
138
138
|
return conn
|
139
139
|
logging.error('failed to connect')
|
140
|
-
|
140
|
+
raise ConnectionError('Failed to connect to postgres db')
|
141
141
|
|
142
142
|
def msg_proc_start(self, message_id):
|
143
143
|
# TODO add consumer ip
|
@@ -6,14 +6,14 @@ oc_cdtapi/DmsGetverAPI.py,sha256=ZPU4HlF59fngKu5mSFhtss3rlBuduffDOSm_y3XWrxk,155
|
|
6
6
|
oc_cdtapi/ForemanAPI.py,sha256=9r1MSOsubiSxM1sdzF2MHD7IcSwX9Y4UDJknHqQK07g,44255
|
7
7
|
oc_cdtapi/JenkinsAPI.py,sha256=lZ8pe3a4eb_6h53JE7QLuzOSlu7Sqatc9PQwWhio9Vg,15748
|
8
8
|
oc_cdtapi/NexusAPI.py,sha256=uU12GtHvKlWorFaPAnFcQ5AGEc94MZ5SdmfM2Pw3F7A,26122
|
9
|
-
oc_cdtapi/PgAPI.py,sha256=
|
10
|
-
oc_cdtapi/PgQAPI.py,sha256=
|
9
|
+
oc_cdtapi/PgAPI.py,sha256=9VQBDHvXupOQEo06OjBjacVrCQJ5eNE29epabQXgIfU,13256
|
10
|
+
oc_cdtapi/PgQAPI.py,sha256=CUN3TSvyglglJ5EgzIt-iE7PX6atKKycoPMHyLkT6oA,8658
|
11
11
|
oc_cdtapi/RundeckAPI.py,sha256=O3LmcFaHSz8UqeUyIHTTEMJncDD191Utd-iZaeJay2s,24243
|
12
12
|
oc_cdtapi/TestServer.py,sha256=HV97UWg2IK4gOYAp9yaMdwFUWsw9v66MxyZdI3qQctA,2715
|
13
13
|
oc_cdtapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
-
oc_cdtapi-3.19.
|
15
|
-
oc_cdtapi-3.19.
|
16
|
-
oc_cdtapi-3.19.
|
17
|
-
oc_cdtapi-3.19.
|
18
|
-
oc_cdtapi-3.19.
|
19
|
-
oc_cdtapi-3.19.
|
14
|
+
oc_cdtapi-3.19.4.data/scripts/nexus.py,sha256=4teqZ_KtCSrwHDJVgA7lkreteod4Xt5XJFZNbwb7E6E,6858
|
15
|
+
oc_cdtapi-3.19.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
16
|
+
oc_cdtapi-3.19.4.dist-info/METADATA,sha256=HdTpx0uFsVibNyg0EaYb7QaYYSWOdGnczQkUwnrUgsY,484
|
17
|
+
oc_cdtapi-3.19.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
18
|
+
oc_cdtapi-3.19.4.dist-info/top_level.txt,sha256=d4-5-D-0CSeSXYuLCP7-nIFCpjkfmJr-Y_muzds8iVU,10
|
19
|
+
oc_cdtapi-3.19.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|