Skip to content

Commit e6e044d

Browse files
feat(api): Updated python-sdk to adopt Code Engine API specification changes
1 parent 08a0ccd commit e6e044d

File tree

8 files changed

+2030
-27
lines changed

8 files changed

+2030
-27
lines changed

.travis.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,4 @@ install:
2828
- pip install setuptools=="60.8.2"
2929

3030
script:
31-
- make ci
32-
33-
deploy:
34-
- provider: pypi
35-
user: __token__
36-
password:
37-
secure: rY5xzjHyKA/F8VQWr5+7bi3JlxFSgbf26jSXlB1KGRhfVFK+pnk6o/SiRnrbMzkKBa3ApfLXTaNLq50rkVGgMHfYg5+bDxGcNt19YcLVqi2geEOOdOFBoBLQmg/mkYJEfvKZJPNjBcX8RntR0Z94N7sEXgoDU3ilbO0P72WZ5AQSL6VqZGKgoltuiultkRdox34r1cCMVDS9Rtg8DkJP81mNGn4orYavmQBJy8SWsy+4oOXJACIGtN2MA59ZmcIhHCqwmcBno40rDo1ANxt+8cAqPJkLosuF+64R8L/Hc3Vo3DVFd2DuREt5PfuSj8ZzfsA1xIrArsXnYCbc54agdUW/fMsOEK5YejfAV4M0Dp7X5xWHfAm2n/9pPYxRLsRKlUxgXbCK9quG2JjPsulbW6P99OgusqQVe0z/q9Y39Q0bcUvtjo04oFIWPqrRWt4ejgFm10R/+kymoZbfkRGXVJNFnUkxJuXGTnRDOjUlOh/qUwpXmevLPMllPKcV1qig69GWaPfPgQF0h0d7Yd38AgKN4+yBfkK4Tb7Dh7n53n/rvINh3l9s3ctcyluqUta+TO34BAzwwSM52F5VMQYKzrXTfMTjxmhRCPpeUHf+tTKVi344BMo8sjddsUxrhZBgYRnH9RmvK7q27vrf2yqsg+T7QUjEGRETid/+dZHSWtQ=
38-
repository: https://upload.pypi.org/legacy
39-
skip_cleanup: true
40-
on:
41-
python: '3.11'
42-
tags: true
31+
- make ci

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!--
33
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
44
-->
5-
# Python SDK for IBM Cloud Code Engine 4.1.1
5+
# Python SDK for IBM Cloud Code Engine 4.4.1
66

