Skip to content

Commit db9c284

Browse files
authored
feat(spec): updated the sdk as per the api spec released on 2025-04-22 (#68)
* feat(spec): updated the sdk as per the api spec released on 2025-04-22 Signed-off-by: Ujjwal Kumar <[email protected]> * Fixed examples Signed-off-by: Ujjwal Kumar <[email protected]> --------- Signed-off-by: Ujjwal Kumar <[email protected]>
1 parent 09ce6aa commit db9c284

File tree

289 files changed

+4084
-1367
lines changed

Some content is hidden

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

289 files changed

+4084
-1367
lines changed

modules/examples/src/main/java/com/ibm/cloud/is/vpc/v1/VPCExamples.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -7650,15 +7650,15 @@ public static void main(String[] args) throws Exception {
76507650
.ifMatch(ifMatchSnapshotCopy)
76517651
.build();
76527652

7653-
Response<Snapshot> responseCopy = vpcService.deleteSnapshot(deleteSnapshotCopyOptions).execute();
7653+
Response<Void> responseCopy = vpcService.deleteSnapshot(deleteSnapshotCopyOptions).execute();
76547654
System.out.printf("deleteSnapshot() copy response status code: %d%n", responseCopy.getStatusCode());
76557655
// begin-delete_snapshot
76567656
DeleteSnapshotOptions deleteSnapshotOptions = new DeleteSnapshotOptions.Builder()
76577657
.id(snapshotId)
76587658
.ifMatch(ifMatchSnapshotCopy)
76597659
.build();
76607660

7661-
Response<Snapshot> response = vpcService.deleteSnapshot(deleteSnapshotOptions).execute();
7661+
Response<Void> response = vpcService.deleteSnapshot(deleteSnapshotOptions).execute();
76627662
// end-delete_snapshot
76637663
System.out.printf("deleteSnapshot() response status code: %d%n", response.getStatusCode());
76647664
} catch (ServiceResponseException e) {

modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/Vpc.java

+73-35
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@
651651
import com.ibm.cloud.sdk.core.service.BaseService;
652652
import com.ibm.cloud.sdk.core.util.RequestUtils;
653653
import com.ibm.cloud.sdk.core.util.ResponseConverterUtils;
654+
import java.util.Collections;
654655
import java.util.HashMap;
655656
import java.util.Map;
656657
import java.util.Map.Entry;
@@ -675,9 +676,46 @@ public class Vpc extends BaseService {
675676
*/
676677
public static final String DEFAULT_SERVICE_URL = "https://us-south.iaas.cloud.ibm.com/v1";
677678

679+
private static final Map<String, String> _regionalEndpoints;
680+
static {
681+
Map<String, String> m = new HashMap<>();
682+
m.put("au-syd", "https://au-syd.iaas.cloud.ibm.com/v1"); // Australia (Sydney)
683+
684+
m.put("br-sao", "https://br-sao.iaas.cloud.ibm.com/v1"); // Brazil (Sao Paulo)
685+
686+
m.put("ca-mon", "https://ca-mon.iaas.cloud.ibm.com/v1"); // Canada (Montreal)
687+
688+
m.put("ca-tor", "https://ca-tor.iaas.cloud.ibm.com/v1"); // Canada (Toronto)
689+
690+
m.put("eu-de", "https://eu-de.iaas.cloud.ibm.com/v1"); // Germany (Frankfurt)
691+
692+
m.put("eu-es", "https://eu-es.iaas.cloud.ibm.com/v1"); // Spain (Madrid)
693+
694+
m.put("eu-gb", "https://eu-gb.iaas.cloud.ibm.com/v1"); // United Kingdom (London)
695+
696+
m.put("jp-osa", "https://jp-osa.iaas.cloud.ibm.com/v1"); // Japan (Osaka)
697+
698+
m.put("jp-tok", "https://jp-tok.iaas.cloud.ibm.com/v1"); // Japan (Tokyo)
699+
700+
m.put("us-east", "https://us-east.iaas.cloud.ibm.com/v1"); // US East (Washington DC)
701+
702+
m.put("us-south", "https://us-south.iaas.cloud.ibm.com/v1"); // US South (Dallas)
703+
_regionalEndpoints = Collections.unmodifiableMap(m);
704+
}
705+
706+
/**
707+
* Returns the service URL associated with the specified region.
708+
* @param region a string representing the region
709+
* @return the service URL associated with the specified region or null
710+
* if no mapping for the region exists
711+
*/
712+
public static String getServiceUrlForRegion(String region) {
713+
return _regionalEndpoints.get(region);
714+
}
715+
678716
private Long generation = Long.valueOf("2");
679717

680-
private String version = "2025-03-04";
718+
private String version = "2025-04-22";
681719

682720
/**
683721
* Class method which constructs an instance of the `Vpc` client.
@@ -741,7 +779,7 @@ public void setGeneration(final long generation) {
741779
* Gets the version.
742780
*
743781
* The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between
744-
* `2024-04-30` and `2025-03-04`.
782+
* `2025-04-08` and `2025-04-23`.
745783
*
746784
* @return the version
747785
*/
@@ -2495,6 +2533,9 @@ public ServiceCall<ImageCollection> listImages(ListImagesOptions listImagesOptio
24952533
if (listImagesOptions.userDataFormat() != null) {
24962534
builder.query("user_data_format", RequestUtils.join(listImagesOptions.userDataFormat(), ","));
24972535
}
2536+
if (listImagesOptions.ownerType() != null) {
2537+
builder.query("owner_type", String.valueOf(listImagesOptions.ownerType()));
2538+
}
24982539
ResponseConverter<ImageCollection> responseConverter =
24992540
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<ImageCollection>() { }.getType());
25002541
return createServiceCall(builder.build(), responseConverter);
@@ -7221,27 +7262,27 @@ public ServiceCall<VolumeCollection> listVolumes(ListVolumesOptions listVolumesO
72217262
if (listVolumesOptions.limit() != null) {
72227263
builder.query("limit", String.valueOf(listVolumesOptions.limit()));
72237264
}
7224-
if (listVolumesOptions.name() != null) {
7225-
builder.query("name", String.valueOf(listVolumesOptions.name()));
7226-
}
72277265
if (listVolumesOptions.attachmentState() != null) {
72287266
builder.query("attachment_state", String.valueOf(listVolumesOptions.attachmentState()));
72297267
}
72307268
if (listVolumesOptions.encryption() != null) {
72317269
builder.query("encryption", String.valueOf(listVolumesOptions.encryption()));
72327270
}
7271+
if (listVolumesOptions.name() != null) {
7272+
builder.query("name", String.valueOf(listVolumesOptions.name()));
7273+
}
72337274
if (listVolumesOptions.operatingSystemFamily() != null) {
72347275
builder.query("operating_system.family", String.valueOf(listVolumesOptions.operatingSystemFamily()));
72357276
}
72367277
if (listVolumesOptions.operatingSystemArchitecture() != null) {
72377278
builder.query("operating_system.architecture", String.valueOf(listVolumesOptions.operatingSystemArchitecture()));
72387279
}
7239-
if (listVolumesOptions.zoneName() != null) {
7240-
builder.query("zone.name", String.valueOf(listVolumesOptions.zoneName()));
7241-
}
72427280
if (listVolumesOptions.tag() != null) {
72437281
builder.query("tag", String.valueOf(listVolumesOptions.tag()));
72447282
}
7283+
if (listVolumesOptions.zoneName() != null) {
7284+
builder.query("zone.name", String.valueOf(listVolumesOptions.zoneName()));
7285+
}
72457286
ResponseConverter<VolumeCollection> responseConverter =
72467287
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<VolumeCollection>() { }.getType());
72477288
return createServiceCall(builder.build(), responseConverter);
@@ -7697,9 +7738,9 @@ public ServiceCall<Snapshot> createSnapshot(CreateSnapshotOptions createSnapshot
76977738
* This request deletes a snapshot. This operation cannot be reversed.
76987739
*
76997740
* @param deleteSnapshotOptions the {@link DeleteSnapshotOptions} containing the options for the call
7700-
* @return a {@link ServiceCall} with a result of type {@link Snapshot}
7741+
* @return a {@link ServiceCall} with a void result
77017742
*/
7702-
public ServiceCall<Snapshot> deleteSnapshot(DeleteSnapshotOptions deleteSnapshotOptions) {
7743+
public ServiceCall<Void> deleteSnapshot(DeleteSnapshotOptions deleteSnapshotOptions) {
77037744
com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSnapshotOptions,
77047745
"deleteSnapshotOptions cannot be null");
77057746
Map<String, String> pathParamsMap = new HashMap<String, String>();
@@ -7709,14 +7750,12 @@ public ServiceCall<Snapshot> deleteSnapshot(DeleteSnapshotOptions deleteSnapshot
77097750
for (Entry<String, String> header : sdkHeaders.entrySet()) {
77107751
builder.header(header.getKey(), header.getValue());
77117752
}
7712-
builder.header("Accept", "application/json");
77137753
if (deleteSnapshotOptions.ifMatch() != null) {
77147754
builder.header("If-Match", deleteSnapshotOptions.ifMatch());
77157755
}
77167756
builder.query("version", String.valueOf(this.version));
77177757
builder.query("generation", String.valueOf(this.generation));
7718-
ResponseConverter<Snapshot> responseConverter =
7719-
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<Snapshot>() { }.getType());
7758+
ResponseConverter<Void> responseConverter = ResponseConverterUtils.getVoid();
77207759
return createServiceCall(builder.build(), responseConverter);
77217760
}
77227761

@@ -8462,12 +8501,9 @@ public ServiceCall<ShareSnapshotCollection> listShareSnapshots(ListShareSnapshot
84628501
* structured in the same way as a retrieved share snapshot, and contains the information necessary to create the new
84638502
* share snapshot.
84648503
*
8465-
* The share must have the `access_control_mode` set to `security_group`.
8504+
* The share must have an `access_control_mode` of `security_group` and a `replication_role` of `source` or `none`.
84668505
*
8467-
* At present, the snapshot's `resource_group` will be inherited from its share, but may be specifiable in the future.
8468-
*
8469-
* The new snapshot will inherit the encryption settings from its share, , and must have a
8470-
* `replication_role` of `source` or `none`.
8506+
* The snapshot will inherit its `resource_group` and encryption settings from the share.
84718507
*
84728508
* If the share has a `replication_role` of `source`, a corresponding snapshot on the replica share will be created
84738509
* with a `status` of `pending`. It will remain in
@@ -10772,9 +10808,10 @@ public ServiceCall<FloatingIP> updateFloatingIp(UpdateFloatingIpOptions updateFl
1077210808
/**
1077310809
* List network ACLs.
1077410810
*
10775-
* This request lists network ACLs in the region. A network ACL defines a set of packet filtering (5-tuple) rules for
10776-
* all traffic in and out of a subnet. Both allow and deny rules can be defined, and rules are stateless such that
10777-
* reverse traffic in response to allowed traffic is not automatically permitted.
10811+
* This request lists network ACLs in the region. A network ACL defines a set of packet filtering rules for traffic in
10812+
* and out of the subnets the network ACL is attached to. No traffic is allowed by default. Both allow and deny rules
10813+
* can be defined, and rules are stateless so that reverse traffic in response to allowed traffic is not automatically
10814+
* allowed.
1077810815
*
1077910816
* @param listNetworkAclsOptions the {@link ListNetworkAclsOptions} containing the options for the call
1078010817
* @return a {@link ServiceCall} with a result of type {@link NetworkACLCollection}
@@ -10808,9 +10845,10 @@ public ServiceCall<NetworkACLCollection> listNetworkAcls(ListNetworkAclsOptions
1080810845
/**
1080910846
* List network ACLs.
1081010847
*
10811-
* This request lists network ACLs in the region. A network ACL defines a set of packet filtering (5-tuple) rules for
10812-
* all traffic in and out of a subnet. Both allow and deny rules can be defined, and rules are stateless such that
10813-
* reverse traffic in response to allowed traffic is not automatically permitted.
10848+
* This request lists network ACLs in the region. A network ACL defines a set of packet filtering rules for traffic in
10849+
* and out of the subnets the network ACL is attached to. No traffic is allowed by default. Both allow and deny rules
10850+
* can be defined, and rules are stateless so that reverse traffic in response to allowed traffic is not automatically
10851+
* allowed.
1081410852
*
1081510853
* @return a {@link ServiceCall} with a result of type {@link NetworkACLCollection}
1081610854
*/
@@ -11072,10 +11110,9 @@ public ServiceCall<NetworkACLRule> updateNetworkAclRule(UpdateNetworkAclRuleOpti
1107211110
/**
1107311111
* List security groups.
1107411112
*
11075-
* This request lists security groups in the region. Security groups provide a way to apply IP filtering rules to
11076-
* instances in the associated VPC. With security groups, all traffic is denied by default, and rules added to
11077-
* security groups define which traffic the security group permits. Security group rules are stateful such that
11078-
* reverse traffic in response to allowed traffic is automatically permitted.
11113+
* This request lists security groups in the region. A security group defines a set of packet filtering rules to allow
11114+
* traffic in and out of the resources targeted by the security group. No traffic is allowed by default. Security
11115+
* group rules are stateful so that reverse traffic in response to allowed traffic is automatically allowed.
1107911116
*
1108011117
* @param listSecurityGroupsOptions the {@link ListSecurityGroupsOptions} containing the options for the call
1108111118
* @return a {@link ServiceCall} with a result of type {@link SecurityGroupCollection}
@@ -11118,10 +11155,9 @@ public ServiceCall<SecurityGroupCollection> listSecurityGroups(ListSecurityGroup
1111811155
/**
1111911156
* List security groups.
1112011157
*
11121-
* This request lists security groups in the region. Security groups provide a way to apply IP filtering rules to
11122-
* instances in the associated VPC. With security groups, all traffic is denied by default, and rules added to
11123-
* security groups define which traffic the security group permits. Security group rules are stateful such that
11124-
* reverse traffic in response to allowed traffic is automatically permitted.
11158+
* This request lists security groups in the region. A security group defines a set of packet filtering rules to allow
11159+
* traffic in and out of the resources targeted by the security group. No traffic is allowed by default. Security
11160+
* group rules are stateful so that reverse traffic in response to allowed traffic is automatically allowed.
1112511161
*
1112611162
* @return a {@link ServiceCall} with a result of type {@link SecurityGroupCollection}
1112711163
*/
@@ -11687,7 +11723,7 @@ public ServiceCall<IKEPolicy> updateIkePolicy(UpdateIkePolicyOptions updateIkePo
1168711723
/**
1168811724
* List VPN gateway connections that use a specified IKE policy.
1168911725
*
11690-
* This request lists VPN gateway connections that use a IKE policy.
11726+
* This request lists VPN gateway connections that use an IKE policy.
1169111727
*
1169211728
* @param listIkePolicyConnectionsOptions the {@link ListIkePolicyConnectionsOptions} containing the options for the call
1169311729
* @return a {@link ServiceCall} with a result of type {@link IKEPolicyConnectionCollection}
@@ -11877,7 +11913,7 @@ public ServiceCall<IPsecPolicy> updateIpsecPolicy(UpdateIpsecPolicyOptions updat
1187711913
/**
1187811914
* List VPN gateway connections that use a specified IPsec policy.
1187911915
*
11880-
* This request lists VPN gateway connections that use a IPsec policy.
11916+
* This request lists VPN gateway connections that use an IPsec policy.
1188111917
*
1188211918
* @param listIpsecPolicyConnectionsOptions the {@link ListIpsecPolicyConnectionsOptions} containing the options for the call
1188311919
* @return a {@link ServiceCall} with a result of type {@link IPsecPolicyConnectionCollection}
@@ -13400,7 +13436,7 @@ public ServiceCall<LoadBalancerListenerPolicyCollection> listLoadBalancerListene
1340013436
*
1340113437
* This request creates a new policy from a load balancer listener policy object. The prototype object is structured
1340213438
* in the same way as a retrieved policy, and contains the information necessary to create the new policy. For this
13403-
* request to succeed, the listener must have a `protocol` of `http` or `https`.
13439+
* request to succeed, the load balancer must be in the `application` family.
1340413440
*
1340513441
* @param createLoadBalancerListenerPolicyOptions the {@link CreateLoadBalancerListenerPolicyOptions} containing the options for the call
1340613442
* @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicy}
@@ -13857,6 +13893,8 @@ public ServiceCall<LoadBalancerPoolMemberCollection> listLoadBalancerPoolMembers
1385713893
*
1385813894
* This request creates a new member and adds the member to the pool.
1385913895
*
13896+
* The pool must not already have a member targeting a load balancer.
13897+
*
1386013898
* @param createLoadBalancerPoolMemberOptions the {@link CreateLoadBalancerPoolMemberOptions} containing the options for the call
1386113899
* @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMember}
1386213900
*/

modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefix.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected AddressPrefix() { }
4040
/**
4141
* Gets the cidr.
4242
*
43-
* The CIDR block for this prefix.
43+
* The CIDR block for this address prefix.
4444
*
4545
* @return the cidr
4646
*/
@@ -51,7 +51,7 @@ public String getCidr() {
5151
/**
5252
* Gets the createdAt.
5353
*
54-
* The date and time that the prefix was created.
54+
* The date and time that this address prefix was created.
5555
*
5656
* @return the createdAt
5757
*/
@@ -62,7 +62,7 @@ public Date getCreatedAt() {
6262
/**
6363
* Gets the hasSubnets.
6464
*
65-
* Indicates whether subnets exist with addresses from this prefix.
65+
* Indicates whether subnets exist with addresses from this address prefix.
6666
*
6767
* @return the hasSubnets
6868
*/

modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCPU.java

+16
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@
2121
*/
2222
public class BareMetalServerCPU extends GenericModel {
2323

24+
/**
25+
* The CPU architecture.
26+
*
27+
* The enumerated values for this property may
28+
* [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future.
29+
*/
30+
public interface Architecture {
31+
/** amd64. */
32+
String AMD64 = "amd64";
33+
/** s390x. */
34+
String S390X = "s390x";
35+
}
36+
2437
protected String architecture;
2538
@SerializedName("core_count")
2639
protected Long coreCount;
@@ -36,6 +49,9 @@ protected BareMetalServerCPU() { }
3649
*
3750
* The CPU architecture.
3851
*
52+
* The enumerated values for this property may
53+
* [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future.
54+
*
3955
* @return the architecture
4056
*/
4157
public String getArchitecture() {

modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototype.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ public ImageIdentity image() {
162162
*
163163
* The public SSH keys to install on the bare metal server. Keys will be made available to the bare metal server as
164164
* cloud-init vendor data. For cloud-init enabled images, these keys will also be added as SSH authorized keys for the
165-
* administrative user.
165+
* [default user](https://cloud.ibm.com/docs/vpc?topic=vpc-vsi_is_connecting_linux#determining-default-user-account).
166166
*
167167
* For Windows images, at least one key must be specified, and one will be selected to encrypt the administrator
168-
* password. Keys are optional for other images, but if no keys are specified, the instance will be inaccessible
169-
* unless the specified image provides another means of access.
168+
* password. Keys are optional for other images, but if no keys are specified, the bare metal server will be
169+
* inaccessible unless the specified image provides another means of access.
170170
*
171171
* @return the keys
172172
*/

modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUArchitecture.java

+20
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
*/
2222
public class BareMetalServerProfileCPUArchitecture extends GenericModel {
2323

24+
/**
25+
* The default CPU architecture for a bare metal server with this profile.
26+
*/
27+
public interface XDefault {
28+
/** amd64. */
29+
String AMD64 = "amd64";
30+
/** s390x. */
31+
String S390X = "s390x";
32+
}
33+
2434
/**
2535
* The type for this profile field.
2636
*/
@@ -29,6 +39,16 @@ public interface Type {
2939
String FIXED = "fixed";
3040
}
3141

42+
/**
43+
* The CPU architecture for a bare metal server with this profile.
44+
*/
45+
public interface Value {
46+
/** amd64. */
47+
String AMD64 = "amd64";
48+
/** s390x. */
49+
String S390X = "s390x";
50+
}
51+
3252
@SerializedName("default")
3353
protected String xDefault;
3454
protected String type;

0 commit comments

Comments
 (0)