651
651
import com.ibm.cloud.sdk.core.service.BaseService;
652
652
import com.ibm.cloud.sdk.core.util.RequestUtils;
653
653
import com.ibm.cloud.sdk.core.util.ResponseConverterUtils;
654
+ import java.util.Collections;
654
655
import java.util.HashMap;
655
656
import java.util.Map;
656
657
import java.util.Map.Entry;
@@ -675,9 +676,46 @@ public class Vpc extends BaseService {
675
676
*/
676
677
public static final String DEFAULT_SERVICE_URL = "https://us-south.iaas.cloud.ibm.com/v1";
677
678
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
+
678
716
private Long generation = Long.valueOf("2");
679
717
680
- private String version = "2025-03-04 ";
718
+ private String version = "2025-04-22 ";
681
719
682
720
/**
683
721
* Class method which constructs an instance of the `Vpc` client.
@@ -741,7 +779,7 @@ public void setGeneration(final long generation) {
741
779
* Gets the version.
742
780
*
743
781
* 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 `.
745
783
*
746
784
* @return the version
747
785
*/
@@ -2495,6 +2533,9 @@ public ServiceCall<ImageCollection> listImages(ListImagesOptions listImagesOptio
2495
2533
if (listImagesOptions.userDataFormat() != null) {
2496
2534
builder.query("user_data_format", RequestUtils.join(listImagesOptions.userDataFormat(), ","));
2497
2535
}
2536
+ if (listImagesOptions.ownerType() != null) {
2537
+ builder.query("owner_type", String.valueOf(listImagesOptions.ownerType()));
2538
+ }
2498
2539
ResponseConverter<ImageCollection> responseConverter =
2499
2540
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<ImageCollection>() { }.getType());
2500
2541
return createServiceCall(builder.build(), responseConverter);
@@ -7221,27 +7262,27 @@ public ServiceCall<VolumeCollection> listVolumes(ListVolumesOptions listVolumesO
7221
7262
if (listVolumesOptions.limit() != null) {
7222
7263
builder.query("limit", String.valueOf(listVolumesOptions.limit()));
7223
7264
}
7224
- if (listVolumesOptions.name() != null) {
7225
- builder.query("name", String.valueOf(listVolumesOptions.name()));
7226
- }
7227
7265
if (listVolumesOptions.attachmentState() != null) {
7228
7266
builder.query("attachment_state", String.valueOf(listVolumesOptions.attachmentState()));
7229
7267
}
7230
7268
if (listVolumesOptions.encryption() != null) {
7231
7269
builder.query("encryption", String.valueOf(listVolumesOptions.encryption()));
7232
7270
}
7271
+ if (listVolumesOptions.name() != null) {
7272
+ builder.query("name", String.valueOf(listVolumesOptions.name()));
7273
+ }
7233
7274
if (listVolumesOptions.operatingSystemFamily() != null) {
7234
7275
builder.query("operating_system.family", String.valueOf(listVolumesOptions.operatingSystemFamily()));
7235
7276
}
7236
7277
if (listVolumesOptions.operatingSystemArchitecture() != null) {
7237
7278
builder.query("operating_system.architecture", String.valueOf(listVolumesOptions.operatingSystemArchitecture()));
7238
7279
}
7239
- if (listVolumesOptions.zoneName() != null) {
7240
- builder.query("zone.name", String.valueOf(listVolumesOptions.zoneName()));
7241
- }
7242
7280
if (listVolumesOptions.tag() != null) {
7243
7281
builder.query("tag", String.valueOf(listVolumesOptions.tag()));
7244
7282
}
7283
+ if (listVolumesOptions.zoneName() != null) {
7284
+ builder.query("zone.name", String.valueOf(listVolumesOptions.zoneName()));
7285
+ }
7245
7286
ResponseConverter<VolumeCollection> responseConverter =
7246
7287
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<VolumeCollection>() { }.getType());
7247
7288
return createServiceCall(builder.build(), responseConverter);
@@ -7697,9 +7738,9 @@ public ServiceCall<Snapshot> createSnapshot(CreateSnapshotOptions createSnapshot
7697
7738
* This request deletes a snapshot. This operation cannot be reversed.
7698
7739
*
7699
7740
* @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
7701
7742
*/
7702
- public ServiceCall<Snapshot > deleteSnapshot(DeleteSnapshotOptions deleteSnapshotOptions) {
7743
+ public ServiceCall<Void > deleteSnapshot(DeleteSnapshotOptions deleteSnapshotOptions) {
7703
7744
com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSnapshotOptions,
7704
7745
"deleteSnapshotOptions cannot be null");
7705
7746
Map<String, String> pathParamsMap = new HashMap<String, String>();
@@ -7709,14 +7750,12 @@ public ServiceCall<Snapshot> deleteSnapshot(DeleteSnapshotOptions deleteSnapshot
7709
7750
for (Entry<String, String> header : sdkHeaders.entrySet()) {
7710
7751
builder.header(header.getKey(), header.getValue());
7711
7752
}
7712
- builder.header("Accept", "application/json");
7713
7753
if (deleteSnapshotOptions.ifMatch() != null) {
7714
7754
builder.header("If-Match", deleteSnapshotOptions.ifMatch());
7715
7755
}
7716
7756
builder.query("version", String.valueOf(this.version));
7717
7757
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();
7720
7759
return createServiceCall(builder.build(), responseConverter);
7721
7760
}
7722
7761
@@ -8462,12 +8501,9 @@ public ServiceCall<ShareSnapshotCollection> listShareSnapshots(ListShareSnapshot
8462
8501
* structured in the same way as a retrieved share snapshot, and contains the information necessary to create the new
8463
8502
* share snapshot.
8464
8503
*
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 `.
8466
8505
*
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.
8471
8507
*
8472
8508
* If the share has a `replication_role` of `source`, a corresponding snapshot on the replica share will be created
8473
8509
* with a `status` of `pending`. It will remain in
@@ -10772,9 +10808,10 @@ public ServiceCall<FloatingIP> updateFloatingIp(UpdateFloatingIpOptions updateFl
10772
10808
/**
10773
10809
* List network ACLs.
10774
10810
*
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.
10778
10815
*
10779
10816
* @param listNetworkAclsOptions the {@link ListNetworkAclsOptions} containing the options for the call
10780
10817
* @return a {@link ServiceCall} with a result of type {@link NetworkACLCollection}
@@ -10808,9 +10845,10 @@ public ServiceCall<NetworkACLCollection> listNetworkAcls(ListNetworkAclsOptions
10808
10845
/**
10809
10846
* List network ACLs.
10810
10847
*
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.
10814
10852
*
10815
10853
* @return a {@link ServiceCall} with a result of type {@link NetworkACLCollection}
10816
10854
*/
@@ -11072,10 +11110,9 @@ public ServiceCall<NetworkACLRule> updateNetworkAclRule(UpdateNetworkAclRuleOpti
11072
11110
/**
11073
11111
* List security groups.
11074
11112
*
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.
11079
11116
*
11080
11117
* @param listSecurityGroupsOptions the {@link ListSecurityGroupsOptions} containing the options for the call
11081
11118
* @return a {@link ServiceCall} with a result of type {@link SecurityGroupCollection}
@@ -11118,10 +11155,9 @@ public ServiceCall<SecurityGroupCollection> listSecurityGroups(ListSecurityGroup
11118
11155
/**
11119
11156
* List security groups.
11120
11157
*
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.
11125
11161
*
11126
11162
* @return a {@link ServiceCall} with a result of type {@link SecurityGroupCollection}
11127
11163
*/
@@ -11687,7 +11723,7 @@ public ServiceCall<IKEPolicy> updateIkePolicy(UpdateIkePolicyOptions updateIkePo
11687
11723
/**
11688
11724
* List VPN gateway connections that use a specified IKE policy.
11689
11725
*
11690
- * This request lists VPN gateway connections that use a IKE policy.
11726
+ * This request lists VPN gateway connections that use an IKE policy.
11691
11727
*
11692
11728
* @param listIkePolicyConnectionsOptions the {@link ListIkePolicyConnectionsOptions} containing the options for the call
11693
11729
* @return a {@link ServiceCall} with a result of type {@link IKEPolicyConnectionCollection}
@@ -11877,7 +11913,7 @@ public ServiceCall<IPsecPolicy> updateIpsecPolicy(UpdateIpsecPolicyOptions updat
11877
11913
/**
11878
11914
* List VPN gateway connections that use a specified IPsec policy.
11879
11915
*
11880
- * This request lists VPN gateway connections that use a IPsec policy.
11916
+ * This request lists VPN gateway connections that use an IPsec policy.
11881
11917
*
11882
11918
* @param listIpsecPolicyConnectionsOptions the {@link ListIpsecPolicyConnectionsOptions} containing the options for the call
11883
11919
* @return a {@link ServiceCall} with a result of type {@link IPsecPolicyConnectionCollection}
@@ -13400,7 +13436,7 @@ public ServiceCall<LoadBalancerListenerPolicyCollection> listLoadBalancerListene
13400
13436
*
13401
13437
* This request creates a new policy from a load balancer listener policy object. The prototype object is structured
13402
13438
* 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 .
13404
13440
*
13405
13441
* @param createLoadBalancerListenerPolicyOptions the {@link CreateLoadBalancerListenerPolicyOptions} containing the options for the call
13406
13442
* @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicy}
@@ -13857,6 +13893,8 @@ public ServiceCall<LoadBalancerPoolMemberCollection> listLoadBalancerPoolMembers
13857
13893
*
13858
13894
* This request creates a new member and adds the member to the pool.
13859
13895
*
13896
+ * The pool must not already have a member targeting a load balancer.
13897
+ *
13860
13898
* @param createLoadBalancerPoolMemberOptions the {@link CreateLoadBalancerPoolMemberOptions} containing the options for the call
13861
13899
* @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMember}
13862
13900
*/
0 commit comments