Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7650,15 +7650,15 @@ public static void main(String[] args) throws Exception {
.ifMatch(ifMatchSnapshotCopy)
.build();

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

Response<Snapshot> response = vpcService.deleteSnapshot(deleteSnapshotOptions).execute();
Response<Void> response = vpcService.deleteSnapshot(deleteSnapshotOptions).execute();
// end-delete_snapshot
System.out.printf("deleteSnapshot() response status code: %d%n", response.getStatusCode());
} catch (ServiceResponseException e) {
Expand Down
108 changes: 73 additions & 35 deletions modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/Vpc.java
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@
import com.ibm.cloud.sdk.core.service.BaseService;
import com.ibm.cloud.sdk.core.util.RequestUtils;
import com.ibm.cloud.sdk.core.util.ResponseConverterUtils;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
Expand All @@ -675,9 +676,46 @@ public class Vpc extends BaseService {
*/
public static final String DEFAULT_SERVICE_URL = "https://us-south.iaas.cloud.ibm.com/v1";

private static final Map<String, String> _regionalEndpoints;
static {
Map<String, String> m = new HashMap<>();
m.put("au-syd", "https://au-syd.iaas.cloud.ibm.com/v1"); // Australia (Sydney)

m.put("br-sao", "https://br-sao.iaas.cloud.ibm.com/v1"); // Brazil (Sao Paulo)

m.put("ca-mon", "https://ca-mon.iaas.cloud.ibm.com/v1"); // Canada (Montreal)

m.put("ca-tor", "https://ca-tor.iaas.cloud.ibm.com/v1"); // Canada (Toronto)

m.put("eu-de", "https://eu-de.iaas.cloud.ibm.com/v1"); // Germany (Frankfurt)

m.put("eu-es", "https://eu-es.iaas.cloud.ibm.com/v1"); // Spain (Madrid)

m.put("eu-gb", "https://eu-gb.iaas.cloud.ibm.com/v1"); // United Kingdom (London)

m.put("jp-osa", "https://jp-osa.iaas.cloud.ibm.com/v1"); // Japan (Osaka)

m.put("jp-tok", "https://jp-tok.iaas.cloud.ibm.com/v1"); // Japan (Tokyo)

m.put("us-east", "https://us-east.iaas.cloud.ibm.com/v1"); // US East (Washington DC)

m.put("us-south", "https://us-south.iaas.cloud.ibm.com/v1"); // US South (Dallas)
_regionalEndpoints = Collections.unmodifiableMap(m);
}

/**
* Returns the service URL associated with the specified region.
* @param region a string representing the region
* @return the service URL associated with the specified region or null
* if no mapping for the region exists
*/
public static String getServiceUrlForRegion(String region) {
return _regionalEndpoints.get(region);
}

private Long generation = Long.valueOf("2");

private String version = "2025-03-04";
private String version = "2025-04-22";

/**
* Class method which constructs an instance of the `Vpc` client.
Expand Down Expand Up @@ -741,7 +779,7 @@ public void setGeneration(final long generation) {
* Gets the version.
*
* The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between
* `2024-04-30` and `2025-03-04`.
* `2025-04-08` and `2025-04-23`.
*
* @return the version
*/
Expand Down Expand Up @@ -2495,6 +2533,9 @@ public ServiceCall<ImageCollection> listImages(ListImagesOptions listImagesOptio
if (listImagesOptions.userDataFormat() != null) {
builder.query("user_data_format", RequestUtils.join(listImagesOptions.userDataFormat(), ","));
}
if (listImagesOptions.ownerType() != null) {
builder.query("owner_type", String.valueOf(listImagesOptions.ownerType()));
}
ResponseConverter<ImageCollection> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<ImageCollection>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
Expand Down Expand Up @@ -7221,27 +7262,27 @@ public ServiceCall<VolumeCollection> listVolumes(ListVolumesOptions listVolumesO
if (listVolumesOptions.limit() != null) {
builder.query("limit", String.valueOf(listVolumesOptions.limit()));
}
if (listVolumesOptions.name() != null) {
builder.query("name", String.valueOf(listVolumesOptions.name()));
}
if (listVolumesOptions.attachmentState() != null) {
builder.query("attachment_state", String.valueOf(listVolumesOptions.attachmentState()));
}
if (listVolumesOptions.encryption() != null) {
builder.query("encryption", String.valueOf(listVolumesOptions.encryption()));
}
if (listVolumesOptions.name() != null) {
builder.query("name", String.valueOf(listVolumesOptions.name()));
}
if (listVolumesOptions.operatingSystemFamily() != null) {
builder.query("operating_system.family", String.valueOf(listVolumesOptions.operatingSystemFamily()));
}
if (listVolumesOptions.operatingSystemArchitecture() != null) {
builder.query("operating_system.architecture", String.valueOf(listVolumesOptions.operatingSystemArchitecture()));
}
if (listVolumesOptions.zoneName() != null) {
builder.query("zone.name", String.valueOf(listVolumesOptions.zoneName()));
}
if (listVolumesOptions.tag() != null) {
builder.query("tag", String.valueOf(listVolumesOptions.tag()));
}
if (listVolumesOptions.zoneName() != null) {
builder.query("zone.name", String.valueOf(listVolumesOptions.zoneName()));
}
ResponseConverter<VolumeCollection> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<VolumeCollection>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
Expand Down Expand Up @@ -7697,9 +7738,9 @@ public ServiceCall<Snapshot> createSnapshot(CreateSnapshotOptions createSnapshot
* This request deletes a snapshot. This operation cannot be reversed.
*
* @param deleteSnapshotOptions the {@link DeleteSnapshotOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link Snapshot}
* @return a {@link ServiceCall} with a void result
*/
public ServiceCall<Snapshot> deleteSnapshot(DeleteSnapshotOptions deleteSnapshotOptions) {
public ServiceCall<Void> deleteSnapshot(DeleteSnapshotOptions deleteSnapshotOptions) {
com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSnapshotOptions,
"deleteSnapshotOptions cannot be null");
Map<String, String> pathParamsMap = new HashMap<String, String>();
Expand All @@ -7709,14 +7750,12 @@ public ServiceCall<Snapshot> deleteSnapshot(DeleteSnapshotOptions deleteSnapshot
for (Entry<String, String> header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
if (deleteSnapshotOptions.ifMatch() != null) {
builder.header("If-Match", deleteSnapshotOptions.ifMatch());
}
builder.query("version", String.valueOf(this.version));
builder.query("generation", String.valueOf(this.generation));
ResponseConverter<Snapshot> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<Snapshot>() { }.getType());
ResponseConverter<Void> responseConverter = ResponseConverterUtils.getVoid();
return createServiceCall(builder.build(), responseConverter);
}

Expand Down Expand Up @@ -8462,12 +8501,9 @@ public ServiceCall<ShareSnapshotCollection> listShareSnapshots(ListShareSnapshot
* structured in the same way as a retrieved share snapshot, and contains the information necessary to create the new
* share snapshot.
*
* The share must have the `access_control_mode` set to `security_group`.
* The share must have an `access_control_mode` of `security_group` and a `replication_role` of `source` or `none`.
*
* At present, the snapshot's `resource_group` will be inherited from its share, but may be specifiable in the future.
*
* The new snapshot will inherit the encryption settings from its share, , and must have a
* `replication_role` of `source` or `none`.
* The snapshot will inherit its `resource_group` and encryption settings from the share.
*
* If the share has a `replication_role` of `source`, a corresponding snapshot on the replica share will be created
* with a `status` of `pending`. It will remain in
Expand Down Expand Up @@ -10772,9 +10808,10 @@ public ServiceCall<FloatingIP> updateFloatingIp(UpdateFloatingIpOptions updateFl
/**
* List network ACLs.
*
* This request lists network ACLs in the region. A network ACL defines a set of packet filtering (5-tuple) rules for
* all traffic in and out of a subnet. Both allow and deny rules can be defined, and rules are stateless such that
* reverse traffic in response to allowed traffic is not automatically permitted.
* This request lists network ACLs in the region. A network ACL defines a set of packet filtering rules for traffic in
* and out of the subnets the network ACL is attached to. No traffic is allowed by default. Both allow and deny rules
* can be defined, and rules are stateless so that reverse traffic in response to allowed traffic is not automatically
* allowed.
*
* @param listNetworkAclsOptions the {@link ListNetworkAclsOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link NetworkACLCollection}
Expand Down Expand Up @@ -10808,9 +10845,10 @@ public ServiceCall<NetworkACLCollection> listNetworkAcls(ListNetworkAclsOptions
/**
* List network ACLs.
*
* This request lists network ACLs in the region. A network ACL defines a set of packet filtering (5-tuple) rules for
* all traffic in and out of a subnet. Both allow and deny rules can be defined, and rules are stateless such that
* reverse traffic in response to allowed traffic is not automatically permitted.
* This request lists network ACLs in the region. A network ACL defines a set of packet filtering rules for traffic in
* and out of the subnets the network ACL is attached to. No traffic is allowed by default. Both allow and deny rules
* can be defined, and rules are stateless so that reverse traffic in response to allowed traffic is not automatically
* allowed.
*
* @return a {@link ServiceCall} with a result of type {@link NetworkACLCollection}
*/
Expand Down Expand Up @@ -11072,10 +11110,9 @@ public ServiceCall<NetworkACLRule> updateNetworkAclRule(UpdateNetworkAclRuleOpti
/**
* List security groups.
*
* This request lists security groups in the region. Security groups provide a way to apply IP filtering rules to
* instances in the associated VPC. With security groups, all traffic is denied by default, and rules added to
* security groups define which traffic the security group permits. Security group rules are stateful such that
* reverse traffic in response to allowed traffic is automatically permitted.
* This request lists security groups in the region. A security group defines a set of packet filtering rules to allow
* traffic in and out of the resources targeted by the security group. No traffic is allowed by default. Security
* group rules are stateful so that reverse traffic in response to allowed traffic is automatically allowed.
*
* @param listSecurityGroupsOptions the {@link ListSecurityGroupsOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link SecurityGroupCollection}
Expand Down Expand Up @@ -11118,10 +11155,9 @@ public ServiceCall<SecurityGroupCollection> listSecurityGroups(ListSecurityGroup
/**
* List security groups.
*
* This request lists security groups in the region. Security groups provide a way to apply IP filtering rules to
* instances in the associated VPC. With security groups, all traffic is denied by default, and rules added to
* security groups define which traffic the security group permits. Security group rules are stateful such that
* reverse traffic in response to allowed traffic is automatically permitted.
* This request lists security groups in the region. A security group defines a set of packet filtering rules to allow
* traffic in and out of the resources targeted by the security group. No traffic is allowed by default. Security
* group rules are stateful so that reverse traffic in response to allowed traffic is automatically allowed.
*
* @return a {@link ServiceCall} with a result of type {@link SecurityGroupCollection}
*/
Expand Down Expand Up @@ -11687,7 +11723,7 @@ public ServiceCall<IKEPolicy> updateIkePolicy(UpdateIkePolicyOptions updateIkePo
/**
* List VPN gateway connections that use a specified IKE policy.
*
* This request lists VPN gateway connections that use a IKE policy.
* This request lists VPN gateway connections that use an IKE policy.
*
* @param listIkePolicyConnectionsOptions the {@link ListIkePolicyConnectionsOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link IKEPolicyConnectionCollection}
Expand Down Expand Up @@ -11877,7 +11913,7 @@ public ServiceCall<IPsecPolicy> updateIpsecPolicy(UpdateIpsecPolicyOptions updat
/**
* List VPN gateway connections that use a specified IPsec policy.
*
* This request lists VPN gateway connections that use a IPsec policy.
* This request lists VPN gateway connections that use an IPsec policy.
*
* @param listIpsecPolicyConnectionsOptions the {@link ListIpsecPolicyConnectionsOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link IPsecPolicyConnectionCollection}
Expand Down Expand Up @@ -13400,7 +13436,7 @@ public ServiceCall<LoadBalancerListenerPolicyCollection> listLoadBalancerListene
*
* This request creates a new policy from a load balancer listener policy object. The prototype object is structured
* in the same way as a retrieved policy, and contains the information necessary to create the new policy. For this
* request to succeed, the listener must have a `protocol` of `http` or `https`.
* request to succeed, the load balancer must be in the `application` family.
*
* @param createLoadBalancerListenerPolicyOptions the {@link CreateLoadBalancerListenerPolicyOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicy}
Expand Down Expand Up @@ -13857,6 +13893,8 @@ public ServiceCall<LoadBalancerPoolMemberCollection> listLoadBalancerPoolMembers
*
* This request creates a new member and adds the member to the pool.
*
* The pool must not already have a member targeting a load balancer.
*
* @param createLoadBalancerPoolMemberOptions the {@link CreateLoadBalancerPoolMemberOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMember}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected AddressPrefix() { }
/**
* Gets the cidr.
*
* The CIDR block for this prefix.
* The CIDR block for this address prefix.
*
* @return the cidr
*/
Expand All @@ -51,7 +51,7 @@ public String getCidr() {
/**
* Gets the createdAt.
*
* The date and time that the prefix was created.
* The date and time that this address prefix was created.
*
* @return the createdAt
*/
Expand All @@ -62,7 +62,7 @@ public Date getCreatedAt() {
/**
* Gets the hasSubnets.
*
* Indicates whether subnets exist with addresses from this prefix.
* Indicates whether subnets exist with addresses from this address prefix.
*
* @return the hasSubnets
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@
*/
public class BareMetalServerCPU extends GenericModel {

/**
* The CPU architecture.
*
* The enumerated values for this property may
* [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future.
*/
public interface Architecture {
/** amd64. */
String AMD64 = "amd64";
/** s390x. */
String S390X = "s390x";
}

protected String architecture;
@SerializedName("core_count")
protected Long coreCount;
Expand All @@ -36,6 +49,9 @@ protected BareMetalServerCPU() { }
*
* The CPU architecture.
*
* The enumerated values for this property may
* [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future.
*
* @return the architecture
*/
public String getArchitecture() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ public ImageIdentity image() {
*
* The public SSH keys to install on the bare metal server. Keys will be made available to the bare metal server as
* cloud-init vendor data. For cloud-init enabled images, these keys will also be added as SSH authorized keys for the
* administrative user.
* [default user](https://cloud.ibm.com/docs/vpc?topic=vpc-vsi_is_connecting_linux#determining-default-user-account).
*
* For Windows images, at least one key must be specified, and one will be selected to encrypt the administrator
* password. Keys are optional for other images, but if no keys are specified, the instance will be inaccessible
* unless the specified image provides another means of access.
* password. Keys are optional for other images, but if no keys are specified, the bare metal server will be
* inaccessible unless the specified image provides another means of access.
*
* @return the keys
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
*/
public class BareMetalServerProfileCPUArchitecture extends GenericModel {

/**
* The default CPU architecture for a bare metal server with this profile.
*/
public interface XDefault {
/** amd64. */
String AMD64 = "amd64";
/** s390x. */
String S390X = "s390x";
}

/**
* The type for this profile field.
*/
Expand All @@ -29,6 +39,16 @@ public interface Type {
String FIXED = "fixed";
}

/**
* The CPU architecture for a bare metal server with this profile.
*/
public interface Value {
/** amd64. */
String AMD64 = "amd64";
/** s390x. */
String S390X = "s390x";
}

@SerializedName("default")
protected String xDefault;
protected String type;
Expand Down
Loading