Introduction
IBM Cloud Code Engine is a fully managed, serverless platform that runs your containerized workloads, including web apps, micro-services, event-driven functions, or batch jobs. Code Engine even builds container images for you from your source code. All these workloads can seamlessly work together because they are all hosted within the same Kubernetes infrastructure. The Code Engine experience is designed so that you can focus on writing code and not on the infrastructure that is needed to host it. For more information about Code Engine, see Getting started with Code Engine.
These code examples use the client library that is provided for Java.
Maven example:
<dependency>
<groupId>com.ibm.cloud</groupId>
<artifactId>code-engine</artifactId>
<version>4.10.0</version>
</dependency>
Gradle example:
compile 'com.ibm.cloud:code-engine:4.10.0'
For more information, view the project on GitHub: https://github.com/IBM/code-engine-java-sdk. See also Using the SDK.
These code examples use the client library that is provided for Node.js.
Installation:
npm install @ibm-cloud/ibm-code-engine-sdk
For more information, view the project on GitHub: https://github.com/IBM/code-engine-node-sdk. See also Using the SDK.
These code examples use the client library that is provided for Python.
Installation:
pip install --upgrade "ibm_code_engine_sdk>=4.1.1"
For more information, view the project on GitHub: https://github.com/IBM/code-engine-python-sdk. See also Using the SDK.
These code examples uses the SDK library that is provided for Go.
Run the go get
command to retrieve the toolchain SDK and add it to the GOPATH
workspace or to the project's Go module dependencies.
go get -u github.com/IBM/code-engine-go-sdk/codeenginev2
To use the SDK within a program, import the package by running the go build
or go mod tidy
commands to load the package.
import "github.com/IBM/code-engine-go-sdk/codeenginev2"
For more information, view the project on GitHub: https://github.com/IBM/code-engine-go-sdk. See also Using the SDK.
Authentication
You can create and manage Identity and Access Management (IAM)-based projects in Code Engine. IAM-based projects are created in resource groups and are managed with IAM access policies.
This API requires IAM authentication. You can retrieve your IAM access token by running the ibmcloud iam oauth-tokens
command. You must pass the IAM token in the Authorization
header.
For more information about using IAM with Code Engine APIs, see the API reference.
The curl
examples require a bearer token. You can retrieve a token with the following command.
ibmcloud iam oauth-tokens --output json
You can also use jq
to get clean output.
token=`ibmcloud iam oauth-tokens --output json | jq .iam_token -r`
import com.ibm.cloud.sdk.core.security.IamAuthenticator;
import com.ibm.cloud.sdk.core.service.exception.ServiceResponseException;
IamAuthenticator authenticator = new IamAuthenticator.Builder().apikey(System.getenv("CE_API_KEY"))
.clientId("bx").clientSecret("bx").url("https://iam.cloud.ibm.com").build();
For System.getenv("CE_API_KEY")
to work, you must provide an IBM Cloud IAM API key inside your runtime environment as variable CE_API_KEY
.
import { IamAuthenticator, UserOptions } from 'ibm-cloud-sdk-core';
// Initialize the IAM authenticator using an API key
const authenticator = new IamAuthenticator({
apikey: process.env.CE_API_KEY,
clientId: 'bx',
clientSecret: 'bx',
url: 'https://iam.cloud.ibm.com',
});
For process.env.CE_API_KEY
to work, you must provide an IBM Cloud IAM API key inside your runtime environment as variable CE_API_KEY
.
import os
import time
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
# Initialize the IAM authenticator using an API key
authenticator = IAMAuthenticator(os.environ.get(
'CE_API_KEY'), url='https://iam.cloud.ibm.com')
For os.environ.get('CE_API_KEY')
to work, you must provide an IBM Cloud IAM API key inside your runtime environment as variable CE_API_KEY
.
import "github.com/IBM/go-sdk-core/v5/core"
// Initialize the IAM authenticator using an API key
authenticator := &core.IamAuthenticator{
ApiKey: os.Getenv("CE_API_KEY"),
ClientId: "bx",
ClientSecret: "bx",
URL: "https://iam.cloud.ibm.com",
}
For os.Getenv("CE_API_KEY")
to work, you must provide an IBM Cloud IAM API key inside your runtime environment as variable CE_API_KEY
.
Endpoint URLs
The endpont URLs are based on the region of the service instance. For example, when Code Engine is hosted in Dallas, TX (us-south
), the base URL is https://api.us-south.codeengine.cloud.ibm.com.
To find out which URL to use, view the service credentials by clicking the service instance in the Resource list from the console. Use that URL in your requests to Code Engine.
All regions might not support Code Engine. For more information, see Regions.
The version information is appended to the base URL to access resources. For example /v2
, resulting in the URL https://api.us-south.codeengine.cloud.ibm.com/v2 for Dallas, TX (us-south
).
Example API request
curl -X {request_method} "https://api.{region}.codeengine.cloud.ibm.com/v2{method_endpoint}"
Replace {request_method}
, {region}
and {method_endpoint}
in this example with the values for your specific API call.
For more information about endpoints by region, see Regions.
import com.ibm.cloud.code_engine.code_engine.v2.CodeEngine;
// Construct the Code Engine client using the IAM authenticator.
CodeEngine service = new CodeEngine("Code Engine Client", authenticator);
service.setServiceUrl("https://api." + REGION + ".codeengine.cloud.ibm.com/v2");
Replace REGION
with the identifier of the region that you are going to use, for example us-east
.
For more information about endpoints by region, see Regions.
import CodeEngineV2 from "@ibm-cloud/ibm-code-engine-sdk/dist/code-engine/v2";
const codeEngineApiEndpoint = `https://api.${REGION}.codeengine.cloud.ibm.com/v2`;
// Construct the Code Engine client using the IAM authenticator.
const options: UserOptions = {
authenticator,
serviceUrl: codeEngineApiEndpoint,
};
const codeEngineService = CodeEngineV2.newInstance(options);
Replace REGION
with the identifier of the region that you are going to use, for example us-east
.
For more information about endpoints by region, see Regions.
Setting up a Code Engine client by passing the previously instantiated IAM authenticator.
from ibm_code_engine_sdk.code_engine_v2 import CodeEngineV2
service = CodeEngineV2(authenticator=authenticator)
service.set_service_url('https://api.'+REGION+'.codeengine.cloud.ibm.com/v2')
Replace REGION
with the identifier of the region that you are going to use, for example us-east
.
For more information about endpoints by region, see Regions.
Setting up a Code Engine client by passing the previously instantiated IAM authenticator.
ceClient, err := codeenginev2.NewCodeEngineV2(&codeenginev2.CodeEngineV2Options{
Authenticator: authenticator,
URL: "https://api."+ REGION + ".codeengine.cloud.ibm.com/v2",
})
if err != nil {
fmt.Printf("NewCodeEngineV2 error: %s\n", err.Error())
os.Exit(1)
return
}
Replace REGION
with the identifier of the region that you are going to use, for example us-east
.
For more information about endpoints by region, see Regions.
Error handling
This API uses standard HTTP response codes to indicate whether a method completed or the type of error that occurred.
HTTP error code | Description | Recovery |
---|---|---|
200 |
Success | The request was successful. |
400 |
Bad Request | The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request. |
401 |
Unauthorized | You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions. |
403 |
Forbidden | The supplied authentication is not authorized to access '{project}'. Check that you have the correct access credentials and permissions. |
404 |
Not Found | The requested resource could not be found. Check that the namespace ID is correct and try again. |
408 |
Request Timeout | The connection to the server timed out. Wait a few minutes, then try again. |
409 |
Conflict | The entity is already in the requested state. |
500 |
Internal Server Error | IBM Cloud Code Engine is currently unavailable. Your request could not be processed. Please wait a few minutes and try again. If you still encounter this problem, note the incident ID and contact IBM Cloud support. |
Concurrent update protection
To prevent multiple clients from unknowingly overwriting each other's updates, select API methods support entity-tags and conditional requests as specified in RFC 7232.
The API requires you to specify version information when you update resources, preventing concurrent requests to overwrite each other. To accomplish that use the ETag
header in the resource response header information. The ETag
is sent with every successful CREATE
, GET
and UPDATE
operation response. The value inside the header represents the version of the resource at the point in time when it was retrieved by the API. To perform an update on a resource, the API requires the custom request header If-Match
, which must be set to the previously received version value or, alternatively to *
, which indicates that any version can be updated by this operation. If the resource’s version on the server and the value inside the If-Match
header don’t match, the API responds with an error that contains the status code 412 Precondition Failed
and a message that indicates a conflict on the resource instance, for example, app_conflict_update
.
If you encounter this issue, you can request the current version of the resource with a GET
operation. The successful response contains a new ETag
value that can be used to issue a new Update
operation with the resource modifications.
The ETag
and If-Match
headers must be used on all UPDATE
methods that explicitly require these headers, for example, the Update an application method. Other related headers that are described in RFC 7232, such as If-None-Match
and If-Modified-Since
, are not supported.
Change log
For a complete list of changes and improvements to this API, see the Code Engine API change log.
Pagination
Some API requests might return a large number of results. To avoid performance issues, these results are returned one page at a time, with a limited number of results on each page. GET requests for the following resources use pagination:
/v2/projects
/v2/projects/{project_id}/apps
/v2/projects/{project_id}/apps/{app_name}/revisions
/v2/projects/{project_id}/jobs
/v2/projects/{project_id}/job_runs
/v2/projects/{project_id}/builds
/v2/projects/{project_id}/build_runs
/v2/projects/{project_id}/config_maps
/v2/projects/{project_id}/secrets
The default page size is 50
objects. To use a different page size, use the limit
query parameter and specify a page size up to 100
, which is the maximum.
For requests that uses pagination, the response includes a next
object that specifies the pagination information. The next
object is the URL for requesting the next page of results. The next
property is null
if there are no more results, and retains the same limit
parameter that is used for the initial request.
Methods
Request
Query Parameters
Optional maximum number of projects per page.
Possible values: 1 ≤ value ≤ 100
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. Any additional query parameters are ignored if a page token is present. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects" -H "Authorization: ${token}"
listProjectsOptions := &codeenginev2.ListProjectsOptions{ Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewProjectsPager(listProjectsOptions) if err != nil { panic(err) } var allResults []codeenginev2.Project for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListProjectsOptions listProjectsOptions = new ListProjectsOptions.Builder() .limit(Long.valueOf("100")) .build(); ProjectsPager pager = new ProjectsPager(codeEngineService, listProjectsOptions); List<Project> allResults = new ArrayList<>(); while (pager.hasNext()) { List<Project> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.ProjectsPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = ProjectsPager( client=code_engine_service, limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of projects and pagination information.
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
List of projects.
Possible values: 0 ≤ number of items ≤ 100
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "projects": [ { "name": "test_project", "id": "15314cc3-85b4-4338-903f-c28cdee6d005", "crn": "crn:v1:bluemix:public:codeengine:us-east:a/4329073d16d2f3663f74bfa955259139:15314cc3-85b4-4338-903f-c28cdee6d005::", "status": "active", "region": "us-east", "account_id": "f9f1030ebf674eda8d57bdbc2b9e536a", "created_at": "2021-03-29T12:18:13.992359829Z", "resource_type": "project_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005", "resource_group_id": "b91e849cedb04e7e92bd68c040c672dc" } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Create a project
Create a Code Engine project on IBM Cloud. The project will be created in the region that corresponds to the API endpoint that is being called.
POST /projects
Request
Project prototype
{
"name": "test_project",
"resource_group_id": "b91e849cedb04e7e92bd68c040c672dc",
"tags": [
"code-engine",
"my-tag"
]
}
The name of the project.
Possible values: 1 ≤ length ≤ 128, Value must match regular expression
^([^\x00-\x7F]|[a-zA-Z0-9\-._: ])+$
Example:
my-project
Optional ID of the resource group for your project deployment. If this field is not defined, the default resource group of the account will be used.
Possible values: length = 32, Value must match regular expression
^[a-z0-9]*$
Example:
b91e849cedb04e7e92bd68c040c672dc
Optional list of labels to assign to your project. Tags are not part of the project resource that is returned by the server, but can be obtained and managed through the Global Tagging API in IBM Cloud. Find more information on Global Tagging API docs.
Possible values: 0 ≤ number of items ≤ 10, 1 ≤ length ≤ 128, Value must match regular expression
^([ ]*[A-Za-z0-9:_.\-]+[ ]*)+$
curl -X POST "https://api.${region}.codeengine.cloud.ibm.com/v2/projects" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ "name": "my-project" }'
createProjectOptions := codeEngineService.NewCreateProjectOptions( "my-project", ) project, response, err := codeEngineService.CreateProject(createProjectOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(project, "", " ") fmt.Println(string(b))
CreateProjectOptions createProjectOptions = new CreateProjectOptions.Builder() .name("my-project") .build(); Response<Project> response = codeEngineService.createProject(createProjectOptions).execute(); Project project = response.getResult(); System.out.println(project);
const params = { name: 'my-project', }; let res; try { res = await codeEngineService.createProject(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.create_project( name='my-project', ) project = response.get_result() print(json.dumps(project, indent=2))
Response
Describes the model of a project.
An alphanumeric value identifying the account ID.
Example:
4329073d16d2f3663f74bfa955259139
The timestamp when the project was created.
Example:
2021-03-29T12:18:13.992359829Z
The CRN of the project.
Example:
crn:v1:bluemix:public:codeengine:eu-de:a/4329073d16d2f3663f74bfa955259139:4e49b3e0-27a8-48d2-a784-c7ee48bb863b::
When you provision a new resource, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The name of the project.
Possible values: 1 ≤ length ≤ 128, Value must match regular expression
^([^\x00-\x7F]|[a-zA-Z0-9\-._: ])+$
Example:
project-name
The region for your project deployment. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The ID of the resource group.
Possible values: length = 32, Value must match regular expression
^[a-z0-9]*$
Example:
5c49eabcf5e85881a37e2d100a33b3df
The type of the project.
Possible values: [
project_v2
]The current state of the project. For example, when the project is created and is ready for use, the status of the project is active.
Possible values: [
active
,inactive
,pending_removal
,hard_deleting
,hard_deletion_failed
,hard_deleted
,deleting
,deletion_failed
,soft_deleted
,preparing
,creating
,creation_failed
]Example:
active
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "name": "test_project", "id": "15314cc3-85b4-4338-903f-c28cdee6d005", "crn": "crn:v1:bluemix:public:codeengine:us-east:a/4329073d16d2f3663f74bfa955259139:15314cc3-85b4-4338-903f-c28cdee6d005::", "status": "active", "region": "us-east", "account_id": "f9f1030ebf674eda8d57bdbc2b9e536a", "created_at": "2021-03-29T12:18:13.992359829Z", "resource_type": "project_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005", "resource_group_id": "b91e849cedb04e7e92bd68c040c672dc" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${id}" -H "Authorization: ${token}"
getProjectOptions := codeEngineService.NewGetProjectOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", ) project, response, err := codeEngineService.GetProject(getProjectOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(project, "", " ") fmt.Println(string(b))
GetProjectOptions getProjectOptions = new GetProjectOptions.Builder() .id("15314cc3-85b4-4338-903f-c28cdee6d005") .build(); Response<Project> response = codeEngineService.getProject(getProjectOptions).execute(); Project project = response.getResult(); System.out.println(project);
const params = { id: '15314cc3-85b4-4338-903f-c28cdee6d005', }; let res; try { res = await codeEngineService.getProject(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_project( id='15314cc3-85b4-4338-903f-c28cdee6d005', ) project = response.get_result() print(json.dumps(project, indent=2))
Response
Describes the model of a project.
An alphanumeric value identifying the account ID.
Example:
4329073d16d2f3663f74bfa955259139
The timestamp when the project was created.
Example:
2021-03-29T12:18:13.992359829Z
The CRN of the project.
Example:
crn:v1:bluemix:public:codeengine:eu-de:a/4329073d16d2f3663f74bfa955259139:4e49b3e0-27a8-48d2-a784-c7ee48bb863b::
When you provision a new resource, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The name of the project.
Possible values: 1 ≤ length ≤ 128, Value must match regular expression
^([^\x00-\x7F]|[a-zA-Z0-9\-._: ])+$
Example:
project-name
The region for your project deployment. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The ID of the resource group.
Possible values: length = 32, Value must match regular expression
^[a-z0-9]*$
Example:
5c49eabcf5e85881a37e2d100a33b3df
The type of the project.
Possible values: [
project_v2
]The current state of the project. For example, when the project is created and is ready for use, the status of the project is active.
Possible values: [
active
,inactive
,pending_removal
,hard_deleting
,hard_deletion_failed
,hard_deleted
,deleting
,deletion_failed
,soft_deleted
,preparing
,creating
,creation_failed
]Example:
active
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "test_project", "id": "15314cc3-85b4-4338-903f-c28cdee6d005", "crn": "crn:v1:bluemix:public:codeengine:us-east:a/4329073d16d2f3663f74bfa955259139:15314cc3-85b4-4338-903f-c28cdee6d005::", "status": "active", "region": "us-east", "account_id": "f9f1030ebf674eda8d57bdbc2b9e536a", "created_at": "2021-03-29T12:18:13.992359829Z", "resource_type": "project_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005", "resource_group_id": "b91e849cedb04e7e92bd68c040c672dc" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${id}" -H "Authorization: ${token}"
deleteProjectOptions := codeEngineService.NewDeleteProjectOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", ) response, err := codeEngineService.DeleteProject(deleteProjectOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteProject(): %d\n", response.StatusCode) }
DeleteProjectOptions deleteProjectOptions = new DeleteProjectOptions.Builder() .id("15314cc3-85b4-4338-903f-c28cdee6d005") .build(); Response<Void> response = codeEngineService.deleteProject(deleteProjectOptions).execute();
const params = { id: '15314cc3-85b4-4338-903f-c28cdee6d005', }; try { await codeEngineService.deleteProject(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_project( id='15314cc3-85b4-4338-903f-c28cdee6d005', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
List allowed outbound destinations
List all allowed outbound destinations in a project.
GET /projects/{project_id}/allowed_outbound_destinations
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
Optional maximum number of allowed outbound destinations per page.
Possible values: 1 ≤ value ≤ 500
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/allowed_outbound_destinations" -H "Authorization: ${token}"
listAllowedOutboundDestinationOptions := &codeenginev2.ListAllowedOutboundDestinationOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewAllowedOutboundDestinationPager(listAllowedOutboundDestinationOptions) if err != nil { panic(err) } var allResults []codeenginev2.AllowedOutboundDestinationIntf for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListAllowedOutboundDestinationOptions listAllowedOutboundDestinationOptions = new ListAllowedOutboundDestinationOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .limit(Long.valueOf("100")) .build(); AllowedOutboundDestinationPager pager = new AllowedOutboundDestinationPager(codeEngineService, listAllowedOutboundDestinationOptions); List<AllowedOutboundDestination> allResults = new ArrayList<>(); while (pager.hasNext()) { List<AllowedOutboundDestination> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.AllowedOutboundDestinationPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = AllowedOutboundDestinationPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of allowed outbound destinations and pagination information.
List of all allowed outbound destinations.
Possible values: 0 ≤ number of items ≤ 500
- allowed_outbound_destinations
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "allowed_outbound_destinations": [ { "cidr_block": "192.68.3.0/24", "name": "my-cidr-block", "type": "cidr_block", "entity_tag": "2385407409" } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Create an allowed outbound destination
Create an allowed outbound destination.
POST /projects/{project_id}/allowed_outbound_destinations
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
AllowedOutboundDestination prototype
{
"cidr_block": "192.68.3.0/24",
"name": "my-cidr-block",
"type": "cidr_block"
}
Specify the type of the allowed outbound destination. Allowed types are: 'cidr_block'.
Allowable values: [
cidr_block
]Possible values: Value must match regular expression
^(cidr_block)$
Example:
cidr_block
Create an allowed outbound destination by using a CIDR block.
Examples:{ "cidr_block": "192.68.3.0/24", "name": "my-cidr" }
- One of
The IP address range
Possible values: 0 ≤ length ≤ 18, Value must match regular expression
^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/(3[0-2]|[1-2][0-9]|[0-9]))$
The name of the CIDR block
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
curl -X POST "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/allowed_outbound_destinations" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ "type": "cidr_block" }'
allowedOutboundDestinationPrototypeModel := &codeenginev2.AllowedOutboundDestinationPrototypeCidrBlockDataPrototype{ Type: core.StringPtr("cidr_block"), CidrBlock: core.StringPtr("testString"), Name: core.StringPtr("testString"), } createAllowedOutboundDestinationOptions := codeEngineService.NewCreateAllowedOutboundDestinationOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", allowedOutboundDestinationPrototypeModel, ) allowedOutboundDestination, response, err := codeEngineService.CreateAllowedOutboundDestination(createAllowedOutboundDestinationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(allowedOutboundDestination, "", " ") fmt.Println(string(b))
AllowedOutboundDestinationPrototypeCidrBlockDataPrototype allowedOutboundDestinationPrototypeModel = new AllowedOutboundDestinationPrototypeCidrBlockDataPrototype.Builder() .type("cidr_block") .cidrBlock("testString") .name("testString") .build(); CreateAllowedOutboundDestinationOptions createAllowedOutboundDestinationOptions = new CreateAllowedOutboundDestinationOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .allowedOutboundDestination(allowedOutboundDestinationPrototypeModel) .build(); Response<AllowedOutboundDestination> response = codeEngineService.createAllowedOutboundDestination(createAllowedOutboundDestinationOptions).execute(); AllowedOutboundDestination allowedOutboundDestination = response.getResult(); System.out.println(allowedOutboundDestination);
// Request models needed by this operation. // AllowedOutboundDestinationPrototypeCidrBlockDataPrototype const allowedOutboundDestinationPrototypeModel = { type: 'cidr_block', cidr_block: 'testString', name: 'testString', }; const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', allowedOutboundDestination: allowedOutboundDestinationPrototypeModel, }; let res; try { res = await codeEngineService.createAllowedOutboundDestination(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
allowed_outbound_destination_prototype_model = { 'type': 'cidr_block', 'cidr_block': 'testString', 'name': 'testString', } response = code_engine_service.create_allowed_outbound_destination( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', allowed_outbound_destination=allowed_outbound_destination_prototype_model, ) allowed_outbound_destination = response.get_result() print(json.dumps(allowed_outbound_destination, indent=2))
Response
AllowedOutboundDestination Describes the model of an allowed outbound destination.
The version of the allowed outbound destination, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
Specify the type of the allowed outbound destination. Allowed types are: 'cidr_block'.
Possible values: [
cidr_block
]Possible values: Value must match regular expression
^(cidr_block)$
Example:
cidr_block
Allowed outbound destination CIDR block.
Examples:{ "cidr_block": "192.68.3.0/24", "name": "my-cidr" }
- One of
The IP address range
Possible values: 0 ≤ length ≤ 18, Value must match regular expression
^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/(3[0-2]|[1-2][0-9]|[0-9]))$
The name of the CIDR block
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Status Code
Created
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "cidr_block": "192.68.3.0/24", "name": "my-cidr-block", "type": "cidr_block", "entity_tag": "2385407409" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Get an allowed outbound destination
Display the details of an allowed outbound destination.
GET /projects/{project_id}/allowed_outbound_destinations/{name}
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your allowed outbound destination.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-allowed-outbound-destination
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/allowed_outbound_destinations/${name}" -H "Authorization: ${token}"
getAllowedOutboundDestinationOptions := codeEngineService.NewGetAllowedOutboundDestinationOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-allowed-outbound-destination", ) allowedOutboundDestination, response, err := codeEngineService.GetAllowedOutboundDestination(getAllowedOutboundDestinationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(allowedOutboundDestination, "", " ") fmt.Println(string(b))
GetAllowedOutboundDestinationOptions getAllowedOutboundDestinationOptions = new GetAllowedOutboundDestinationOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-allowed-outbound-destination") .build(); Response<AllowedOutboundDestination> response = codeEngineService.getAllowedOutboundDestination(getAllowedOutboundDestinationOptions).execute(); AllowedOutboundDestination allowedOutboundDestination = response.getResult(); System.out.println(allowedOutboundDestination);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-allowed-outbound-destination', }; let res; try { res = await codeEngineService.getAllowedOutboundDestination(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_allowed_outbound_destination( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-allowed-outbound-destination', ) allowed_outbound_destination = response.get_result() print(json.dumps(allowed_outbound_destination, indent=2))
Response
AllowedOutboundDestination Describes the model of an allowed outbound destination.
The version of the allowed outbound destination, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
Specify the type of the allowed outbound destination. Allowed types are: 'cidr_block'.
Possible values: [
cidr_block
]Possible values: Value must match regular expression
^(cidr_block)$
Example:
cidr_block
Allowed outbound destination CIDR block.
Examples:{ "cidr_block": "192.68.3.0/24", "name": "my-cidr" }
- One of
The IP address range
Possible values: 0 ≤ length ≤ 18, Value must match regular expression
^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/(3[0-2]|[1-2][0-9]|[0-9]))$
The name of the CIDR block
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "cidr_block": "192.68.3.0/24", "name": "my-cidr-block", "type": "cidr_block", "entity_tag": "2385407409" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Delete an allowed outbound destination
Delete an allowed outbound destination.
DELETE /projects/{project_id}/allowed_outbound_destinations/{name}
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your allowed outbound destination.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-allowed-outbound-destination
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/allowed_outbound_destinations/${name}" -H "Authorization: ${token}"
deleteAllowedOutboundDestinationOptions := codeEngineService.NewDeleteAllowedOutboundDestinationOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-allowed-outbound-destination", ) response, err := codeEngineService.DeleteAllowedOutboundDestination(deleteAllowedOutboundDestinationOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteAllowedOutboundDestination(): %d\n", response.StatusCode) }
DeleteAllowedOutboundDestinationOptions deleteAllowedOutboundDestinationOptions = new DeleteAllowedOutboundDestinationOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-allowed-outbound-destination") .build(); Response<Void> response = codeEngineService.deleteAllowedOutboundDestination(deleteAllowedOutboundDestinationOptions).execute();
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-allowed-outbound-destination', }; try { await codeEngineService.deleteAllowedOutboundDestination(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_allowed_outbound_destination( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-allowed-outbound-destination', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Update an allowed outbound destination
Update an allowed outbound destination.
PATCH /projects/{project_id}/allowed_outbound_destinations/{name}
Request
Custom Headers
Version of the allowed outbound destination to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the allowed outbound destination. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^[0-9]*$
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your allowed outbound destination.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-allowed-outbound-destination
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
AllowedOutboundDestination patch
{
"cidr_block": "192.68.3.0/24",
"type": "cidr_block"
}
Specify the type of the allowed outbound destination. Allowed types are: 'cidr_block'.
Allowable values: [
cidr_block
]Possible values: Value must match regular expression
^(cidr_block)$
Example:
cidr_block
Update an allowed outbound destination by using a CIDR block.
Examples:{ "cidr_block": "192.68.3.0/24" }
- One of
The IP address range
Possible values: 0 ≤ length ≤ 18, Value must match regular expression
^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/(3[0-2]|[1-2][0-9]|[0-9]))$
curl -X PATCH "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/allowed_outbound_destinations/${name}" -H "Authorization: ${token}" -H "Content-Type: application/merge-patch+json" -d '{ }'
allowedOutboundDestinationPatchModel := &codeenginev2.AllowedOutboundDestinationPatchCidrBlockDataPatch{ } allowedOutboundDestinationPatchModelAsPatch, asPatchErr := allowedOutboundDestinationPatchModel.AsPatch() Expect(asPatchErr).To(BeNil()) updateAllowedOutboundDestinationOptions := codeEngineService.NewUpdateAllowedOutboundDestinationOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-allowed-outbound-destination", "testString", allowedOutboundDestinationPatchModelAsPatch, ) allowedOutboundDestination, response, err := codeEngineService.UpdateAllowedOutboundDestination(updateAllowedOutboundDestinationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(allowedOutboundDestination, "", " ") fmt.Println(string(b))
AllowedOutboundDestinationPatchCidrBlockDataPatch allowedOutboundDestinationPatchModel = new AllowedOutboundDestinationPatchCidrBlockDataPatch.Builder() .build(); Map<String, Object> allowedOutboundDestinationPatchModelAsPatch = allowedOutboundDestinationPatchModel.asPatch(); UpdateAllowedOutboundDestinationOptions updateAllowedOutboundDestinationOptions = new UpdateAllowedOutboundDestinationOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-allowed-outbound-destination") .ifMatch("testString") .allowedOutboundDestination(allowedOutboundDestinationPatchModelAsPatch) .build(); Response<AllowedOutboundDestination> response = codeEngineService.updateAllowedOutboundDestination(updateAllowedOutboundDestinationOptions).execute(); AllowedOutboundDestination allowedOutboundDestination = response.getResult(); System.out.println(allowedOutboundDestination);
// Request models needed by this operation. // AllowedOutboundDestinationPatchCidrBlockDataPatch const allowedOutboundDestinationPatchModel = {}; const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-allowed-outbound-destination', ifMatch: 'testString', allowedOutboundDestination: allowedOutboundDestinationPatchModel, }; let res; try { res = await codeEngineService.updateAllowedOutboundDestination(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
allowed_outbound_destination_patch_model = {} response = code_engine_service.update_allowed_outbound_destination( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-allowed-outbound-destination', if_match='testString', allowed_outbound_destination=allowed_outbound_destination_patch_model, ) allowed_outbound_destination = response.get_result() print(json.dumps(allowed_outbound_destination, indent=2))
Response
AllowedOutboundDestination Describes the model of an allowed outbound destination.
The version of the allowed outbound destination, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
Specify the type of the allowed outbound destination. Allowed types are: 'cidr_block'.
Possible values: [
cidr_block
]Possible values: Value must match regular expression
^(cidr_block)$
Example:
cidr_block
Allowed outbound destination CIDR block.
Examples:{ "cidr_block": "192.68.3.0/24", "name": "my-cidr" }
- One of
The IP address range
Possible values: 0 ≤ length ≤ 18, Value must match regular expression
^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/(3[0-2]|[1-2][0-9]|[0-9]))$
The name of the CIDR block
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "cidr_block": "192.68.3.0/24", "name": "my-cidr-block", "type": "cidr_block", "entity_tag": "2385407409" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
List egress IP addresses
Lists all egress IP addresses (public and private) that are used by components running in this project. For information about using egress IP addresses, see Code Engine public and private IP addresses.
GET /projects/{project_id}/egress_ips
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/egress_ips" -H "Authorization: ${token}"
getProjectEgressIpsOptions := codeEngineService.NewGetProjectEgressIpsOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", ) projectEgressIpAddresses, response, err := codeEngineService.GetProjectEgressIps(getProjectEgressIpsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(projectEgressIpAddresses, "", " ") fmt.Println(string(b))
GetProjectEgressIpsOptions getProjectEgressIpsOptions = new GetProjectEgressIpsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .build(); Response<ProjectEgressIPAddresses> response = codeEngineService.getProjectEgressIps(getProjectEgressIpsOptions).execute(); ProjectEgressIPAddresses projectEgressIpAddresses = response.getResult(); System.out.println(projectEgressIpAddresses);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', }; let res; try { res = await codeEngineService.getProjectEgressIps(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_project_egress_ips( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', ) project_egress_ip_addresses = response.get_result() print(json.dumps(project_egress_ip_addresses, indent=2))
Response
Describes the model of egress IP addresses.
List of IBM private network IP addresses
Possible values: 0 ≤ number of items ≤ 100
List of public IP addresses
Possible values: 0 ≤ number of items ≤ 100
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "private": [ "10.223.236.11", "10.223.242.142", "10.12.3.244" ], "public": [ "159.23.99.151", "130.198.13.241", "135.90.137.31" ] }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Get the status details for a project
Retrieves status details about the given project.
GET /projects/{project_id}/status_details
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/status_details" -H "Authorization: ${token}"
getProjectStatusDetailsOptions := codeEngineService.NewGetProjectStatusDetailsOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", ) projectStatusDetails, response, err := codeEngineService.GetProjectStatusDetails(getProjectStatusDetailsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(projectStatusDetails, "", " ") fmt.Println(string(b))
GetProjectStatusDetailsOptions getProjectStatusDetailsOptions = new GetProjectStatusDetailsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .build(); Response<ProjectStatusDetails> response = codeEngineService.getProjectStatusDetails(getProjectStatusDetailsOptions).execute(); ProjectStatusDetails projectStatusDetails = response.getResult(); System.out.println(projectStatusDetails);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', }; let res; try { res = await codeEngineService.getProjectStatusDetails(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_project_status_details( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', ) project_status_details = response.get_result() print(json.dumps(project_status_details, indent=2))
Response
Describes the model of a project status details.
Status of the domain created for the project.
Possible values: [
unknown
,ready
]Defines whether a project is enabled for management and consumption.
Possible values: [
enabled
,disabled
]Return true when project is not VPE enabled.
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "domain": "ready", "project": "enabled" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
Optional maximum number of apps per page.
Possible values: 1 ≤ value ≤ 500
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/apps" -H "Authorization: ${token}"
listAppsOptions := &codeenginev2.ListAppsOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewAppsPager(listAppsOptions) if err != nil { panic(err) } var allResults []codeenginev2.App for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListAppsOptions listAppsOptions = new ListAppsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .limit(Long.valueOf("100")) .build(); AppsPager pager = new AppsPager(codeEngineService, listAppsOptions); List<App> allResults = new ArrayList<>(); while (pager.hasNext()) { List<App> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.AppsPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = AppsPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of apps and pagination information.
List of all apps.
Possible values: 0 ≤ number of items ≤ 500
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "apps": [ { "name": "my-app", "id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "region": "us-east", "project_id": "15314cc3-85b4-4338-903f-c28cdee6d005", "created_at": "2022-11-15T22:07:55+01:00", "resource_type": "app_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/apps/my-app", "managed_domain_mappings": "local_public", "endpoint_internal": "http://my-app.vg67hzldruk.svc.cluster.local", "entity_tag": "1", "image_reference": "icr.io/codeengine/helloworld", "image_port": 8080, "scale_cpu_limit": "1", "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "scale_concurrency": 100, "scale_initial_instances": 1, "scale_min_instances": 0, "scale_max_instances": 10, "scale_request_timeout": 300, "run_arguments": [], "run_commands": [], "run_volume_mounts": [], "run_env_variables": [ { "type": "literal", "name": "CE_SUBDOMAIN", "value": "uyh5shf7s0f" }, { "type": "literal", "name": "CE_APP", "value": "my-app" }, { "type": "literal", "name": "CE_DOMAIN", "value": "us-east.codeengine.appdomain.cloud" } ], "status": "ready" } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
App prototype
{
"name": "my-app",
"image_reference": "icr.io/codeengine/helloworld"
}
The name of the image that is used for this app. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
The name of the app. Use a name that is unique within the project.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app
Optional port the app listens on. While the app will always be exposed via port
443
for end users, this port is used to connect to the port that is exposed by the container image.Default:
8080
Example:
8080
Optional name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the app will be created but cannot reach the ready status, until this property is provided, too.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Optional value controlling which of the system managed domain mappings will be setup for the application. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports application private visibility.
Allowable values: [
local
,local_private
,local_public
]Default:
local_public
Example:
local_public
Request model for probes
Request model for probes
Optional arguments for the app that are passed to start the container. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Optional user ID (UID) to run the app.
Default:
0
Example:
1001
Optional commands for the app that are passed to start the container. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Optional references to config maps, secrets or literal values that are exposed as environment variables within the running application.
Possible values: 0 ≤ number of items ≤ 100
Optional name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
.Allowable values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Default:
default
Example:
default
Optional mounts of config maps or a secrets.
Possible values: 0 ≤ number of items ≤ 100
Optional maximum number of requests that can be processed concurrently per instance.
Default:
100
Example:
100
Optional threshold of concurrent requests per instance at which one or more additional instances are created. Use this value to scale up instances based on concurrent number of requests. This option defaults to the value of the
scale_concurrency
option, if not specified.Example:
80
Optional number of CPU set for the instance of the app. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Default:
1
Example:
1
Optional amount of time in seconds that delays the scale-down behavior for an app instance.
Possible values: 0 ≤ value ≤ 3600
Default:
0
Example:
300
Optional amount of ephemeral storage to set for the instance of the app. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Default:
400M
Example:
4G
Optional initial number of instances that are created upon app creation or app update.
Default:
1
Example:
1
Optional maximum number of instances for this app. If you set this value to
0
, this property does not set a upper scaling limit. However, the app scaling is still limited by the project quota for instances. See Limits and quotas for Code Engine.Default:
10
Example:
10
Optional amount of memory set for the instance of the app. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Default:
4G
Example:
4G
Optional minimum number of instances for this app. If you set this value to
0
, the app will scale down to zero, if not hit by any request for some time.Default:
0
Example:
1
Optional amount of time in seconds that is allowed for a running app to respond to a request.
Default:
300
Example:
300
curl -X POST "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/apps" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ "name": "my-app", "image_reference": "icr.io/codeengine/helloworld" }'
createAppOptions := codeEngineService.NewCreateAppOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "icr.io/codeengine/helloworld", "my-app", ) app, response, err := codeEngineService.CreateApp(createAppOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(app, "", " ") fmt.Println(string(b))
CreateAppOptions createAppOptions = new CreateAppOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .imageReference("icr.io/codeengine/helloworld") .name("my-app") .build(); Response<App> response = codeEngineService.createApp(createAppOptions).execute(); App app = response.getResult(); System.out.println(app);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', imageReference: 'icr.io/codeengine/helloworld', name: 'my-app', }; let res; try { res = await codeEngineService.createApp(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.create_app( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', image_reference='icr.io/codeengine/helloworld', name='my-app', ) app = response.get_result() print(json.dumps(app, indent=2))
Response
App is the response model for app resources.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the app instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
When you provision a new app, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/apps/my-app
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the image that is used for this app. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
Optional value controlling which of the system managed domain mappings will be setup for the application. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports application private visibility.
Possible values: [
local
,local_private
,local_public
]Example:
local_public
The name of the app.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the app.
Possible values: [
app_v2
]Optional arguments for the app that are passed to start the container. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Optional commands for the app that are passed to start the container. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
References to config maps, secrets or literal values, which are defined by the app owner and are exposed as environment variables in the application.
Possible values: 0 ≤ number of items ≤ 100
Mounts of config maps or secrets.
Possible values: 0 ≤ number of items ≤ 100
Optional number of CPU set for the instance of the app. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of ephemeral storage to set for the instance of the app. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional maximum number of instances for this app. If you set this value to
0
, this property does not set a upper scaling limit. However, the app scaling is still limited by the project quota for instances. See Limits and quotas for Code Engine.Example:
10
Optional amount of memory set for the instance of the app. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional minimum number of instances for this app. If you set this value to
0
, the app will scale down to zero, if not hit by any request for some time.Example:
1
Optional amount of time in seconds that is allowed for a running app to respond to a request.
Example:
300
The current status of the app.
Possible values: [
ready
,deploying
,failed
,warning
]Example:
ready
Reference to a build that is associated with the application.
Example:
my-build
Reference to a build run that is associated with the application.
Example:
my-build-run
References to config maps, secrets or literal values, which are defined and set by Code Engine and are exposed as environment variables in the application.
Possible values: 0 ≤ number of items ≤ 100
Optional URL to invoke the app. Depending on visibility, this is accessible publicly or in the private network only. Empty in case 'managed_domain_mappings' is set to 'local'.
Example:
https://my-app.vg67hzldruk.eu-de.codeengine.appdomain.cloud
The URL to the app that is only visible within the project.
Example:
http://my-app.vg67hzldruk.svc.cluster.local
Optional port the app listens on. While the app will always be exposed via port
443
for end users, this port is used to connect to the port that is exposed by the container image.Example:
8080
Optional name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the app will be created but cannot reach the ready status, until this property is provided, too.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Response model for probes
Response model for probes
Optional user ID (UID) to run the app.
Example:
1001
Optional name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
.Possible values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Example:
default
Optional maximum number of requests that can be processed concurrently per instance.
Example:
100
Optional threshold of concurrent requests per instance at which one or more additional instances are created. Use this value to scale up instances based on concurrent number of requests. This option defaults to the value of the
scale_concurrency
option, if not specified.Example:
80
Optional amount of time in seconds that delays the scale-down behavior for an app instance.
Possible values: 0 ≤ value ≤ 3600
Example:
300
Optional initial number of instances that are created upon app creation or app update.
Example:
1
The detailed status of the application.
Examples:{ "reason": "ready", "latest_created_revision": "my-app-00002", "latest_ready_revision": "my-app-00001" }
Status Code
Created
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "name": "my-app", "id": "3bf57be1-66f0-4a89-ad34-ed77c049935e", "region": "us-east", "project_id": "15314cc3-85b4-4338-903f-c28cdee6d005", "created_at": "2022-11-15T22:07:55+01:00", "resource_type": "app_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/apps/my-app", "managed_domain_mappings": "local_public", "endpoint_internal": "http://my-app.vg67hzldruk.svc.cluster.local", "entity_tag": "1", "image_reference": "icr.io/codeengine/helloworld", "image_port": 8080, "scale_cpu_limit": "1", "scale_down_delay": 0, "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "scale_concurrency": 100, "scale_initial_instances": 1, "scale_min_instances": 0, "scale_max_instances": 10, "scale_request_timeout": 300, "run_arguments": [], "run_commands": [], "run_volume_mounts": [], "run_env_variables": [ { "type": "literal", "name": "CE_SUBDOMAIN", "value": "uyh5shf7s0f" }, { "type": "literal", "name": "CE_APP", "value": "my-app" }, { "type": "literal", "name": "CE_DOMAIN", "value": "us-east.codeengine.appdomain.cloud" } ], "status": "ready" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your application.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/apps/${name}" -H "Authorization: ${token}"
getAppOptions := codeEngineService.NewGetAppOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-app", ) app, response, err := codeEngineService.GetApp(getAppOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(app, "", " ") fmt.Println(string(b))
GetAppOptions getAppOptions = new GetAppOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-app") .build(); Response<App> response = codeEngineService.getApp(getAppOptions).execute(); App app = response.getResult(); System.out.println(app);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-app', }; let res; try { res = await codeEngineService.getApp(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_app( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-app', ) app = response.get_result() print(json.dumps(app, indent=2))
Response
App is the response model for app resources.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the app instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
When you provision a new app, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/apps/my-app
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the image that is used for this app. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
Optional value controlling which of the system managed domain mappings will be setup for the application. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports application private visibility.
Possible values: [
local
,local_private
,local_public
]Example:
local_public
The name of the app.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the app.
Possible values: [
app_v2
]Optional arguments for the app that are passed to start the container. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Optional commands for the app that are passed to start the container. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
References to config maps, secrets or literal values, which are defined by the app owner and are exposed as environment variables in the application.
Possible values: 0 ≤ number of items ≤ 100
Mounts of config maps or secrets.
Possible values: 0 ≤ number of items ≤ 100
Optional number of CPU set for the instance of the app. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of ephemeral storage to set for the instance of the app. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional maximum number of instances for this app. If you set this value to
0
, this property does not set a upper scaling limit. However, the app scaling is still limited by the project quota for instances. See Limits and quotas for Code Engine.Example:
10
Optional amount of memory set for the instance of the app. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional minimum number of instances for this app. If you set this value to
0
, the app will scale down to zero, if not hit by any request for some time.Example:
1
Optional amount of time in seconds that is allowed for a running app to respond to a request.
Example:
300
The current status of the app.
Possible values: [
ready
,deploying
,failed
,warning
]Example:
ready
Reference to a build that is associated with the application.
Example:
my-build
Reference to a build run that is associated with the application.
Example:
my-build-run
References to config maps, secrets or literal values, which are defined and set by Code Engine and are exposed as environment variables in the application.
Possible values: 0 ≤ number of items ≤ 100
Optional URL to invoke the app. Depending on visibility, this is accessible publicly or in the private network only. Empty in case 'managed_domain_mappings' is set to 'local'.
Example:
https://my-app.vg67hzldruk.eu-de.codeengine.appdomain.cloud
The URL to the app that is only visible within the project.
Example:
http://my-app.vg67hzldruk.svc.cluster.local
Optional port the app listens on. While the app will always be exposed via port
443
for end users, this port is used to connect to the port that is exposed by the container image.Example:
8080
Optional name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the app will be created but cannot reach the ready status, until this property is provided, too.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Response model for probes
Response model for probes
Optional user ID (UID) to run the app.
Example:
1001
Optional name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
.Possible values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Example:
default
Optional maximum number of requests that can be processed concurrently per instance.
Example:
100
Optional threshold of concurrent requests per instance at which one or more additional instances are created. Use this value to scale up instances based on concurrent number of requests. This option defaults to the value of the
scale_concurrency
option, if not specified.Example:
80
Optional amount of time in seconds that delays the scale-down behavior for an app instance.
Possible values: 0 ≤ value ≤ 3600
Example:
300
Optional initial number of instances that are created upon app creation or app update.
Example:
1
The detailed status of the application.
Examples:{ "reason": "ready", "latest_created_revision": "my-app-00002", "latest_ready_revision": "my-app-00001" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-app", "id": "3bf57be1-66f0-4a89-ad34-ed77c049935e", "region": "us-east", "project_id": "15314cc3-85b4-4338-903f-c28cdee6d005", "created_at": "2022-11-15T22:07:55+01:00", "resource_type": "app_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/apps/my-app", "managed_domain_mappings": "local_public", "endpoint_internal": "http://my-app.vg67hzldruk.svc.cluster.local", "entity_tag": "1", "image_reference": "icr.io/codeengine/helloworld", "image_port": 8080, "scale_cpu_limit": "1", "scale_down_delay": 0, "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "scale_concurrency": 100, "scale_initial_instances": 1, "scale_min_instances": 0, "scale_max_instances": 10, "scale_request_timeout": 300, "run_arguments": [], "run_commands": [], "run_volume_mounts": [], "run_env_variables": [ { "type": "literal", "name": "CE_SUBDOMAIN", "value": "uyh5shf7s0f" }, { "type": "literal", "name": "CE_APP", "value": "my-app" }, { "type": "literal", "name": "CE_DOMAIN", "value": "us-east.codeengine.appdomain.cloud" } ], "status": "ready" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your application.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/apps/${name}" -H "Authorization: ${token}"
deleteAppOptions := codeEngineService.NewDeleteAppOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-app", ) response, err := codeEngineService.DeleteApp(deleteAppOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteApp(): %d\n", response.StatusCode) }
DeleteAppOptions deleteAppOptions = new DeleteAppOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-app") .build(); Response<Void> response = codeEngineService.deleteApp(deleteAppOptions).execute();
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-app', }; try { await codeEngineService.deleteApp(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_app( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-app', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Update an application
An application contains one or more revisions. A revision represents an immutable version of the configuration properties of the application. Each update of an application configuration property creates a new revision of the application. Learn more
PATCH /projects/{project_id}/apps/{name}
Request
Custom Headers
Version of the app settings to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the app. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^[0-9]*$
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your application.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
App patch
{
"image_reference": "icr.io/codeengine/hello"
}
Optional port the app listens on. While the app will always be exposed via port
443
for end users, this port is used to connect to the port that is exposed by the container image.Example:
8080
The name of the image that is used for this app. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
Optional name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the app will be created but cannot reach the ready status, until this property is provided, too.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Optional value controlling which of the system managed domain mappings will be setup for the application. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports application private visibility.
Allowable values: [
local
,local_private
,local_public
]Example:
local_public
Request model for probes
Request model for probes
Optional arguments for the app that are passed to start the container. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Optional user ID (UID) to run the app.
Default:
0
Example:
1001
Optional commands for the app that are passed to start the container. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Optional references to config maps, secrets or literal values.
Possible values: 0 ≤ number of items ≤ 100
Optional name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
.Allowable values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Example:
default
Optional mounts of config maps or a secrets. In case this is provided, existing
run_volume_mounts
will be overwritten.Possible values: 0 ≤ number of items ≤ 100
Optional maximum number of requests that can be processed concurrently per instance.
Example:
100
Optional threshold of concurrent requests per instance at which one or more additional instances are created. Use this value to scale up instances based on concurrent number of requests. This option defaults to the value of the
scale_concurrency
option, if not specified.Example:
80
Optional number of CPU set for the instance of the app. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of time in seconds that delays the scale-down behavior for an app instance.
Possible values: 0 ≤ value ≤ 3600
Default:
0
Example:
300
Optional amount of ephemeral storage to set for the instance of the app. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional initial number of instances that are created upon app creation or app update.
Example:
1
Optional maximum number of instances for this app. If you set this value to
0
, this property does not set a upper scaling limit. However, the app scaling is still limited by the project quota for instances. See Limits and quotas for Code Engine.Example:
10
Optional amount of memory set for the instance of the app. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional minimum number of instances for this app. If you set this value to
0
, the app will scale down to zero, if not hit by any request for some time.Default:
0
Example:
1
Optional amount of time in seconds that is allowed for a running app to respond to a request.
Example:
300
curl -X PATCH "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/apps/${name}" -H "Authorization: ${token}" -H "Content-Type: application/merge-patch+json" -d '{ }'
appPatchModel := &codeenginev2.AppPatch{ } appPatchModelAsPatch, asPatchErr := appPatchModel.AsPatch() Expect(asPatchErr).To(BeNil()) updateAppOptions := codeEngineService.NewUpdateAppOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-app", "testString", appPatchModelAsPatch, ) app, response, err := codeEngineService.UpdateApp(updateAppOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(app, "", " ") fmt.Println(string(b))
AppPatch appPatchModel = new AppPatch.Builder() .build(); Map<String, Object> appPatchModelAsPatch = appPatchModel.asPatch(); UpdateAppOptions updateAppOptions = new UpdateAppOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-app") .ifMatch("testString") .app(appPatchModelAsPatch) .build(); Response<App> response = codeEngineService.updateApp(updateAppOptions).execute(); App app = response.getResult(); System.out.println(app);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-app', ifMatch: 'testString', }; let res; try { res = await codeEngineService.updateApp(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
app_patch_model = {} response = code_engine_service.update_app( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-app', if_match='testString', app=app_patch_model, ) app = response.get_result() print(json.dumps(app, indent=2))
Response
App is the response model for app resources.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the app instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
When you provision a new app, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/apps/my-app
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the image that is used for this app. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
Optional value controlling which of the system managed domain mappings will be setup for the application. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports application private visibility.
Possible values: [
local
,local_private
,local_public
]Example:
local_public
The name of the app.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the app.
Possible values: [
app_v2
]Optional arguments for the app that are passed to start the container. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Optional commands for the app that are passed to start the container. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
References to config maps, secrets or literal values, which are defined by the app owner and are exposed as environment variables in the application.
Possible values: 0 ≤ number of items ≤ 100
Mounts of config maps or secrets.
Possible values: 0 ≤ number of items ≤ 100
Optional number of CPU set for the instance of the app. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of ephemeral storage to set for the instance of the app. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional maximum number of instances for this app. If you set this value to
0
, this property does not set a upper scaling limit. However, the app scaling is still limited by the project quota for instances. See Limits and quotas for Code Engine.Example:
10
Optional amount of memory set for the instance of the app. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional minimum number of instances for this app. If you set this value to
0
, the app will scale down to zero, if not hit by any request for some time.Example:
1
Optional amount of time in seconds that is allowed for a running app to respond to a request.
Example:
300
The current status of the app.
Possible values: [
ready
,deploying
,failed
,warning
]Example:
ready
Reference to a build that is associated with the application.
Example:
my-build
Reference to a build run that is associated with the application.
Example:
my-build-run
References to config maps, secrets or literal values, which are defined and set by Code Engine and are exposed as environment variables in the application.
Possible values: 0 ≤ number of items ≤ 100
Optional URL to invoke the app. Depending on visibility, this is accessible publicly or in the private network only. Empty in case 'managed_domain_mappings' is set to 'local'.
Example:
https://my-app.vg67hzldruk.eu-de.codeengine.appdomain.cloud
The URL to the app that is only visible within the project.
Example:
http://my-app.vg67hzldruk.svc.cluster.local
Optional port the app listens on. While the app will always be exposed via port
443
for end users, this port is used to connect to the port that is exposed by the container image.Example:
8080
Optional name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the app will be created but cannot reach the ready status, until this property is provided, too.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Response model for probes
Response model for probes
Optional user ID (UID) to run the app.
Example:
1001
Optional name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
.Possible values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Example:
default
Optional maximum number of requests that can be processed concurrently per instance.
Example:
100
Optional threshold of concurrent requests per instance at which one or more additional instances are created. Use this value to scale up instances based on concurrent number of requests. This option defaults to the value of the
scale_concurrency
option, if not specified.Example:
80
Optional amount of time in seconds that delays the scale-down behavior for an app instance.
Possible values: 0 ≤ value ≤ 3600
Example:
300
Optional initial number of instances that are created upon app creation or app update.
Example:
1
The detailed status of the application.
Examples:{ "reason": "ready", "latest_created_revision": "my-app-00002", "latest_ready_revision": "my-app-00001" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-app", "id": "3bf57be1-66f0-4a89-ad34-ed77c049935e", "region": "us-east", "project_id": "15314cc3-85b4-4338-903f-c28cdee6d005", "created_at": "2022-11-15T22:07:55+01:00", "resource_type": "app_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/apps/my-app", "managed_domain_mappings": "local_public", "endpoint_internal": "http://my-app.vg67hzldruk.svc.cluster.local", "entity_tag": "1", "image_reference": "icr.io/codeengine/helloworld", "image_port": 8080, "scale_cpu_limit": "1", "scale_down_delay": 0, "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "scale_concurrency": 100, "scale_initial_instances": 1, "scale_min_instances": 0, "scale_max_instances": 10, "scale_request_timeout": 300, "run_arguments": [], "run_commands": [], "run_volume_mounts": [], "run_env_variables": [ { "type": "literal", "name": "CE_SUBDOMAIN", "value": "uyh5shf7s0f" }, { "type": "literal", "name": "CE_APP", "value": "my-app" }, { "type": "literal", "name": "CE_DOMAIN", "value": "us-east.codeengine.appdomain.cloud" } ], "status": "ready" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
List application revisions
List all application revisions in a particular application.
GET /projects/{project_id}/apps/{app_name}/revisions
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your application.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app
Query Parameters
Optional maximum number of apps per page.
Possible values: 1 ≤ value ≤ 500
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/apps/${app_name}/revisions" -H "Authorization: ${token}"
listAppRevisionsOptions := &codeenginev2.ListAppRevisionsOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), AppName: core.StringPtr("my-app"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewAppRevisionsPager(listAppRevisionsOptions) if err != nil { panic(err) } var allResults []codeenginev2.AppRevision for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListAppRevisionsOptions listAppRevisionsOptions = new ListAppRevisionsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .appName("my-app") .limit(Long.valueOf("100")) .build(); AppRevisionsPager pager = new AppRevisionsPager(codeEngineService, listAppRevisionsOptions); List<AppRevision> allResults = new ArrayList<>(); while (pager.hasNext()) { List<AppRevision> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', appName: 'my-app', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.AppRevisionsPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = AppRevisionsPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', app_name='my-app', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of app revisions and pagination information.
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
List of all app revisions.
Possible values: 0 ≤ number of items ≤ 500
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "revisions": [ { "name": "my-app-00001", "app_name": "my-app", "id": "b63b3e28-2c1b-4784-9cd6-18c201fc6806", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T22:07:55+01:00", "resource_type": "app_revision_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/apps/my-app/revisions/my-app-00001", "image_reference": "icr.io/codeengine/helloworld", "image_port": 8080, "scale_cpu_limit": "1", "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "scale_concurrency": 100, "scale_initial_instances": 1, "scale_min_instances": 0, "scale_max_instances": 10, "scale_request_timeout": 300, "run_arguments": [], "run_commands": [], "run_volume_mounts": [], "run_env_variables": [ { "type": "literal", "name": "CE_SUBDOMAIN", "value": "uyh5shf7s0f" }, { "type": "literal", "name": "CE_APP", "value": "my-app" }, { "type": "literal", "name": "CE_DOMAIN", "value": "us-east.codeengine.appdomain.cloud" } ], "status": "ready" } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Get an application revision
Display the details of an application revision.
GET /projects/{project_id}/apps/{app_name}/revisions/{name}
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your application.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app
The name of your application revision.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app-00001
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/apps/${app_name}/revisions/${name}" -H "Authorization: ${token}"
getAppRevisionOptions := codeEngineService.NewGetAppRevisionOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-app", "my-app-00001", ) appRevision, response, err := codeEngineService.GetAppRevision(getAppRevisionOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(appRevision, "", " ") fmt.Println(string(b))
GetAppRevisionOptions getAppRevisionOptions = new GetAppRevisionOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .appName("my-app") .name("my-app-00001") .build(); Response<AppRevision> response = codeEngineService.getAppRevision(getAppRevisionOptions).execute(); AppRevision appRevision = response.getResult(); System.out.println(appRevision);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', appName: 'my-app', name: 'my-app-00001', }; let res; try { res = await codeEngineService.getAppRevision(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_app_revision( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', app_name='my-app', name='my-app-00001', ) app_revision = response.get_result() print(json.dumps(app_revision, indent=2))
Response
AppRevision is the response model for app revision resources.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
When you provision a new revision, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/apps/my-app/revisions/my-app-00001
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the image that is used for this app. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
The name of the app revision.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app-00001
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the app revision.
Possible values: [
app_revision_v2
]Optional arguments for the app that are passed to start the container. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Optional commands for the app that are passed to start the container. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
References to config maps, secrets or literal values, which are defined by the app owner and are exposed as environment variables in the application.
Possible values: 0 ≤ number of items ≤ 100
Mounts of config maps or secrets.
Possible values: 0 ≤ number of items ≤ 100
Optional number of CPU set for the instance of the app. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of ephemeral storage to set for the instance of the app. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional maximum number of instances for this app. If you set this value to
0
, this property does not set a upper scaling limit. However, the app scaling is still limited by the project quota for instances. See Limits and quotas for Code Engine.Example:
10
Optional amount of memory set for the instance of the app. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional minimum number of instances for this app. If you set this value to
0
, the app will scale down to zero, if not hit by any request for some time.Example:
1
Optional amount of time in seconds that is allowed for a running app to respond to a request.
Example:
300
The current status of the app revision.
Possible values: [
ready
,loading
,warning
,failed
]Example:
ready
Name of the associated app.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app
References to config maps, secrets or literal values, which are defined and set by Code Engine and are exposed as environment variables in the application.
Possible values: 0 ≤ number of items ≤ 100
Optional port the app listens on. While the app will always be exposed via port
443
for end users, this port is used to connect to the port that is exposed by the container image.Example:
8080
Optional name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the app will be created but cannot reach the ready status, until this property is provided, too.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Response model for probes
Response model for probes
Optional user ID (UID) to run the app.
Example:
1001
Optional name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
.Possible values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Example:
default
Optional maximum number of requests that can be processed concurrently per instance.
Example:
100
Optional threshold of concurrent requests per instance at which one or more additional instances are created. Use this value to scale up instances based on concurrent number of requests. This option defaults to the value of the
scale_concurrency
option, if not specified.Example:
80
Optional amount of time in seconds that delays the scale-down behavior for an app instance.
Possible values: 0 ≤ value ≤ 3600
Example:
300
Optional initial number of instances that are created upon app creation or app update.
Example:
1
The detailed status of the application revision.
Examples:{ "reason": "ready", "actual_instances": 1 }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-app-00001", "app_name": "my-app", "id": "b63b3e28-2c1b-4784-9cd6-18c201fc6806", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T22:07:55+01:00", "resource_type": "app_revision_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/apps/my-app/revisions/my-app-00001", "image_reference": "icr.io/codeengine/helloworld", "image_port": 8080, "scale_cpu_limit": "1", "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "scale_concurrency": 100, "scale_initial_instances": 1, "scale_min_instances": 0, "scale_max_instances": 10, "scale_request_timeout": 300, "run_arguments": [], "run_commands": [], "run_volume_mounts": [], "run_env_variables": [ { "type": "literal", "name": "CE_SUBDOMAIN", "value": "uyh5shf7s0f" }, { "type": "literal", "name": "CE_APP", "value": "my-app" }, { "type": "literal", "name": "CE_DOMAIN", "value": "us-east.codeengine.appdomain.cloud" } ], "status": "ready" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Delete an application revision
Delete an application revision.
DELETE /projects/{project_id}/apps/{app_name}/revisions/{name}
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your application.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app
The name of your application revision.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app-00001
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/apps/${app_name}/revisions/${name}" -H "Authorization: ${token}"
deleteAppRevisionOptions := codeEngineService.NewDeleteAppRevisionOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-app", "my-app-00001", ) response, err := codeEngineService.DeleteAppRevision(deleteAppRevisionOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteAppRevision(): %d\n", response.StatusCode) }
DeleteAppRevisionOptions deleteAppRevisionOptions = new DeleteAppRevisionOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .appName("my-app") .name("my-app-00001") .build(); Response<Void> response = codeEngineService.deleteAppRevision(deleteAppRevisionOptions).execute();
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', appName: 'my-app', name: 'my-app-00001', }; try { await codeEngineService.deleteAppRevision(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_app_revision( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', app_name='my-app', name='my-app-00001', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
List application instances
List all instances of an application.
GET /projects/{project_id}/apps/{app_name}/instances
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your application.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-app
Query Parameters
Optional maximum number of apps per page.
Possible values: 1 ≤ value ≤ 500
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/apps/${app_name}/instances" -H "Authorization: ${token}"
listAppInstancesOptions := &codeenginev2.ListAppInstancesOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), AppName: core.StringPtr("my-app"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewAppInstancesPager(listAppInstancesOptions) if err != nil { panic(err) } var allResults []codeenginev2.AppInstance for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListAppInstancesOptions listAppInstancesOptions = new ListAppInstancesOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .appName("my-app") .limit(Long.valueOf("100")) .build(); AppInstancesPager pager = new AppInstancesPager(codeEngineService, listAppInstancesOptions); List<AppInstance> allResults = new ArrayList<>(); while (pager.hasNext()) { List<AppInstance> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', appName: 'my-app', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.AppInstancesPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = AppInstancesPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', app_name='my-app', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of app instances and pagination information.
List of all app instances.
Possible values: 0 ≤ number of items ≤ 500
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "instances": [ { "name": "crash-00001-deployment-86c64f66fd-cjwqp", "resource_type": "app_instance_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/apps/my-app/instances", "id": "7755a00a-0d8f-4eab-8dbd-ab43fc3498dd", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2023-10-23T11:56:46-04:00", "region": "us-east", "status": "running", "scale_cpu_limit": "0.125", "scale_memory_limit": "250M", "scale_ephemeral_storage_limit": "400M", "app_name": "crash", "revision_name": "crash-00001", "restarts": 58, "status_details": { "user_container": { "current_state": { "container_status": "terminated", "reason": "OOMKilled", "exit_code": 1, "started_at": "2023-10-23T16:55:36-04:00", "completed_at": "2023-10-23T16:56:02-04:00" }, "last_observed_state": { "container_status": "terminated", "reason": "OOMKilled", "exit_code": 1, "started_at": "2023-10-23T16:49:58-04:00", "completed_at": "2023-10-23T16:50:24-04:00" } }, "system_containers": { "current_state": { "container_status": "running", "start_time": "2023-10-23T11:57:10-04:00" }, "last_observed_state": {} } } } ], "limit": 50, "first": { "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/apps/my-app/instances?limit=50" } }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
Optional maximum number of jobs per page.
Possible values: 1 ≤ value ≤ 500
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/jobs" -H "Authorization: ${token}"
listJobsOptions := &codeenginev2.ListJobsOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewJobsPager(listJobsOptions) if err != nil { panic(err) } var allResults []codeenginev2.Job for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListJobsOptions listJobsOptions = new ListJobsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .limit(Long.valueOf("100")) .build(); JobsPager pager = new JobsPager(codeEngineService, listJobsOptions); List<Job> allResults = new ArrayList<>(); while (pager.hasNext()) { List<Job> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.JobsPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = JobsPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of jobs and pagination information.
List of all jobs.
Possible values: 0 ≤ number of items ≤ 500
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "jobs": [ { "name": "my-job", "id": "7e49dd78-09d0-45c7-ad7e-cd968e0e7747", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T21:40:40+01:00", "resource_type": "job_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/jobs/my-job", "image_reference": "icr.io/codeengine/helloworld", "run_mode": "task", "run_arguments": [], "run_commands": [], "run_volume_mounts": [], "run_env_variables": [], "scale_array_spec": "0", "scale_max_execution_time": 7200, "scale_retry_limit": 3, "scale_cpu_limit": "1", "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "status": "ready", "entity_tag": "2386231540" } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
Job prototype
{
"name": "my-job",
"image_reference": "icr.io/codeengine/helloworld",
"run_env_variables": [
{
"type": "literal",
"name": "MY_PROPERTY",
"value": "VALUE"
}
]
}
The name of the image that is used for this job. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
The name of the job. Use a name that is unique within the project.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job
The name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the job / job runs will be created but submitted job runs will fail, until this property is provided, too. This property must not be set on a job run, which references a job template.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Set arguments for the job that are passed to start job run containers. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
The user ID (UID) to run the job.
Default:
0
Example:
1001
Set commands for the job that are passed to start job run containers. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Optional references to config maps, secrets or literal values.
Possible values: 0 ≤ number of items ≤ 100
The mode for runs of the job. Valid values are
task
anddaemon
. Intask
mode, themax_execution_time
andretry_limit
properties apply. Indaemon
mode, since there is no timeout and failed instances are restarted indefinitely, themax_execution_time
andretry_limit
properties are not allowed.Allowable values: [
task
,daemon
]Possible values: length ≥ 0, Value must match regular expression
^(task|daemon)$
Default:
task
Example:
task
The name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
. This property must not be set on a job run, which references a job template.Allowable values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Default:
default
Example:
default
Optional mounts of config maps or a secrets.
Possible values: 0 ≤ number of items ≤ 100
Define a custom set of array indices as a comma-separated list containing single values and hyphen-separated ranges, such as 5,12-14,23,27. Each instance gets its array index value from the environment variable JOB_INDEX. The number of unique array indices that you specify with this parameter determines the number of job instances to run.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?(?:,(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?)*$
Default:
0
Example:
1-5,7-8,10
Optional amount of CPU set for the instance of the job. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Default:
1
Example:
1
Optional amount of ephemeral storage to set for the instance of the job. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Default:
400M
Example:
4G
The maximum execution time in seconds for runs of the job. This property can only be specified if
run_mode
istask
.Default:
7200
Example:
7200
Optional amount of memory set for the instance of the job. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Default:
4G
Example:
4G
The number of times to rerun an instance of the job before the job is marked as failed. This property can only be specified if
run_mode
istask
.Default:
3
Example:
3
curl -X POST "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/jobs" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ "image_reference": "icr.io/codeengine/helloworld", "name": "my-job" }'
createJobOptions := codeEngineService.NewCreateJobOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "icr.io/codeengine/helloworld", "my-job", ) job, response, err := codeEngineService.CreateJob(createJobOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(job, "", " ") fmt.Println(string(b))
CreateJobOptions createJobOptions = new CreateJobOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .imageReference("icr.io/codeengine/helloworld") .name("my-job") .build(); Response<Job> response = codeEngineService.createJob(createJobOptions).execute(); Job job = response.getResult(); System.out.println(job);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', imageReference: 'icr.io/codeengine/helloworld', name: 'my-job', }; let res; try { res = await codeEngineService.createJob(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.create_job( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', image_reference='icr.io/codeengine/helloworld', name='my-job', ) job = response.get_result() print(json.dumps(job, indent=2))
Response
Job is the response model for job resources
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the job instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
When you provision a new job, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/jobs/my-job
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the image that is used for this job. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
The name of the job.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the job.
Possible values: [
job_v2
]Set arguments for the job that are passed to start job run containers. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Set commands for the job that are passed to start job run containers. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
References to config maps, secrets or literal values, which are defined by the function owner and are exposed as environment variables in the job run.
Possible values: 0 ≤ number of items ≤ 100
The mode for runs of the job. Valid values are
task
anddaemon
. Intask
mode, themax_execution_time
andretry_limit
properties apply. Indaemon
mode, since there is no timeout and failed instances are restarted indefinitely, themax_execution_time
andretry_limit
properties are not allowed.Possible values: [
task
,daemon
]Possible values: length ≥ 0, Value must match regular expression
^(task|daemon)$
Example:
task
Optional mounts of config maps or secrets.
Possible values: 0 ≤ number of items ≤ 100
Define a custom set of array indices as a comma-separated list containing single values and hyphen-separated ranges, such as 5,12-14,23,27. Each instance gets its array index value from the environment variable JOB_INDEX. The number of unique array indices that you specify with this parameter determines the number of job instances to run.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?(?:,(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?)*$
Example:
1-5,7-8,10
Optional amount of CPU set for the instance of the job. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of ephemeral storage to set for the instance of the job. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional amount of memory set for the instance of the job. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Reference to a build that is associated with the job.
Example:
my-build
Reference to a build run that is associated with the job.
Example:
my-build-run
References to config maps, secrets or literal values, which are defined and set by Code Engine and are exposed as environment variables in the job run.
Possible values: 0 ≤ number of items ≤ 100
The name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the job / job runs will be created but submitted job runs will fail, until this property is provided, too. This property must not be set on a job run, which references a job template.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
The user ID (UID) to run the job.
Example:
1001
The name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
. This property must not be set on a job run, which references a job template.Possible values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Example:
default
The maximum execution time in seconds for runs of the job. This property can only be specified if
run_mode
istask
.Example:
7200
The number of times to rerun an instance of the job before the job is marked as failed. This property can only be specified if
run_mode
istask
.Example:
3
Status Code
Created
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "name": "my-job", "id": "7e49dd78-09d0-45c7-ad7e-cd968e0e7747", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T21:40:40+01:00", "resource_type": "job_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/jobs/my-job", "image_reference": "icr.io/codeengine/helloworld", "run_arguments": [], "run_commands": [], "run_mode": "task", "run_volume_mounts": [], "run_env_variables": [], "scale_array_spec": "0", "scale_max_execution_time": 7200, "scale_retry_limit": 3, "scale_cpu_limit": "1", "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "status": "ready", "entity_tag": "2386231540" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your job.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/jobs/${name}" -H "Authorization: ${token}"
getJobOptions := codeEngineService.NewGetJobOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-job", ) job, response, err := codeEngineService.GetJob(getJobOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(job, "", " ") fmt.Println(string(b))
GetJobOptions getJobOptions = new GetJobOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-job") .build(); Response<Job> response = codeEngineService.getJob(getJobOptions).execute(); Job job = response.getResult(); System.out.println(job);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-job', }; let res; try { res = await codeEngineService.getJob(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_job( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-job', ) job = response.get_result() print(json.dumps(job, indent=2))
Response
Job is the response model for job resources
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the job instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
When you provision a new job, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/jobs/my-job
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the image that is used for this job. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
The name of the job.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the job.
Possible values: [
job_v2
]Set arguments for the job that are passed to start job run containers. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Set commands for the job that are passed to start job run containers. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
References to config maps, secrets or literal values, which are defined by the function owner and are exposed as environment variables in the job run.
Possible values: 0 ≤ number of items ≤ 100
The mode for runs of the job. Valid values are
task
anddaemon
. Intask
mode, themax_execution_time
andretry_limit
properties apply. Indaemon
mode, since there is no timeout and failed instances are restarted indefinitely, themax_execution_time
andretry_limit
properties are not allowed.Possible values: [
task
,daemon
]Possible values: length ≥ 0, Value must match regular expression
^(task|daemon)$
Example:
task
Optional mounts of config maps or secrets.
Possible values: 0 ≤ number of items ≤ 100
Define a custom set of array indices as a comma-separated list containing single values and hyphen-separated ranges, such as 5,12-14,23,27. Each instance gets its array index value from the environment variable JOB_INDEX. The number of unique array indices that you specify with this parameter determines the number of job instances to run.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?(?:,(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?)*$
Example:
1-5,7-8,10
Optional amount of CPU set for the instance of the job. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of ephemeral storage to set for the instance of the job. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional amount of memory set for the instance of the job. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Reference to a build that is associated with the job.
Example:
my-build
Reference to a build run that is associated with the job.
Example:
my-build-run
References to config maps, secrets or literal values, which are defined and set by Code Engine and are exposed as environment variables in the job run.
Possible values: 0 ≤ number of items ≤ 100
The name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the job / job runs will be created but submitted job runs will fail, until this property is provided, too. This property must not be set on a job run, which references a job template.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
The user ID (UID) to run the job.
Example:
1001
The name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
. This property must not be set on a job run, which references a job template.Possible values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Example:
default
The maximum execution time in seconds for runs of the job. This property can only be specified if
run_mode
istask
.Example:
7200
The number of times to rerun an instance of the job before the job is marked as failed. This property can only be specified if
run_mode
istask
.Example:
3
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-job", "id": "7e49dd78-09d0-45c7-ad7e-cd968e0e7747", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T21:40:40+01:00", "resource_type": "job_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/jobs/my-job", "image_reference": "icr.io/codeengine/helloworld", "run_arguments": [], "run_commands": [], "run_mode": "task", "run_volume_mounts": [], "run_env_variables": [], "scale_array_spec": "0", "scale_max_execution_time": 7200, "scale_retry_limit": 3, "scale_cpu_limit": "1", "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "status": "ready", "entity_tag": "2386231540" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your job.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/jobs/${name}" -H "Authorization: ${token}"
deleteJobOptions := codeEngineService.NewDeleteJobOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-job", ) response, err := codeEngineService.DeleteJob(deleteJobOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteJob(): %d\n", response.StatusCode) }
DeleteJobOptions deleteJobOptions = new DeleteJobOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-job") .build(); Response<Void> response = codeEngineService.deleteJob(deleteJobOptions).execute();
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-job', }; try { await codeEngineService.deleteJob(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_job( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-job', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Custom Headers
Version of the job settings to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the job. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^[0-9]*$
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your job.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
Job patch prototype
{
"image_reference": "icr.io/codeengine/hello",
"run_env_variables": [
{
"type": "literal",
"name": "MY_PROPERTY",
"value": "OTHER"
}
]
}
The name of the image that is used for this job. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
The name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the job / job runs will be created but submitted job runs will fail, until this property is provided, too. This property must not be set on a job run, which references a job template.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Set arguments for the job that are passed to start job run containers. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
The user ID (UID) to run the job.
Default:
0
Example:
1001
Set commands for the job that are passed to start job run containers. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Optional references to config maps, secrets or literal values.
Possible values: 0 ≤ number of items ≤ 100
The mode for runs of the job. Valid values are
task
anddaemon
. Intask
mode, themax_execution_time
andretry_limit
properties apply. Indaemon
mode, since there is no timeout and failed instances are restarted indefinitely, themax_execution_time
andretry_limit
properties are not allowed.Allowable values: [
task
,daemon
]Possible values: length ≥ 0, Value must match regular expression
^(task|daemon)$
Example:
task
The name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
. This property must not be set on a job run, which references a job template.Allowable values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Example:
default
Optional mounts of config maps or a secrets. In case this is provided, existing
run_volume_mounts
will be overwritten.Possible values: 0 ≤ number of items ≤ 100
Define a custom set of array indices as a comma-separated list containing single values and hyphen-separated ranges, such as 5,12-14,23,27. Each instance gets its array index value from the environment variable JOB_INDEX. The number of unique array indices that you specify with this parameter determines the number of job instances to run.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?(?:,(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?)*$
Example:
1-5,7-8,10
Optional amount of CPU set for the instance of the job. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of ephemeral storage to set for the instance of the job. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
The maximum execution time in seconds for runs of the job. This property can only be specified if
run_mode
istask
.Example:
7200
Optional amount of memory set for the instance of the job. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
The number of times to rerun an instance of the job before the job is marked as failed. This property can only be specified if
run_mode
istask
.Example:
3
curl -X PATCH "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/jobs/${name}" -H "Authorization: ${token}" -H "Content-Type: application/merge-patch+json" -d '{ }'
jobPatchModel := &codeenginev2.JobPatch{ } jobPatchModelAsPatch, asPatchErr := jobPatchModel.AsPatch() Expect(asPatchErr).To(BeNil()) updateJobOptions := codeEngineService.NewUpdateJobOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-job", "testString", jobPatchModelAsPatch, ) job, response, err := codeEngineService.UpdateJob(updateJobOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(job, "", " ") fmt.Println(string(b))
JobPatch jobPatchModel = new JobPatch.Builder() .build(); Map<String, Object> jobPatchModelAsPatch = jobPatchModel.asPatch(); UpdateJobOptions updateJobOptions = new UpdateJobOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-job") .ifMatch("testString") .job(jobPatchModelAsPatch) .build(); Response<Job> response = codeEngineService.updateJob(updateJobOptions).execute(); Job job = response.getResult(); System.out.println(job);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-job', ifMatch: 'testString', }; let res; try { res = await codeEngineService.updateJob(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
job_patch_model = {} response = code_engine_service.update_job( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-job', if_match='testString', job=job_patch_model, ) job = response.get_result() print(json.dumps(job, indent=2))
Response
Job is the response model for job resources
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the job instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
When you provision a new job, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/jobs/my-job
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the image that is used for this job. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
The name of the job.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the job.
Possible values: [
job_v2
]Set arguments for the job that are passed to start job run containers. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Set commands for the job that are passed to start job run containers. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
References to config maps, secrets or literal values, which are defined by the function owner and are exposed as environment variables in the job run.
Possible values: 0 ≤ number of items ≤ 100
The mode for runs of the job. Valid values are
task
anddaemon
. Intask
mode, themax_execution_time
andretry_limit
properties apply. Indaemon
mode, since there is no timeout and failed instances are restarted indefinitely, themax_execution_time
andretry_limit
properties are not allowed.Possible values: [
task
,daemon
]Possible values: length ≥ 0, Value must match regular expression
^(task|daemon)$
Example:
task
Optional mounts of config maps or secrets.
Possible values: 0 ≤ number of items ≤ 100
Define a custom set of array indices as a comma-separated list containing single values and hyphen-separated ranges, such as 5,12-14,23,27. Each instance gets its array index value from the environment variable JOB_INDEX. The number of unique array indices that you specify with this parameter determines the number of job instances to run.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?(?:,(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?)*$
Example:
1-5,7-8,10
Optional amount of CPU set for the instance of the job. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of ephemeral storage to set for the instance of the job. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Optional amount of memory set for the instance of the job. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
Reference to a build that is associated with the job.
Example:
my-build
Reference to a build run that is associated with the job.
Example:
my-build-run
References to config maps, secrets or literal values, which are defined and set by Code Engine and are exposed as environment variables in the job run.
Possible values: 0 ≤ number of items ≤ 100
The name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the job / job runs will be created but submitted job runs will fail, until this property is provided, too. This property must not be set on a job run, which references a job template.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
The user ID (UID) to run the job.
Example:
1001
The name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
. This property must not be set on a job run, which references a job template.Possible values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Example:
default
The maximum execution time in seconds for runs of the job. This property can only be specified if
run_mode
istask
.Example:
7200
The number of times to rerun an instance of the job before the job is marked as failed. This property can only be specified if
run_mode
istask
.Example:
3
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-job", "id": "7e49dd78-09d0-45c7-ad7e-cd968e0e7747", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T21:40:40+01:00", "resource_type": "job_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/jobs/my-job", "image_reference": "icr.io/codeengine/helloworld", "run_arguments": [], "run_commands": [], "run_mode": "task", "run_volume_mounts": [], "run_env_variables": [], "scale_array_spec": "0", "scale_max_execution_time": 7200, "scale_retry_limit": 3, "scale_cpu_limit": "1", "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "status": "ready", "entity_tag": "2386231540" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
Optional name of the job that you want to use to filter.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job
Optional maximum number of job runs per page.
Possible values: 1 ≤ value ≤ 500
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/job_runs" -H "Authorization: ${token}"
listJobRunsOptions := &codeenginev2.ListJobRunsOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), JobName: core.StringPtr("my-job"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewJobRunsPager(listJobRunsOptions) if err != nil { panic(err) } var allResults []codeenginev2.JobRun for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListJobRunsOptions listJobRunsOptions = new ListJobRunsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .jobName("my-job") .limit(Long.valueOf("100")) .build(); JobRunsPager pager = new JobRunsPager(codeEngineService, listJobRunsOptions); List<JobRun> allResults = new ArrayList<>(); while (pager.hasNext()) { List<JobRun> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', jobName: 'my-job', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.JobRunsPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = JobRunsPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', job_name='my-job', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of job runs and pagination information.
List of all jobs.
Possible values: 0 ≤ number of items ≤ 500
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "job_runs": [ { "job_name": "my-job", "name": "my-job-run-1", "id": "ced5039e-b1d3-4c51-aa29-8dbde3531ace", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T22:06:21+01:00", "resource_type": "job_run_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/jobs/my-job-run-1", "image_reference": "icr.io/codeengine/helloworld", "run_arguments": [], "run_commands": [], "run_mode": "task", "run_volume_mounts": [], "run_env_variables": [], "scale_array_spec": "0", "scale_max_execution_time": 7200, "scale_retry_limit": 3, "scale_cpu_limit": "1", "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "status": "completed" } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
Job run prototype
{
"name": "my-job-run-1",
"job_name": "my-job"
}
The name of the image that is used for this job. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
The name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the job / job runs will be created but submitted job runs will fail, until this property is provided, too. This property must not be set on a job run, which references a job template.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Optional name of the job on which this job run is based on. If specified, the job run will inherit the configuration of the referenced job.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job
The name of the job. Use a name that is unique within the project.
Possible values: 1 ≤ length ≤ 53, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job-run
Set arguments for the job that are passed to start job run containers. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
The user ID (UID) to run the job.
Default:
0
Example:
1001
Set commands for the job that are passed to start job run containers. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Optional references to config maps, secrets or literal values.
Possible values: 0 ≤ number of items ≤ 100
The mode for runs of the job. Valid values are
task
anddaemon
. Intask
mode, themax_execution_time
andretry_limit
properties apply. Indaemon
mode, since there is no timeout and failed instances are restarted indefinitely, themax_execution_time
andretry_limit
properties are not allowed.Allowable values: [
task
,daemon
]Possible values: length ≥ 0, Value must match regular expression
^(task|daemon)$
Default:
task
Example:
task
The name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
. This property must not be set on a job run, which references a job template.Allowable values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Default:
default
Example:
default
Optional mounts of config maps or a secrets.
Possible values: 0 ≤ number of items ≤ 100
Optional value to override the JOB_ARRAY_SIZE environment variable for a job run.
Example:
2
Define a custom set of array indices as a comma-separated list containing single values and hyphen-separated ranges, such as 5,12-14,23,27. Each instance gets its array index value from the environment variable JOB_INDEX. The number of unique array indices that you specify with this parameter determines the number of job instances to run.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?(?:,(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?)*$
Default:
0
Example:
1-5,7-8,10
Optional amount of CPU set for the instance of the job. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Default:
1
Example:
1
Optional amount of ephemeral storage to set for the instance of the job. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Default:
400M
Example:
4G
The maximum execution time in seconds for runs of the job. This property can only be specified if
run_mode
istask
.Default:
7200
Example:
7200
Optional amount of memory set for the instance of the job. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Default:
4G
Example:
4G
The number of times to rerun an instance of the job before the job is marked as failed. This property can only be specified if
run_mode
istask
.Default:
3
Example:
3
curl -X POST "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/job_runs" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ }'
createJobRunOptions := codeEngineService.NewCreateJobRunOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", ) jobRun, response, err := codeEngineService.CreateJobRun(createJobRunOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(jobRun, "", " ") fmt.Println(string(b))
CreateJobRunOptions createJobRunOptions = new CreateJobRunOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .build(); Response<JobRun> response = codeEngineService.createJobRun(createJobRunOptions).execute(); JobRun jobRun = response.getResult(); System.out.println(jobRun);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', }; let res; try { res = await codeEngineService.createJobRun(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.create_job_run( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', ) job_run = response.get_result() print(json.dumps(job_run, indent=2))
Response
Response model for job run resources.
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
Set arguments for the job that are passed to start job run containers. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Set commands for the job that are passed to start job run containers. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
References to config maps, secrets or literal values, which are defined by the function owner and are exposed as environment variables in the job run.
Possible values: 0 ≤ number of items ≤ 100
Optional mounts of config maps or secrets.
Possible values: 0 ≤ number of items ≤ 100
References to config maps, secrets or literal values, which are defined and set by Code Engine and are exposed as environment variables in the job run.
Possible values: 0 ≤ number of items ≤ 100
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
When you provision a new job run, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/job_runs/my-job-run
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the image that is used for this job. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
The name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the job / job runs will be created but submitted job runs will fail, until this property is provided, too. This property must not be set on a job run, which references a job template.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Optional name of the job reference of this job run. If specified, the job run will inherit the configuration of the referenced job.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job
The name of the job run.
Possible values: 1 ≤ length ≤ 53, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job-run
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the job run.
Possible values: [
job_run_v2
]The user ID (UID) to run the job.
Example:
1001
The mode for runs of the job. Valid values are
task
anddaemon
. Intask
mode, themax_execution_time
andretry_limit
properties apply. Indaemon
mode, since there is no timeout and failed instances are restarted indefinitely, themax_execution_time
andretry_limit
properties are not allowed.Possible values: [
task
,daemon
]Possible values: length ≥ 0, Value must match regular expression
^(task|daemon)$
Example:
task
The name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
. This property must not be set on a job run, which references a job template.Possible values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Example:
default
Optional value to override the JOB_ARRAY_SIZE environment variable for a job run.
Example:
2
Define a custom set of array indices as a comma-separated list containing single values and hyphen-separated ranges, such as 5,12-14,23,27. Each instance gets its array index value from the environment variable JOB_INDEX. The number of unique array indices that you specify with this parameter determines the number of job instances to run.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?(?:,(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?)*$
Example:
1-5,7-8,10
Optional amount of CPU set for the instance of the job. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of ephemeral storage to set for the instance of the job. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
The maximum execution time in seconds for runs of the job. This property can only be specified if
run_mode
istask
.Example:
7200
Optional amount of memory set for the instance of the job. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
The number of times to rerun an instance of the job before the job is marked as failed. This property can only be specified if
run_mode
istask
.Example:
3
The current status of the job run.
Possible values: [
failed
,completed
,running
,pending
]Example:
failed
The detailed status of the job run.
Examples:{ "failed": 0, "pending": 0, "requested": 0, "running": 0, "succeeded": 1, "unknown": 0, "start_time": "2022-09-22T17:34:00Z", "completion_time": "2022-09-22T17:40:00Z" }
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "job_name": "my-job", "name": "my-job-run-1", "id": "ced5039e-b1d3-4c51-aa29-8dbde3531ace", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T22:06:21+01:00", "resource_type": "job_run_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/jobs/my-job-run-1", "image_reference": "icr.io/codeengine/helloworld", "run_arguments": [], "run_commands": [], "run_mode": "task", "run_volume_mounts": [], "run_env_variables": [], "scale_array_spec": "0", "scale_max_execution_time": 7200, "scale_retry_limit": 3, "scale_cpu_limit": "1", "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "status": "completed" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your job run.
Possible values: 1 ≤ length ≤ 53, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job-run
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/job_runs/${name}" -H "Authorization: ${token}"
getJobRunOptions := codeEngineService.NewGetJobRunOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-job-run", ) jobRun, response, err := codeEngineService.GetJobRun(getJobRunOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(jobRun, "", " ") fmt.Println(string(b))
GetJobRunOptions getJobRunOptions = new GetJobRunOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-job-run") .build(); Response<JobRun> response = codeEngineService.getJobRun(getJobRunOptions).execute(); JobRun jobRun = response.getResult(); System.out.println(jobRun);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-job-run', }; let res; try { res = await codeEngineService.getJobRun(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_job_run( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-job-run', ) job_run = response.get_result() print(json.dumps(job_run, indent=2))
Response
Response model for job run resources.
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
Set arguments for the job that are passed to start job run containers. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Set commands for the job that are passed to start job run containers. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.
Possible values: 0 ≤ number of items ≤ 100, 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
References to config maps, secrets or literal values, which are defined by the function owner and are exposed as environment variables in the job run.
Possible values: 0 ≤ number of items ≤ 100
Optional mounts of config maps or secrets.
Possible values: 0 ≤ number of items ≤ 100
References to config maps, secrets or literal values, which are defined and set by Code Engine and are exposed as environment variables in the job run.
Possible values: 0 ≤ number of items ≤ 100
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
When you provision a new job run, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/job_runs/my-job-run
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the image that is used for this job. The format is
REGISTRY/NAMESPACE/REPOSITORY:TAG
whereREGISTRY
andTAG
are optional. IfREGISTRY
is not specified, the default isdocker.io
. IfTAG
is not specified, the default islatest
. If the image reference points to a registry that requires authentication, make sure to also specify the propertyimage_secret
.Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
icr.io/codeengine/helloworld
The name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the job / job runs will be created but submitted job runs will fail, until this property is provided, too. This property must not be set on a job run, which references a job template.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Optional name of the job reference of this job run. If specified, the job run will inherit the configuration of the referenced job.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job
The name of the job run.
Possible values: 1 ≤ length ≤ 53, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job-run
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the job run.
Possible values: [
job_run_v2
]The user ID (UID) to run the job.
Example:
1001
The mode for runs of the job. Valid values are
task
anddaemon
. Intask
mode, themax_execution_time
andretry_limit
properties apply. Indaemon
mode, since there is no timeout and failed instances are restarted indefinitely, themax_execution_time
andretry_limit
properties are not allowed.Possible values: [
task
,daemon
]Possible values: length ≥ 0, Value must match regular expression
^(task|daemon)$
Example:
task
The name of the service account. For built-in service accounts, you can use the shortened names
manager
,none
,reader
, andwriter
. This property must not be set on a job run, which references a job template.Possible values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Example:
default
Optional value to override the JOB_ARRAY_SIZE environment variable for a job run.
Example:
2
Define a custom set of array indices as a comma-separated list containing single values and hyphen-separated ranges, such as 5,12-14,23,27. Each instance gets its array index value from the environment variable JOB_INDEX. The number of unique array indices that you specify with this parameter determines the number of job instances to run.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?(?:,(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d)(?:-(?:[1-9]\d\d\d\d\d\d|[1-9]\d\d\d\d\d|[1-9]\d\d\d\d|[1-9]\d\d\d|[1-9]\d\d|[1-9]?\d))?)*$
Example:
1-5,7-8,10
Optional amount of CPU set for the instance of the job. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of ephemeral storage to set for the instance of the job. The amount specified as ephemeral storage, must not exceed the amount of
scale_memory_limit
. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
The maximum execution time in seconds for runs of the job. This property can only be specified if
run_mode
istask
.Example:
7200
Optional amount of memory set for the instance of the job. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
4G
The number of times to rerun an instance of the job before the job is marked as failed. This property can only be specified if
run_mode
istask
.Example:
3
The current status of the job run.
Possible values: [
failed
,completed
,running
,pending
]Example:
failed
The detailed status of the job run.
Examples:{ "failed": 0, "pending": 0, "requested": 0, "running": 0, "succeeded": 1, "unknown": 0, "start_time": "2022-09-22T17:34:00Z", "completion_time": "2022-09-22T17:40:00Z" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "job_name": "my-job", "name": "my-job-run-1", "id": "ced5039e-b1d3-4c51-aa29-8dbde3531ace", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T22:06:21+01:00", "resource_type": "job_run_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/jobs/my-job-run-1", "image_reference": "icr.io/codeengine/helloworld", "run_arguments": [], "run_commands": [], "run_mode": "task", "run_volume_mounts": [], "run_env_variables": [], "scale_array_spec": "0", "scale_max_execution_time": 7200, "scale_retry_limit": 3, "scale_cpu_limit": "1", "scale_memory_limit": "4G", "scale_ephemeral_storage_limit": "400M", "status": "completed" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your job run.
Possible values: 1 ≤ length ≤ 53, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-job-run
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/job_runs/${name}" -H "Authorization: ${token}"
deleteJobRunOptions := codeEngineService.NewDeleteJobRunOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-job-run", ) response, err := codeEngineService.DeleteJobRun(deleteJobRunOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteJobRun(): %d\n", response.StatusCode) }
DeleteJobRunOptions deleteJobRunOptions = new DeleteJobRunOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-job-run") .build(); Response<Void> response = codeEngineService.deleteJobRun(deleteJobRunOptions).execute();
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-job-run', }; try { await codeEngineService.deleteJobRun(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_job_run( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-job-run', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
No Request Parameters
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/function_runtimes" -H "Authorization: ${token}"
listFunctionRuntimesOptions := codeEngineService.NewListFunctionRuntimesOptions() functionRuntimeList, response, err := codeEngineService.ListFunctionRuntimes(listFunctionRuntimesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(functionRuntimeList, "", " ") fmt.Println(string(b))
ListFunctionRuntimesOptions listFunctionRuntimesOptions = new ListFunctionRuntimesOptions(); Response<FunctionRuntimeList> response = codeEngineService.listFunctionRuntimes(listFunctionRuntimesOptions).execute(); FunctionRuntimeList functionRuntimeList = response.getResult(); System.out.println(functionRuntimeList);
let res; try { res = await codeEngineService.listFunctionRuntimes({}); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.list_function_runtimes() function_runtime_list = response.get_result() print(json.dumps(function_runtime_list, indent=2))
Response
Contains a list of Function runtimes.
List of all Function runtimes.
Possible values: 0 ≤ number of items ≤ 100
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "function_runtimes": [ { "name": "Node.js 18", "id": "nodejs-18", "family": "nodejs", "default": true, "optimized": true, "deprecated": false }, { "name": "Python 3.11", "id": "python-3.11", "family": "python", "default": true, "optimized": true, "deprecated": false } ] }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
Optional maximum number of functions per page.
Possible values: 1 ≤ value ≤ 500
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the 'next_url' field of the operation response.
Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/functions" -H "Authorization: ${token}"
listFunctionsOptions := &codeenginev2.ListFunctionsOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewFunctionsPager(listFunctionsOptions) if err != nil { panic(err) } var allResults []codeenginev2.Function for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListFunctionsOptions listFunctionsOptions = new ListFunctionsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .limit(Long.valueOf("100")) .build(); FunctionsPager pager = new FunctionsPager(codeEngineService, listFunctionsOptions); List<Function> allResults = new ArrayList<>(); while (pager.hasNext()) { List<Function> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.FunctionsPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = FunctionsPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of functions and pagination information.
List of all functions.
Possible values: 0 ≤ number of items ≤ 500
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "functions": [ { "name": "my-function", "id": "3bf57be1-66f0-4a89-ad34-ed77c049935e", "project_id": "15314cc3-85b4-4338-903f-c28cdee6d005", "created_at": "2023-11-15T22:07:55Z", "resource_type": "function_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/functions/my-function", "region": "us-east", "runtime": "nodejs-18", "code_binary": true, "code_reference": "icr.io/codeengine/samples/function-nodejs-codebundle", "code_secret": "my-secret", "entity_tag": "1", "endpoint": "https://my-function.uyh5shf7s0f.us-east.codeengine.appdomain.cloud", "endpoint_internal": "http://my-function.uyh5shf7s0f.function.cluster.local", "managed_domain_mappings": "local_public", "scale_cpu_limit": "0.5", "scale_memory_limit": "2G", "scale_concurrency": 1, "scale_max_execution_time": 60, "scale_down_delay": 0, "status": "ready", "status_details": { "reason": "ready" }, "run_env_variables": [ { "type": "literal", "name": "CE_API_BASE_URL", "value": "https://api.us-east.codeengine.cloud.ibm.com" }, { "type": "literal", "name": "CE_DOMAIN", "value": "us-east.codeengine.appdomain.cloud" }, { "type": "literal", "name": "CE_FUNCTION", "value": "my-function" }, { "type": "literal", "name": "CE_REGION", "value": "us-east" }, { "type": "literal", "name": "CE_SUBDOMAIN", "value": "uyh5shf7s0f" }, { "type": "literal", "name": "CE_PROJECT_ID", "value": "15314cc3-85b4-4338-903f-c28cdee6d005" } ] } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
Function prototype
{
"name": "my-function",
"runtime": "nodejs-18",
"code_reference": "data:text/plain;base64,<base64encoded-source-code>"
}
Specifies either a reference to a code bundle or the source code itself. To specify the source code, use the data URL scheme and include the source code as base64 encoded. The data URL scheme is defined in RFC 2397.
Possible values: 1 ≤ length ≤ 1048576, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$|data:([-\w]+\/[-+\w.]+)?(;?\w+=[-\w]+)*;base64,.*
Example:
data:text/plain;base64,<base64encoded-source-code>
The name of the function. Use a name that is unique within the project.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-function
The managed runtime used to execute the injected code.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]*\-[0-9]*(\.[0-9]*)?$
Example:
nodejs-18
Specifies whether the code is binary or not. Defaults to false when
code_reference
is set to a data URL. Whencode_reference
is set to a code bundle URL, this field is always true.Specifies the name of the function that should be invoked.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-zA-Z_][a-zA-Z0-9_]*$
Default:
main
Example:
main
The name of the secret that is used to access the specified
code_reference
. The secret is used to authenticate with a non-public endpoint that is specified ascode_reference
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Optional value controlling which of the system managed domain mappings will be setup for the function. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports function private visibility.
Allowable values: [
local
,local_private
,local_public
]Default:
local_public
Example:
local_public
Optional references to config maps, secrets or literal values.
Possible values: 0 ≤ number of items ≤ 100
Number of parallel requests handled by a single instance, supported only by Node.js, default is
1
.Possible values: 1 ≤ value ≤ 100
Default:
1
Optional amount of CPU set for the instance of the function. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Default:
1
Example:
1
Optional amount of time in seconds that delays the scale down behavior for a function.
Possible values: 0 ≤ value ≤ 600
Default:
1
Example:
300
Timeout in secs after which the function is terminated
Possible values: 1 ≤ value ≤ 120
Default:
60
Example:
60
Optional amount of memory set for the instance of the function. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Default:
4G
Example:
1G
curl -X POST "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/functions" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ "name": "my-function", "runtime": "nodejs-18", "code_reference": "data:text/plain;base64,<base64encoded-source-code>" }'
createFunctionOptions := codeEngineService.NewCreateFunctionOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "data:text/plain;base64,<base64encoded-source-code>", "my-function", "nodejs-18", ) function, response, err := codeEngineService.CreateFunction(createFunctionOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(function, "", " ") fmt.Println(string(b))
CreateFunctionOptions createFunctionOptions = new CreateFunctionOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .codeReference("data:text/plain;base64,<base64encoded-source-code>") .name("my-function") .runtime("nodejs-18") .build(); Response<Function> response = codeEngineService.createFunction(createFunctionOptions).execute(); Function function = response.getResult(); System.out.println(function);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', codeReference: 'data:text/plain;base64,<base64encoded-source-code>', name: 'my-function', runtime: 'nodejs-18', }; let res; try { res = await codeEngineService.createFunction(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.create_function( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', code_reference='data:text/plain;base64,<base64encoded-source-code>', name='my-function', runtime='nodejs-18', ) function = response.get_result() print(json.dumps(function, indent=2))
Response
Function is the response model for function resources
Specifies whether the code is binary or not. Defaults to false when
code_reference
is set to a data URL. Whencode_reference
is set to a code bundle URL, this field is always true.Specifies either a reference to a code bundle or the source code itself. To specify the source code, use the data URL scheme and include the source code as base64 encoded. The data URL scheme is defined in RFC 2397.
Possible values: 1 ≤ length ≤ 1048576, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$|data:([-\w]+\/[-+\w.]+)?(;?\w+=[-\w]+)*;base64,.*
Example:
data:text/plain;base64,<base64encoded-source-code>
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
URL to function that is only visible within the project.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
http://my-function.vg67hzldruk.svc.cluster.local
The version of the function instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
When you provision a new function, a relative URL path is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/functions/my-function
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
Optional value controlling which of the system managed domain mappings will be setup for the function. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports function private visibility.
Possible values: [
local
,local_private
,local_public
]Example:
local_public
The name of the function.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-function
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the function.
Possible values: [
function_v2
]References to config maps, secrets or literal values, which are defined by the function owner and are exposed as environment variables in the function.
Possible values: 0 ≤ number of items ≤ 100
The managed runtime used to execute the injected code.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]*\-[0-9]*(\.[0-9]*)?$
Example:
nodejs-18
Number of parallel requests handled by a single instance, supported only by Node.js, default is
1
.Possible values: 1 ≤ value ≤ 100
Optional amount of CPU set for the instance of the function. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of time in seconds that delays the scale down behavior for a function.
Possible values: 0 ≤ value ≤ 600
Example:
300
Timeout in secs after which the function is terminated
Possible values: 1 ≤ value ≤ 120
Example:
60
Optional amount of memory set for the instance of the function. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1G
The current status of the function.
Possible values: [
offline
,deploying
,ready
,failed
]Example:
offline
The detailed status of the function.
Specifies the name of the function that should be invoked.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-zA-Z_][a-zA-Z0-9_]*$
Example:
main
The name of the secret that is used to access the specified
code_reference
. The secret is used to authenticate with a non-public endpoint that is specified ascode_reference
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
References to config maps, secrets or literal values, which are defined and set by Code Engine and are exposed as environment variables in the function.
Possible values: 0 ≤ number of items ≤ 100
URL to invoke the function.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://my-function.vg67hzldruk.eu-de.codeengine.appdomain.cloud
Status Code
Created
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "name": "my-function", "id": "3bf57be1-66f0-4a89-ad34-ed77c049935e", "region": "us-east", "project_id": "15314cc3-85b4-4338-903f-c28cdee6d005", "created_at": "2023-11-15T22:07:55Z", "resource_type": "function_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/functions/my-function", "runtime": "nodejs-18", "code_binary": false, "code_reference": "data:text/plain;base64,<base64encoded-source-code>", "managed_domain_mappings": "local_public", "entity_tag": "1", "endpoint": "https://my-function.uyh5shf7s0f.us-east.codeengine.appdomain.cloud", "endpoint_internal": "http://my-function.uyh5shf7s0f.function.cluster.local", "scale_cpu_limit": "0.5", "scale_memory_limit": "2G", "scale_concurrency": 1, "scale_max_execution_time": 60, "scale_down_delay": 0, "status": "ready", "status_details": { "reason": "ready" }, "run_env_variables": [] }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your function.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-function
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/functions/${name}" -H "Authorization: ${token}"
getFunctionOptions := codeEngineService.NewGetFunctionOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-function", ) function, response, err := codeEngineService.GetFunction(getFunctionOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(function, "", " ") fmt.Println(string(b))
GetFunctionOptions getFunctionOptions = new GetFunctionOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-function") .build(); Response<Function> response = codeEngineService.getFunction(getFunctionOptions).execute(); Function function = response.getResult(); System.out.println(function);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-function', }; let res; try { res = await codeEngineService.getFunction(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_function( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-function', ) function = response.get_result() print(json.dumps(function, indent=2))
Response
Function is the response model for function resources
Specifies whether the code is binary or not. Defaults to false when
code_reference
is set to a data URL. Whencode_reference
is set to a code bundle URL, this field is always true.Specifies either a reference to a code bundle or the source code itself. To specify the source code, use the data URL scheme and include the source code as base64 encoded. The data URL scheme is defined in RFC 2397.
Possible values: 1 ≤ length ≤ 1048576, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$|data:([-\w]+\/[-+\w.]+)?(;?\w+=[-\w]+)*;base64,.*
Example:
data:text/plain;base64,<base64encoded-source-code>
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
URL to function that is only visible within the project.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
http://my-function.vg67hzldruk.svc.cluster.local
The version of the function instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
When you provision a new function, a relative URL path is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/functions/my-function
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
Optional value controlling which of the system managed domain mappings will be setup for the function. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports function private visibility.
Possible values: [
local
,local_private
,local_public
]Example:
local_public
The name of the function.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-function
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the function.
Possible values: [
function_v2
]References to config maps, secrets or literal values, which are defined by the function owner and are exposed as environment variables in the function.
Possible values: 0 ≤ number of items ≤ 100
The managed runtime used to execute the injected code.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]*\-[0-9]*(\.[0-9]*)?$
Example:
nodejs-18
Number of parallel requests handled by a single instance, supported only by Node.js, default is
1
.Possible values: 1 ≤ value ≤ 100
Optional amount of CPU set for the instance of the function. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of time in seconds that delays the scale down behavior for a function.
Possible values: 0 ≤ value ≤ 600
Example:
300
Timeout in secs after which the function is terminated
Possible values: 1 ≤ value ≤ 120
Example:
60
Optional amount of memory set for the instance of the function. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1G
The current status of the function.
Possible values: [
offline
,deploying
,ready
,failed
]Example:
offline
The detailed status of the function.
Specifies the name of the function that should be invoked.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-zA-Z_][a-zA-Z0-9_]*$
Example:
main
The name of the secret that is used to access the specified
code_reference
. The secret is used to authenticate with a non-public endpoint that is specified ascode_reference
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
References to config maps, secrets or literal values, which are defined and set by Code Engine and are exposed as environment variables in the function.
Possible values: 0 ≤ number of items ≤ 100
URL to invoke the function.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://my-function.vg67hzldruk.eu-de.codeengine.appdomain.cloud
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-function", "id": "3bf57be1-66f0-4a89-ad34-ed77c049935e", "region": "us-east", "project_id": "15314cc3-85b4-4338-903f-c28cdee6d005", "created_at": "2023-11-15T22:07:55Z", "resource_type": "function_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/functions/my-function", "runtime": "nodejs-18", "code_binary": false, "code_reference": "data:text/plain;base64,<base64encoded-source-code>", "managed_domain_mappings": "local_public", "entity_tag": "1", "endpoint": "https://my-function.uyh5shf7s0f.us-east.codeengine.appdomain.cloud", "endpoint_internal": "http://my-function.uyh5shf7s0f.function.cluster.local", "scale_cpu_limit": "0.5", "scale_memory_limit": "2G", "scale_concurrency": 1, "scale_max_execution_time": 60, "scale_down_delay": 0, "status": "ready", "status_details": { "reason": "ready" }, "run_env_variables": [] }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your function.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-function
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/functions/${name}" -H "Authorization: ${token}"
deleteFunctionOptions := codeEngineService.NewDeleteFunctionOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-function", ) response, err := codeEngineService.DeleteFunction(deleteFunctionOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteFunction(): %d\n", response.StatusCode) }
DeleteFunctionOptions deleteFunctionOptions = new DeleteFunctionOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-function") .build(); Response<Void> response = codeEngineService.deleteFunction(deleteFunctionOptions).execute();
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-function', }; try { await codeEngineService.deleteFunction(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_function( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-function', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Custom Headers
Version of the function settings to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the function. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^[0-9]*$
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your function.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-function
Query Parameters
The API version, in format
YYYY-MM-DD
. For the API behavior documented here, specify any date between2021-03-31
and2024-11-18
.Possible values: length = 10, Value must match regular expression
^[0-9]{4}-[0-9]{2}-[0-9]{2}$
Example:
2024-11-18
Function patch
{
"code_reference": "icr.io/codeengine/samples/function-nodejs-codebundle",
"code_secret": "my-secret",
"scale_cpu_limit": "1",
"scale_memory_limit": "4G"
}
Specifies whether the code is binary or not. Defaults to false when
code_reference
is set to a data URL. Whencode_reference
is set to a code bundle URL, this field is always true.Specifies the name of the function that should be invoked.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-zA-Z_][a-zA-Z0-9_]*$
Example:
main
Specifies either a reference to a code bundle or the source code itself. To specify the source code, use the data URL scheme and include the source code as base64 encoded. The data URL scheme is defined in RFC 2397.
Possible values: 1 ≤ length ≤ 1048576, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$|data:([-\w]+\/[-+\w.]+)?(;?\w+=[-\w]+)*;base64,.*
Example:
data:text/plain;base64,<base64encoded-source-code>
The name of the secret that is used to access the specified
code_reference
. The secret is used to authenticate with a non-public endpoint that is specified ascode_reference
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Optional value controlling which of the system managed domain mappings will be setup for the function. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports function private visibility.
Allowable values: [
local
,local_private
,local_public
]Example:
local_public
Optional references to config maps, secrets or literal values.
Possible values: 0 ≤ number of items ≤ 100
The managed runtime used to execute the injected code.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]*\-[0-9]*(\.[0-9]*)?$
Example:
nodejs-18
Number of parallel requests handled by a single instance, supported only by Node.js, default is
1
.Possible values: 1 ≤ value ≤ 100
Default:
1
Optional amount of CPU set for the instance of the function. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of time in seconds that delays the scale down behavior for a function.
Possible values: 0 ≤ value ≤ 600
Default:
1
Example:
300
Timeout in secs after which the function is terminated
Possible values: 1 ≤ value ≤ 120
Default:
60
Example:
60
Optional amount of memory set for the instance of the function. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1G
curl -X PATCH "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/functions/${name}" -H "Authorization: ${token}" -H "Content-Type: application/merge-patch+json" -d '{ }'
functionPatchModel := &codeenginev2.FunctionPatch{ } functionPatchModelAsPatch, asPatchErr := functionPatchModel.AsPatch() Expect(asPatchErr).To(BeNil()) updateFunctionOptions := codeEngineService.NewUpdateFunctionOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-function", "testString", functionPatchModelAsPatch, ) function, response, err := codeEngineService.UpdateFunction(updateFunctionOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(function, "", " ") fmt.Println(string(b))
FunctionPatch functionPatchModel = new FunctionPatch.Builder() .build(); Map<String, Object> functionPatchModelAsPatch = functionPatchModel.asPatch(); UpdateFunctionOptions updateFunctionOptions = new UpdateFunctionOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-function") .ifMatch("testString") .function(functionPatchModelAsPatch) .build(); Response<Function> response = codeEngineService.updateFunction(updateFunctionOptions).execute(); Function function = response.getResult(); System.out.println(function);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-function', ifMatch: 'testString', }; let res; try { res = await codeEngineService.updateFunction(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
function_patch_model = {} response = code_engine_service.update_function( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-function', if_match='testString', function=function_patch_model, ) function = response.get_result() print(json.dumps(function, indent=2))
Response
Function is the response model for function resources
Specifies whether the code is binary or not. Defaults to false when
code_reference
is set to a data URL. Whencode_reference
is set to a code bundle URL, this field is always true.Specifies either a reference to a code bundle or the source code itself. To specify the source code, use the data URL scheme and include the source code as base64 encoded. The data URL scheme is defined in RFC 2397.
Possible values: 1 ≤ length ≤ 1048576, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$|data:([-\w]+\/[-+\w.]+)?(;?\w+=[-\w]+)*;base64,.*
Example:
data:text/plain;base64,<base64encoded-source-code>
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
URL to function that is only visible within the project.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
http://my-function.vg67hzldruk.svc.cluster.local
The version of the function instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
When you provision a new function, a relative URL path is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/functions/my-function
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
Optional value controlling which of the system managed domain mappings will be setup for the function. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports function private visibility.
Possible values: [
local
,local_private
,local_public
]Example:
local_public
The name of the function.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:
my-function
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the function.
Possible values: [
function_v2
]References to config maps, secrets or literal values, which are defined by the function owner and are exposed as environment variables in the function.
Possible values: 0 ≤ number of items ≤ 100
The managed runtime used to execute the injected code.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z]*\-[0-9]*(\.[0-9]*)?$
Example:
nodejs-18
Number of parallel requests handled by a single instance, supported only by Node.js, default is
1
.Possible values: 1 ≤ value ≤ 100
Optional amount of CPU set for the instance of the function. For valid values see Supported memory and CPU combinations.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1
Optional amount of time in seconds that delays the scale down behavior for a function.
Possible values: 0 ≤ value ≤ 600
Example:
300
Timeout in secs after which the function is terminated
Possible values: 1 ≤ value ≤ 120
Example:
60
Optional amount of memory set for the instance of the function. For valid values see Supported memory and CPU combinations. The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see Units of measurement.
Possible values: 0 ≤ length ≤ 10, Value must match regular expression
^([0-9.]+)([eEinumkKMGTPB]*)$
Example:
1G
The current status of the function.
Possible values: [
offline
,deploying
,ready
,failed
]Example:
offline
The detailed status of the function.
Specifies the name of the function that should be invoked.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-zA-Z_][a-zA-Z0-9_]*$
Example:
main
The name of the secret that is used to access the specified
code_reference
. The secret is used to authenticate with a non-public endpoint that is specified ascode_reference
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
References to config maps, secrets or literal values, which are defined and set by Code Engine and are exposed as environment variables in the function.
Possible values: 0 ≤ number of items ≤ 100
URL to invoke the function.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://my-function.vg67hzldruk.eu-de.codeengine.appdomain.cloud
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-function", "id": "3bf57be1-66f0-4a89-ad34-ed77c049935e", "region": "us-east", "project_id": "15314cc3-85b4-4338-903f-c28cdee6d005", "created_at": "2023-11-15T22:07:55Z", "resource_type": "function_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/functions/my-function", "runtime": "nodejs-18", "code_binary": false, "code_reference": "data:text/plain;base64,<base64encoded-source-code>", "managed_domain_mappings": "local_public", "entity_tag": "1", "endpoint": "https://my-function.uyh5shf7s0f.us-east.codeengine.appdomain.cloud", "endpoint_internal": "http://my-function.uyh5shf7s0f.function.cluster.local", "scale_cpu_limit": "0.5", "scale_memory_limit": "2G", "scale_concurrency": 1, "scale_max_execution_time": 60, "scale_down_delay": 0, "status": "ready", "status_details": { "reason": "ready" }, "run_env_variables": [] }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
Optional maximum number of bindings per page.
Possible values: 1 ≤ value ≤ 500
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/bindings" -H "Authorization: ${token}"
listBindingsOptions := &codeenginev2.ListBindingsOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewBindingsPager(listBindingsOptions) if err != nil { panic(err) } var allResults []codeenginev2.Binding for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListBindingsOptions listBindingsOptions = new ListBindingsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .limit(Long.valueOf("100")) .build(); BindingsPager pager = new BindingsPager(codeEngineService, listBindingsOptions); List<Binding> allResults = new ArrayList<>(); while (pager.hasNext()) { List<Binding> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.BindingsPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = BindingsPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of bindings and pagination information.
List of all bindings.
Possible values: 0 ≤ number of items ≤ 500
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "bindings": [ { "component": { "resource_type": "app_v2", "name": "my-app-1" }, "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/bindings/app_my-app-1_my-service-access_PREFIX", "id": "app_my-app-1_my-service-access_PREFIX", "prefix": "PREFIX", "region": "us-east", "project_id": "4e49b3e0-27a8-48d2-a784-c7ee48bb863b", "resource_type": "binding_v2", "secret_name": "my-service-access", "status": "active" } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Create a binding
Create a binding. Creating a service binding with a Code Engine app will update the app, creating a new revision. For more information see the documentaion
POST /projects/{project_id}/bindings
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Binding prototype.
{
"component": {
"resource_type": "app_v2",
"name": "my-app-1"
},
"prefix": "PREFIX",
"secret_name": "my-service-access"
}
A reference to another component.
Examples:{ "resource_type": "app_v2", "name": "my-app-1" }
Optional value that is set as prefix in the component that is bound. Will be generated if not provided.
Possible values: 0 ≤ length ≤ 31, Value must match regular expression
^[A-Z]([_A-Z0-9]*[A-Z0-9])*$
Example:
MY_COS
The service access secret that is bound to a component.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-service-access
curl -X POST "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/bindings" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ "component": { "resource_type": "app_v2", "name": "my-app-1", }, "prefix": "MY_COS", "secret_name": "my-service-access" }'
componentRefModel := &codeenginev2.ComponentRef{ Name: core.StringPtr("my-app-1"), ResourceType: core.StringPtr("app_v2"), } createBindingOptions := codeEngineService.NewCreateBindingOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", componentRefModel, "MY_COS", "my-service-access", ) binding, response, err := codeEngineService.CreateBinding(createBindingOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(binding, "", " ") fmt.Println(string(b))
ComponentRef componentRefModel = new ComponentRef.Builder() .name("my-app-1") .resourceType("app_v2") .build(); CreateBindingOptions createBindingOptions = new CreateBindingOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .component(componentRefModel) .prefix("MY_COS") .secretName("my-service-access") .build(); Response<Binding> response = codeEngineService.createBinding(createBindingOptions).execute(); Binding binding = response.getResult(); System.out.println(binding);
// Request models needed by this operation. // ComponentRef const componentRefModel = { name: 'my-app-1', resource_type: 'app_v2', }; const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', component: componentRefModel, prefix: 'MY_COS', secretName: 'my-service-access', }; let res; try { res = await codeEngineService.createBinding(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
component_ref_model = { 'name': 'my-app-1', 'resource_type': 'app_v2', } response = code_engine_service.create_binding( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', component=component_ref_model, prefix='MY_COS', secret_name='my-service-access', ) binding = response.get_result() print(json.dumps(binding, indent=2))
Response
Describes the model of a binding.
A reference to another component.
Examples:{ "resource_type": "app_v2", "name": "my-app-1" }
When you provision a new binding, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/bindings/my-binding
The ID of the binding.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
.+
Example:
a172ced-b5f21bc-71ba50c-1638604
The value that is set as a prefix in the component that is bound.
Possible values: 0 ≤ length ≤ 31, Value must match regular expression
^[A-Z]([_A-Z0-9]*[A-Z0-9])*$
Example:
MY_COS
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The type of the binding.
Possible values: [
binding_v2
]The service access secret that is bound to a component.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-service-access
The current status of the binding.
Example:
active
Status Code
Created
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "component": { "resource_type": "app_v2", "name": "my-app-1" }, "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/bindings/a172ced-b5f21bc-71ba50c-1638604", "id": "a172ced-b5f21bc-71ba50c-1638604", "prefix": "PREFIX", "project_id": "15314cc3-85b4-4338-903f-c28cdee6d005", "resource_type": "binding_v2", "secret_name": "my-service-access", "status": "active" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The id of your binding.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
.+
Example:
a172ced-b5f21bc-71ba50c-1638604
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/bindings/${id}" -H "Authorization: ${token}"
getBindingOptions := codeEngineService.NewGetBindingOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "a172ced-b5f21bc-71ba50c-1638604", ) binding, response, err := codeEngineService.GetBinding(getBindingOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(binding, "", " ") fmt.Println(string(b))
GetBindingOptions getBindingOptions = new GetBindingOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .id("a172ced-b5f21bc-71ba50c-1638604") .build(); Response<Binding> response = codeEngineService.getBinding(getBindingOptions).execute(); Binding binding = response.getResult(); System.out.println(binding);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', id: 'a172ced-b5f21bc-71ba50c-1638604', }; let res; try { res = await codeEngineService.getBinding(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_binding( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', id='a172ced-b5f21bc-71ba50c-1638604', ) binding = response.get_result() print(json.dumps(binding, indent=2))
Response
Describes the model of a binding.
A reference to another component.
Examples:{ "resource_type": "app_v2", "name": "my-app-1" }
When you provision a new binding, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/bindings/my-binding
The ID of the binding.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
.+
Example:
a172ced-b5f21bc-71ba50c-1638604
The value that is set as a prefix in the component that is bound.
Possible values: 0 ≤ length ≤ 31, Value must match regular expression
^[A-Z]([_A-Z0-9]*[A-Z0-9])*$
Example:
MY_COS
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The type of the binding.
Possible values: [
binding_v2
]The service access secret that is bound to a component.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-service-access
The current status of the binding.
Example:
active
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "component": { "resource_type": "app_v2", "name": "my-app-1" }, "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/bindings/a172ced-b5f21bc-71ba50c-1638604", "id": "a172ced-b5f21bc-71ba50c-1638604", "prefix": "PREFIX", "project_id": "15314cc3-85b4-4338-903f-c28cdee6d005", "resource_type": "binding_v2", "secret_name": "my-service-access", "status": "active" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The id of your binding.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
.+
Example:
a172ced-b5f21bc-71ba50c-1638604
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/bindings/${id}" -H "Authorization: ${token}"
deleteBindingOptions := codeEngineService.NewDeleteBindingOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "a172ced-b5f21bc-71ba50c-1638604", ) response, err := codeEngineService.DeleteBinding(deleteBindingOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteBinding(): %d\n", response.StatusCode) }
DeleteBindingOptions deleteBindingOptions = new DeleteBindingOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .id("a172ced-b5f21bc-71ba50c-1638604") .build(); Response<Void> response = codeEngineService.deleteBinding(deleteBindingOptions).execute();
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', id: 'a172ced-b5f21bc-71ba50c-1638604', }; try { await codeEngineService.deleteBinding(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_binding( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', id='a172ced-b5f21bc-71ba50c-1638604', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
Optional maximum number of builds per page.
Possible values: 1 ≤ value ≤ 100
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/builds" -H "Authorization: ${token}"
listBuildsOptions := &codeenginev2.ListBuildsOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewBuildsPager(listBuildsOptions) if err != nil { panic(err) } var allResults []codeenginev2.Build for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListBuildsOptions listBuildsOptions = new ListBuildsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .limit(Long.valueOf("100")) .build(); BuildsPager pager = new BuildsPager(codeEngineService, listBuildsOptions); List<Build> allResults = new ArrayList<>(); while (pager.hasNext()) { List<Build> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.BuildsPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = BuildsPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of builds and pagination information.
List of all builds.
Possible values: 0 ≤ number of items ≤ 500
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "builds": [ { "name": "my-build", "id": "27587824-aba8-4f70-8c1d-416326907049", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T11:31:27+01:00", "entity_tag": "2385407409", "resource_type": "build_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/builds/my-build", "source_type": "git", "source_url": "https://github.com/IBM/CodeEngine", "source_revision": "main", "strategy_type": "dockerfile", "strategy_size": "medium", "output_image": "private.de.icr.io/icr_namespace/test-image-1", "output_secret": "ce-auto-icr-private-eu-de", "status": "ready", "timeout": 600 } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Build prototype
{
"name": "my-build",
"source_type": "git",
"source_revision": "main",
"source_url": "https://github.com/IBM/CodeEngine",
"strategy_type": "dockerfile",
"strategy_size": "medium",
"output_image": "private.de.icr.io/icr_namespace/test-image-1",
"output_secret": "ce-auto-icr-private-eu-de"
}
The name of the build. Use a name that is unique within the project.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-build
The name of the image.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
private.de.icr.io/icr_namespace/image-name
The secret that is required to access the image registry. Make sure that the secret is granted with push permissions towards the specified container registry namespace.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
ce-auto-icr-private-eu-de
The strategy to use for building the image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
dockerfile
Optional directory in the repository that contains the buildpacks file or the Dockerfile.
Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^(.*)+$
Example:
some/subfolder
Commit, tag, or branch in the source repository to pull. This field is optional if the
source_type
isgit
and uses the HEAD of default branch if not specified. If thesource_type
value islocal
, this field must be omitted.Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
main
Name of the secret that is used access the repository source. This field is optional if the
source_type
isgit
. Additionally, if thesource_url
points to a repository that requires authentication, the build will be created but cannot access any source code, until this property is provided, too. If thesource_type
value islocal
, this field must be omitted.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Specifies the type of source to determine if your build source is in a repository or based on local source code.
- local - For builds from local source code.
- git - For builds from git version controlled source code.
Allowable values: [
local
,git
]Default:
git
Example:
git
The URL of the code repository. This field is required if the
source_type
isgit
. If thesource_type
value islocal
, this field must be omitted. If the repository is publicly available you can provide a 'https' URL likehttps://github.com/IBM/CodeEngine
. If the repository requires authentication, you need to provide a 'ssh' URL likegit@github.com:IBM/CodeEngine.git
along with asource_secret
that points to a secret of formatssh_auth
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^((https:\/\/[a-z0-9]([\-.]?[a-z0-9])+(:\d{1,5})?)|((ssh:\/\/)?git@[a-z0-9]([\-.]{0,1}[a-z0-9])+(:[a-zA-Z0-9\/][\w\-.]*)?))(\/([\w\-.]|%20)+)*$
Example:
https://github.com/IBM/CodeEngine
Optional size for the build, which determines the amount of resources used. Build sizes are
small
,medium
,large
,xlarge
,xxlarge
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Default:
medium
Example:
medium
Optional path to the specification file that is used for build strategies for building an image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Default:
Dockerfile
Example:
Dockerfile
The maximum amount of time, in seconds, that can pass before the build must succeed or fail.
Possible values: 1 ≤ value ≤ 3600
Default:
600
Example:
600
curl -X POST "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/builds" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ "name": "my-build", "output_image": "private.de.icr.io/icr_namespace/image-name", "output_secret": "ce-auto-icr-private-eu-de", "strategy_type": "dockerfile" }'
createBuildOptions := codeEngineService.NewCreateBuildOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-build", "private.de.icr.io/icr_namespace/image-name", "ce-auto-icr-private-eu-de", "dockerfile", ) build, response, err := codeEngineService.CreateBuild(createBuildOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(build, "", " ") fmt.Println(string(b))
CreateBuildOptions createBuildOptions = new CreateBuildOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-build") .outputImage("private.de.icr.io/icr_namespace/image-name") .outputSecret("ce-auto-icr-private-eu-de") .strategyType("dockerfile") .build(); Response<Build> response = codeEngineService.createBuild(createBuildOptions).execute(); Build build = response.getResult(); System.out.println(build);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-build', outputImage: 'private.de.icr.io/icr_namespace/image-name', outputSecret: 'ce-auto-icr-private-eu-de', strategyType: 'dockerfile', }; let res; try { res = await codeEngineService.createBuild(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.create_build( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-build', output_image='private.de.icr.io/icr_namespace/image-name', output_secret='ce-auto-icr-private-eu-de', strategy_type='dockerfile', ) build = response.get_result() print(json.dumps(build, indent=2))
Response
Response model for build definitions.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the build instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the image.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
private.de.icr.io/icr_namespace/image-name
The secret that is required to access the image registry. Make sure that the secret is granted with push permissions towards the specified container registry namespace.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
ce-auto-icr-private-eu-de
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
Specifies the type of source to determine if your build source is in a repository or based on local source code.
- local - For builds from local source code.
- git - For builds from git version controlled source code.
Possible values: [
local
,git
]Example:
git
Optional size for the build, which determines the amount of resources used. Build sizes are
small
,medium
,large
,xlarge
,xxlarge
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
medium
The strategy to use for building the image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
dockerfile
When you provision a new build, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/builds/my-build
The name of the build.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-build
The type of the build.
Possible values: [
build_v2
]Optional directory in the repository that contains the buildpacks file or the Dockerfile.
Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^(.*)+$
Example:
some/subfolder
Commit, tag, or branch in the source repository to pull. This field is optional if the
source_type
isgit
and uses the HEAD of default branch if not specified. If thesource_type
value islocal
, this field must be omitted.Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
main
Name of the secret that is used access the repository source. This field is optional if the
source_type
isgit
. Additionally, if thesource_url
points to a repository that requires authentication, the build will be created but cannot access any source code, until this property is provided, too. If thesource_type
value islocal
, this field must be omitted.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
The URL of the code repository. This field is required if the
source_type
isgit
. If thesource_type
value islocal
, this field must be omitted. If the repository is publicly available you can provide a 'https' URL likehttps://github.com/IBM/CodeEngine
. If the repository requires authentication, you need to provide a 'ssh' URL likegit@github.com:IBM/CodeEngine.git
along with asource_secret
that points to a secret of formatssh_auth
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^((https:\/\/[a-z0-9]([\-.]?[a-z0-9])+(:\d{1,5})?)|((ssh:\/\/)?git@[a-z0-9]([\-.]{0,1}[a-z0-9])+(:[a-zA-Z0-9\/][\w\-.]*)?))(\/([\w\-.]|%20)+)*$
Example:
https://github.com/IBM/CodeEngine
The current status of the build.
Possible values: [
ready
,failed
]Example:
ready
The detailed status of the build.
Optional path to the specification file that is used for build strategies for building an image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
Dockerfile
The maximum amount of time, in seconds, that can pass before the build must succeed or fail.
Possible values: 1 ≤ value ≤ 3600
Example:
600
Status Code
Created
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "name": "my-build", "id": "27587824-aba8-4f70-8c1d-416326907049", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T11:31:27+01:00", "entity_tag": "2385407409", "resource_type": "build_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/builds/my-build", "source_type": "git", "source_url": "https://github.com/IBM/CodeEngine", "source_revision": "main", "strategy_type": "dockerfile", "strategy_size": "medium", "output_image": "private.de.icr.io/icr_namespace/test-image-1", "output_secret": "ce-auto-icr-private-eu-de", "status": "ready", "timeout": 600 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your build.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-build
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/builds/${name}" -H "Authorization: ${token}"
getBuildOptions := codeEngineService.NewGetBuildOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-build", ) build, response, err := codeEngineService.GetBuild(getBuildOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(build, "", " ") fmt.Println(string(b))
GetBuildOptions getBuildOptions = new GetBuildOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-build") .build(); Response<Build> response = codeEngineService.getBuild(getBuildOptions).execute(); Build build = response.getResult(); System.out.println(build);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-build', }; let res; try { res = await codeEngineService.getBuild(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_build( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-build', ) build = response.get_result() print(json.dumps(build, indent=2))
Response
Response model for build definitions.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the build instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the image.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
private.de.icr.io/icr_namespace/image-name
The secret that is required to access the image registry. Make sure that the secret is granted with push permissions towards the specified container registry namespace.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
ce-auto-icr-private-eu-de
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
Specifies the type of source to determine if your build source is in a repository or based on local source code.
- local - For builds from local source code.
- git - For builds from git version controlled source code.
Possible values: [
local
,git
]Example:
git
Optional size for the build, which determines the amount of resources used. Build sizes are
small
,medium
,large
,xlarge
,xxlarge
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
medium
The strategy to use for building the image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
dockerfile
When you provision a new build, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/builds/my-build
The name of the build.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-build
The type of the build.
Possible values: [
build_v2
]Optional directory in the repository that contains the buildpacks file or the Dockerfile.
Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^(.*)+$
Example:
some/subfolder
Commit, tag, or branch in the source repository to pull. This field is optional if the
source_type
isgit
and uses the HEAD of default branch if not specified. If thesource_type
value islocal
, this field must be omitted.Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
main
Name of the secret that is used access the repository source. This field is optional if the
source_type
isgit
. Additionally, if thesource_url
points to a repository that requires authentication, the build will be created but cannot access any source code, until this property is provided, too. If thesource_type
value islocal
, this field must be omitted.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
The URL of the code repository. This field is required if the
source_type
isgit
. If thesource_type
value islocal
, this field must be omitted. If the repository is publicly available you can provide a 'https' URL likehttps://github.com/IBM/CodeEngine
. If the repository requires authentication, you need to provide a 'ssh' URL likegit@github.com:IBM/CodeEngine.git
along with asource_secret
that points to a secret of formatssh_auth
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^((https:\/\/[a-z0-9]([\-.]?[a-z0-9])+(:\d{1,5})?)|((ssh:\/\/)?git@[a-z0-9]([\-.]{0,1}[a-z0-9])+(:[a-zA-Z0-9\/][\w\-.]*)?))(\/([\w\-.]|%20)+)*$
Example:
https://github.com/IBM/CodeEngine
The current status of the build.
Possible values: [
ready
,failed
]Example:
ready
The detailed status of the build.
Optional path to the specification file that is used for build strategies for building an image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
Dockerfile
The maximum amount of time, in seconds, that can pass before the build must succeed or fail.
Possible values: 1 ≤ value ≤ 3600
Example:
600
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-build", "id": "27587824-aba8-4f70-8c1d-416326907049", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T11:31:27+01:00", "entity_tag": "2385407409", "resource_type": "build_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/builds/my-build", "source_type": "git", "source_url": "https://github.com/IBM/CodeEngine", "source_revision": "main", "strategy_type": "dockerfile", "strategy_size": "medium", "output_image": "private.de.icr.io/icr_namespace/test-image-1", "output_secret": "ce-auto-icr-private-eu-de", "status": "ready", "timeout": 600 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your build.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-build
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/builds/${name}" -H "Authorization: ${token}"
deleteBuildOptions := codeEngineService.NewDeleteBuildOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-build", ) response, err := codeEngineService.DeleteBuild(deleteBuildOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteBuild(): %d\n", response.StatusCode) }
DeleteBuildOptions deleteBuildOptions = new DeleteBuildOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-build") .build(); Response<Void> response = codeEngineService.deleteBuild(deleteBuildOptions).execute();
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-build', }; try { await codeEngineService.deleteBuild(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_build( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-build', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Custom Headers
Version of the build settings to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the build. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^[0-9]*$
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your build.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-build
Build patch
{
"source_type": "git",
"source_revision": "main",
"source_url": "https://github.com/IBM/CodeEngine",
"strategy_type": "dockerfile",
"strategy_size": "large",
"output_image": "private.de.icr.io/icr_namespace/test-image-1",
"output_secret": "ce-auto-icr-private-eu-de"
}
The name of the image.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
private.de.icr.io/icr_namespace/image-name
The secret that is required to access the image registry. Make sure that the secret is granted with push permissions towards the specified container registry namespace.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
ce-auto-icr-private-eu-de
Optional directory in the repository that contains the buildpacks file or the Dockerfile.
Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^(.*)+$
Example:
some/subfolder
Commit, tag, or branch in the source repository to pull. This field is optional if the
source_type
isgit
and uses the HEAD of default branch if not specified. If thesource_type
value islocal
, this field must be omitted.Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
main
Name of the secret that is used access the repository source. This field is optional if the
source_type
isgit
. Additionally, if thesource_url
points to a repository that requires authentication, the build will be created but cannot access any source code, until this property is provided, too. If thesource_type
value islocal
, this field must be omitted.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Specifies the type of source to determine if your build source is in a repository or based on local source code.
- local - For builds from local source code.
- git - For builds from git version controlled source code.
Allowable values: [
local
,git
]Example:
git
The URL of the code repository. This field is required if the
source_type
isgit
. If thesource_type
value islocal
, this field must be omitted. If the repository is publicly available you can provide a 'https' URL likehttps://github.com/IBM/CodeEngine
. If the repository requires authentication, you need to provide a 'ssh' URL likegit@github.com:IBM/CodeEngine.git
along with asource_secret
that points to a secret of formatssh_auth
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^((https:\/\/[a-z0-9]([\-.]?[a-z0-9])+(:\d{1,5})?)|((ssh:\/\/)?git@[a-z0-9]([\-.]{0,1}[a-z0-9])+(:[a-zA-Z0-9\/][\w\-.]*)?))(\/([\w\-.]|%20)+)*$
Example:
https://github.com/IBM/CodeEngine
Optional size for the build, which determines the amount of resources used. Build sizes are
small
,medium
,large
,xlarge
,xxlarge
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
medium
Optional path to the specification file that is used for build strategies for building an image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
Dockerfile
The strategy to use for building the image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
dockerfile
The maximum amount of time, in seconds, that can pass before the build must succeed or fail.
Possible values: 1 ≤ value ≤ 3600
Example:
600
curl -X PATCH "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/builds/${name}" -H "Authorization: ${token}" -H "Content-Type: application/merge-patch+json" -d '{ }'
buildPatchModel := &codeenginev2.BuildPatch{ } buildPatchModelAsPatch, asPatchErr := buildPatchModel.AsPatch() Expect(asPatchErr).To(BeNil()) updateBuildOptions := codeEngineService.NewUpdateBuildOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-build", "testString", buildPatchModelAsPatch, ) build, response, err := codeEngineService.UpdateBuild(updateBuildOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(build, "", " ") fmt.Println(string(b))
BuildPatch buildPatchModel = new BuildPatch.Builder() .build(); Map<String, Object> buildPatchModelAsPatch = buildPatchModel.asPatch(); UpdateBuildOptions updateBuildOptions = new UpdateBuildOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-build") .ifMatch("testString") .build(buildPatchModelAsPatch) .build(); Response<Build> response = codeEngineService.updateBuild(updateBuildOptions).execute(); Build build = response.getResult(); System.out.println(build);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-build', ifMatch: 'testString', }; let res; try { res = await codeEngineService.updateBuild(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
build_patch_model = {} response = code_engine_service.update_build( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-build', if_match='testString', build=build_patch_model, ) build = response.get_result() print(json.dumps(build, indent=2))
Response
Response model for build definitions.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the build instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the image.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
private.de.icr.io/icr_namespace/image-name
The secret that is required to access the image registry. Make sure that the secret is granted with push permissions towards the specified container registry namespace.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
ce-auto-icr-private-eu-de
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
Specifies the type of source to determine if your build source is in a repository or based on local source code.
- local - For builds from local source code.
- git - For builds from git version controlled source code.
Possible values: [
local
,git
]Example:
git
Optional size for the build, which determines the amount of resources used. Build sizes are
small
,medium
,large
,xlarge
,xxlarge
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
medium
The strategy to use for building the image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
dockerfile
When you provision a new build, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/builds/my-build
The name of the build.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-build
The type of the build.
Possible values: [
build_v2
]Optional directory in the repository that contains the buildpacks file or the Dockerfile.
Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^(.*)+$
Example:
some/subfolder
Commit, tag, or branch in the source repository to pull. This field is optional if the
source_type
isgit
and uses the HEAD of default branch if not specified. If thesource_type
value islocal
, this field must be omitted.Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
main
Name of the secret that is used access the repository source. This field is optional if the
source_type
isgit
. Additionally, if thesource_url
points to a repository that requires authentication, the build will be created but cannot access any source code, until this property is provided, too. If thesource_type
value islocal
, this field must be omitted.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
The URL of the code repository. This field is required if the
source_type
isgit
. If thesource_type
value islocal
, this field must be omitted. If the repository is publicly available you can provide a 'https' URL likehttps://github.com/IBM/CodeEngine
. If the repository requires authentication, you need to provide a 'ssh' URL likegit@github.com:IBM/CodeEngine.git
along with asource_secret
that points to a secret of formatssh_auth
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^((https:\/\/[a-z0-9]([\-.]?[a-z0-9])+(:\d{1,5})?)|((ssh:\/\/)?git@[a-z0-9]([\-.]{0,1}[a-z0-9])+(:[a-zA-Z0-9\/][\w\-.]*)?))(\/([\w\-.]|%20)+)*$
Example:
https://github.com/IBM/CodeEngine
The current status of the build.
Possible values: [
ready
,failed
]Example:
ready
The detailed status of the build.
Optional path to the specification file that is used for build strategies for building an image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
Dockerfile
The maximum amount of time, in seconds, that can pass before the build must succeed or fail.
Possible values: 1 ≤ value ≤ 3600
Example:
600
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-build", "id": "27587824-aba8-4f70-8c1d-416326907049", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T11:31:27+01:00", "entity_tag": "2385407409", "resource_type": "build_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/builds/my-build", "source_type": "git", "source_url": "https://github.com/IBM/CodeEngine", "source_revision": "main", "strategy_type": "dockerfile", "strategy_size": "medium", "output_image": "private.de.icr.io/icr_namespace/test-image-1", "output_secret": "ce-auto-icr-private-eu-de", "status": "ready", "timeout": 600 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
Optional name of the build that should be filtered for.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-build
Optional maximum number of build runs per page.
Possible values: 1 ≤ value ≤ 500
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/build_runs" -H "Authorization: ${token}"
listBuildRunsOptions := &codeenginev2.ListBuildRunsOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), BuildName: core.StringPtr("my-build"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewBuildRunsPager(listBuildRunsOptions) if err != nil { panic(err) } var allResults []codeenginev2.BuildRun for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListBuildRunsOptions listBuildRunsOptions = new ListBuildRunsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .buildName("my-build") .limit(Long.valueOf("100")) .build(); BuildRunsPager pager = new BuildRunsPager(codeEngineService, listBuildRunsOptions); List<BuildRun> allResults = new ArrayList<>(); while (pager.hasNext()) { List<BuildRun> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', buildName: 'my-build', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.BuildRunsPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = BuildRunsPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', build_name='my-build', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of build runs and pagination information.
List of all build runs.
Possible values: 0 ≤ number of items ≤ 500
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "build_runs": [ { "name": "my-buildrun-1", "id": "ca151bf7-b1bf-4e18-a1cb-857329c2d097", "region": "us-east", "project_id": "4e49b3e0-27a8-48d2-a784-c7ee48bb863b", "created_at": "2022-06-20T10:10:00+02:00", "resource_type": "build_run_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/build_runs/my-buildrun-1", "build_name": "my-build", "status": "succeeded" } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Build run prototype
{
"name": "my-buildrun-1",
"build_name": "my-build"
}
Optional name of the build on which this build run is based on. If specified, the build run will inherit the configuration of the referenced build. If not specified, make sure to specify at least the fields
strategy_type
,source_url
,output_image
andoutput_secret
to describe the build run.Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Name of the build run. This field is optional, if the field
build_name
is specified and its value will be generated like so:[BUILD_NAME]-run-[timestamp with format: YYMMDD-hhmmss] if not set.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
The name of the image.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
private.de.icr.io/icr_namespace/image-name
The secret that is required to access the image registry. Make sure that the secret is granted with push permissions towards the specified container registry namespace.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
ce-auto-icr-private-eu-de
Optional service account, which is used for resource control.” or “Optional service account that is used for resource control.
Allowable values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Optional directory in the repository that contains the buildpacks file or the Dockerfile.
Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^(.*)+$
Example:
some/subfolder
Commit, tag, or branch in the source repository to pull. This field is optional if the
source_type
isgit
and uses the HEAD of default branch if not specified. If thesource_type
value islocal
, this field must be omitted.Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
main
Name of the secret that is used access the repository source. This field is optional if the
source_type
isgit
. Additionally, if thesource_url
points to a repository that requires authentication, the build will be created but cannot access any source code, until this property is provided, too. If thesource_type
value islocal
, this field must be omitted.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Specifies the type of source to determine if your build source is in a repository or based on local source code.
- local - For builds from local source code.
- git - For builds from git version controlled source code.
Allowable values: [
local
,git
]Default:
git
Example:
git
The URL of the code repository. This field is required if the
source_type
isgit
. If thesource_type
value islocal
, this field must be omitted. If the repository is publicly available you can provide a 'https' URL likehttps://github.com/IBM/CodeEngine
. If the repository requires authentication, you need to provide a 'ssh' URL likegit@github.com:IBM/CodeEngine.git
along with asource_secret
that points to a secret of formatssh_auth
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^((https:\/\/[a-z0-9]([\-.]?[a-z0-9])+(:\d{1,5})?)|((ssh:\/\/)?git@[a-z0-9]([\-.]{0,1}[a-z0-9])+(:[a-zA-Z0-9\/][\w\-.]*)?))(\/([\w\-.]|%20)+)*$
Example:
https://github.com/IBM/CodeEngine
Optional size for the build, which determines the amount of resources used. Build sizes are
small
,medium
,large
,xlarge
,xxlarge
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Default:
medium
Example:
medium
Optional path to the specification file that is used for build strategies for building an image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Default:
Dockerfile
Example:
Dockerfile
The strategy to use for building the image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Default:
dockerfile
Example:
dockerfile
The maximum amount of time, in seconds, that can pass before the build must succeed or fail.
Possible values: 1 ≤ value ≤ 3600
Default:
600
Example:
600
curl -X POST "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/build_runs" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ }'
createBuildRunOptions := codeEngineService.NewCreateBuildRunOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", ) buildRun, response, err := codeEngineService.CreateBuildRun(createBuildRunOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(buildRun, "", " ") fmt.Println(string(b))
CreateBuildRunOptions createBuildRunOptions = new CreateBuildRunOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .build(); Response<BuildRun> response = codeEngineService.createBuildRun(createBuildRunOptions).execute(); BuildRun buildRun = response.getResult(); System.out.println(buildRun);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', }; let res; try { res = await codeEngineService.createBuildRun(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.create_build_run( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', ) build_run = response.get_result() print(json.dumps(build_run, indent=2))
Response
Response model for build run objects.
Optional name of the build on which this build run is based on. If specified, the build run will inherit the configuration of the referenced build. If not specified, make sure to specify at least the fields
strategy_type
,source_url
,output_image
andoutput_secret
to describe the build run.Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the build run.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-build-run
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the build run.
Possible values: [
build_run_v2
]The current status of the build run.
Possible values: [
succeeded
,running
,pending
,failed
]Example:
succeeded
When you trigger a new build run, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/build_runs/my-build-run
The name of the image.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
private.de.icr.io/icr_namespace/image-name
The secret that is required to access the image registry. Make sure that the secret is granted with push permissions towards the specified container registry namespace.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
ce-auto-icr-private-eu-de
Optional service account, which is used for resource control.” or “Optional service account that is used for resource control.
Possible values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Optional directory in the repository that contains the buildpacks file or the Dockerfile.
Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^(.*)+$
Example:
some/subfolder
Commit, tag, or branch in the source repository to pull. This field is optional if the
source_type
isgit
and uses the HEAD of default branch if not specified. If thesource_type
value islocal
, this field must be omitted.Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
main
Name of the secret that is used access the repository source. This field is optional if the
source_type
isgit
. Additionally, if thesource_url
points to a repository that requires authentication, the build will be created but cannot access any source code, until this property is provided, too. If thesource_type
value islocal
, this field must be omitted.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Specifies the type of source to determine if your build source is in a repository or based on local source code.
- local - For builds from local source code.
- git - For builds from git version controlled source code.
Possible values: [
local
,git
]Example:
git
The URL of the code repository. This field is required if the
source_type
isgit
. If thesource_type
value islocal
, this field must be omitted. If the repository is publicly available you can provide a 'https' URL likehttps://github.com/IBM/CodeEngine
. If the repository requires authentication, you need to provide a 'ssh' URL likegit@github.com:IBM/CodeEngine.git
along with asource_secret
that points to a secret of formatssh_auth
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^((https:\/\/[a-z0-9]([\-.]?[a-z0-9])+(:\d{1,5})?)|((ssh:\/\/)?git@[a-z0-9]([\-.]{0,1}[a-z0-9])+(:[a-zA-Z0-9\/][\w\-.]*)?))(\/([\w\-.]|%20)+)*$
Example:
https://github.com/IBM/CodeEngine
Current status condition of a build run.
Optional size for the build, which determines the amount of resources used. Build sizes are
small
,medium
,large
,xlarge
,xxlarge
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
medium
Optional path to the specification file that is used for build strategies for building an image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
Dockerfile
The strategy to use for building the image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
dockerfile
The maximum amount of time, in seconds, that can pass before the build must succeed or fail.
Possible values: 1 ≤ value ≤ 3600
Example:
600
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "name": "my-buildrun-1", "id": "ca151bf7-b1bf-4e18-a1cb-857329c2d097", "region": "us-east", "project_id": "4e49b3e0-27a8-48d2-a784-c7ee48bb863b", "created_at": "2022-06-20T10:10:00+02:00", "resource_type": "build_run_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/build_runs/my-buildrun-1", "build_name": "my-build", "status": "succeeded" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your build run.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-build-run
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/build_runs/${name}" -H "Authorization: ${token}"
getBuildRunOptions := codeEngineService.NewGetBuildRunOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-build-run", ) buildRun, response, err := codeEngineService.GetBuildRun(getBuildRunOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(buildRun, "", " ") fmt.Println(string(b))
GetBuildRunOptions getBuildRunOptions = new GetBuildRunOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-build-run") .build(); Response<BuildRun> response = codeEngineService.getBuildRun(getBuildRunOptions).execute(); BuildRun buildRun = response.getResult(); System.out.println(buildRun);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-build-run', }; let res; try { res = await codeEngineService.getBuildRun(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_build_run( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-build-run', ) build_run = response.get_result() print(json.dumps(build_run, indent=2))
Response
Response model for build run objects.
Optional name of the build on which this build run is based on. If specified, the build run will inherit the configuration of the referenced build. If not specified, make sure to specify at least the fields
strategy_type
,source_url
,output_image
andoutput_secret
to describe the build run.Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the build run.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-build-run
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the build run.
Possible values: [
build_run_v2
]The current status of the build run.
Possible values: [
succeeded
,running
,pending
,failed
]Example:
succeeded
When you trigger a new build run, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/build_runs/my-build-run
The name of the image.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^([a-z0-9][a-z0-9\-_.]+[a-z0-9][/])?([a-z0-9][a-z0-9\-_]+[a-z0-9][/])?[a-z0-9][a-z0-9\-_./]+[a-z0-9](:[\w][\w.\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$
Example:
private.de.icr.io/icr_namespace/image-name
The secret that is required to access the image registry. Make sure that the secret is granted with push permissions towards the specified container registry namespace.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
ce-auto-icr-private-eu-de
Optional service account, which is used for resource control.” or “Optional service account that is used for resource control.
Possible values: [
default
,manager
,reader
,writer
,none
]Possible values: length ≥ 0, Value must match regular expression
^(manager|reader|writer|none|default)$
Optional directory in the repository that contains the buildpacks file or the Dockerfile.
Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^(.*)+$
Example:
some/subfolder
Commit, tag, or branch in the source repository to pull. This field is optional if the
source_type
isgit
and uses the HEAD of default branch if not specified. If thesource_type
value islocal
, this field must be omitted.Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
main
Name of the secret that is used access the repository source. This field is optional if the
source_type
isgit
. Additionally, if thesource_url
points to a repository that requires authentication, the build will be created but cannot access any source code, until this property is provided, too. If thesource_type
value islocal
, this field must be omitted.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Specifies the type of source to determine if your build source is in a repository or based on local source code.
- local - For builds from local source code.
- git - For builds from git version controlled source code.
Possible values: [
local
,git
]Example:
git
The URL of the code repository. This field is required if the
source_type
isgit
. If thesource_type
value islocal
, this field must be omitted. If the repository is publicly available you can provide a 'https' URL likehttps://github.com/IBM/CodeEngine
. If the repository requires authentication, you need to provide a 'ssh' URL likegit@github.com:IBM/CodeEngine.git
along with asource_secret
that points to a secret of formatssh_auth
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^((https:\/\/[a-z0-9]([\-.]?[a-z0-9])+(:\d{1,5})?)|((ssh:\/\/)?git@[a-z0-9]([\-.]{0,1}[a-z0-9])+(:[a-zA-Z0-9\/][\w\-.]*)?))(\/([\w\-.]|%20)+)*$
Example:
https://github.com/IBM/CodeEngine
Current status condition of a build run.
Optional size for the build, which determines the amount of resources used. Build sizes are
small
,medium
,large
,xlarge
,xxlarge
.Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
medium
Optional path to the specification file that is used for build strategies for building an image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[\S]*$
Example:
Dockerfile
The strategy to use for building the image.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
[\S]*
Example:
dockerfile
The maximum amount of time, in seconds, that can pass before the build must succeed or fail.
Possible values: 1 ≤ value ≤ 3600
Example:
600
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-buildrun-1", "id": "ca151bf7-b1bf-4e18-a1cb-857329c2d097", "region": "us-east", "project_id": "4e49b3e0-27a8-48d2-a784-c7ee48bb863b", "created_at": "2022-06-20T10:10:00+02:00", "resource_type": "build_run_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/build_runs/my-buildrun-1", "build_name": "my-build", "status": "succeeded" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your build run.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$
Example:
my-build-run
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/build_runs/${name}" -H "Authorization: ${token}"
deleteBuildRunOptions := codeEngineService.NewDeleteBuildRunOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-build-run", ) response, err := codeEngineService.DeleteBuildRun(deleteBuildRunOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteBuildRun(): %d\n", response.StatusCode) }
DeleteBuildRunOptions deleteBuildRunOptions = new DeleteBuildRunOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-build-run") .build(); Response<Void> response = codeEngineService.deleteBuildRun(deleteBuildRunOptions).execute();
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-build-run', }; try { await codeEngineService.deleteBuildRun(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_build_run( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-build-run', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
List domain mappings
List all domain mappings in a project.
GET /projects/{project_id}/domain_mappings
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
Optional maximum number of domain mappings per page.
Possible values: 1 ≤ value ≤ 100
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/domain_mappings" -H "Authorization: ${token}"
listDomainMappingsOptions := &codeenginev2.ListDomainMappingsOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewDomainMappingsPager(listDomainMappingsOptions) if err != nil { panic(err) } var allResults []codeenginev2.DomainMapping for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListDomainMappingsOptions listDomainMappingsOptions = new ListDomainMappingsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .limit(Long.valueOf("100")) .build(); DomainMappingsPager pager = new DomainMappingsPager(codeEngineService, listDomainMappingsOptions); List<DomainMapping> allResults = new ArrayList<>(); while (pager.hasNext()) { List<DomainMapping> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.DomainMappingsPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = DomainMappingsPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of domain mappings and pagination information.
List of all domain mappings.
Possible values: 0 ≤ number of items ≤ 500
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "domain_mappings": [ { "name": "www.example.com", "id": "27587824-aba8-4f70-8c1d-416326907049", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T11:31:27+01:00", "entity_tag": "2385407409", "resource_type": "domain_mapping_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/domain_mappings/www.example.com", "cname_target": "custom.abcdabcdabc.us-east.codeengine.appdomain.cloud", "component": { "name": "my-app", "resource_type": "app_v2" }, "tls_secret": "my-tls-secret", "visibility": "custom", "user_managed": true, "status": "ready" } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
DomainMapping prototype
{
"name": "www.example.com",
"component": {
"name": "my-app",
"resource_type": "app_v2"
},
"tls_secret": "my-tls-secret"
}
A reference to another component.
Examples:{ "resource_type": "app_v2", "name": "my-app-1" }
The name of the domain mapping.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)+$
Example:
www.example.com
The name of the TLS secret that includes the certificate and private key of this domain mapping.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-tls-secret
curl -X POST "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/domain_mappings" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ "name": "www.example.com", "component": { "resource_type": "app_v2", "name": "my-app-1", }, "tls_secret": "my-tls-secret" }'
componentRefModel := &codeenginev2.ComponentRef{ Name: core.StringPtr("my-app-1"), ResourceType: core.StringPtr("app_v2"), } createDomainMappingOptions := codeEngineService.NewCreateDomainMappingOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", componentRefModel, "www.example.com", "my-tls-secret", ) domainMapping, response, err := codeEngineService.CreateDomainMapping(createDomainMappingOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(domainMapping, "", " ") fmt.Println(string(b))
ComponentRef componentRefModel = new ComponentRef.Builder() .name("my-app-1") .resourceType("app_v2") .build(); CreateDomainMappingOptions createDomainMappingOptions = new CreateDomainMappingOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .component(componentRefModel) .name("www.example.com") .tlsSecret("my-tls-secret") .build(); Response<DomainMapping> response = codeEngineService.createDomainMapping(createDomainMappingOptions).execute(); DomainMapping domainMapping = response.getResult(); System.out.println(domainMapping);
// Request models needed by this operation. // ComponentRef const componentRefModel = { name: 'my-app-1', resource_type: 'app_v2', }; const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', component: componentRefModel, name: 'www.example.com', tlsSecret: 'my-tls-secret', }; let res; try { res = await codeEngineService.createDomainMapping(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
component_ref_model = { 'name': 'my-app-1', 'resource_type': 'app_v2', } response = code_engine_service.create_domain_mapping( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', component=component_ref_model, name='www.example.com', tls_secret='my-tls-secret', ) domain_mapping = response.get_result() print(json.dumps(domain_mapping, indent=2))
Response
Response model for domain mapping definitions.
The value of the CNAME record that must be configured in the DNS settings of the domain, to route traffic properly to the target Code Engine region.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
custom.abcdabcdabc.us-east.codeengine.appdomain.cloud
A reference to another component.
Examples:{ "resource_type": "app_v2", "name": "my-app-1" }
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the domain mapping instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
When you provision a new domain mapping, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/domain_mappings/www.example.com
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the domain mapping.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)+$
Example:
www.example.com
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the Code Engine resource.
Possible values: [
domain_mapping_v2
]The current status of the domain mapping.
Possible values: [
ready
,failed
,deploying
]Example:
ready
The name of the TLS secret that includes the certificate and private key of this domain mapping.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-tls-secret
Specifies whether the domain mapping is managed by the user or by Code Engine.
Specifies whether the domain mapping is reachable through the public internet, or private IBM network, or only through other components within the same Code Engine project.
Possible values: [
custom
,private
,project
,public
]Example:
public
The detailed status of the domain mapping.
Status Code
Created
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "name": "www.example.com", "id": "27587824-aba8-4f70-8c1d-416326907049", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T11:31:27+01:00", "entity_tag": "2385407409", "resource_type": "domain_mapping_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/domain_mappings/www.example.com", "cname_target": "custom.abcdabcdabc.us-east.codeengine.appdomain.cloud", "component": { "name": "my-app", "resource_type": "app_v2" }, "tls_secret": "my-tls-secret", "visibility": "custom", "user_managed": true, "status": "ready" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your domain mapping.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)+$
Example:
www.example.com
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/domain_mappings/${name}" -H "Authorization: ${token}"
getDomainMappingOptions := codeEngineService.NewGetDomainMappingOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "www.example.com", ) domainMapping, response, err := codeEngineService.GetDomainMapping(getDomainMappingOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(domainMapping, "", " ") fmt.Println(string(b))
GetDomainMappingOptions getDomainMappingOptions = new GetDomainMappingOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("www.example.com") .build(); Response<DomainMapping> response = codeEngineService.getDomainMapping(getDomainMappingOptions).execute(); DomainMapping domainMapping = response.getResult(); System.out.println(domainMapping);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'www.example.com', }; let res; try { res = await codeEngineService.getDomainMapping(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_domain_mapping( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='www.example.com', ) domain_mapping = response.get_result() print(json.dumps(domain_mapping, indent=2))
Response
Response model for domain mapping definitions.
The value of the CNAME record that must be configured in the DNS settings of the domain, to route traffic properly to the target Code Engine region.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
custom.abcdabcdabc.us-east.codeengine.appdomain.cloud
A reference to another component.
Examples:{ "resource_type": "app_v2", "name": "my-app-1" }
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the domain mapping instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
When you provision a new domain mapping, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/domain_mappings/www.example.com
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the domain mapping.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)+$
Example:
www.example.com
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the Code Engine resource.
Possible values: [
domain_mapping_v2
]The current status of the domain mapping.
Possible values: [
ready
,failed
,deploying
]Example:
ready
The name of the TLS secret that includes the certificate and private key of this domain mapping.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-tls-secret
Specifies whether the domain mapping is managed by the user or by Code Engine.
Specifies whether the domain mapping is reachable through the public internet, or private IBM network, or only through other components within the same Code Engine project.
Possible values: [
custom
,private
,project
,public
]Example:
public
The detailed status of the domain mapping.
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "www.example.com", "id": "27587824-aba8-4f70-8c1d-416326907049", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T11:31:27+01:00", "entity_tag": "2385407409", "resource_type": "domain_mapping_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/domain_mappings/www.example.com", "cname_target": "custom.abcdabcdabc.us-east.codeengine.appdomain.cloud", "component": { "name": "my-app", "resource_type": "app_v2" }, "tls_secret": "my-tls-secret", "visibility": "custom", "user_managed": true, "status": "ready" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your domain mapping.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)+$
Example:
www.example.com
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/domain_mappings/${name}" -H "Authorization: ${token}"
deleteDomainMappingOptions := codeEngineService.NewDeleteDomainMappingOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "www.example.com", ) response, err := codeEngineService.DeleteDomainMapping(deleteDomainMappingOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteDomainMapping(): %d\n", response.StatusCode) }
DeleteDomainMappingOptions deleteDomainMappingOptions = new DeleteDomainMappingOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("www.example.com") .build(); Response<Void> response = codeEngineService.deleteDomainMapping(deleteDomainMappingOptions).execute();
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'www.example.com', }; try { await codeEngineService.deleteDomainMapping(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_domain_mapping( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='www.example.com', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Custom Headers
Version of the domain mapping to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the domain mapping. This value helps identify parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^[0-9]*$
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your domain mapping.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)+$
Example:
www.example.com
DomainMapping patch
{
"component": {
"name": "my-app",
"resource_type": "app_v2"
},
"tls_secret": "my-tls-secret"
}
A reference to another component.
Examples:{ "resource_type": "app_v2", "name": "my-app-1" }
The name of the TLS secret that includes the certificate and private key of this domain mapping.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-tls-secret
curl -X PATCH "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/domain_mappings/${name}" -H "Authorization: ${token}" -H "Content-Type: application/merge-patch+json" -d '{ }'
domainMappingPatchModel := &codeenginev2.DomainMappingPatch{ } domainMappingPatchModelAsPatch, asPatchErr := domainMappingPatchModel.AsPatch() Expect(asPatchErr).To(BeNil()) updateDomainMappingOptions := codeEngineService.NewUpdateDomainMappingOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "www.example.com", "testString", domainMappingPatchModelAsPatch, ) domainMapping, response, err := codeEngineService.UpdateDomainMapping(updateDomainMappingOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(domainMapping, "", " ") fmt.Println(string(b))
DomainMappingPatch domainMappingPatchModel = new DomainMappingPatch.Builder() .build(); Map<String, Object> domainMappingPatchModelAsPatch = domainMappingPatchModel.asPatch(); UpdateDomainMappingOptions updateDomainMappingOptions = new UpdateDomainMappingOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("www.example.com") .ifMatch("testString") .domainMapping(domainMappingPatchModelAsPatch) .build(); Response<DomainMapping> response = codeEngineService.updateDomainMapping(updateDomainMappingOptions).execute(); DomainMapping domainMapping = response.getResult(); System.out.println(domainMapping);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'www.example.com', ifMatch: 'testString', }; let res; try { res = await codeEngineService.updateDomainMapping(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
domain_mapping_patch_model = {} response = code_engine_service.update_domain_mapping( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='www.example.com', if_match='testString', domain_mapping=domain_mapping_patch_model, ) domain_mapping = response.get_result() print(json.dumps(domain_mapping, indent=2))
Response
Response model for domain mapping definitions.
The value of the CNAME record that must be configured in the DNS settings of the domain, to route traffic properly to the target Code Engine region.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
custom.abcdabcdabc.us-east.codeengine.appdomain.cloud
A reference to another component.
Examples:{ "resource_type": "app_v2", "name": "my-app-1" }
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the domain mapping instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
When you provision a new domain mapping, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/domain_mappings/www.example.com
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the domain mapping.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)+$
Example:
www.example.com
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the Code Engine resource.
Possible values: [
domain_mapping_v2
]The current status of the domain mapping.
Possible values: [
ready
,failed
,deploying
]Example:
ready
The name of the TLS secret that includes the certificate and private key of this domain mapping.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-tls-secret
Specifies whether the domain mapping is managed by the user or by Code Engine.
Specifies whether the domain mapping is reachable through the public internet, or private IBM network, or only through other components within the same Code Engine project.
Possible values: [
custom
,private
,project
,public
]Example:
public
The detailed status of the domain mapping.
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "www.example.com", "id": "27587824-aba8-4f70-8c1d-416326907049", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T11:31:27+01:00", "entity_tag": "2385407409", "resource_type": "domain_mapping_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/domain_mappings/www.example.com", "cname_target": "custom.abcdabcdabc.us-east.codeengine.appdomain.cloud", "component": { "name": "my-app", "resource_type": "app_v2" }, "tls_secret": "my-tls-secret", "visibility": "custom", "user_managed": true, "status": "ready" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
Optional maximum number of config maps per page.
Possible values: 1 ≤ value ≤ 500
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/config_maps" -H "Authorization: ${token}"
listConfigMapsOptions := &codeenginev2.ListConfigMapsOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewConfigMapsPager(listConfigMapsOptions) if err != nil { panic(err) } var allResults []codeenginev2.ConfigMap for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListConfigMapsOptions listConfigMapsOptions = new ListConfigMapsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .limit(Long.valueOf("100")) .build(); ConfigMapsPager pager = new ConfigMapsPager(codeEngineService, listConfigMapsOptions); List<ConfigMap> allResults = new ArrayList<>(); while (pager.hasNext()) { List<ConfigMap> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.ConfigMapsPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = ConfigMapsPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
Contains a list of config maps and pagination information.
List of all config maps.
Possible values: 0 ≤ number of items ≤ 500
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "config_maps": [ { "name": "my-config-map", "id": "b8376985-d6df-43c5-8feb-194d45390bc8", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T21:45:49+01:00", "resource_type": "config_map_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/config_maps/my-config-map", "data": { "MY_PROPERTY": "VALUE" }, "entity_tag": "2386238209" } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Config map prototype.
{
"name": "my-config-map",
"data": {
"MY_PROPERTY": "VALUE"
}
}
The name of the configmap. Use a name that is unique within the project.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-config-map
The key-value pair for the config map. Values must be specified in
KEY=VALUE
format. EachKEY
field must consist of alphanumeric characters,-
,_
or.
and must not be exceed a max length of 253 characters. EachVALUE
field can consists of any character and must not be exceed a max length of 1048576 characters.- data
Possible values: 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
curl -X POST "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/config_maps" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ "name": "my-config-map" }'
createConfigMapOptions := codeEngineService.NewCreateConfigMapOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-config-map", ) configMap, response, err := codeEngineService.CreateConfigMap(createConfigMapOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(configMap, "", " ") fmt.Println(string(b))
CreateConfigMapOptions createConfigMapOptions = new CreateConfigMapOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-config-map") .build(); Response<ConfigMap> response = codeEngineService.createConfigMap(createConfigMapOptions).execute(); ConfigMap configMap = response.getResult(); System.out.println(configMap);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-config-map', }; let res; try { res = await codeEngineService.createConfigMap(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.create_config_map( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-config-map', ) config_map = response.get_result() print(json.dumps(config_map, indent=2))
Response
Describes the model of a configmap.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the config map instance, which is used to achieve optimistic locking.
Example:
2385407409
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the config map.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-config-map
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the config map.
Possible values: [
config_map_v2
]The key-value pair for the config map. Values must be specified in
KEY=VALUE
format.- data
Possible values: 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
When you provision a new config map, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/config_maps/my-config-map
Status Code
Created
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "name": "my-config-map", "id": "b8376985-d6df-43c5-8feb-194d45390bc8", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T21:45:49+01:00", "resource_type": "config_map_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/config_maps/my-config-map", "data": { "MY_PROPERTY": "VALUE" }, "entity_tag": "2386238209" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your configmap.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-config-map
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/config_maps/${name}" -H "Authorization: ${token}"
getConfigMapOptions := codeEngineService.NewGetConfigMapOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-config-map", ) configMap, response, err := codeEngineService.GetConfigMap(getConfigMapOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(configMap, "", " ") fmt.Println(string(b))
GetConfigMapOptions getConfigMapOptions = new GetConfigMapOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-config-map") .build(); Response<ConfigMap> response = codeEngineService.getConfigMap(getConfigMapOptions).execute(); ConfigMap configMap = response.getResult(); System.out.println(configMap);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-config-map', }; let res; try { res = await codeEngineService.getConfigMap(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_config_map( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-config-map', ) config_map = response.get_result() print(json.dumps(config_map, indent=2))
Response
Describes the model of a configmap.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the config map instance, which is used to achieve optimistic locking.
Example:
2385407409
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the config map.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-config-map
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the config map.
Possible values: [
config_map_v2
]The key-value pair for the config map. Values must be specified in
KEY=VALUE
format.- data
Possible values: 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
When you provision a new config map, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/config_maps/my-config-map
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-config-map", "id": "b8376985-d6df-43c5-8feb-194d45390bc8", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T21:45:49+01:00", "resource_type": "config_map_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/config_maps/my-config-map", "data": { "MY_PROPERTY": "VALUE" }, "entity_tag": "2386238209" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Custom Headers
Version of the config map settings to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the config map. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^[0-9]*$
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your configmap.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-config-map
Config map prototype.
{
"data": {
"MY_PROPERTY": "OTHER"
}
}
The key-value pair for the config map. Values must be specified in
KEY=VALUE
format. EachKEY
field must consist of alphanumeric characters,-
,_
or.
and must not be exceed a max length of 253 characters. EachVALUE
field can consists of any character and must not be exceed a max length of 1048576 characters.- data
Possible values: 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
curl -X PUT "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/config_maps/${name}" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ }'
replaceConfigMapOptions := codeEngineService.NewReplaceConfigMapOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-config-map", "testString", ) configMap, response, err := codeEngineService.ReplaceConfigMap(replaceConfigMapOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(configMap, "", " ") fmt.Println(string(b))
ReplaceConfigMapOptions replaceConfigMapOptions = new ReplaceConfigMapOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-config-map") .ifMatch("testString") .build(); Response<ConfigMap> response = codeEngineService.replaceConfigMap(replaceConfigMapOptions).execute(); ConfigMap configMap = response.getResult(); System.out.println(configMap);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-config-map', ifMatch: 'testString', }; let res; try { res = await codeEngineService.replaceConfigMap(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.replace_config_map( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-config-map', if_match='testString', ) config_map = response.get_result() print(json.dumps(config_map, indent=2))
Response
Describes the model of a configmap.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the config map instance, which is used to achieve optimistic locking.
Example:
2385407409
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the config map.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-config-map
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the config map.
Possible values: [
config_map_v2
]The key-value pair for the config map. Values must be specified in
KEY=VALUE
format.- data
Possible values: 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
When you provision a new config map, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/config_maps/my-config-map
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-config-map", "id": "b8376985-d6df-43c5-8feb-194d45390bc8", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T21:45:49+01:00", "resource_type": "config_map_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/config_maps/my-config-map", "data": { "MY_PROPERTY": "VALUE" }, "entity_tag": "2386238209" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your configmap.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-config-map
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/config_maps/${name}" -H "Authorization: ${token}"
deleteConfigMapOptions := codeEngineService.NewDeleteConfigMapOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-config-map", ) response, err := codeEngineService.DeleteConfigMap(deleteConfigMapOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteConfigMap(): %d\n", response.StatusCode) }
DeleteConfigMapOptions deleteConfigMapOptions = new DeleteConfigMapOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-config-map") .build(); Response<Void> response = codeEngineService.deleteConfigMap(deleteConfigMapOptions).execute();
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-config-map', }; try { await codeEngineService.deleteConfigMap(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_config_map( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-config-map', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Query Parameters
Optional maximum number of secrets per page.
Possible values: 1 ≤ value ≤ 500
Default:
50
Example:
100
An optional token that indicates the beginning of the page of results to be returned. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the
next
object of the operation response.Possible values: 0 ≤ length ≤ 3000, Value must match regular expression
^[a-zA-Z0-9=]+$
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/secrets" -H "Authorization: ${token}"
listSecretsOptions := &codeenginev2.ListSecretsOptions{ ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"), Limit: core.Int64Ptr(int64(100)), } pager, err := codeEngineService.NewSecretsPager(listSecretsOptions) if err != nil { panic(err) } var allResults []codeenginev2.Secret for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
ListSecretsOptions listSecretsOptions = new ListSecretsOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .limit(Long.valueOf("100")) .build(); SecretsPager pager = new SecretsPager(codeEngineService, listSecretsOptions); List<Secret> allResults = new ArrayList<>(); while (pager.hasNext()) { List<Secret> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', limit: 100, }; const allResults = []; try { const pager = new CodeEngineV2.SecretsPager(codeEngineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = SecretsPager( client=code_engine_service, project_id='15314cc3-85b4-4338-903f-c28cdee6d005', limit=100, ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
Response
List of secret resources.
Maximum number of resources per page.
Possible values: 1 ≤ value ≤ 100
Example:
100
List of secrets.
Possible values: 0 ≤ number of items ≤ 500
Describes properties needed to retrieve the first page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50" }
Describes properties needed to retrieve the next page of a result list.
Examples:{ "href": "https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/15314cc3-85b4-4338-903f-c28cdee6d005/secrets?limit=50&start=eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9", "start": "eyJ2IjoibWV0YS5rOHMuaW8vdjEiLCJydiI6NDA5MzY4OTcxMSwic3RhcnQiOiJjZS1zZXJ2aWNlc1x1MDAwMCJ9" }
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "secrets": [ { "name": "my-secret", "id": "36e3a621-4895-4bd1-b7e8-1163ab49a28f", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T21:59:08+01:00", "resource_type": "secret_generic_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/secrets/my-secret", "format": "generic", "data": { "MY_PROPERTY": "VALUE" }, "entity_tag": "2386255530" } ], "limit": 50 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
Secret prototype.
{
"name": "my-secret",
"format": "generic",
"data": {
"MY_PROPERTY": "VALUE"
}
}
Specify the format of the secret. The format of the secret will determine how the secret is used.
Allowable values: [
generic
,ssh_auth
,basic_auth
,tls
,service_access
,registry
,service_operator
,other
]Possible values: Value must match regular expression
^(generic|ssh_auth|basic_auth|tls|service_access|registry|service_operator|other)$
Example:
generic
The name of the secret.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Data container that allows to specify config parameters and their values as a key-value map. Each key field must consist of alphanumeric characters,
-
,_
or.
and must not exceed a max length of 253 characters. Each value field can consists of any character and must not exceed a max length of 1048576 characters.No properties to display- data
Possible values: 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Properties for Service Access Secrets
Properties for the IBM Cloud Operator Secrets
curl -X POST "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/secrets" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ "name": "my-secret", "format": "generic" }'
createSecretOptions := codeEngineService.NewCreateSecretOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "generic", "my-secret", ) secret, response, err := codeEngineService.CreateSecret(createSecretOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(secret, "", " ") fmt.Println(string(b))
CreateSecretOptions createSecretOptions = new CreateSecretOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .format("generic") .name("my-secret") .build(); Response<Secret> response = codeEngineService.createSecret(createSecretOptions).execute(); Secret secret = response.getResult(); System.out.println(secret);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', format: 'generic', name: 'my-secret', }; let res; try { res = await codeEngineService.createSecret(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.create_secret( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', format='generic', name='my-secret', ) secret = response.get_result() print(json.dumps(secret, indent=2))
Response
Describes the model of a secret.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the secret instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the secret.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the secret.
Data container that allows to specify config parameters and their values as a key-value map. Each key field must consist of alphanumeric characters,
-
,_
or.
and must not exceed a max length of 253 characters. Each value field can consists of any character and must not exceed a max length of 1048576 characters.- data
Possible values: 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Specify the format of the secret.
Possible values: [
generic
,ssh_auth
,basic_auth
,tls
,service_access
,registry
,service_operator
,other
]Possible values: Value must match regular expression
^(generic|ssh_auth|basic_auth|tls|service_access|registry|service_operator|other)$
Example:
generic
When you provision a new secret, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/secrets/my-secret
Properties for Service Access Secrets
Properties for the IBM Cloud Operator Secret
Status Code
Created
Bad Request
Unauthorized
Forbidden
Internal Server Error
{ "name": "my-secret", "id": "36e3a621-4895-4bd1-b7e8-1163ab49a28f", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T21:59:08+01:00", "resource_type": "secret_generic_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/secrets/my-secret", "format": "generic", "data": { "MY_PROPERTY": "VALUE" }, "entity_tag": "2386255530" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your secret.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
curl -X GET "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/secrets/${name}" -H "Authorization: ${token}"
getSecretOptions := codeEngineService.NewGetSecretOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-secret", ) secret, response, err := codeEngineService.GetSecret(getSecretOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(secret, "", " ") fmt.Println(string(b))
GetSecretOptions getSecretOptions = new GetSecretOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-secret") .build(); Response<Secret> response = codeEngineService.getSecret(getSecretOptions).execute(); Secret secret = response.getResult(); System.out.println(secret);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-secret', }; let res; try { res = await codeEngineService.getSecret(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.get_secret( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-secret', ) secret = response.get_result() print(json.dumps(secret, indent=2))
Response
Describes the model of a secret.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the secret instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the secret.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the secret.
Data container that allows to specify config parameters and their values as a key-value map. Each key field must consist of alphanumeric characters,
-
,_
or.
and must not exceed a max length of 253 characters. Each value field can consists of any character and must not exceed a max length of 1048576 characters.- data
Possible values: 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Specify the format of the secret.
Possible values: [
generic
,ssh_auth
,basic_auth
,tls
,service_access
,registry
,service_operator
,other
]Possible values: Value must match regular expression
^(generic|ssh_auth|basic_auth|tls|service_access|registry|service_operator|other)$
Example:
generic
When you provision a new secret, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/secrets/my-secret
Properties for Service Access Secrets
Properties for the IBM Cloud Operator Secret
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "name": "my-secret", "id": "36e3a621-4895-4bd1-b7e8-1163ab49a28f", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T21:59:08+01:00", "resource_type": "secret_generic_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/secrets/my-secret", "format": "generic", "data": { "MY_PROPERTY": "VALUE" }, "entity_tag": "2386255530" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Custom Headers
Version of the secret settings to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the secret. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.
Possible values: 1 ≤ length ≤ 256, Value must match regular expression
^[0-9]*$
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your secret.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
Secret patch.
{
"format": "generic",
"data": {
"MY_PROPERTY": "OTHER"
}
}
Specify the format of the secret. The format of the secret will determine how the secret is used.
Allowable values: [
generic
,ssh_auth
,basic_auth
,tls
,service_access
,registry
,service_operator
,other
]Possible values: Value must match regular expression
^(generic|ssh_auth|basic_auth|tls|service_access|registry|service_operator|other)$
Example:
generic
Data container that allows to specify config parameters and their values as a key-value map. Each key field must consist of alphanumeric characters,
-
,_
or.
and must not exceed a max length of 253 characters. Each value field can consists of any character and must not exceed a max length of 1048576 characters.No properties to display- data
Possible values: 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
curl -X PUT "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/secrets/${name}" -H "Authorization: ${token}" -H "Content-Type: application/json" -d '{ "format": "generic" }'
replaceSecretOptions := codeEngineService.NewReplaceSecretOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-secret", "testString", "generic", ) secret, response, err := codeEngineService.ReplaceSecret(replaceSecretOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(secret, "", " ") fmt.Println(string(b))
ReplaceSecretOptions replaceSecretOptions = new ReplaceSecretOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-secret") .ifMatch("testString") .format("generic") .build(); Response<Secret> response = codeEngineService.replaceSecret(replaceSecretOptions).execute(); Secret secret = response.getResult(); System.out.println(secret);
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-secret', ifMatch: 'testString', format: 'generic', }; let res; try { res = await codeEngineService.replaceSecret(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = code_engine_service.replace_secret( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-secret', if_match='testString', format='generic', ) secret = response.get_result() print(json.dumps(secret, indent=2))
Response
Describes the model of a secret.
The timestamp when the resource was created.
Example:
2022-09-13T11:41:35+02:00
The version of the secret instance, which is used to achieve optimistic locking.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^[\*\-a-z0-9]+$
Example:
2385407409
The identifier of the resource.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
e33b1cv7-7390-4437-a5c2-130d5ccdddc3
The name of the secret.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
The ID of the project in which the resource is located.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
4e49b3e0-27a8-48d2-a784-c7ee48bb863b
The region of the project the resource is located in. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.
Example:
us-east
The type of the secret.
Data container that allows to specify config parameters and their values as a key-value map. Each key field must consist of alphanumeric characters,
-
,_
or.
and must not exceed a max length of 253 characters. Each value field can consists of any character and must not exceed a max length of 1048576 characters.- data
Possible values: 0 ≤ length ≤ 1048576, Value must match regular expression
^.*$
Specify the format of the secret.
Possible values: [
generic
,ssh_auth
,basic_auth
,tls
,service_access
,registry
,service_operator
,other
]Possible values: Value must match regular expression
^(generic|ssh_auth|basic_auth|tls|service_access|registry|service_operator|other)$
Example:
generic
When you provision a new secret, a URL is created identifying the location of the instance.
Possible values: 0 ≤ length ≤ 2048, Value must match regular expression
(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$
Example:
https://api.eu-de.codeengine.cloud.ibm.com/v2/projects/4e49b3e0-27a8-48d2-a784-c7ee48bb863b/secrets/my-secret
Properties for Service Access Secrets
Properties for the IBM Cloud Operator Secret
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Conflict
Internal Server Error
{ "name": "my-secret", "id": "36e3a621-4895-4bd1-b7e8-1163ab49a28f", "region": "us-east", "project_id": "230828b4-4f15-40a9-b183-1268c6ab88d5", "created_at": "2022-11-15T21:59:08+01:00", "resource_type": "secret_generic_v2", "href": "https://api.us-east.codeengine.cloud.ibm.com/v2/projects/230828b4-4f15-40a9-b183-1268c6ab88d5/secrets/my-secret", "format": "generic", "data": { "MY_PROPERTY": "VALUE" }, "entity_tag": "2386255530" }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
Request
Path Parameters
The ID of the project.
Possible values: length = 36, Value must match regular expression
^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$
Example:
15314cc3-85b4-4338-903f-c28cdee6d005
The name of your secret.
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-z0-9]([\-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([\-a-z0-9]*[a-z0-9])?)*$
Example:
my-secret
curl -X DELETE "https://api.${region}.codeengine.cloud.ibm.com/v2/projects/${project_id}/secrets/${name}" -H "Authorization: ${token}"
deleteSecretOptions := codeEngineService.NewDeleteSecretOptions( "15314cc3-85b4-4338-903f-c28cdee6d005", "my-secret", ) response, err := codeEngineService.DeleteSecret(deleteSecretOptions) if err != nil { panic(err) } if response.StatusCode != 202 { fmt.Printf("\nUnexpected response status code received from DeleteSecret(): %d\n", response.StatusCode) }
DeleteSecretOptions deleteSecretOptions = new DeleteSecretOptions.Builder() .projectId("15314cc3-85b4-4338-903f-c28cdee6d005") .name("my-secret") .build(); Response<Void> response = codeEngineService.deleteSecret(deleteSecretOptions).execute();
const params = { projectId: '15314cc3-85b4-4338-903f-c28cdee6d005', name: 'my-secret', }; try { await codeEngineService.deleteSecret(params); } catch (err) { console.warn(err); }
response = code_engine_service.delete_secret( project_id='15314cc3-85b4-4338-903f-c28cdee6d005', name='my-secret', )
Response
Status Code
Accepted
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }
{ "errors": [ { "code": "unauthorized", "message": "A meaningful explanation" } ], "trace": "codeengine-api-93ca4d5e39454d04b878ddb6b9bb82c4", "status_code": 503 }