Skip to content

Commit 24e4280

Browse files
authored
Merge pull request #15 from IBM/sdk-update-20230724-095204
Sdk update 20230724 095204
2 parents 95cf95f + 9776ec4 commit 24e4280

File tree

70 files changed

+4073
-232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+4073
-232
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Build Status](https://travis-ci.com/IBM/code-engine-java-sdk.svg?branch=main)](https://travis-ci.com/IBM/code-engine-java-sdk)
22
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
33

4-
# IBM Cloud Code Engine Java SDK Version 3.1.0
4+
# IBM Cloud Code Engine Java SDK Version 4.0.0
55

66
Java client library to interact with the [Code Engine API](https://cloud.ibm.com/apidocs/codeengine).
77

@@ -39,7 +39,7 @@ The IBM Cloud Code Engine Java SDK allows developers to programmatically interac
3939

4040
Service Name | Artifact Coordinates
4141
--- | ---
42-
[Code Engine](https://cloud.ibm.com/apidocs/codeengine/codeengine-v2.0.0) | com.ibm.cloud.code-engine:3.1.0
42+
[Code Engine](https://cloud.ibm.com/apidocs/codeengine/codeengine-v2.0.0) | com.ibm.cloud.code-engine:4.0.0
4343

4444
## Prerequisites
4545

@@ -51,7 +51,7 @@ Service Name | Artifact Coordinates
5151

5252
## Installation
5353

54-
The current version of this SDK is: 3.1.0
54+
The current version of this SDK is: 4.0.0
5555

5656
Each service's artifact coordinates are listed in the table above.
5757

@@ -70,14 +70,14 @@ Here are examples for maven and gradle:
7070
<dependency>
7171
<groupId>com.ibm.cloud</groupId>
7272
<artifactId>code-engine</artifactId>
73-
<version>3.1.0</version>
73+
<version>4.0.0</version>
7474
</dependency>
7575
```
7676

7777
### Gradle
7878

7979
```gradle
80-
compile 'com.ibm.cloud:code-engine:3.1.0'
80+
compile 'com.ibm.cloud:code-engine:4.0.0'
8181
```
8282

8383
## Using the SDK

modules/code-engine/src/main/java/com/ibm/cloud/code_engine/code_engine/v2/CodeEngine.java

Lines changed: 155 additions & 6 deletions
Large diffs are not rendered by default.

modules/code-engine/src/main/java/com/ibm/cloud/code_engine/code_engine/v2/model/App.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ public interface Status {
115115
protected Long scaleConcurrencyTarget;
116116
@SerializedName("scale_cpu_limit")
117117
protected String scaleCpuLimit;
118+
@SerializedName("scale_down_delay")
119+
protected Long scaleDownDelay;
118120
@SerializedName("scale_ephemeral_storage_limit")
119121
protected String scaleEphemeralStorageLimit;
120122
@SerializedName("scale_initial_instances")
@@ -136,7 +138,7 @@ protected App() { }
136138
/**
137139
* Gets the createdAt.
138140
*
139-
* The date when the resource was created.
141+
* The timestamp when the resource was created.
140142
*
141143
* @return the createdAt
142144
*/
@@ -147,7 +149,7 @@ public String getCreatedAt() {
147149
/**
148150
* Gets the endpoint.
149151
*
150-
* Optional URL to invoke app. Depending on visibility this is accessible publicly ot in the private network only.
152+
* Optional URL to invoke app. Depending on visibility this is accessible publicly or in the private network only.
151153
* Empty in case 'managed_domain_mappings' is set to 'local'.
152154
*
153155
* @return the endpoint
@@ -215,7 +217,7 @@ public Long getImagePort() {
215217
/**
216218
* Gets the imageReference.
217219
*
218-
* The name of the image that is used for this job. The format is `REGISTRY/NAMESPACE/REPOSITORY:TAG` where `REGISTRY`
220+
* The name of the image that is used for this app. The format is `REGISTRY/NAMESPACE/REPOSITORY:TAG` where `REGISTRY`
219221
* and `TAG` are optional. If `REGISTRY` is not specified, the default is `docker.io`. If `TAG` is not specified, the
220222
* default is `latest`. If the image reference points to a registry that requires authentication, make sure to also
221223
* specify the property `image_secret`.
@@ -323,7 +325,7 @@ public List<String> getRunCommands() {
323325
/**
324326
* Gets the runEnvVariables.
325327
*
326-
* References to config maps, secrets or a literal values, which are exposed as environment variables in the
328+
* References to config maps, secrets or literal values, which are exposed as environment variables in the
327329
* application.
328330
*
329331
* @return the runEnvVariables
@@ -391,6 +393,17 @@ public String getScaleCpuLimit() {
391393
return scaleCpuLimit;
392394
}
393395

396+
/**
397+
* Gets the scaleDownDelay.
398+
*
399+
* Optional amount of time in seconds that delays the scale down behavior for an app instance.
400+
*
401+
* @return the scaleDownDelay
402+
*/
403+
public Long getScaleDownDelay() {
404+
return scaleDownDelay;
405+
}
406+
394407
/**
395408
* Gets the scaleEphemeralStorageLimit.
396409
*

modules/code-engine/src/main/java/com/ibm/cloud/code_engine/code_engine/v2/model/AppPatch.java

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public interface RunServiceAccount {
8282
protected Long scaleConcurrencyTarget;
8383
@SerializedName("scale_cpu_limit")
8484
protected String scaleCpuLimit;
85+
@SerializedName("scale_down_delay")
86+
protected Long scaleDownDelay;
8587
@SerializedName("scale_ephemeral_storage_limit")
8688
protected String scaleEphemeralStorageLimit;
8789
@SerializedName("scale_initial_instances")
@@ -112,6 +114,7 @@ public static class Builder {
112114
private Long scaleConcurrency;
113115
private Long scaleConcurrencyTarget;
114116
private String scaleCpuLimit;
117+
private Long scaleDownDelay;
115118
private String scaleEphemeralStorageLimit;
116119
private Long scaleInitialInstances;
117120
private Long scaleMaxInstances;
@@ -138,6 +141,7 @@ private Builder(AppPatch appPatch) {
138141
this.scaleConcurrency = appPatch.scaleConcurrency;
139142
this.scaleConcurrencyTarget = appPatch.scaleConcurrencyTarget;
140143
this.scaleCpuLimit = appPatch.scaleCpuLimit;
144+
this.scaleDownDelay = appPatch.scaleDownDelay;
141145
this.scaleEphemeralStorageLimit = appPatch.scaleEphemeralStorageLimit;
142146
this.scaleInitialInstances = appPatch.scaleInitialInstances;
143147
this.scaleMaxInstances = appPatch.scaleMaxInstances;
@@ -372,6 +376,17 @@ public Builder scaleCpuLimit(String scaleCpuLimit) {
372376
return this;
373377
}
374378

379+
/**
380+
* Set the scaleDownDelay.
381+
*
382+
* @param scaleDownDelay the scaleDownDelay
383+
* @return the AppPatch builder
384+
*/
385+
public Builder scaleDownDelay(long scaleDownDelay) {
386+
this.scaleDownDelay = scaleDownDelay;
387+
return this;
388+
}
389+
375390
/**
376391
* Set the scaleEphemeralStorageLimit.
377392
*
@@ -455,6 +470,7 @@ protected AppPatch(Builder builder) {
455470
scaleConcurrency = builder.scaleConcurrency;
456471
scaleConcurrencyTarget = builder.scaleConcurrencyTarget;
457472
scaleCpuLimit = builder.scaleCpuLimit;
473+
scaleDownDelay = builder.scaleDownDelay;
458474
scaleEphemeralStorageLimit = builder.scaleEphemeralStorageLimit;
459475
scaleInitialInstances = builder.scaleInitialInstances;
460476
scaleMaxInstances = builder.scaleMaxInstances;
@@ -487,7 +503,7 @@ public Long imagePort() {
487503
/**
488504
* Gets the imageReference.
489505
*
490-
* The name of the image that is used for this job. The format is `REGISTRY/NAMESPACE/REPOSITORY:TAG` where `REGISTRY`
506+
* The name of the image that is used for this app. The format is `REGISTRY/NAMESPACE/REPOSITORY:TAG` where `REGISTRY`
491507
* and `TAG` are optional. If `REGISTRY` is not specified, the default is `docker.io`. If `TAG` is not specified, the
492508
* default is `latest`. If the image reference points to a registry that requires authentication, make sure to also
493509
* specify the property `image_secret`.
@@ -562,7 +578,7 @@ public List<String> runCommands() {
562578
/**
563579
* Gets the runEnvVariables.
564580
*
565-
* Optional references to config maps, secrets or a literal values.
581+
* Optional references to config maps, secrets or literal values.
566582
*
567583
* @return the runEnvVariables
568584
*/
@@ -630,6 +646,17 @@ public String scaleCpuLimit() {
630646
return scaleCpuLimit;
631647
}
632648

649+
/**
650+
* Gets the scaleDownDelay.
651+
*
652+
* Optional amount of time in seconds that delays the scale down behavior for an app instance.
653+
*
654+
* @return the scaleDownDelay
655+
*/
656+
public Long scaleDownDelay() {
657+
return scaleDownDelay;
658+
}
659+
633660
/**
634661
* Gets the scaleEphemeralStorageLimit.
635662
*

modules/code-engine/src/main/java/com/ibm/cloud/code_engine/code_engine/v2/model/AppRevision.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ public interface Status {
9696
protected Long scaleConcurrencyTarget;
9797
@SerializedName("scale_cpu_limit")
9898
protected String scaleCpuLimit;
99+
@SerializedName("scale_down_delay")
100+
protected Long scaleDownDelay;
99101
@SerializedName("scale_ephemeral_storage_limit")
100102
protected String scaleEphemeralStorageLimit;
101103
@SerializedName("scale_initial_instances")
@@ -128,7 +130,7 @@ public String getAppName() {
128130
/**
129131
* Gets the createdAt.
130132
*
131-
* The date when the resource was created.
133+
* The timestamp when the resource was created.
132134
*
133135
* @return the createdAt
134136
*/
@@ -173,7 +175,7 @@ public Long getImagePort() {
173175
/**
174176
* Gets the imageReference.
175177
*
176-
* The name of the image that is used for this job. The format is `REGISTRY/NAMESPACE/REPOSITORY:TAG` where `REGISTRY`
178+
* The name of the image that is used for this app. The format is `REGISTRY/NAMESPACE/REPOSITORY:TAG` where `REGISTRY`
177179
* and `TAG` are optional. If `REGISTRY` is not specified, the default is `docker.io`. If `TAG` is not specified, the
178180
* default is `latest`. If the image reference points to a registry that requires authentication, make sure to also
179181
* specify the property `image_secret`.
@@ -268,7 +270,7 @@ public List<String> getRunCommands() {
268270
/**
269271
* Gets the runEnvVariables.
270272
*
271-
* References to config maps, secrets or a literal values, which are exposed as environment variables in the
273+
* References to config maps, secrets or literal values, which are exposed as environment variables in the
272274
* application.
273275
*
274276
* @return the runEnvVariables
@@ -336,6 +338,17 @@ public String getScaleCpuLimit() {
336338
return scaleCpuLimit;
337339
}
338340

341+
/**
342+
* Gets the scaleDownDelay.
343+
*
344+
* Optional amount of time in seconds that delays the scale down behavior for an app instance.
345+
*
346+
* @return the scaleDownDelay
347+
*/
348+
public Long getScaleDownDelay() {
349+
return scaleDownDelay;
350+
}
351+
339352
/**
340353
* Gets the scaleEphemeralStorageLimit.
341354
*
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2023.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
package com.ibm.cloud.code_engine.code_engine.v2.model;
14+
15+
import com.google.gson.annotations.SerializedName;
16+
import com.ibm.cloud.sdk.core.service.model.GenericModel;
17+
18+
/**
19+
* Describes the model of a binding.
20+
*/
21+
public class Binding extends GenericModel {
22+
23+
/**
24+
* The type of the binding.
25+
*/
26+
public interface ResourceType {
27+
/** binding_v2. */
28+
String BINDING_V2 = "binding_v2";
29+
}
30+
31+
protected ComponentRef component;
32+
protected String href;
33+
protected String id;
34+
protected String prefix;
35+
@SerializedName("project_id")
36+
protected String projectId;
37+
@SerializedName("resource_type")
38+
protected String resourceType;
39+
@SerializedName("secret_name")
40+
protected String secretName;
41+
protected String status;
42+
43+
protected Binding() { }
44+
45+
/**
46+
* Gets the component.
47+
*
48+
* A reference to another component.
49+
*
50+
* @return the component
51+
*/
52+
public ComponentRef getComponent() {
53+
return component;
54+
}
55+
56+
/**
57+
* Gets the href.
58+
*
59+
* When you provision a new binding, a URL is created identifying the location of the instance.
60+
*
61+
* @return the href
62+
*/
63+
public String getHref() {
64+
return href;
65+
}
66+
67+
/**
68+
* Gets the id.
69+
*
70+
* The ID of the binding.
71+
*
72+
* @return the id
73+
*/
74+
public String getId() {
75+
return id;
76+
}
77+
78+
/**
79+
* Gets the prefix.
80+
*
81+
* The value that is set as prefix in the component that is bound.
82+
*
83+
* @return the prefix
84+
*/
85+
public String getPrefix() {
86+
return prefix;
87+
}
88+
89+
/**
90+
* Gets the projectId.
91+
*
92+
* The ID of the project the resource is located in.
93+
*
94+
* @return the projectId
95+
*/
96+
public String getProjectId() {
97+
return projectId;
98+
}
99+
100+
/**
101+
* Gets the resourceType.
102+
*
103+
* The type of the binding.
104+
*
105+
* @return the resourceType
106+
*/
107+
public String getResourceType() {
108+
return resourceType;
109+
}
110+
111+
/**
112+
* Gets the secretName.
113+
*
114+
* The service access secret that is bound to a component.
115+
*
116+
* @return the secretName
117+
*/
118+
public String getSecretName() {
119+
return secretName;
120+
}
121+
122+
/**
123+
* Gets the status.
124+
*
125+
* The current status of the binding.
126+
*
127+
* @return the status
128+
*/
129+
public String getStatus() {
130+
return status;
131+
}
132+
}
133+

0 commit comments

Comments
 (0)