11<!--
22[](https://github.com/semantic-release/semantic-release)
33-->
4- # Python SDK for IBM Cloud Code Engine 4.22 .0
4+ # Python SDK for IBM Cloud Code Engine 5.0 .0
55
66Python client library to interact with the [ IBM Cloud Code Engine API] ( https://cloud.ibm.com/apidocs/codeengine ) .
77
@@ -21,6 +21,7 @@ Python client library to interact with the [IBM Cloud Code Engine API](https://c
2121
2222- [ Overview] ( #overview )
2323- [ Prerequisites] ( #prerequisites )
24+ - [ Breaking Changes (March 2026)] ( #breaking-changes-march-2026 )
2425- [ Installation] ( #installation )
2526- [ Using the SDK] ( #using-the-sdk )
2627- [ Questions] ( #questions )
@@ -38,8 +39,8 @@ IBM Cloud services:
3839
3940Service Name | Imported Class Name
4041--- | ---
41- [ IBM Cloud Code Engine V2] ( https://cloud.ibm.com/apidocs/codeengine/codeengine-v4.22 .0 ) | CodeEngineV2
42- [ IBM Cloud Code Engine V1] ( https://cloud.ibm.com/apidocs/codeengine/codeengine-v4.22 .0 ) | IbmCloudCodeEngineV1
42+ [ IBM Cloud Code Engine V2] ( https://cloud.ibm.com/apidocs/codeengine/codeengine-v5.0 .0 ) | CodeEngineV2
43+ [ IBM Cloud Code Engine V1] ( https://cloud.ibm.com/apidocs/codeengine/codeengine-v5.0 .0 ) | IbmCloudCodeEngineV1
4344
4445## Prerequisites
4546
@@ -49,18 +50,204 @@ Service Name | Imported Class Name
4950* An IAM API key to allow the SDK to access your account. Create one [ here] ( https://cloud.ibm.com/iam/apikeys ) .
5051* Python 3.9 or above.
5152
53+ ## Breaking Changes (March 2026)
54+
55+ - ** Service method renames (pluralization)**
56+ Update list methods and their ` operation_id ` s accordingly:
57+
58+ ``` python
59+ # before
60+ ce.list_allowed_outbound_destination(project_id, limit = 100 , start = token)
61+
62+ # after
63+ ce.list_allowed_outbound_destinations(project_id, limit = 100 , start = token)
64+ ```
65+
66+ ```python
67+ # before
68+ ce.list_persistent_data_store(project_id, limit = 100 , start = token)
69+
70+ # after
71+ ce.list_persistent_data_stores(project_id, limit = 100 , start = token)
72+ ```
73+
74+ - ** Pager class renames**
75+ Use the new pluralized pager classes and doc tag strings:
76+
77+ ```python
78+ # before
79+ pager = ibm_code_engine_sdk.code_engine_v2.AllowedOutboundDestinationPager(ce, project_id, limit = 100 )
80+
81+ # after
82+ pager = ibm_code_engine_sdk.code_engine_v2.AllowedOutboundDestinationsPager(ce, project_id, limit = 100 )
83+ ```
84+
85+ ```python
86+ # before
87+ pager = ibm_code_engine_sdk.code_engine_v2.PersistentDataStorePager(ce, project_id, limit = 100 )
88+
89+ # after
90+ pager = ibm_code_engine_sdk.code_engine_v2.PersistentDataStoresPager(ce, project_id, limit = 100 )
91+ ```
92+
93+ - ** Allowed outbound destinations: new type & fields; constructor shape changes**
94+ - New type supported: `" private_path_service_gateway" ` (in addition to `" cidr_block" ` ). Update any branching/ validation on `type ` .
95+ - New optional fields on `AllowedOutboundDestination` and subclasses:
96+ - `name` , `status` , `status_details`
97+ - Private Path specific: `private_path_service_gateway_crn` , `isolation_policy`
98+ - Base classes `AllowedOutboundDestination` , `AllowedOutboundDestinationPatch` , `AllowedOutboundDestinationPrototype` , `AllowedOutboundStatusDetails` are now ** abstract** with expanded subclass sets. Instantiate the specific subclass instead, as before, but note the extended list .
99+
100+ - ** Creation prototypes changed**
101+ - `AllowedOutboundDestinationPrototype` now ** requires** `name` .
102+ - ** CIDR prototype constructor order changed** :
103+
104+ ```python
105+ from ibm_code_engine_sdk.code_engine_v2 import AllowedOutboundDestinationPrototypeCidrBlockDataPrototype
106+ # before: (type, cidr_block, name)
107+ # after: (type, name, cidr_block)
108+ cidr_proto = AllowedOutboundDestinationPrototypeCidrBlockDataPrototype(
109+ type = " cidr_block" ,
110+ name = " allow-egress" ,
111+ cidr_block = " 10.0.0.0/24" ,
112+ )
113+ ```
114+ - ** New prototype for Private Path service** :
115+
116+ ```python
117+ from ibm_code_engine_sdk.code_engine_v2 import (
118+ AllowedOutboundDestinationPrototypePrivatePathServiceGatewayDataPrototype as PPSGProto
119+ )
120+ ppsg_proto = PPSGProto(
121+ type = " private_path_service_gateway" ,
122+ name = " pps-to-service-x" ,
123+ private_path_service_gateway_crn = " <pps_gateway_crn>" ,
124+ isolation_policy = " shared" , # optional: "shared" | "dedicated"
125+ )
126+ ```
127+
128+ - ** Patch models changed (do not send `type ` )**
129+ - Remove `type ` from CIDR patch payloads; field and serialization removed:
130+
131+ ```python
132+ from ibm_code_engine_sdk.code_engine_v2 import AllowedOutboundDestinationPatchCidrBlockDataPatch
133+
134+ patch = AllowedOutboundDestinationPatchCidrBlockDataPatch(cidr_block = " 10.0.1.0/24" )
135+ ```
136+
137+ - New patch model for Private Path destinations:
138+
139+ ```python
140+ from ibm_code_engine_sdk.code_engine_v2 import AllowedOutboundDestinationPatchPrivatePathServiceGatewayDataPatch
141+
142+ pp_patch = AllowedOutboundDestinationPatchPrivatePathServiceGatewayDataPatch(
143+ isolation_policy = " dedicated" # "shared" | "dedicated"
144+ )
145+ ```
146+
147+ - ** Probe model: `type ` is now required**
148+ When constructing `Probe` , set the protocol explicitly:
149+
150+ ```python
151+ from ibm_code_engine_sdk.code_engine_v2 import Probe
152+
153+ # before (omitted `type`)
154+ # after (required)
155+ probe = Probe(
156+ type = " http" , # "http" or "tcp"
157+ initial_delay = 5 ,
158+ timeout = 2 ,
159+ )
160+ ```
161+
162+ - ** Secret model: `format ` is now required**
163+ If you build `Secret` instances (e.g., in replace flows), you must set `format ` :
164+
165+ ```python
166+ from ibm_code_engine_sdk.code_engine_v2 import Secret
167+
168+ secret = Secret(
169+ entity_tag = etag,
170+ format = " generic" , # set the appropriate format value
171+ name = " my-secret" ,
172+ data = {" key" : " value" },
173+ )
174+ ```
175+
176+ - ** Previously- optional fields are now required in several response models (affects re- use of response as request)**
177+ These fields are validated as required in model deserialization; if you reuse response objects to send updates, you must provide them:
178+
179+ - `App` : `computed_env_variables` , `run_service_account` , `run_volume_mounts`
180+ - `AppRevision` : `computed_env_variables` , `run_service_account` , `run_volume_mounts`
181+ - `Build` : `run_build_params`
182+ - `BuildRun` : `run_build_params` , `service_account` , `source_type` , `strategy_size` , `strategy_type`
183+ - `Function` : `computed_env_variables`
184+ - `FunctionRuntimeList` : `function_runtimes`
185+ - `Job` : `computed_env_variables` , `run_service_account` , `run_volume_mounts`
186+ - `JobRun` : `computed_env_variables`
187+
188+ ** Example (BuildRun)**
189+
190+ ```python
191+ from ibm_code_engine_sdk.code_engine_v2 import BuildRun, BuildParam
192+
193+ build_run = BuildRun(
194+ build_name = " my-build" ,
195+ name = " run-1" ,
196+ run_build_params = [BuildParam(name = " ARG1" , value = " v" )],
197+ service_account = " default" ,
198+ source_type = " git" ,
199+ strategy_size = " small" ,
200+ strategy_type = " buildpacks" ,
201+ source_url = " https://github.com/org/repo" ,
202+ )
203+ ```
204+
205+ - ** Allowed outbound destination CIDR model loosened & enriched**
206+ - ` entity_tag ` and ` name ` are no longer required at construction time; they may be absent in incoming JSON.
207+ - New status fields added (` status ` , ` status_details ` ). Update your parsing/logic if you inspect readiness.
208+
209+ - ** New status details and helper models (if you consume detailed status)**
210+ - ` AllowedOutboundStatusDetails ` base plus:
211+ - ` AllowedOutboundStatusDetailsPrivatePathServiceGatewayStatusDetails `
212+ - Helper models:
213+ - ` EndpointGatewayDetails `
214+ - ` PrivatePathServiceGatewayDetails `
215+ If you serialize/deserialize status detail trees, include these types.
216+
217+ - ** Volume mount doc clarifications (no code changes)**
218+ - ` read_only ` description now explicitly applies to mounts of type ` 'persistent_data_store' ` .
219+ - Name generation references ` reference ` (was ` ref ` in docstring).
220+
221+ - ** Storage data enum expansion & doc update**
222+ - ` StorageData ` /` StorageDataObjectStorageData ` now enumerate more ` bucket_location ` values (regional/zone shorthands). If you validate these values client-side, include the new options.
223+ - ` StorageDataObjectStorageData ` doc now specifies key/value constraints.
224+
225+ > ** Migration checklist**
226+ >
227+ > - [ ] Rename ` list_allowed_outbound_destination ` → ` list_allowed_outbound_destinations ` .
228+ > - [ ] Rename ` list_persistent_data_store ` → ` list_persistent_data_stores ` .
229+ > - [ ] Switch pagers to pluralized classes.
230+ > - [ ] Update API ` version ` upper bound if you set it.
231+ > - [ ] For outbound destination ** create** :
232+ > - [ ] Provide ` name ` in prototypes.
233+ > - [ ] For CIDR prototype, adjust constructor order to ` (type, name, cidr_block) ` .
234+ > - [ ] Use new Private Path prototype when needed.
235+ > - [ ] For outbound destination ** patch** : remove ` type ` ; use CIDR/Private Path specific patch models.
236+ > - [ ] Set required fields now enforced in models (` Probe.type ` , ` Secret.format ` , and the required lists/fields in ` App ` , ` Build ` , ` BuildRun ` , ` Function ` , ` Job ` , ` JobRun ` , etc.).
237+ > - [ ] Include handling for new enum values: ` private_path_service_gateway ` , ` status ` values (` ready|failed|deploying ` ), and ` isolation_policy ` (` shared|dedicated ` ).
238+
52239## Installation
53240
54241To install, use ` pip ` or ` easy_install ` :
55242
56243``` bash
57- pip install --upgrade " ibm_code_engine_sdk>=4.22 .0"
244+ pip install --upgrade " ibm_code_engine_sdk>=5.0 .0"
58245```
59246
60247or
61248
62249``` bash
63- easy_install --upgrade " ibm_code_engine_sdk>=4.22 .0"
250+ easy_install --upgrade " ibm_code_engine_sdk>=5.0 .0"
64251```
65252
66253## Using the SDK
0 commit comments