ibm-code-engine-sdk 4.22.0__tar.gz → 5.0.0__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.
- ibm_code_engine_sdk-5.0.0/PKG-INFO +319 -0
- ibm_code_engine_sdk-5.0.0/README.md +278 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/ibm_code_engine_sdk/code_engine_v2.py +987 -233
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/ibm_code_engine_sdk/version.py +1 -1
- ibm_code_engine_sdk-5.0.0/ibm_code_engine_sdk.egg-info/PKG-INFO +319 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/pyproject.toml +1 -1
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/setup.py +2 -4
- ibm_code_engine_sdk-4.22.0/PKG-INFO +0 -132
- ibm_code_engine_sdk-4.22.0/README.md +0 -91
- ibm_code_engine_sdk-4.22.0/ibm_code_engine_sdk.egg-info/PKG-INFO +0 -132
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/LICENSE +0 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/MANIFEST.in +0 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/ibm_code_engine_sdk/__init__.py +0 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/ibm_code_engine_sdk/common.py +0 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/ibm_code_engine_sdk/ibm_cloud_code_engine_v1.py +0 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/ibm_code_engine_sdk.egg-info/SOURCES.txt +0 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/ibm_code_engine_sdk.egg-info/dependency_links.txt +0 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/ibm_code_engine_sdk.egg-info/requires.txt +0 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/ibm_code_engine_sdk.egg-info/top_level.txt +0 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/ibm_code_engine_sdk.egg-info/zip-safe +0 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/requirements-dev.txt +0 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/requirements.txt +0 -0
- {ibm_code_engine_sdk-4.22.0 → ibm_code_engine_sdk-5.0.0}/setup.cfg +0 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ibm-code-engine-sdk
|
|
3
|
+
Version: 5.0.0
|
|
4
|
+
Summary: Python SDK for IBM Cloud Code Engine
|
|
5
|
+
Home-page: https://github.com/IBM/code-engine-python-sdk
|
|
6
|
+
Author: IBM
|
|
7
|
+
Author-email: IBM <coligo@de.ibm.com>
|
|
8
|
+
License: Apache 2.0
|
|
9
|
+
Project-URL: Homepage, https://github.com/IBM/code-engine-python-sdk
|
|
10
|
+
Keywords: ibm_code_engine_sdk,ibm-code-engine-sdk,Code Engine,Code-Engine,code engine,code-engine
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
19
|
+
Classifier: Intended Audience :: Developers
|
|
20
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: requests<3.0.0,>=2.32.4
|
|
27
|
+
Requires-Dist: urllib3<2.7.0,>=2.6.3
|
|
28
|
+
Requires-Dist: python_dateutil<3.0.0,>=2.5.3
|
|
29
|
+
Requires-Dist: ibm_cloud_sdk_core<4.0.0,>=3.16.0
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: coverage>=4.5.4; extra == "dev"
|
|
32
|
+
Requires-Dist: pylint<4.1.0,>=4.0.2; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest<9.1.0,>=9.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-cov<7.1.0,>=7.0.0; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-rerunfailures>=3.1; extra == "dev"
|
|
36
|
+
Requires-Dist: responses<1.0.0,>=0.12.1; extra == "dev"
|
|
37
|
+
Requires-Dist: black>=26.1.0; extra == "dev"
|
|
38
|
+
Dynamic: author
|
|
39
|
+
Dynamic: home-page
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+
<!--
|
|
43
|
+
[](https://github.com/semantic-release/semantic-release)
|
|
44
|
+
-->
|
|
45
|
+
# Python SDK for IBM Cloud Code Engine 5.0.0
|
|
46
|
+
|
|
47
|
+
Python client library to interact with the [IBM Cloud Code Engine API](https://cloud.ibm.com/apidocs/codeengine).
|
|
48
|
+
|
|
49
|
+
## Table of Contents
|
|
50
|
+
|
|
51
|
+
<!--
|
|
52
|
+
The TOC below is generated using the `markdown-toc` node package.
|
|
53
|
+
|
|
54
|
+
https://github.com/jonschlinkert/markdown-toc
|
|
55
|
+
|
|
56
|
+
You should regenerate the TOC after making changes to this file.
|
|
57
|
+
|
|
58
|
+
npx markdown-toc -i README.md
|
|
59
|
+
-->
|
|
60
|
+
|
|
61
|
+
<!-- toc -->
|
|
62
|
+
|
|
63
|
+
- [Overview](#overview)
|
|
64
|
+
- [Prerequisites](#prerequisites)
|
|
65
|
+
- [Breaking Changes (March 2026)](#breaking-changes-march-2026)
|
|
66
|
+
- [Installation](#installation)
|
|
67
|
+
- [Using the SDK](#using-the-sdk)
|
|
68
|
+
- [Questions](#questions)
|
|
69
|
+
- [Issues](#issues)
|
|
70
|
+
- [Open source @ IBM](#open-source--ibm)
|
|
71
|
+
- [Contributing](#contributing)
|
|
72
|
+
- [License](#license)
|
|
73
|
+
|
|
74
|
+
<!-- tocstop -->
|
|
75
|
+
|
|
76
|
+
## Overview
|
|
77
|
+
|
|
78
|
+
The IBM Cloud Code Engine Python SDK allows developers to programmatically interact with the following
|
|
79
|
+
IBM Cloud services:
|
|
80
|
+
|
|
81
|
+
Service Name | Imported Class Name
|
|
82
|
+
--- | ---
|
|
83
|
+
[IBM Cloud Code Engine V2](https://cloud.ibm.com/apidocs/codeengine/codeengine-v5.0.0) | CodeEngineV2
|
|
84
|
+
[IBM Cloud Code Engine V1](https://cloud.ibm.com/apidocs/codeengine/codeengine-v5.0.0) | IbmCloudCodeEngineV1
|
|
85
|
+
|
|
86
|
+
## Prerequisites
|
|
87
|
+
|
|
88
|
+
[ibm-cloud-onboarding]: https://cloud.ibm.com/registration
|
|
89
|
+
|
|
90
|
+
* An [IBM Cloud][ibm-cloud-onboarding] account.
|
|
91
|
+
* An IAM API key to allow the SDK to access your account. Create one [here](https://cloud.ibm.com/iam/apikeys).
|
|
92
|
+
* Python 3.9 or above.
|
|
93
|
+
|
|
94
|
+
## Breaking Changes (March 2026)
|
|
95
|
+
|
|
96
|
+
- **Service method renames (pluralization)**
|
|
97
|
+
Update list methods and their `operation_id`s accordingly:
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
# before
|
|
101
|
+
ce.list_allowed_outbound_destination(project_id, limit=100, start=token)
|
|
102
|
+
|
|
103
|
+
# after
|
|
104
|
+
ce.list_allowed_outbound_destinations(project_id, limit=100, start=token)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
# before
|
|
109
|
+
ce.list_persistent_data_store(project_id, limit=100, start=token)
|
|
110
|
+
|
|
111
|
+
# after
|
|
112
|
+
ce.list_persistent_data_stores(project_id, limit=100, start=token)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
- **Pager class renames**
|
|
116
|
+
Use the new pluralized pager classes and doc tag strings:
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
# before
|
|
120
|
+
pager = ibm_code_engine_sdk.code_engine_v2.AllowedOutboundDestinationPager(ce, project_id, limit=100)
|
|
121
|
+
|
|
122
|
+
# after
|
|
123
|
+
pager = ibm_code_engine_sdk.code_engine_v2.AllowedOutboundDestinationsPager(ce, project_id, limit=100)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
# before
|
|
128
|
+
pager = ibm_code_engine_sdk.code_engine_v2.PersistentDataStorePager(ce, project_id, limit=100)
|
|
129
|
+
|
|
130
|
+
# after
|
|
131
|
+
pager = ibm_code_engine_sdk.code_engine_v2.PersistentDataStoresPager(ce, project_id, limit=100)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
- **Allowed outbound destinations: new type & fields; constructor shape changes**
|
|
135
|
+
- New type supported: `"private_path_service_gateway"` (in addition to `"cidr_block"`). Update any branching/validation on `type`.
|
|
136
|
+
- New optional fields on `AllowedOutboundDestination` and subclasses:
|
|
137
|
+
- `name`, `status`, `status_details`
|
|
138
|
+
- Private Path specific: `private_path_service_gateway_crn`, `isolation_policy`
|
|
139
|
+
- 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.
|
|
140
|
+
|
|
141
|
+
- **Creation prototypes changed**
|
|
142
|
+
- `AllowedOutboundDestinationPrototype` now **requires** `name`.
|
|
143
|
+
- **CIDR prototype constructor order changed**:
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
from ibm_code_engine_sdk.code_engine_v2 import AllowedOutboundDestinationPrototypeCidrBlockDataPrototype
|
|
147
|
+
# before: (type, cidr_block, name)
|
|
148
|
+
# after: (type, name, cidr_block)
|
|
149
|
+
cidr_proto = AllowedOutboundDestinationPrototypeCidrBlockDataPrototype(
|
|
150
|
+
type="cidr_block",
|
|
151
|
+
name="allow-egress",
|
|
152
|
+
cidr_block="10.0.0.0/24",
|
|
153
|
+
)
|
|
154
|
+
```
|
|
155
|
+
- **New prototype for Private Path service**:
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
from ibm_code_engine_sdk.code_engine_v2 import (
|
|
159
|
+
AllowedOutboundDestinationPrototypePrivatePathServiceGatewayDataPrototype as PPSGProto
|
|
160
|
+
)
|
|
161
|
+
ppsg_proto = PPSGProto(
|
|
162
|
+
type="private_path_service_gateway",
|
|
163
|
+
name="pps-to-service-x",
|
|
164
|
+
private_path_service_gateway_crn="<pps_gateway_crn>",
|
|
165
|
+
isolation_policy="shared", # optional: "shared" | "dedicated"
|
|
166
|
+
)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
- **Patch models changed (do not send `type`)**
|
|
170
|
+
- Remove `type` from CIDR patch payloads; field and serialization removed:
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
from ibm_code_engine_sdk.code_engine_v2 import AllowedOutboundDestinationPatchCidrBlockDataPatch
|
|
174
|
+
|
|
175
|
+
patch = AllowedOutboundDestinationPatchCidrBlockDataPatch(cidr_block="10.0.1.0/24")
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
- New patch model for Private Path destinations:
|
|
179
|
+
|
|
180
|
+
```python
|
|
181
|
+
from ibm_code_engine_sdk.code_engine_v2 import AllowedOutboundDestinationPatchPrivatePathServiceGatewayDataPatch
|
|
182
|
+
|
|
183
|
+
pp_patch = AllowedOutboundDestinationPatchPrivatePathServiceGatewayDataPatch(
|
|
184
|
+
isolation_policy="dedicated" # "shared" | "dedicated"
|
|
185
|
+
)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
- **Probe model: `type` is now required**
|
|
189
|
+
When constructing `Probe`, set the protocol explicitly:
|
|
190
|
+
|
|
191
|
+
```python
|
|
192
|
+
from ibm_code_engine_sdk.code_engine_v2 import Probe
|
|
193
|
+
|
|
194
|
+
# before (omitted `type`)
|
|
195
|
+
# after (required)
|
|
196
|
+
probe = Probe(
|
|
197
|
+
type="http", # "http" or "tcp"
|
|
198
|
+
initial_delay=5,
|
|
199
|
+
timeout=2,
|
|
200
|
+
)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
- **Secret model: `format` is now required**
|
|
204
|
+
If you build `Secret` instances (e.g., in replace flows), you must set `format`:
|
|
205
|
+
|
|
206
|
+
```python
|
|
207
|
+
from ibm_code_engine_sdk.code_engine_v2 import Secret
|
|
208
|
+
|
|
209
|
+
secret = Secret(
|
|
210
|
+
entity_tag=etag,
|
|
211
|
+
format="generic", # set the appropriate format value
|
|
212
|
+
name="my-secret",
|
|
213
|
+
data={"key": "value"},
|
|
214
|
+
)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
- **Previously-optional fields are now required in several response models (affects re-use of response as request)**
|
|
218
|
+
These fields are validated as required in model deserialization; if you reuse response objects to send updates, you must provide them:
|
|
219
|
+
|
|
220
|
+
- `App`: `computed_env_variables`, `run_service_account`, `run_volume_mounts`
|
|
221
|
+
- `AppRevision`: `computed_env_variables`, `run_service_account`, `run_volume_mounts`
|
|
222
|
+
- `Build`: `run_build_params`
|
|
223
|
+
- `BuildRun`: `run_build_params`, `service_account`, `source_type`, `strategy_size`, `strategy_type`
|
|
224
|
+
- `Function`: `computed_env_variables`
|
|
225
|
+
- `FunctionRuntimeList`: `function_runtimes`
|
|
226
|
+
- `Job`: `computed_env_variables`, `run_service_account`, `run_volume_mounts`
|
|
227
|
+
- `JobRun`: `computed_env_variables`
|
|
228
|
+
|
|
229
|
+
**Example (BuildRun)**
|
|
230
|
+
|
|
231
|
+
```python
|
|
232
|
+
from ibm_code_engine_sdk.code_engine_v2 import BuildRun, BuildParam
|
|
233
|
+
|
|
234
|
+
build_run = BuildRun(
|
|
235
|
+
build_name="my-build",
|
|
236
|
+
name="run-1",
|
|
237
|
+
run_build_params=[BuildParam(name="ARG1", value="v")],
|
|
238
|
+
service_account="default",
|
|
239
|
+
source_type="git",
|
|
240
|
+
strategy_size="small",
|
|
241
|
+
strategy_type="buildpacks",
|
|
242
|
+
source_url="https://github.com/org/repo",
|
|
243
|
+
)
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
- **Allowed outbound destination CIDR model loosened & enriched**
|
|
247
|
+
- `entity_tag` and `name` are no longer required at construction time; they may be absent in incoming JSON.
|
|
248
|
+
- New status fields added (`status`, `status_details`). Update your parsing/logic if you inspect readiness.
|
|
249
|
+
|
|
250
|
+
- **New status details and helper models (if you consume detailed status)**
|
|
251
|
+
- `AllowedOutboundStatusDetails` base plus:
|
|
252
|
+
- `AllowedOutboundStatusDetailsPrivatePathServiceGatewayStatusDetails`
|
|
253
|
+
- Helper models:
|
|
254
|
+
- `EndpointGatewayDetails`
|
|
255
|
+
- `PrivatePathServiceGatewayDetails`
|
|
256
|
+
If you serialize/deserialize status detail trees, include these types.
|
|
257
|
+
|
|
258
|
+
- **Volume mount doc clarifications (no code changes)**
|
|
259
|
+
- `read_only` description now explicitly applies to mounts of type `'persistent_data_store'`.
|
|
260
|
+
- Name generation references `reference` (was `ref` in docstring).
|
|
261
|
+
|
|
262
|
+
- **Storage data enum expansion & doc update**
|
|
263
|
+
- `StorageData`/`StorageDataObjectStorageData` now enumerate more `bucket_location` values (regional/zone shorthands). If you validate these values client-side, include the new options.
|
|
264
|
+
- `StorageDataObjectStorageData` doc now specifies key/value constraints.
|
|
265
|
+
|
|
266
|
+
> **Migration checklist**
|
|
267
|
+
>
|
|
268
|
+
> - [ ] Rename `list_allowed_outbound_destination` → `list_allowed_outbound_destinations`.
|
|
269
|
+
> - [ ] Rename `list_persistent_data_store` → `list_persistent_data_stores`.
|
|
270
|
+
> - [ ] Switch pagers to pluralized classes.
|
|
271
|
+
> - [ ] Update API `version` upper bound if you set it.
|
|
272
|
+
> - [ ] For outbound destination **create**:
|
|
273
|
+
> - [ ] Provide `name` in prototypes.
|
|
274
|
+
> - [ ] For CIDR prototype, adjust constructor order to `(type, name, cidr_block)`.
|
|
275
|
+
> - [ ] Use new Private Path prototype when needed.
|
|
276
|
+
> - [ ] For outbound destination **patch**: remove `type`; use CIDR/Private Path specific patch models.
|
|
277
|
+
> - [ ] Set required fields now enforced in models (`Probe.type`, `Secret.format`, and the required lists/fields in `App`, `Build`, `BuildRun`, `Function`, `Job`, `JobRun`, etc.).
|
|
278
|
+
> - [ ] Include handling for new enum values: `private_path_service_gateway`, `status` values (`ready|failed|deploying`), and `isolation_policy` (`shared|dedicated`).
|
|
279
|
+
|
|
280
|
+
## Installation
|
|
281
|
+
|
|
282
|
+
To install, use `pip` or `easy_install`:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
pip install --upgrade "ibm_code_engine_sdk>=5.0.0"
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
or
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
easy_install --upgrade "ibm_code_engine_sdk>=5.0.0"
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## Using the SDK
|
|
295
|
+
Examples and a demo are available in the [examples](/examples) folder.
|
|
296
|
+
|
|
297
|
+
For general SDK usage information, please see [this link](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md)
|
|
298
|
+
|
|
299
|
+
## Questions
|
|
300
|
+
|
|
301
|
+
If you are having difficulties using this SDK or have a question about the IBM Cloud services,
|
|
302
|
+
please ask a question
|
|
303
|
+
[Stack Overflow](http://stackoverflow.com/questions/ask?tags=ibm-cloud).
|
|
304
|
+
|
|
305
|
+
## Issues
|
|
306
|
+
If you encounter an issue with the project, you are welcome to submit a
|
|
307
|
+
[bug report](https://github.com/IBM/code-engine-python-sdk/issues).
|
|
308
|
+
Before that, please search for similar issues. It's possible that someone has already reported the problem.
|
|
309
|
+
|
|
310
|
+
## Open source @ IBM
|
|
311
|
+
Find more open source projects on the [IBM Github Page](http://ibm.github.io/)
|
|
312
|
+
|
|
313
|
+
## Contributing
|
|
314
|
+
See [CONTRIBUTING.md](https://github.com/IBM/code-engine-python-sdk/blob/main/CONTRIBUTING.md).
|
|
315
|
+
|
|
316
|
+
## License
|
|
317
|
+
|
|
318
|
+
This SDK is released under the Apache 2.0 license.
|
|
319
|
+
The license's full text can be found in [LICENSE](https://github.com/IBM/code-engine-python-sdk/blob/main/LICENSE).
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
[](https://github.com/semantic-release/semantic-release)
|
|
3
|
+
-->
|
|
4
|
+
# Python SDK for IBM Cloud Code Engine 5.0.0
|
|
5
|
+
|
|
6
|
+
Python client library to interact with the [IBM Cloud Code Engine API](https://cloud.ibm.com/apidocs/codeengine).
|
|
7
|
+
|
|
8
|
+
## Table of Contents
|
|
9
|
+
|
|
10
|
+
<!--
|
|
11
|
+
The TOC below is generated using the `markdown-toc` node package.
|
|
12
|
+
|
|
13
|
+
https://github.com/jonschlinkert/markdown-toc
|
|
14
|
+
|
|
15
|
+
You should regenerate the TOC after making changes to this file.
|
|
16
|
+
|
|
17
|
+
npx markdown-toc -i README.md
|
|
18
|
+
-->
|
|
19
|
+
|
|
20
|
+
<!-- toc -->
|
|
21
|
+
|
|
22
|
+
- [Overview](#overview)
|
|
23
|
+
- [Prerequisites](#prerequisites)
|
|
24
|
+
- [Breaking Changes (March 2026)](#breaking-changes-march-2026)
|
|
25
|
+
- [Installation](#installation)
|
|
26
|
+
- [Using the SDK](#using-the-sdk)
|
|
27
|
+
- [Questions](#questions)
|
|
28
|
+
- [Issues](#issues)
|
|
29
|
+
- [Open source @ IBM](#open-source--ibm)
|
|
30
|
+
- [Contributing](#contributing)
|
|
31
|
+
- [License](#license)
|
|
32
|
+
|
|
33
|
+
<!-- tocstop -->
|
|
34
|
+
|
|
35
|
+
## Overview
|
|
36
|
+
|
|
37
|
+
The IBM Cloud Code Engine Python SDK allows developers to programmatically interact with the following
|
|
38
|
+
IBM Cloud services:
|
|
39
|
+
|
|
40
|
+
Service Name | Imported Class Name
|
|
41
|
+
--- | ---
|
|
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
|
|
44
|
+
|
|
45
|
+
## Prerequisites
|
|
46
|
+
|
|
47
|
+
[ibm-cloud-onboarding]: https://cloud.ibm.com/registration
|
|
48
|
+
|
|
49
|
+
* An [IBM Cloud][ibm-cloud-onboarding] account.
|
|
50
|
+
* An IAM API key to allow the SDK to access your account. Create one [here](https://cloud.ibm.com/iam/apikeys).
|
|
51
|
+
* Python 3.9 or above.
|
|
52
|
+
|
|
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
|
+
|
|
239
|
+
## Installation
|
|
240
|
+
|
|
241
|
+
To install, use `pip` or `easy_install`:
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
pip install --upgrade "ibm_code_engine_sdk>=5.0.0"
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
or
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
easy_install --upgrade "ibm_code_engine_sdk>=5.0.0"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Using the SDK
|
|
254
|
+
Examples and a demo are available in the [examples](/examples) folder.
|
|
255
|
+
|
|
256
|
+
For general SDK usage information, please see [this link](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md)
|
|
257
|
+
|
|
258
|
+
## Questions
|
|
259
|
+
|
|
260
|
+
If you are having difficulties using this SDK or have a question about the IBM Cloud services,
|
|
261
|
+
please ask a question
|
|
262
|
+
[Stack Overflow](http://stackoverflow.com/questions/ask?tags=ibm-cloud).
|
|
263
|
+
|
|
264
|
+
## Issues
|
|
265
|
+
If you encounter an issue with the project, you are welcome to submit a
|
|
266
|
+
[bug report](https://github.com/IBM/code-engine-python-sdk/issues).
|
|
267
|
+
Before that, please search for similar issues. It's possible that someone has already reported the problem.
|
|
268
|
+
|
|
269
|
+
## Open source @ IBM
|
|
270
|
+
Find more open source projects on the [IBM Github Page](http://ibm.github.io/)
|
|
271
|
+
|
|
272
|
+
## Contributing
|
|
273
|
+
See [CONTRIBUTING.md](https://github.com/IBM/code-engine-python-sdk/blob/main/CONTRIBUTING.md).
|
|
274
|
+
|
|
275
|
+
## License
|
|
276
|
+
|
|
277
|
+
This SDK is released under the Apache 2.0 license.
|
|
278
|
+
The license's full text can be found in [LICENSE](https://github.com/IBM/code-engine-python-sdk/blob/main/LICENSE).
|