77
Python client library to interact with the [IBM Cloud Code Engine API](https://cloud.ibm.com/apidocs/codeengine).
88

@@ -39,8 +39,8 @@ IBM Cloud services:
3939

4040
Service Name | Imported Class Name
4141
--- | ---
42-
[IBM Cloud Code Engine V2](https://cloud.ibm.com/apidocs/codeengine/codeengine-v4.1.1) | CodeEngineV2
43-
[IBM Cloud Code Engine V1](https://cloud.ibm.com/apidocs/codeengine/codeengine-v4.1.1) | IbmCloudCodeEngineV1
42+
[IBM Cloud Code Engine V2](https://cloud.ibm.com/apidocs/codeengine/codeengine-v4.4.1) | CodeEngineV2
43+
[IBM Cloud Code Engine V1](https://cloud.ibm.com/apidocs/codeengine/codeengine-v4.4.1) | IbmCloudCodeEngineV1
4444

4545
## Prerequisites
4646

@@ -55,13 +55,13 @@ Service Name | Imported Class Name
5555
To install, use `pip` or `easy_install`:
5656

5757
```bash
58-
pip install --upgrade "ibm_code_engine_sdk>=4.1.1"
58+
pip install --upgrade "ibm_code_engine_sdk>=4.4.1"
5959
```
6060

6161
or
6262

6363
```bash
64-
easy_install --upgrade "ibm_code_engine_sdk>=4.1.1"
64+
easy_install --upgrade "ibm_code_engine_sdk>=4.4.1"
6565
```
6666

6767
## Using the SDK

examples/test_code_engine_v2_examples.py

Lines changed: 126 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import pytest
2323
from ibm_code_engine_sdk.code_engine_v2 import *
2424

25-
version = '2024-09-27'
25+
version = '2024-11-18'
2626

2727
#
2828
# This file provides an example of how to use the Code Engine service.
@@ -146,6 +146,112 @@ def test_get_project_example(self):
146146
except ApiException as e:
147147
pytest.fail(str(e))
148148

149+
@needscredentials
150+
def test_list_allowed_outbound_destination_example(self):
151+
"""
152+
list_allowed_outbound_destination request example
153+
"""
154+
try:
155+
print('\nlist_allowed_outbound_destination() result:')
156+
157+
# begin-list_allowed_outbound_destination
158+
159+
all_results = []
160+
pager = AllowedOutboundDestinationPager(
161+
client=code_engine_service,
162+
project_id='15314cc3-85b4-4338-903f-c28cdee6d005',
163+
limit=100,
164+
)
165+
while pager.has_next():
166+
next_page = pager.get_next()
167+
assert next_page is not None
168+
all_results.extend(next_page)
169+
170+
print(json.dumps(all_results, indent=2))
171+
172+
# end-list_allowed_outbound_destination
173+
except ApiException as e:
174+
pytest.fail(str(e))
175+
176+
@needscredentials
177+
def test_create_allowed_outbound_destination_example(self):
178+
"""
179+
create_allowed_outbound_destination request example
180+
"""
181+
try:
182+
print('\ncreate_allowed_outbound_destination() result:')
183+
184+
# begin-create_allowed_outbound_destination
185+
186+
allowed_outbound_destination_prototype_model = {
187+
'type': 'cidr_block',
188+
'cidr_block': 'testString',
189+
'name': 'testString',
190+
}
191+
192+
response = code_engine_service.create_allowed_outbound_destination(
193+
project_id='15314cc3-85b4-4338-903f-c28cdee6d005',
194+
allowed_outbound_destination=allowed_outbound_destination_prototype_model,
195+
)
196+
allowed_outbound_destination = response.get_result()
197+
198+
print(json.dumps(allowed_outbound_destination, indent=2))
199+
200+
# end-create_allowed_outbound_destination
201+
202+
except ApiException as e:
203+
pytest.fail(str(e))
204+
205+
@needscredentials
206+
def test_get_allowed_outbound_destination_example(self):
207+
"""
208+
get_allowed_outbound_destination request example
209+
"""
210+
try:
211+
print('\nget_allowed_outbound_destination() result:')
212+
213+
# begin-get_allowed_outbound_destination
214+
215+
response = code_engine_service.get_allowed_outbound_destination(
216+
project_id='15314cc3-85b4-4338-903f-c28cdee6d005',
217+
name='my-allowed-outbound-destination',
218+
)
219+
allowed_outbound_destination = response.get_result()
220+
221+
print(json.dumps(allowed_outbound_destination, indent=2))
222+
223+
# end-get_allowed_outbound_destination
224+
225+
except ApiException as e:
226+
pytest.fail(str(e))
227+
228+
@needscredentials
229+
def test_update_allowed_outbound_destination_example(self):
230+
"""
231+
update_allowed_outbound_destination request example
232+
"""
233+
try:
234+
print('\nupdate_allowed_outbound_destination() result:')
235+
236+
# begin-update_allowed_outbound_destination
237+
238+
allowed_outbound_destination_patch_model = {}
239+
240+
response = code_engine_service.update_allowed_outbound_destination(
241+
project_id='15314cc3-85b4-4338-903f-c28cdee6d005',
242+
name='my-allowed-outbound-destination',
243+
if_match='testString',
244+
allowed_outbound_destination=allowed_outbound_destination_patch_model,
245+
)
246+
allowed_outbound_destination = response.get_result()
247+
248+
print(json.dumps(allowed_outbound_destination, indent=2))
249+
250+
# end-update_allowed_outbound_destination
251+
252+
except ApiException as e:
253+
pytest.fail(str(e))
254+
149255
@needscredentials
150256
def test_get_project_egress_ips_example(self):
151257
"""
@@ -1244,6 +1350,25 @@ def test_delete_project_example(self):
12441350
except ApiException as e:
12451351
pytest.fail(str(e))
12461352

1353+
@needscredentials
1354+
def test_delete_allowed_outbound_destination_example(self):
1355+
"""
1356+
delete_allowed_outbound_destination request example
1357+
"""
1358+
try:
1359+
# begin-delete_allowed_outbound_destination
1360+
1361+
response = code_engine_service.delete_allowed_outbound_destination(
1362+
project_id='15314cc3-85b4-4338-903f-c28cdee6d005',
1363+
name='my-allowed-outbound-destination',
1364+
)
1365+
1366+
# end-delete_allowed_outbound_destination
1367+
print('\ndelete_allowed_outbound_destination() response status code: ', response.get_status_code())
1368+
1369+
except ApiException as e:
1370+
pytest.fail(str(e))
1371+
12471372
@needscredentials
12481373
def test_delete_app_example(self):
12491374
"""

0 commit comments

Comments
 (0)